Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Creates an instance of the DefaultLoader. The name of the underlying native loader plugin used to load text.
function FuseAureliaLoader() { _classCallCheck(this, FuseAureliaLoader); var _this = _possibleConstructorReturn(this, _Loader.call(this)); _this.textPluginName = 'text'; _this.loaderPlugins = Object.create(null); _this.moduleRegistry = Object.create(null); _this.useTemplateLoader(new _textTemplateLoader.TextTemplateLoader()); var that = _this; _this.addPlugin('template-registry-entry', { 'fetch': function fetch(address) { console.log('fetch =>', address); var entry = that.getOrCreateTemplateRegistryEntry(address); return entry.templateIsLoaded ? entry : that.templateLoader.loadTemplate(that, entry).then(function (x) { return entry; }); } }); // this.addPlugin('html-resource-plugin', { // 'fetch': function(address) { // console.log('fetch =>', address) // let entry = that.getOrCreateTemplateRegistryEntry(address); // return entry.templateIsLoaded ? entry : that.templateLoader.loadTemplate(that, entry).then(x => entry); // } // }); // this.addPlugin('css-resource-plugin', { // 'fetch': function(address) { // console.log('fetch =>', address) // let entry = that.getOrCreateTemplateRegistryEntry(address); // return entry.templateIsLoaded ? entry : that.templateLoader.loadTemplate(that, entry).then(x => entry); // } // }); return _this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LocalLoader() { }", "initLoader(loaderName) {\n loaderName = true;\n }", "function defaultLoader() {\n H.events.dispatch(\"error\", {\n \"msg\": \"loader/loaderSync has not been configured.\"\n });\n return null;\n}", "function PluginLoader()\n{\n this._isIE = null;\n this._name = null;\n this._clsname = null;\n this._clsid = null;\n this._initProps = null;\n \n // the loaded plugin object\n this._pluginInstance = new Object();\n}", "function Loader(parent, options) {\n\n // Initialization of loader state from options\n this._global = options.global || Object.create(null);\n this._baseURL = options.baseURL || this.global && this.global.baseURL;\n if (options.linkedTo === null || options.linkedTo) {\n throw new Error(\"Setting 'linkedTo' not yet supported.\");\n }\n this._strict = options.string === undefined ? false : !! options.string;\n this._resolve = options.resolve || parent.resolve;\n this._fetch = options.fetch || parent.fetch;\n this._translate = options.translate || parent.translate;\n\n // The internal table of module instance objects\n this._mios = {};\n }", "function init() {\n return {\n loaders: [ new LocalLoader() ],\n fetch: function(dep_name, targetConfig) {\n var output;\n this.loaders.forEach(function(l) {\n if (!output && l.match(dep_name)) {\n output = l.load(dep_name, targetConfig);\n }\n });\n return output;\n }\n };\n}", "function LoaderProto() {}", "function LoaderProto() {}", "function LoaderProto() {}", "function createLoaderLoad(object) {\n return {\n // modules is an object for ES5 implementation\n modules: {},\n loads: [],\n loaderObj: object\n };\n }", "function createLoad(name) {\n return {\n status: 'loading',\n name: name,\n linkSets: [],\n dependencies: [],\n metadata: {}\n };\n }", "function createLoad(name) {\n return {\n status: 'loading',\n name: name,\n linkSets: [],\n dependencies: [],\n metadata: {}\n };\n }", "function createLoad(name) {\n return {\n status: 'loading',\n name: name,\n linkSets: [],\n dependencies: [],\n metadata: {}\n };\n }", "function createLoad(name) {\n return {\n status: 'loading',\n name: name,\n linkSets: [],\n dependencies: [],\n metadata: {}\n };\n }", "registerLoader (name, loaderFunc) {\n registerLoader(name, loaderFunc)\n }", "registerLoader (name, loaderFunc) {\n registerLoader(name, loaderFunc)\n }", "function createTranslateLoader(http) {\n}", "constructor() {\n super();\n\n /**\n * The name of the underlying native loader plugin used to load text.\n */\n this.textPluginName = 'text';\n\n this.moduleRegistry = Object.create(null);\n this.useTemplateLoader(new TextTemplateLoader());\n // TODO: find way receive current loader from aurelia\n loader = this;\n\n this.addPlugin('template-registry-entry', {\n fetch: async(address, _loader) => {\n const entry = this.getOrCreateTemplateRegistryEntry(address);\n if (!entry.templateIsLoaded) {\n await this.templateLoader.loadTemplate(this, entry);\n }\n return entry;\n }\n });\n\n // TODO: add event emitter hook here to watch module updates.\n // Not clear what to call\n // loadModule\n // loadTemplate\n\n PLATFORM.eachModule = function(callback) {\n if (System.registry) { // SystemJS >= 0.20.x\n for (let [k, m] of System.registry.entries()) {\n try {\n if (callback(k, m)) return;\n } catch (e) {\n // catch error\n }\n }\n return;\n }\n\n // SystemJS < 0.20.x\n let modules = System._loader.modules;\n for (let key in modules) {\n try {\n if (callback(key, modules[key].module)) return;\n } catch (e) {\n // catch error\n }\n }\n };\n }", "function HttpLoaderFactory(http) {\n return new http_loader_1.TranslateHttpLoader(http); //, BaseUrl + \"assets/i18n/\", \".json\"\n}", "function SystemJSLoader() {\n Loader.call(this);\n\n this.paths = {};\n this._loader.paths = {};\n\n systemJSConstructor.call(this);\n}", "constructor () {\n this.hdrCubeLoader = new HDRCubeTextureLoader();\n this.gltfLoader = new GLTFLoader();\n this.fbxLoader = new FBXLoader();\n this.jsonLoader = new JSONLoader();\n this.textureLoader = new TextureLoader();\n this.fontLoader = new FontLoader();\n this.isLoaded = false;\n }", "function HttpLoaderFactory(httpClient) {\n return new http_loader_1.TranslateHttpLoader(httpClient, \"i18n/\", \".json\");\n}", "static load() {\n\t\t\treturn loader().then(ResolvedComponent => {\n\t\t\t\tComponent = ResolvedComponent.default || ResolvedComponent\n\t\t\t})\n\t\t}", "function CreateLoad(name) {\n //> 1. Let load be a new Load Record.\n return {\n //> 2. Set the [[Status]] field of load to `\"loading\"`.\n status: \"loading\",\n //> 3. Set the [[Name]] field of load to name.\n name: name,\n //> 4. Set the [[LinkSets]] field of load to a new empty List.\n linkSets: CreateSet(),\n //> 5. Let metadata be the result of ObjectCreate(%ObjectPrototype%).\n //> 6. Set the [[Metadata]] field of load to metadata.\n metadata: {},\n //> 7. Set the [[Address]] field of load to undefined.\n address: undefined,\n //> 8. Set the [[Source]] field of load to undefined.\n source: undefined,\n //> 9. Set the [[Kind]] field of load to undefined.\n kind: undefined,\n //> 10. Set the [[Body]] field of load to undefined.\n body: undefined,\n //> 11. Set the [[Execute]] field of load to undefined.\n execute: undefined,\n //> 12. Set the [[Exception]] field of load to undefined.\n exception: undefined,\n //> 13. Set the [[Module]] field of load to undefined.\n module: null,\n then: undefined\n };\n //> 14. Return load.\n}", "function loader(source, inputSourceMap) {\n const config = loaderUtils.getOptions(this) || {};\n config.module = config['module'] || 'Icon.SvgAsset';\n config.tagger = config['tagger'] || 'svgAsset';\n\n const packageName = config['package'] || 'user/project',\n taggerName =\n '_' +\n [\n packageName.replace(/-/g, '_').replace(/\\//g, '$'),\n config.module.replace(/\\./g, '_'),\n config.tagger,\n ].join('$'),\n escapedTaggerName = taggerName.replace(/\\$/g, '\\\\$'),\n moduleNameCapture = \"'([a-zA-Z-./]+)'\",\n regexp = regexpForFunctionCall(escapedTaggerName, [moduleNameCapture]);\n\n return source.replace(regexp, \"require('$1').default\");\n}", "function translateLoaderFactory(http) {\n return new __WEBPACK_IMPORTED_MODULE_4__src_translate_service__[\"b\" /* TranslateStaticLoader */](http);\n}", "function SystemJSLoader() {\n SystemLoader.call(this);\n\n systemJSConstructor.call(this);\n}", "function SystemJSLoader() {\n SystemLoader.call(this);\n\n systemJSConstructor.call(this);\n}", "function createContentLoader(args)\n {\n args = args || {};\n args.applicationName = defaultValue(args.applicationName, 'default');\n args.platformName = defaultValue(args.platformName, 'generic');\n args.version = defaultValue(args.version, 'latest');\n args.background = defaultValue(args.background, true);\n args.servers = defaultValue(args.servers, []);\n var loader = new ContentLoader();\n loader.applicationName = args.applicationName;\n loader.platformName = args.platformName;\n loader.version = args.version;\n loader.connect(args.background);\n loader.openCache(args.applicationName);\n for (var i = 0, n = args.servers.length; i < n; ++i)\n loader.addServer(args.servers[i]);\n\n return loader;\n }", "load (language) {\n\t\tlet strings;\n\n\t\tif ((typeof language == \"string\") && (language != \"\")) {\n\t\t\ttry {\n\t\t\t\tstrings = require (Path.join (App.SOURCE_DIRECTORY, \"UiText\", `${language}.js`));\n\t\t\t}\n\t\t\tcatch (err) {\n\t\t\t\tLog.warn (`Failed to load text strings; language=${language} err=${err}`);\n\t\t\t\tstrings = null;\n\t\t\t}\n\n\t\t\tif (strings != null) {\n\t\t\t\tLog.debug (`Loaded text strings; language=${language}`);\n\t\t\t\tthis.strings = strings;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlanguage = DefaultLanguage;\n\t\ttry {\n\t\t\tstrings = require (Path.join (App.SOURCE_DIRECTORY, \"UiText\", `${language}.js`));\n\t\t}\n\t\tcatch (err) {\n\t\t\tLog.warn (`Failed to load text strings; language=${language} err=${err}`);\n\t\t\tstrings = null;\n\t\t}\n\t\tif (strings != null) {\n\t\t\tLog.debug (`Loaded text strings; language=${language}`);\n\t\t\tthis.strings = strings;\n\t\t}\n\t}", "function selectLoader(loaders, url = '', data = null, {nothrow = false} = {}) {\n url = url || '';\n\n // if only a single loader was provided (not as array), force its use\n // TODO - Should this behaviour be kept and documented?\n if (loaders && !Array.isArray(loaders)) {\n const loader = loaders;\n Object(_loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_1__[\"normalizeLoader\"])(loader);\n return loader;\n }\n\n // If no loaders provided, get the registered loaders\n loaders = loaders || Object(_register_loaders__WEBPACK_IMPORTED_MODULE_0__[\"getRegisteredLoaders\"])();\n normalizeLoaders(loaders);\n\n url = url.replace(/\\?.*/, '');\n let loader = null;\n loader = loader || findLoaderByUrl(loaders, url);\n loader = loader || findLoaderByExamingInitialData(loaders, data);\n\n // no loader available\n if (!loader) {\n if (nothrow) {\n return null;\n }\n throw new Error(`No valid loader found for ${url}`);\n }\n\n return loader;\n}", "function init($nimbleLoader, settings){\n var loader = new LoadingHandlerGenerator($nimbleLoader, settings);\n $nimbleLoader.data(\"loader\", loader);\n }", "function XLoader() {\r\n return __loadScript(\"YLoader\", 2);\r\n}", "function load(oldLoad, statics, str, options) {\n var initialize = oldLoad(str, options);\n _.extend(initialize.__proto__, statics);\n\n return initialize;\n}", "function Loader(manager) {\n if (!manager) {\n throw new TypeError(\"Must provide a manager\");\n }\n\n this.manager = manager;\n this.context = manager.context || {};\n\n if (!this.context.loaded) {\n this.context.loaded = {};\n }\n }", "function SchemeLoaderFactory() {\n var instance;\n var schemeLoaderMap;\n\n function registerLoader(scheme, loader) {\n schemeLoaderMap[scheme] = loader;\n }\n\n function unregisterLoader(scheme) {\n if (schemeLoaderMap[scheme]) {\n delete schemeLoaderMap[scheme];\n }\n }\n\n function unregisterAllLoader() {\n schemeLoaderMap = {};\n }\n\n function getLoader(url) {\n // iterates through schemeLoaderMap to find a loader for the scheme\n for (var scheme in schemeLoaderMap) {\n if (schemeLoaderMap.hasOwnProperty(scheme) && url.startsWith(scheme)) {\n return schemeLoaderMap[scheme];\n }\n }\n\n return _streaming_net_HTTPLoader__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\n }\n\n function reset() {\n unregisterAllLoader();\n }\n\n function setup() {\n reset();\n }\n\n setup();\n instance = {\n getLoader: getLoader,\n registerLoader: registerLoader,\n unregisterLoader: unregisterLoader,\n unregisterAllLoader: unregisterAllLoader,\n reset: reset\n };\n return instance;\n}", "function Loader() {\n\n}", "function HttpLoaderFactory(http) {\n return new _ngx_translate_http_loader__WEBPACK_IMPORTED_MODULE_8__[\"TranslateHttpLoader\"](http, 'assets/languages/');\n}", "function Loader() {\n var $obj = this;\n this.append = function () {\n this.node = $('<div/>').addClass('zoomPreload').css('visibility', 'hidden').html(settings.preloadText);\n $('.zoomPad', el).append(this.node);\n };\n this.show = function () {\n this.node.top = (smallimage.oh - this.node.height()) / 2;\n this.node.left = (smallimage.ow - this.node.width()) / 2;\n //setting position\n this.node.css({\n top: this.node.top,\n left: this.node.left,\n position: 'absolute',\n visibility: 'visible'\n });\n };\n this.hide = function () {\n this.node.css('visibility', 'hidden');\n };\n return this;\n }", "static LoadFromFile() {}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = require('./lib/types/json')\n break\n case 'raw':\n parser = require('./lib/types/raw')\n break\n case 'text':\n parser = require('./lib/types/text')\n break\n case 'urlencoded':\n parser = require('./lib/types/urlencoded')\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = require('./lib/types/json')\n break\n case 'raw':\n parser = require('./lib/types/raw')\n break\n case 'text':\n parser = require('./lib/types/text')\n break\n case 'urlencoded':\n parser = require('./lib/types/urlencoded')\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = require('./lib/types/json')\n break\n case 'raw':\n parser = require('./lib/types/raw')\n break\n case 'text':\n parser = require('./lib/types/text')\n break\n case 'urlencoded':\n parser = require('./lib/types/urlencoded')\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = require('./lib/types/json')\n break\n case 'raw':\n parser = require('./lib/types/raw')\n break\n case 'text':\n parser = require('./lib/types/text')\n break\n case 'urlencoded':\n parser = require('./lib/types/urlencoded')\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function mkloader (dest, name) {\n return function _loadParser (p1, p2, p3, p4) {\n return (dest[name] = _req(name))(p1, p2, p3, p4)\n }\n }", "function newInstance(classname) {\n return IJ.getClassLoader().loadClass(classname).newInstance();\n}", "function newInstance(classname) {\n return IJ.getClassLoader().loadClass(classname).newInstance();\n}", "function newInstance(classname) {\n return IJ.getClassLoader().loadClass(classname).newInstance();\n}", "function HttpLoaderFactory(http) {\n return new _ngx_translate_http_loader__WEBPACK_IMPORTED_MODULE_3__[\"TranslateHttpLoader\"](http);\n}", "function HttpLoaderFactory(http) {\n return new _ngx_translate_http_loader__WEBPACK_IMPORTED_MODULE_9__[\"TranslateHttpLoader\"](http, './assets/i18n/', '.json');\n }", "function run() {\r\n\t// Initialize the loader before anything happens\r\n\tloader.init();\r\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __nccwpck_require__(20859)\n break\n case 'raw':\n parser = __nccwpck_require__(49609)\n break\n case 'text':\n parser = __nccwpck_require__(26382)\n break\n case 'urlencoded':\n parser = __nccwpck_require__(76100)\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(373)\n break\n case 'raw':\n parser = __webpack_require__(395)\n break\n case 'text':\n parser = __webpack_require__(396)\n break\n case 'urlencoded':\n parser = __webpack_require__(397)\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "init() {\n\t\tthis.#activateNew('Loading');\n\t}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(212)\n break\n case 'raw':\n parser = __webpack_require__(242)\n break\n case 'text':\n parser = __webpack_require__(243)\n break\n case 'urlencoded':\n parser = __webpack_require__(244)\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(455)\n break\n case 'raw':\n parser = __webpack_require__(486)\n break\n case 'text':\n parser = __webpack_require__(487)\n break\n case 'urlencoded':\n parser = __webpack_require__(488)\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function HttpLoaderFactory(http) {\n return new _ngx_translate_http_loader__WEBPACK_IMPORTED_MODULE_11__[\"TranslateHttpLoader\"](http, './assets/i18n/', '.json');\n}", "function HttpLoaderFactory(http) {\n return new _ngx_translate_http_loader__WEBPACK_IMPORTED_MODULE_10__[\"TranslateHttpLoader\"](http, './assets/i18n/', '.json');\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(441)\n break\n case 'raw':\n parser = __webpack_require__(460)\n break\n case 'text':\n parser = __webpack_require__(461)\n break\n case 'urlencoded':\n parser = __webpack_require__(462)\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(22)\n break\n case 'raw':\n parser = __webpack_require__(28)\n break\n case 'text':\n parser = __webpack_require__(29)\n break\n case 'urlencoded':\n parser = __webpack_require__(30)\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(558)\n break\n case 'raw':\n parser = __webpack_require__(591)\n break\n case 'text':\n parser = __webpack_require__(592)\n break\n case 'urlencoded':\n parser = __webpack_require__(593)\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(273)\n break\n case 'raw':\n parser = __webpack_require__(307)\n break\n case 'text':\n parser = __webpack_require__(308)\n break\n case 'urlencoded':\n parser = __webpack_require__(309)\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function DefaultLoadingScreen(_renderingCanvas, _loadingText, _loadingDivBackgroundColor) {\n var _this = this;\n if (_loadingText === void 0) { _loadingText = \"\"; }\n if (_loadingDivBackgroundColor === void 0) { _loadingDivBackgroundColor = \"black\"; }\n this._renderingCanvas = _renderingCanvas;\n this._loadingText = _loadingText;\n this._loadingDivBackgroundColor = _loadingDivBackgroundColor;\n // Resize\n this._resizeLoadingUI = function () {\n var canvasRect = _this._renderingCanvas.getBoundingClientRect();\n var canvasPositioning = window.getComputedStyle(_this._renderingCanvas).position;\n if (!_this._loadingDiv) {\n return;\n }\n _this._loadingDiv.style.position = (canvasPositioning === \"fixed\") ? \"fixed\" : \"absolute\";\n _this._loadingDiv.style.left = canvasRect.left + \"px\";\n _this._loadingDiv.style.top = canvasRect.top + \"px\";\n _this._loadingDiv.style.width = canvasRect.width + \"px\";\n _this._loadingDiv.style.height = canvasRect.height + \"px\";\n };\n }", "function HttpLoaderFactory(http) {\n return new __WEBPACK_IMPORTED_MODULE_17__ngx_translate_http_loader__[\"a\" /* TranslateHttpLoader */](http, \"./assets/i18n/\", \".json\");\n}", "function HttpLoaderFactory(http) {\n return new __WEBPACK_IMPORTED_MODULE_5__ngx_translate_http_loader__[\"a\" /* TranslateHttpLoader */](http, './assets/i18n/', '.json');\n}", "function HttpLoaderFactory(http) {\n // for development\n // return new TranslateHttpLoader(http, '/start-angular/SB-Admin-BS4-Angular-4/master/dist/assets/i18n/', '.json');\n return new __WEBPACK_IMPORTED_MODULE_7__ngx_translate_http_loader__[\"a\" /* TranslateHttpLoader */](http, '/assets/i18n/', '.json');\n}", "function HttpLoaderFactory(http) {\n return new __WEBPACK_IMPORTED_MODULE_38__ngx_translate_http_loader__[\"a\" /* TranslateHttpLoader */](http, './assets/i18n/', '.json');\n}", "function HttpLoaderFactory(httpClient) {\n return new _ngx_translate_http_loader__WEBPACK_IMPORTED_MODULE_28__[\"TranslateHttpLoader\"](httpClient, './assets/i18n/', '.json');\n}", "function Loader( resources, callback, thisArg ) { \n\t\t// Sets the current instance in a variable\n\t\tconst al = this;\n\t\t\n\t\t// If there are less than three arguments, set the context to the current instance\n\t\tif ( arguments.length < 3 ) thisArg = this;\n\n\t\t// An array of loaded scripts\n\t\tal.loadedScripts = [ ];\n\n\t\t// An array of MediaWiki modules\n\t\tal.modules = resources.MODULES || [ ];\n\n\t\t// An object of scripts to load\n\t\tal.scripts = resources.SCRIPTS || { };\n\n\t\t// An array of stylesheets to load\n\t\tal.stylesheets = resources.STYLESHEETS || [ ];\n\n\t\t// Initializes the loader\n\t\tal.init = function( ) { \n\t\t\tif ( Array.isArray( al.modules ) && al.modules.length ) { \n\t\t\t\treturn mw.loader\n\t\t\t\t\t.using( al.modules )\n\t\t\t\t\t.then( al.loadScripts.bind( al ) );\n\t\t\t}\n\n\t\t\tal.loadScripts( );\n\t\t};\n\n\t\t// Loads all scripts and stylesheets if they are not loaded\n\t\tal.loadScripts = function( ) { \n\t\t\tif ( Array.isArray( al.stylesheets ) && al.stylesheets.length ) { \n\t\t\t\timportArticles( { type: \"style\", articles: al.stylesheets } );\n\t\t\t}\n\n\t\t\tconst promises = Promise.all( \n\t\t\t\tObject\n\t\t\t\t\t.getOwnPropertyNames( al.scripts )\n\t\t\t\t\t.map( function( name ) { \n\t\t\t\t\t\tconst script = al.scripts[ name ];\n\n\t\t\t\t\t\tif ( window.dev && window.dev[ name ] ) { \n\t\t\t\t\t\t\tal.loadedScripts.push( script );\n\t\t\t\t\t\t\treturn Promise.resolve( );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn new Promise( function( resolve, reject ) { \n\t\t\t\t\t\t\timportArticle( { \n\t\t\t\t\t\t\t\ttype: \"script\",\n\t\t\t\t\t\t\t\tarticle: script\n\t\t\t\t\t\t\t} ).then( function( ) { \n\t\t\t\t\t\t\t\tal.loadedScripts.push( script );\n\t\t\t\t\t\t\t} ).then( resolve )[ \"catch\" ]( reject );\n\t\t\t\t\t\t} );\n\t\t\t\t\t} )\n\t\t\t);\n\n\t\t\treturn promises.then( function( ) { \n\t\t\t\tal.loaded = true;\n\t\t\t\treturn callback.apply( thisArg, al );\n\t\t\t} );\n\t\t};\n\n\t\treturn al;\n\t}", "function AtlasLoaderPlugin(fileExtension,plugin){return function(){AtlasPictureInfoFactory.addLoader(fileExtension,plugin);};}", "function HttpLoaderFactory(http) {\n return new __WEBPACK_IMPORTED_MODULE_7__ngx_translate_http_loader__[\"a\" /* TranslateHttpLoader */](http, 'assets/i18n/', '.json');\n}", "function LoadModule(loader, name, options) {\n var loaderData = GetLoaderInternalData(loader);\n\n //> 1. Let name be ToString(name).\n //> 1. ReturnIfAbrupt(name).\n name = ToString(name);\n\n //> 1. Let address be GetOption(options, `\"address\"`).\n //> 1. ReturnIfAbrupt(address).\n var address = GetOption(options, \"address\");\n\n //> 1. Let F be a new anonymous function object as defined in\n //> AsyncStartLoadPartwayThrough.\n //> 1. Set F.[[Loader]] to loader.\n //> 1. Set F.[[ModuleName]] to name.\n //> 1. If address is undefined, set F.[[Step]] to `\"locate\"`.\n //> 1. Else, set F.[[Step]] to `\"fetch\"`.\n //> 1. Let metadata be the result of ObjectCreate(%ObjectPrototype%,\n //> ()).\n //> 1. Set F.[[ModuleMetadata]] to metadata.\n //> 1. Set F.[[ModuleSource]] to source.\n //> 1. Set F.[[ModuleAddress]] to address.\n var F = MakeClosure_AsyncStartLoadPartwayThrough(\n loader, loaderData, name,\n address === undefined ? \"locate\" : \"fetch\",\n {}, address, undefined);\n\n //> 1. Return the result of calling OrdinaryConstruct(%Promise%, (F)).\n return new std_Promise(F);\n}", "function loadPlugin$1(name, options) {\n return commonjsRequire(resolvePlugin(name, options) || name)\n}", "function HttpLoaderFactory(http) {\n return new __WEBPACK_IMPORTED_MODULE_19__ngx_translate_http_loader__[\"a\" /* TranslateHttpLoader */](http, \"../assets/i18n/\", \".json\");\n}", "function GBlockLoader () {\n this.manager = THREE.DefaultLoadingManager\n this.path = THREE.Loader.prototype.extractUrlBase( url )\n }", "function fillModelForIndicator(text) {\n if (typeof text == \"undefined\") { text = null; }\n return {\n uniqueId: generateUniqueId(),\n type: elementTypes.loader,\n info: text,\n isErrorOccurred: false,\n isRemoved: false,\n status: function (text) {\n this.info = text;\n updateIndicatorUI(this);\n },\n error: function () {\n this.isErrorOccurred = true;\n updateIndicatorUI(this);\n },\n remove: function () {\n this.isRemoved = true;\n updateIndicatorUI(this);\n }\n };\n }", "function ResourceLoader() {\n\tthis.mTexQueue = new Array(); // the queue of unprocessed textures\n\tthis.mFontQueue = new Array(); // the queue of unprocessed fonts\n\t\n\tthis.mWorking = false; // indicates if our resourceloader is currently working\n\tthis.mIntervalID = null; // the handle of the interval that is checking the state of the resources\n}", "_default() {\n return {\n async loadNativeLanguage() {\n const { entity, application } = this;\n await this._loadEntityClientTranslations(entity, application);\n\n const context = { ...this.application };\n await this._loadClientTranslations(context);\n },\n };\n }", "static of(spec) {\n let { load, support } = spec;\n if (!load) {\n if (!support)\n throw new RangeError(\"Must pass either 'load' or 'support' to LanguageDescription.of\");\n load = () => Promise.resolve(support);\n }\n return new LanguageDescription(spec.name, (spec.alias || []).concat(spec.name).map(s => s.toLowerCase()), spec.extensions || [], spec.filename, load, support);\n }", "async function loader(\n args\n ) {\n try {\n const isCommonjs = args.namespace.endsWith('commonjs');\n \n const key = removeEndingSlash(args.path);\n const contents = polyfilledBuiltins.get(key) || polyfillLib[key + '.js'];\n const resolveDir = path.dirname(key);\n\n if (isCommonjs) {\n return {\n loader: 'js',\n contents: commonJsTemplate({\n importPath: args.path,\n }),\n resolveDir,\n };\n }\n return {\n loader: 'js',\n contents,\n resolveDir,\n };\n } catch (e) {\n console.error('node-modules-polyfill', e);\n return {\n contents: `export {}`,\n loader: 'js',\n };\n }\n }", "function Loader(props) {\n var active = props.active,\n children = props.children,\n className = props.className,\n content = props.content,\n disabled = props.disabled,\n indeterminate = props.indeterminate,\n inline = props.inline,\n inverted = props.inverted,\n size = props.size;\n var classes = classnames_default()('ui', size, useKeyOnly(active, 'active'), useKeyOnly(disabled, 'disabled'), useKeyOnly(indeterminate, 'indeterminate'), useKeyOnly(inverted, 'inverted'), useKeyOnly(children || content, 'text'), useKeyOrValueAndKey(inline, 'inline'), 'loader', className);\n var rest = lib_getUnhandledProps(Loader, props);\n var ElementType = lib_getElementType(Loader, props);\n return react_default.a.createElement(ElementType, extends_default()({}, rest, {\n className: classes\n }), childrenUtils_namespaceObject.isNil(children) ? content : children);\n}", "function Plugin(name, dependencies, initializer) {\n this.name = name;\n this.dependencies = dependencies;\n this.initialized = false;\n this.supported = false;\n this.initializer = initializer;\n }", "async function parseWithLoader(loader, data, options, context) {\n data = await Object(_loader_utils_get_data__WEBPACK_IMPORTED_MODULE_3__[\"getArrayBufferOrStringFromData\"])(data, loader);\n\n // First check for synchronous text parser, wrap results in promises\n if (loader.parseTextSync && typeof data === 'string') {\n options.dataType = 'text';\n return loader.parseTextSync(data, options, context, loader);\n }\n\n // Check for asynchronous parser\n if (loader.parse) {\n return await loader.parse(data, options, context, loader);\n }\n\n // Now check for synchronous binary data parser, wrap results in promises\n if (loader.parseSync) {\n return loader.parseSync(data, options, context, loader);\n }\n\n if (loader.worker) {\n return await Object(_loader_utils_parse_with_worker__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(loader.worker, loader.name, data, options, context, loader);\n }\n\n // TBD - If asynchronous parser not available, return null\n // => This loader does not work on loaded data and only supports `loadAndParseAsync`\n return Object(_utils_assert__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(false);\n}", "static getLoader() {\n return tpmModuleLoader;\n }", "function loadParser(parserName) {\n var parser = parsers[parserName];\n\n if (parser !== undefined) {\n return parser;\n } // this uses a switch for static require analysis\n\n\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(/*! ./lib/types/json */ \"./node_modules/body-parser/lib/types/json.js\");\n break;\n\n case 'raw':\n parser = __webpack_require__(/*! ./lib/types/raw */ \"./node_modules/body-parser/lib/types/raw.js\");\n break;\n\n case 'text':\n parser = __webpack_require__(/*! ./lib/types/text */ \"./node_modules/body-parser/lib/types/text.js\");\n break;\n\n case 'urlencoded':\n parser = __webpack_require__(/*! ./lib/types/urlencoded */ \"./node_modules/body-parser/lib/types/urlencoded.js\");\n break;\n } // store to prevent invoking require()\n\n\n return parsers[parserName] = parser;\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(/*! ./lib/types/json */ \"./node_modules/body-parser/lib/types/json.js\")\n break\n case 'raw':\n parser = __webpack_require__(/*! ./lib/types/raw */ \"./node_modules/body-parser/lib/types/raw.js\")\n break\n case 'text':\n parser = __webpack_require__(/*! ./lib/types/text */ \"./node_modules/body-parser/lib/types/text.js\")\n break\n case 'urlencoded':\n parser = __webpack_require__(/*! ./lib/types/urlencoded */ \"./node_modules/body-parser/lib/types/urlencoded.js\")\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(/*! ./lib/types/json */ \"./node_modules/body-parser/lib/types/json.js\")\n break\n case 'raw':\n parser = __webpack_require__(/*! ./lib/types/raw */ \"./node_modules/body-parser/lib/types/raw.js\")\n break\n case 'text':\n parser = __webpack_require__(/*! ./lib/types/text */ \"./node_modules/body-parser/lib/types/text.js\")\n break\n case 'urlencoded':\n parser = __webpack_require__(/*! ./lib/types/urlencoded */ \"./node_modules/body-parser/lib/types/urlencoded.js\")\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(/*! ./lib/types/json */ \"./node_modules/body-parser/lib/types/json.js\")\n break\n case 'raw':\n parser = __webpack_require__(/*! ./lib/types/raw */ \"./node_modules/body-parser/lib/types/raw.js\")\n break\n case 'text':\n parser = __webpack_require__(/*! ./lib/types/text */ \"./node_modules/body-parser/lib/types/text.js\")\n break\n case 'urlencoded':\n parser = __webpack_require__(/*! ./lib/types/urlencoded */ \"./node_modules/body-parser/lib/types/urlencoded.js\")\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = __webpack_require__(/*! ./lib/types/json */ \"./node_modules/body-parser/lib/types/json.js\")\n break\n case 'raw':\n parser = __webpack_require__(/*! ./lib/types/raw */ \"./node_modules/body-parser/lib/types/raw.js\")\n break\n case 'text':\n parser = __webpack_require__(/*! ./lib/types/text */ \"./node_modules/body-parser/lib/types/text.js\")\n break\n case 'urlencoded':\n parser = __webpack_require__(/*! ./lib/types/urlencoded */ \"./node_modules/body-parser/lib/types/urlencoded.js\")\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}", "function plugins(loader) {\n if (typeof indexOf == 'undefined')\n indexOf = Array.prototype.indexOf;\n\n loader._extensions.push(plugins);\n\n var loaderNormalize = loader.normalize;\n loader.normalize = function(name, parentName, parentAddress) {\n var loader = this;\n // if parent is a plugin, normalize against the parent plugin argument only\n var parentPluginIndex;\n if (parentName && (parentPluginIndex = parentName.indexOf('!')) != -1)\n parentName = parentName.substr(0, parentPluginIndex);\n\n return Promise.resolve(loaderNormalize.call(loader, name, parentName, parentAddress))\n .then(function(name) {\n // if this is a plugin, normalize the plugin name and the argument\n var pluginIndex = name.lastIndexOf('!');\n if (pluginIndex != -1) {\n var argumentName = name.substr(0, pluginIndex);\n\n // plugin name is part after \"!\" or the extension itself\n var pluginName = name.substr(pluginIndex + 1) || argumentName.substr(argumentName.lastIndexOf('.') + 1);\n\n // normalize the plugin name relative to the same parent\n return new Promise(function(resolve) {\n resolve(loader.normalize(pluginName, parentName, parentAddress));\n })\n // normalize the plugin argument\n .then(function(_pluginName) {\n pluginName = _pluginName;\n return loader.normalize(argumentName, parentName, parentAddress, true);\n })\n .then(function(argumentName) {\n return argumentName + '!' + pluginName;\n });\n }\n\n // standard normalization\n return name;\n });\n };\n\n var loaderLocate = loader.locate;\n loader.locate = function(load) {\n var loader = this;\n\n var name = load.name;\n\n // only fetch the plugin itself if this name isn't defined\n if (this.defined && this.defined[name])\n return loaderLocate.call(this, load);\n\n // plugin\n var pluginIndex = name.lastIndexOf('!');\n if (pluginIndex != -1) {\n var pluginName = name.substr(pluginIndex + 1);\n\n // the name to locate is the plugin argument only\n load.name = name.substr(0, pluginIndex);\n\n var pluginLoader = loader.pluginLoader || loader;\n\n // load the plugin module\n // NB ideally should use pluginLoader.load for normalized,\n // but not currently working for some reason\n return pluginLoader['import'](pluginName)\n .then(function() {\n var plugin = pluginLoader.get(pluginName);\n plugin = plugin['default'] || plugin;\n\n // allow plugins to opt-out of build\n if (plugin.build === false && loader.pluginLoader)\n load.metadata.build = false;\n\n // store the plugin module itself on the metadata\n load.metadata.plugin = plugin;\n load.metadata.pluginName = pluginName;\n load.metadata.pluginArgument = load.name;\n load.metadata.buildType = plugin.buildType || \"js\";\n\n // run plugin locate if given\n if (plugin.locate)\n return plugin.locate.call(loader, load);\n\n // otherwise use standard locate without '.js' extension adding\n else\n return Promise.resolve(loader.locate(load))\n .then(function(address) {\n return address.replace(/\\.js$/, '');\n });\n });\n }\n\n return loaderLocate.call(this, load);\n };\n\n var loaderFetch = loader.fetch;\n loader.fetch = function(load) {\n var loader = this;\n // ignore fetching build = false unless in a plugin loader\n if (load.metadata.build === false && loader.pluginLoader)\n return '';\n else if (load.metadata.plugin && load.metadata.plugin.fetch && !load.metadata.pluginFetchCalled) {\n load.metadata.pluginFetchCalled = true;\n return load.metadata.plugin.fetch.call(loader, load, loaderFetch);\n }\n else\n return loaderFetch.call(loader, load);\n };\n\n var loaderTranslate = loader.translate;\n loader.translate = function(load) {\n var loader = this;\n if (load.metadata.plugin && load.metadata.plugin.translate)\n return Promise.resolve(load.metadata.plugin.translate.call(loader, load)).then(function(result) {\n if (typeof result == 'string')\n load.source = result;\n return loaderTranslate.call(loader, load);\n });\n else\n return loaderTranslate.call(loader, load);\n };\n\n var loaderInstantiate = loader.instantiate;\n loader.instantiate = function(load) {\n var loader = this;\n if (load.metadata.plugin && load.metadata.plugin.instantiate)\n return Promise.resolve(load.metadata.plugin.instantiate.call(loader, load)).then(function(result) {\n if (result) {\n // load.metadata.format = 'defined';\n // load.metadata.execute = function() {\n // return result;\n // };\n return result;\n }\n return loaderInstantiate.call(loader, load);\n });\n else if (load.metadata.plugin && load.metadata.plugin.build === false) {\n load.metadata.format = 'defined';\n load.metadata.deps.push(load.metadata.pluginName);\n load.metadata.execute = function() {\n return loader.newModule({});\n };\n return loaderInstantiate.call(loader, load);\n }\n else\n return loaderInstantiate.call(loader, load);\n }\n\n}", "function HttpLoaderFactory(httpClient) {\n return new __WEBPACK_IMPORTED_MODULE_4__ngx_translate_http_loader__[\"a\" /* TranslateHttpLoader */](httpClient, \"../../assets/i18n/\", \".json\");\n}", "function Loader(props) {\n var active = props.active,\n children = props.children,\n className = props.className,\n content = props.content,\n disabled = props.disabled,\n indeterminate = props.indeterminate,\n inline = props.inline,\n inverted = props.inverted,\n size = props.size;\n\n var classes = (0, _classnames2.default)('ui', size, (0, _lib.useKeyOnly)(active, 'active'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(indeterminate, 'indeterminate'), (0, _lib.useKeyOnly)(inverted, 'inverted'), (0, _lib.useKeyOnly)(children || content, 'text'), (0, _lib.useKeyOrValueAndKey)(inline, 'inline'), 'loader', className);\n var rest = (0, _lib.getUnhandledProps)(Loader, props);\n var ElementType = (0, _lib.getElementType)(Loader, props);\n\n return _react2.default.createElement(ElementType, (0, _extends3.default)({}, rest, { className: classes }), _lib.childrenUtils.isNil(children) ? content : children);\n}", "function Loader(props) {\n var active = props.active,\n children = props.children,\n className = props.className,\n content = props.content,\n disabled = props.disabled,\n indeterminate = props.indeterminate,\n inline = props.inline,\n inverted = props.inverted,\n size = props.size;\n\n var classes = (0, _classnames2.default)('ui', size, (0, _lib.useKeyOnly)(active, 'active'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(indeterminate, 'indeterminate'), (0, _lib.useKeyOnly)(inverted, 'inverted'), (0, _lib.useKeyOnly)(children || content, 'text'), (0, _lib.useKeyOrValueAndKey)(inline, 'inline'), 'loader', className);\n var rest = (0, _lib.getUnhandledProps)(Loader, props);\n var ElementType = (0, _lib.getElementType)(Loader, props);\n\n return _react2.default.createElement(ElementType, (0, _extends3.default)({}, rest, { className: classes }), _lib.childrenUtils.isNil(children) ? content : children);\n}", "function createTranslateLoader(http) {\n return new __WEBPACK_IMPORTED_MODULE_8__ngx_translate_http_loader__[\"a\" /* TranslateHttpLoader */](http, './assets/i18n/', '.json');\n}", "function createTranslateLoader(http) {\n return new __WEBPACK_IMPORTED_MODULE_13__ngx_translate_http_loader__[\"a\" /* TranslateHttpLoader */](http, './assets/i18n/', '.json');\n}", "function generateLoaders(loaders) {\n var sourceLoader = loaders\n .map(function(loader) {\n var extraParamChar;\n if (/\\?/.test(loader)) {\n loader = loader.replace(/\\?/, '-loader?');\n extraParamChar = '&';\n } else {\n loader = loader + '-loader';\n extraParamChar = '?';\n }\n return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '');\n })\n .join('!');\n\n return ExtractTextPlugin.extract(sourceLoader);\n }", "function getDefaultLoaderImage()\n {\n\nvar loader = 'R0lGODlhGAAYAPYAAAAAAP///wwMDFZWVq6urtTU1Ozs7FpaWgICAnR0dOrq6v///xgYGMbGxsjIyBQUFN7e3uDg4BoaGgYGBnh4eA4ODmZmZmhoaLCwsMzMzPj4+PLy8tLS0iYmJkJCQuTk5JaWlhISErS0tNra2qqqqlRUVPb29mJiYh4eHiwsLPDw8IyMjHp6ekpKSn5+fm5ubpycnAgICM7OzjIyMlBQUFxcXJCQkLq6ury8vNjY2MDAwDg4OLa2toCAgKSkpJiYmE5OTubm5iAgIIqKikhISAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJBQAAACwAAAAAGAAYAAAHmoAAgoOEhYaHgxUWBA4aCxwkJwKIhBMJBguZmpkqLBOUDw2bo5kKEogMEKSkLYgIoqubK5QJsZsNCIgCCraZBiiUA72ZJZQABMMgxgAFvRyfxpixGx3LANKxHtbNth8hy8i9IssHwwsXxgLYsSYpxrXDz5QIDubKlAwR5q2UErC2poxNoLBukwoX0IxVuIAhQ6YRBC5MskaxUCAAIfkECQUAAAAsAAAAABgAGAAAB6GAAIKDhIWGh4MVFgQOGhsOGAcxiIQTCQYLmZqZGwkIlA8Nm6OaMgyHDBCkqwsjEoUIoqykNxWFCbOkNoYCCrmaJjWHA7+ZHzOIBMUND5QFvzATlACYsy/TgtWsIpPTz7kyr5TKv8eUB8ULGzSIAtq/CYi46Qswn7AO9As4toUMEfRcHZIgC9wpRBMovNvU6d60ChcwZFigwYGIAwKwaUQUCAAh+QQJBQAAACwAAAAAGAAYAAAHooAAgoOEhYaHgxUWBA4aCzkkJwKIhBMJBguZmpkqLAiUDw2bo5oyEocMEKSrCxCnhAiirKs3hQmzsy+DAgq4pBogKIMDvpvAwoQExQvHhwW+zYiYrNGU06wNHpSCz746O5TKyzwzhwfLmgQphQLX6D4dhLfomgmwDvQLOoYMEegRyApJkIWLQ0BDEyi426Six4RtgipcwJAhUwQCFypA3IgoEAAh+QQJBQAAACwAAAAAGAAYAAAHrYAAgoOEhYaHgxUWBA4aCxwkJzGIhBMJBguZmpkGLAiUDw2bo5oZEocMEKSrCxCnhAiirKsZn4MJs7MJgwIKuawqFYIDv7MnggTFozlDLZMABcpBPjUMhpisJiIJKZQA2KwfP0DPh9HFGjwJQobJypoQK0S2B++kF4IC4PbBt/aaPWA5+CdjQiEGEd5FQHFIgqxcHF4dmkBh3yYVLmx5q3ABQ4ZMBUhYEOCtpLdAACH5BAkFAAAALAAAAAAYABgAAAeegACCg4SFhoeDFRYEDhoaDgQWFYiEEwkGC5mamQYJE5QPDZujmg0PhwwQpKsLEAyFCKKsqw0IhAmzswmDAgq5rAoCggO/sxaCBMWsBIIFyqsRgpjPoybS1KMqzdibBcjcmswAB+CZxwAC09gGwoK43LuDCA7YDp+EDBHPEa+GErK5GkigNIGCulEGKNyjBKDCBQwZMmXAcGESw4uUAgEAIfkECQUAAAAsAAAAABgAGAAAB62AAIKDhIWGh4MVFgQOGgscJCcxiIQTCQYLmZqZBiwIlA8Nm6OaGRKHDBCkqwsQp4QIoqyrGZ+DCbOzCYMCCrmsKhWCA7+zJ4IExaM5Qy2TAAXKQT41DIaYrCYiCSmUANisHz9Az4fRxRo8CUKGycqaECtEtgfvpBeCAuD2wbf2mj1gOfgnY0IhBhHeRUBxSIKsXBxeHZpAYd8mFS5seatwAUOGTAVIWBDgraS3QAAh+QQJBQAAACwAAAAAGAAYAAAHooAAgoOEhYaHgxUWBA4aCzkkJwKIhBMJBguZmpkqLAiUDw2bo5oyEocMEKSrCxCnhAiirKs3hQmzsy+DAgq4pBogKIMDvpvAwoQExQvHhwW+zYiYrNGU06wNHpSCz746O5TKyzwzhwfLmgQphQLX6D4dhLfomgmwDvQLOoYMEegRyApJkIWLQ0BDEyi426Six4RtgipcwJAhUwQCFypA3IgoEAAh+QQJBQAAACwAAAAAGAAYAAAHoYAAgoOEhYaHgxUWBA4aGw4YBzGIhBMJBguZmpkbCQiUDw2bo5oyDIcMEKSrCyMShQiirKQ3FYUJs6Q2hgIKuZomNYcDv5kfM4gExQ0PlAW/MBOUAJizL9OC1awik9PPuTKvlMq/x5QHxQsbNIgC2r8JiLjpCzCfsA70Czi2hQwR9FwdkiAL3ClEEyi829Tp3rQKFzBkWKDBgYgDArBpRBQIADsAAAAAAAAAAAA=';\n return loader;\n }", "function createTranslateLoader(http) {\n return new __WEBPACK_IMPORTED_MODULE_16__ngx_translate_http_loader__[\"a\" /* TranslateHttpLoader */](http, './assets/i18n/', '.json');\n}", "load() {}", "load() {}" ]
[ "0.6542073", "0.63252306", "0.6155259", "0.5918532", "0.5566025", "0.5540094", "0.5523345", "0.5523345", "0.5523345", "0.54904604", "0.5484643", "0.5484643", "0.5484643", "0.5484643", "0.5467891", "0.5467891", "0.54387397", "0.533061", "0.53264225", "0.5325682", "0.5266383", "0.52596503", "0.52401686", "0.52245146", "0.5224317", "0.52065164", "0.5182571", "0.5182571", "0.51725423", "0.51720244", "0.5170302", "0.5136529", "0.507945", "0.50549257", "0.5050928", "0.5003014", "0.5000584", "0.4993425", "0.49859208", "0.49797136", "0.49765447", "0.49765447", "0.49765447", "0.49765447", "0.49753943", "0.49641383", "0.49641383", "0.49641383", "0.49612296", "0.4949063", "0.49447158", "0.49417582", "0.49085042", "0.49018428", "0.49012965", "0.49011725", "0.4897737", "0.48913303", "0.48871624", "0.48706236", "0.48679832", "0.48556298", "0.4839004", "0.48305184", "0.48264354", "0.48102978", "0.4807134", "0.47916663", "0.47858748", "0.478336", "0.47828034", "0.4780144", "0.47797748", "0.47769552", "0.47549534", "0.47534376", "0.47440848", "0.47378084", "0.47303358", "0.47225264", "0.47206464", "0.47156692", "0.4710442", "0.4694713", "0.4687291", "0.46858072", "0.46858072", "0.46858072", "0.46858072", "0.46746197", "0.46692574", "0.4660912", "0.4660912", "0.46600878", "0.46600774", "0.46588817", "0.46490532", "0.4644766", "0.46334714", "0.46334714" ]
0.4982402
39
v8 likes predictible objects
function Item(fun, array) { this.fun = fun; this.array = array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareLike(a,b){\n var al = a.idLikesProp.length;\n var bl = b.idLikesProp.length;\n if(al > bl) return -1;\n if(bl > al) return 1;\n return 0;\n}", "function lookAround() {\n var objectDescription = \"\"\n tj.see().then(function(objects) {\n objects.forEach(function(each) {\n if (each.score >= 0.4) {\n objectDescription = objectDescription + \", \" + each.class\n }\n })\n tj.speak(\"The objects I see are: \" + objectDescription)\n });\n}", "function recommendNewPosts() {\n model.loadModel();\n getNewPosts(function (err, posts) {\n var label\n ;\n posts.forEach(function (post) {\n label = model.classifyPost(post);\n if (label == 'like') {\n console.log(post);\n }\n });\n });\n }", "function BOT_onLike() {\r\n\tBOT_traceString += \"GOTO command judge\" + \"\\n\"; // change performative\r\n\tBOT_theReqJudgement = \"likeable\";\r\n\tBOT_onJudge(); \t\r\n\tif(BOT_reqSuccess) {\r\n\t\tvar ta = [BOT_theReqTopic,BOT_theReqAttribute]; \r\n\t\tBOT_del(BOT_theUserTopicId,\"distaste\",\"VAL\",ta);\r\n\t\tBOT_add(BOT_theUserTopicId,\"preference\",\"VAL\",ta);\r\n\t}\r\n}", "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 }", "function LanguageUnderstandingModel() {\n }", "function guess() {\n classifier.predict(video.elt, 5, gotResult);\n}", "function theBigBang() {\n\t\tinitLibs();\n\t\tinitFuncs();\n\t\tObject.setPrototypeOf(Universe.prototype, universe.kjsclasses._primitive_prototype);\n\t\tObject.setPrototypeOf(Object.prototype, universe); // [0]\n\t}", "function readOwn(obj, name, pumpkin) {\n if (typeof obj !== 'object' || !obj) {\n if (typeOf(obj) !== 'object') {\n return pumpkin;\n }\n }\n if (typeof name === 'number' && name >= 0) {\n if (myOriginalHOP.call(obj, name)) { return obj[name]; }\n return pumpkin;\n }\n name = String(name);\n if (obj[name + '_canRead___'] === obj) { return obj[name]; }\n if (!myOriginalHOP.call(obj, name)) { return pumpkin; }\n // inline remaining relevant cases from canReadPub\n if (endsWith__.test(name)) { return pumpkin; }\n if (name === 'toString') { return pumpkin; }\n if (!isJSONContainer(obj)) { return pumpkin; }\n fastpathRead(obj, name);\n return obj[name];\n }", "function a(e,t,n){(n?Reflect.getOwnMetadataKeys(t,n):Reflect.getOwnMetadataKeys(t)).forEach(function(r){var i=n?Reflect.getOwnMetadata(r,t,n):Reflect.getOwnMetadata(r,t);n?Reflect.defineMetadata(r,i,e,n):Reflect.defineMetadata(r,i,e)})}", "function NXObject() {}", "function isPrimative(val) { return (typeof val !== 'object') }", "function like (data, duck) {\n var name;\n\n assert.object(data);\n assert.object(duck);\n\n for (name in duck) {\n if (duck.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof duck[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], duck[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }", "static get observedAttributes() {\n return ['rainbow', 'lang'];\n }", "function a(e,t,n){(n?Reflect.getOwnMetadataKeys(t,n):Reflect.getOwnMetadataKeys(t)).forEach((function(r){var i=n?Reflect.getOwnMetadata(r,t,n):Reflect.getOwnMetadata(r,t);n?Reflect.defineMetadata(r,i,e,n):Reflect.defineMetadata(r,i,e)}))}", "function testSimpleHole_prototype() {\n var theHole = Object.create({ x: \"in proto\" });\n var theReplacement = \"yay\";\n var serialized = bidar.serialize(theHole, holeFilter);\n var parsed = bidar.parse(serialized, holeFiller);\n\n assert.equal(parsed, theReplacement);\n\n function holeFilter(x) {\n assert.equal(x, theHole);\n return { data: \"blort\" };\n }\n\n function holeFiller(x) {\n assert.equal(x, \"blort\");\n return theReplacement;\n }\n}", "function test() {\n\t// \"ex nihilo\" object creation using the literal\n\t// object notation {}.\n\tvar foo = {\n\t\tname : \"foo\",\n\t\tone : 1,\n\t\ttwo : 2\n\t};\n\n\t// Another \"ex nihilo\" object.\n\tvar bar = {\n\t\ttwo : \"two\",\n\t\tthree : 3\n\t};\n\n\t// Gecko and Webkit JavaScript engines can directly\n\t// manipulate the internal prototype link.\n\t// For the sake of simplicity, let us pretend\n\t// that the following line works regardless of the\n\t// engine used:\n\tbar.__proto__ = foo; // foo is now the prototype of bar.\n\n\t// If we try to access foo's properties from bar\n\t// from now on, we'll succeed.\n\tlog(bar.one) // Resolves to 1.\n\n\t// The child object's properties are also accessible.\n\tlog(bar.three) // Resolves to 3.\n\n\t// Own properties shadow prototype properties\n\tlog(bar.two); // Resolves to \"two\"\n\tlog(foo.name); // unaffected, resolves to \"foo\"\n\tlog(bar.name); // Resolves to \"foo\"\n log(foo.__proto__);\n}", "function wrappedPrimitivePreviewer(className, classObj, objectActor, grip) {\r\n let {_obj} = objectActor;\r\n\r\n if (!_obj.proto || _obj.proto.class != className) {\r\n return false;\r\n }\r\n\r\n let raw = _obj.unsafeDereference();\r\n let v = null;\r\n try {\r\n v = classObj.prototype.valueOf.call(raw);\r\n } catch (ex) {\r\n // valueOf() can throw if the raw JS object is \"misbehaved\".\r\n return false;\r\n }\r\n\r\n if (v === null) {\r\n return false;\r\n }\r\n\r\n let canHandle = GenericObject(objectActor, grip, className === \"String\");\r\n if (!canHandle) {\r\n return false;\r\n }\r\n\r\n grip.preview.wrappedValue = objectActor.getGrip(makeDebuggeeValueIfNeeded(_obj, v));\r\n return true;\r\n}", "function DartObject(o) {\n this.o = o;\n}", "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)})}", "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)})}", "function likeVsLikes(toyLikeCount){\n\t\tif (toyLikeCount == 1){\n\t\t\treturn 'Like';\n\t\t} else {\n\t\t\treturn 'Likes';\n\t\t}\n\t}", "constructor(spec) {\n this.cached = /* @__PURE__ */ Object.create(null);\n let instanceSpec = this.spec = {};\n for (let prop in spec)\n instanceSpec[prop] = spec[prop];\n instanceSpec.nodes = OrderedMap.from(spec.nodes), instanceSpec.marks = OrderedMap.from(spec.marks || {}), this.nodes = NodeType$1.compile(this.spec.nodes, this);\n this.marks = MarkType.compile(this.spec.marks, this);\n let contentExprCache = /* @__PURE__ */ Object.create(null);\n for (let prop in this.nodes) {\n if (prop in this.marks)\n throw new RangeError(prop + \" can not be both a node and a mark\");\n let type = this.nodes[prop], contentExpr = type.spec.content || \"\", markExpr = type.spec.marks;\n type.contentMatch = contentExprCache[contentExpr] || (contentExprCache[contentExpr] = ContentMatch.parse(contentExpr, this.nodes));\n type.inlineContent = type.contentMatch.inlineContent;\n type.markSet = markExpr == \"_\" ? null : markExpr ? gatherMarks(this, markExpr.split(\" \")) : markExpr == \"\" || !type.inlineContent ? [] : null;\n }\n for (let prop in this.marks) {\n let type = this.marks[prop], excl = type.spec.excludes;\n type.excluded = excl == null ? [type] : excl == \"\" ? [] : gatherMarks(this, excl.split(\" \"));\n }\n this.nodeFromJSON = this.nodeFromJSON.bind(this);\n this.markFromJSON = this.markFromJSON.bind(this);\n this.topNodeType = this.nodes[this.spec.topNode || \"doc\"];\n this.cached.wrappings = /* @__PURE__ */ Object.create(null);\n }", "wordClass(word) {\r\n return {\r\n der: word.artikel == \"der\",\r\n die: word.artikel == \"die\",\r\n das: word.artikel == \"das\",\r\n marked: word.marker\r\n }\r\n }", "function dummyObjects(name, age){\n this.name = name\n this.age = age\n}", "function handleLikes() {\n // Get a random number\n let randomNumber = Math.random();\n // To make it unpredictable, only change the likes if =>\n if (randomNumber < REVEAL_PROBABILITY) {\n defineLikes();\n }\n}", "constructor() { \n \n Like.initialize(this);\n }", "like() {\r\n return this.clone(Comment, \"Like\").postCore();\r\n }", "like() {\r\n return this.getItem().then(i => {\r\n return i.like();\r\n });\r\n }", "added(vrobject){}", "classify(phrase) { return this.clf.classify(phrase) }", "function badIdea(){\n this.idea = \"bad\";\n}", "shouldSerialize(prop, dataKey) {\n const contains = (str, re) => (str.match(re) || []).length > 0;\n const a = contains(dataKey, /\\./g);\n const b = contains(dataKey, /\\[/g);\n return !!prop.object && !(a || b);\n }", "static get observedAttributes(){this.finalize();const e=[];// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nreturn this._classProperties.forEach((t,n)=>{const r=this._attributeNameForProperty(n,t);void 0!==r&&(this._attributeToPropertyMap.set(r,n),e.push(r))}),e}", "function oldAndLoud(object){\n\tobject.age++;\n\tobject.name = object.name.toUpperCase();\n}", "like() {\r\n return this.clone(Item, \"like\").postCore();\r\n }", "function classifyPose() {\n if (pose && working) {\n inputs = [];\n for (let i = 0; i < pose.landmarks.length; i++) {\n inputs.push(pose.landmarks[i][0]);\n inputs.push(pose.landmarks[i][1]);\n inputs.push(pose.landmarks[i][2]);\n }\n brain.classify(inputs, gotResult)\n }\n }", "function PropertyDetection() {}", "constructor()\n {\n this.likes = [];\n }", "async TestLikeDoctorPost(){\n var response = await entity.Likes(6,28,true,true);\n //console.log(response)\n if(response != null){\n console.log(\"\\x1b[32m%s\\x1b[0m\",\"TestDOctorRating Passed\");\n }else{\n console.log(\"\\x1b[31m%s\\x1b[0m\",\"TestDOctorRating Failed\");\n }\n\n }", "function classifyVideo() {\n classifier.predict(gotResult);\n}", "function classifyVideo() {\n classifier.predict(gotResult);\n}", "function classifyVideo() {\n classifier.predict(gotResult);\n}", "function showLikes(likes) {\n\tconsole.log(`THINGS I LIKE:\\n`);\n\tfor(let like of likes) {\n\t\tconsole.log(like);\n\t}\n}", "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "function Nevis() {}", "function Nevis() {}", "function Nevis() {}", "test_primitivesExtended() {\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.primitivesExtended);\n let object = translator.decode(text).getRoot();\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.PrimitivesExtended\", object.constructor.__getClass());\n Assert.equals(\"alpha16\", object.string);\n }", "function buildObjectsObj(gCloudV, azureCV, minScore = 0.0){\n let objects = [];\n\n if(gCloudV) {// gcloud vision results are available\n let gCloudObjects = gCloudV['localizedObjectAnnotations'];\n\n //apply standard bounding box to all the detected objects\n if(azureCV)// azure computer vision results are available\n gCloudVObjsToCogniBoundingBox(gCloudObjects, azureCV['metadata']['width'], azureCV['metadata']['height']);\n\n else//need to retrieve image sizes from gcloud (already done and put in the metadata tag of gcloudv with appropriate calls)\n gCloudVObjsToCogniBoundingBox(gCloudObjects, gCloudV['metadata']['width'], gCloudV['metadata']['height']);\n\n for (let gCloudObj of gCloudObjects) {\n if (gCloudObj['score'] > minScore) { //filter out unwanted tags\n objects.push({\n name: gCloudObj['name'],\n mid: (gCloudObj['mid'] && gCloudObj['mid']!= '')? gCloudObj['mid']: undefined,\n confidence: gCloudObj['score'],\n boundingBox: gCloudObj['boundingBox']\n });\n }\n }\n }\n\n if(azureCV){// azure computer vision results are available\n let azureObjects = azureCV['objects'];\n //apply standard bounding box to all the detected objects\n azureCVObjsToCogniBoundingBox(azureObjects, azureCV['metadata']['width'], azureCV['metadata']['height']);\n for(let aObj of azureObjects){\n if(aObj['confidence'] > minScore) { //filter out unwanted tags\n objects.push({\n name: aObj['object'],\n confidence: aObj['confidence'],\n boundingBox: aObj['boundingBox']\n });\n }\n }\n }\n\n objects = combineObjectsArray(objects);// build an array where labels regarding the same exact object are combined with averaged confidence\n\n objects.sort((a, b) => {\n if(a['confidence']>b['confidence'])\n return -1;\n else if(a['confidence']==b['confidence'])\n return 0;\n else\n return 1;\n });\n\n return objects;\n}", "function V(e){if(null===e||\"[object Object]\"!==function(e){return Object.prototype.toString.call(e)}(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}", "function classifyVideo() {\r\n classifier.classify(vid, gotResult);\r\n\r\n}", "function test_nountag_does_not_think_it_has_watch_tag_when_it_does_not() {\n Assert.equal(TagNoun.fromJSON(\"watch\"), undefined);\n}", "function v11(v12,v13) {\n const v15 = v11(Object,Function);\n // v15 = .unknown\n const v16 = Object(v13,v8,0,v6);\n // v16 = .object()\n const v17 = 0;\n // v17 = .integer\n const v18 = 1;\n // v18 = .integer\n const v19 = 512;\n // v19 = .integer\n const v20 = \"-1024\";\n // v20 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v21 = isFinite;\n // v21 = .function([.anything] => .boolean)\n const v23 = [1337];\n // v23 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v24 = {};\n // v24 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n let v25 = v23;\n const v26 = -29897853;\n // v26 = .integer\n const v27 = \"replace\";\n // v27 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v28 = Boolean;\n // v28 = .object(ofGroup: BooleanConstructor, withProperties: [\"prototype\"]) + .function([.anything] => .boolean) + .constructor([.anything] => .boolean)\n const v30 = [13.37,13.37];\n // v30 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v31 = 1337;\n // v31 = .integer\n let v32 = 13.37;\n const v36 = [13.37,13.37,13.37];\n // v36 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v38 = [1337,1337];\n // v38 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v39 = [13.37,1337,v38,1337,\"-128\",13.37,\"-128\",\"-128\",2147483647,1337];\n // v39 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v40 = {__proto__:v36,length:v39};\n // v40 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"length\"])\n const v41 = \"0\";\n // v41 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v42 = -4130093409;\n // v42 = .integer\n const v44 = {b:2147483647,e:v38,valueOf:v36};\n // v44 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"b\", \"valueOf\", \"e\"])\n const v45 = \"k**baeaDif\";\n // v45 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v46 = 65536;\n // v46 = .integer\n const v47 = \"k**baeaDif\";\n // v47 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v48 = 13.37;\n // v48 = .float\n const v50 = [13.37,13.37];\n // v50 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v51 = ~v50;\n // v51 = .boolean\n const v53 = [13.37];\n // v53 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n let v54 = v53;\n const v55 = gc;\n // v55 = .function([] => .undefined)\n const v58 = [13.37,13.37,13.37,13.37];\n // v58 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v60 = [1337,1337,1337,1337];\n // v60 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v61 = [3697200800,v58,v60];\n // v61 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v62 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,valueOf:v61};\n // v62 = .object(ofGroup: Object, withProperties: [\"e\", \"__proto__\", \"length\", \"constructor\", \"toString\", \"valueOf\"])\n const v65 = [13.37,13.37,13.37,13.37];\n // v65 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v67 = [1337,1337,1337,1337];\n // v67 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v68 = [3697200800,v65,v67];\n // v68 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v69 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,valueOf:v68};\n // v69 = .object(ofGroup: Object, withProperties: [\"e\", \"constructor\", \"__proto__\", \"length\", \"toString\", \"valueOf\"])\n const v70 = Object;\n // v70 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n function v71(v72) {\n }\n const v74 = [13.37];\n // v74 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v75 = 1337;\n // v75 = .integer\n const v76 = v44 ** 13.37;\n // v76 = .integer | .float | .bigint\n function v77(v78,v79,v80,v81,v82) {\n }\n let v83 = v74;\n const v84 = \"2\";\n // v84 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v85 = \"2\";\n // v85 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v88 = [13.37,13.37,1337,13.37];\n // v88 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n function v89(v90,v91,v92) {\n }\n const v94 = [1337,1337,1337,1337];\n // v94 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v95 = [3697200800,v88,v94];\n // v95 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n function v96(v97,v98) {\n }\n const v99 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,d:v95};\n // v99 = .object(ofGroup: Object, withProperties: [\"toString\", \"length\", \"constructor\", \"__proto__\", \"e\", \"d\"])\n let v100 = 13.37;\n const v101 = typeof v74;\n // v101 = .string\n const v102 = \"symbol\";\n // v102 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v103 = 3697200800;\n // v103 = .integer\n const v104 = \"2\";\n // v104 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v105 = Boolean;\n // v105 = .object(ofGroup: BooleanConstructor, withProperties: [\"prototype\"]) + .function([.anything] => .boolean) + .constructor([.anything] => .boolean)\n const v106 = Function;\n // v106 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v107 = 13.37;\n // v107 = .float\n const v108 = 1337;\n // v108 = .integer\n const v109 = \"2\";\n // v109 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v110 = Function;\n // v110 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v112 = [13.37,13.37,13.37,13.37];\n // v112 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v113 = 1337;\n // v113 = .integer\n let v114 = 13.37;\n const v116 = {...3697200800,...3697200800};\n // v116 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n const v117 = Object;\n // v117 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v118 = Function;\n // v118 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v119 = {};\n // v119 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n let v120 = v119;\n const v121 = (3697200800).constructor;\n // v121 = .unknown\n function v122(v123,v124) {\n }\n const v125 = Promise;\n // v125 = .object(ofGroup: PromiseConstructor, withProperties: [\"prototype\"], withMethods: [\"race\", \"allSettled\", \"reject\", \"all\", \"resolve\"]) + .constructor([.function()] => .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"]))\n const v128 = 4;\n // v128 = .integer\n let v129 = 0;\n const v131 = [13.37,13.37,13.37,13.37];\n // v131 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v133 = [1337,1337,1337,1337];\n // v133 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v134 = [3697200800,v131,v133];\n // v134 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v135 = Object;\n // v135 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v136 = -944747134;\n // v136 = .integer\n const v139 = [13.37,13.37,13.37,13.37];\n // v139 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v141 = [1337,1337,1337,1337];\n // v141 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v142 = [3697200800,v139,v141];\n // v142 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v143 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,valueOf:v142};\n // v143 = .object(ofGroup: Object, withProperties: [\"toString\", \"constructor\", \"e\", \"__proto__\", \"valueOf\", \"length\"])\n let v144 = v143;\n const v145 = gc;\n // v145 = .function([] => .undefined)\n let v146 = 13.37;\n const v150 = [13.37,13.37,13.37,Function];\n // v150 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v152 = [1337,1337,1337,1337];\n // v152 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v153 = [3697200800,v150,v152];\n // v153 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v154 = v153 + 1;\n // v154 = .primitive\n let v155 = 0;\n const v156 = v155 + 1;\n // v156 = .primitive\n const v158 = \"2\";\n // v158 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v160 = [13.37,13.37,13.37,13.37];\n // v160 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v162 = 0;\n // v162 = .integer\n const v163 = [1337,1337,1337,1337];\n // v163 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v164 = [3697200800,1337,v163];\n // v164 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v166 = 1337;\n // v166 = .integer\n let v167 = 2594067260;\n const v169 = 4;\n // v169 = .integer\n let v170 = 0;\n const v171 = v167 + 1;\n // v171 = .primitive\n const v172 = {__proto__:3697200800,constructor:v163,e:3697200800,length:13.37,toString:3697200800,valueOf:v164};\n // v172 = .object(ofGroup: Object, withProperties: [\"e\", \"__proto__\", \"constructor\", \"valueOf\", \"length\", \"toString\"])\n const v173 = 0;\n // v173 = .integer\n const v174 = 5;\n // v174 = .integer\n const v175 = 2937513072;\n // v175 = .integer\n const v176 = Object;\n // v176 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v177 = v172.constructor;\n // v177 = .unknown\n const v178 = 0;\n // v178 = .integer\n const v179 = 1;\n // v179 = .integer\n try {\n } catch(v180) {\n const v182 = [13.37,13.37,13.37,13.37];\n // v182 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v183 = v182.__proto__;\n // v183 = .object()\n function v185(v186) {\n }\n const v187 = Object >>> v183;\n // v187 = .integer | .bigint\n }\n function v188(v189,v190,v191,v192,...v193) {\n }\n}", "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.__raw__ = true;\r\n def(obj, '__ob__', ob);\r\n // mark as Raw\r\n rawSet.set(obj, true);\r\n return obj;\r\n}", "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.__raw__ = true;\r\n def(obj, '__ob__', ob);\r\n // mark as Raw\r\n rawSet.set(obj, true);\r\n return obj;\r\n}", "transient private internal function m185() {}", "function rekognizeLabels(bucket, key) {\n let params = {\n Image: {\n S3Object: {\n Bucket: bucket,\n Name: key\n }\n },\n MaxLabels: 3,\n MinConfidence: 80\n };\n\n return rekognition.detectLabels(params).promise()\n}", "test_doNotRetainAnno(){\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.doNotRetainAnno);\n let object1 = translator.decode(text).getRoot();\n let object2 = translator.decode(text).getRoot();\n\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.DoNotRetainAnno\", object1.constructor.__getClass());\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.DoNotRetainAnno\", object2.constructor.__getClass());\n Assert.notEquals(object1, object2);\n }", "function LK_likeIt(elem) {\n var likeGroup = elem.getAttribute(LK_LIKEGROUP);\n var likeValue = elem.getAttribute(LK_LIKEVALUE);\n localStorage[likeGroup] = likeValue;\n\n // Change the style of the liker nodes\n var siblings = elem.parentNode.childNodes;\n for (var i = 0; i < siblings.length; i++) {\n if (siblings[i].style) { \n LK_applyNormalStyle(siblings[i]);\n }\n }\n LK_applySelectedStyle(elem, likeValue);\n\n // Change the value of any mini likers\n var allSpans = document.getElementsByTagName('span');\n for (var i = 0; i < allSpans.length; i++) {\n var span = allSpans[i];\n if (span.getAttribute(LK_LIKEGROUP) == likeGroup) {\n if (span.getAttribute(LK_LIKETYPE) == 'mini') {\n span.innerHTML = LK_MAPPINGS[likeValue].label;\n LK_applySelectedStyle(allSpans[i], likeValue);\n }\n }\n }\n}", "function OOPExample(who) {\n this.me = who;\n}", "getLikes(state, data) {\n state.likes = data\n }", "function _isAlternativeRecognitionResult(obj) {\r\n return obj && typeof obj === 'object';\r\n}", "function addLikes() {\n if (propLike?.includes(user.username)) {\n let index = propLike.indexOf(user.username);\n let removeLike = [\n ...propLike.slice(0, index),\n ...propLike.slice(index + 1),\n ];\n setLikeGet(removeLike);\n setPropLike(removeLike);\n setRedLike(\"\");\n\n addToLike(eventid, removeLike);\n } else {\n let likesArr = [...propLike, `${user.username}`];\n\n setLikeGet(likesArr);\n setPropLike(likesArr);\n setRedLike(\"red\");\n addToLike(eventid, likesArr);\n }\n }", "function LiteralObject() {\r\n}", "function Komunalne() {}", "function Bevy() {}", "function Prediction() {\n this.score = {};\n}", "function Object() {}", "function Object() {}", "function canEnumPub(obj, name) {\n if (obj === null) { return false; }\n if (obj === void 0) { return false; }\n name = String(name);\n if (obj[name + '_canEnum___']) { return true; }\n if (endsWith__.test(name)) { return false; }\n if (!isJSONContainer(obj)) { return false; }\n if (!myOriginalHOP.call(obj, name)) { return false; }\n fastpathEnum(obj, name);\n if (name === 'toString') { return true; }\n fastpathRead(obj, name);\n return true;\n }", "function Obj(){ return Literal.apply(this,arguments) }", "test_primitives() {\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.primitives);\n let object = translator.decode(text).getRoot();\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.Primitives\", object.constructor.__getClass());\n Assert.equals(\"alpha9\", object.string);\n }", "function hello()\n{\n /* ATTRIBUTES */\n this.coolbeans = 'class';\n this.something = 'hello-class';\n\n}", "function test_cluster_tagged_crosshair_op_vsphere65() {}", "function classifyVideo() {\n classifier.classify(gotResult);\n}", "function classifyVideo() {\n classifier.classify(gotResult);\n}", "constructor(papa,mummy,sivlings,belongs,loving_bro,favs_bro){\n super(papa,mummy,sivlings,belongs)\n this.loving_bro=loving_bro\n this.favs_bro=favs_bro\n }", "function v8(v9,v10) {\n const v16 = [1337,1337];\n // v16 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v17 = [\"536870912\",-3848843708,v16,-3848843708,1337,13.37,13.37,WeakMap,-3848843708];\n // v17 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v18 = {constructor:13.37,e:v16};\n // v18 = .object(ofGroup: Object, withProperties: [\"constructor\", \"e\", \"__proto__\"])\n const v19 = {__proto__:-3848843708,a:v18,b:-3848843708,constructor:1337,d:v18,e:v17,length:WeakMap};\n // v19 = .object(ofGroup: Object, withProperties: [\"d\", \"b\", \"a\", \"__proto__\", \"e\", \"constructor\", \"length\"])\n const v21 = new Float64Array(v19);\n // v21 = .object(ofGroup: Float64Array, withProperties: [\"byteOffset\", \"constructor\", \"buffer\", \"__proto__\", \"byteLength\", \"length\"], withMethods: [\"map\", \"values\", \"subarray\", \"find\", \"fill\", \"set\", \"findIndex\", \"some\", \"reduceRight\", \"reverse\", \"join\", \"includes\", \"entries\", \"reduce\", \"every\", \"copyWithin\", \"sort\", \"forEach\", \"lastIndexOf\", \"indexOf\", \"filter\", \"slice\", \"keys\"])\n v6[6] = v7;\n v7.toString = v9;\n }", "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[\"a\" /* default */]) {\n classObject.prototype[nodejsCustomInspectSymbol[\"a\" /* default */]] = fn;\n }\n}", "annotate(message: string, data: Object) {\n this.message = message;\n this.data = assign(this.data, data);\n }", "function encodeObject(o) {\n if (_.isNumber(o)) {\n if (_.isNaN(o)) {\n return ['SPECIAL_FLOAT', 'NaN'];\n } else if (o === Infinity) {\n return ['SPECIAL_FLOAT', 'Infinity'];\n } else if (o === -Infinity) {\n return ['SPECIAL_FLOAT', '-Infinity'];\n } else {\n return o;\n }\n } else if (_.isString(o)) {\n return o;\n } else if (_.isBoolean(o) || _.isNull(o) || _.isUndefined(o)) {\n return ['JS_SPECIAL_VAL', String(o)];\n } else if (typeof o === 'symbol') {\n // ES6 symbol\n return ['JS_SPECIAL_VAL', String(o)];\n } else {\n // render these as heap objects\n\n // very important to use _.has since we don't want to\n // grab the property in your prototype, only in YOURSELF ... SUBTLE!\n if (!_.has(o, 'smallObjId_hidden_')) {\n // make this non-enumerable so that it doesn't show up in\n // console.log() or other inspector functions\n Object.defineProperty(o, 'smallObjId_hidden_', { value: smallObjId,\n enumerable: false });\n smallObjId++;\n }\n assert(o.smallObjId_hidden_ > 0);\n\n var ret = ['REF', o.smallObjId_hidden_];\n\n if (encodedHeapObjects[String(o.smallObjId_hidden_)] !== undefined) {\n return ret;\n }\n else {\n assert(_.isObject(o));\n\n var newEncodedObj = [];\n encodedHeapObjects[String(o.smallObjId_hidden_)] = newEncodedObj;\n\n var i;\n\n if (_.isFunction(o)) {\n var funcProperties = []; // each element is a pair of [name, encoded value]\n\n var encodedProto = null;\n if (_.isObject(o.prototype)) {\n // TRICKY TRICKY! for inheritance to be displayed properly, we\n // want to find the prototype of o.prototype and see if it's\n // non-empty. if that's true, then even if o.prototype is\n // empty (i.e., has no properties of its own), then we should\n // still encode it since its 'prototype' \"uber-hidden\n // property\" is non-empty\n var prototypeOfPrototype = Object.getPrototypeOf(o.prototype);\n if (!_.isEmpty(o.prototype) ||\n (_.isObject(prototypeOfPrototype) && !_.isEmpty(prototypeOfPrototype))) {\n encodedProto = encodeObject(o.prototype);\n }\n }\n\n if (encodedProto) {\n funcProperties.push(['prototype', encodedProto]);\n }\n\n // now get all of the normal properties out of this function\n // object (it's unusual to put properties in a function object,\n // but it's still legal!)\n var funcPropPairs = _.pairs(o);\n for (i = 0; i < funcPropPairs.length; i++) {\n funcProperties.push([funcPropPairs[i][0], encodeObject(funcPropPairs[i][1])]);\n }\n\n var funcCodeString = o.toString();\n\n /*\n\n #craftsmanship -- make nested functions look better by indenting\n the first line of a nested function definition by however much\n the LAST line is indented, ONLY if the last line is simply a\n single ending '}'. otherwise it will look ugly since the\n function definition doesn't start out indented, like so:\n\nfunction bar(x) {\n globalZ += 100;\n return x + y + globalZ;\n }\n\n */\n var codeLines = funcCodeString.split('\\n');\n if (codeLines.length > 1) {\n var lastLine = _.last(codeLines);\n if (lastLine.trim() === '}') {\n var lastLinePrefix = lastLine.slice(0, lastLine.indexOf('}'));\n funcCodeString = lastLinePrefix + funcCodeString; // prepend!\n }\n }\n\n newEncodedObj.push('JS_FUNCTION',\n o.name,\n funcCodeString, /* code string*/\n funcProperties.length ? funcProperties : null, /* OPTIONAL */\n null /* parent frame */);\n } else if (_.isArray(o)) {\n newEncodedObj.push('LIST');\n for (i = 0; i < o.length; i++) {\n newEncodedObj.push(encodeObject(o[i]));\n }\n } else if (o.__proto__.toString() === canonicalSet.__proto__.toString()) { // dunno why 'instanceof' doesn't work :(\n newEncodedObj.push('SET');\n // ES6 Set (TODO: add WeakSet)\n for (let item of o) {\n newEncodedObj.push(encodeObject(item));\n }\n } else if (o.__proto__.toString() === canonicalMap.__proto__.toString()) { // dunno why 'instanceof' doesn't work :(\n // ES6 Map (TODO: add WeakMap)\n newEncodedObj.push('DICT'); // use the Python 'DICT' type since it's close enough; adjust display in frontend\n for (let [key, value] of o) {\n newEncodedObj.push([encodeObject(key), encodeObject(value)]);\n }\n } else {\n // a true object\n\n // if there's a custom toString() function (note that a truly\n // prototypeless object won't have toString method, so check first to\n // see if toString is *anywhere* up the prototype chain)\n var s = (o.toString !== undefined) ? o.toString() : '';\n if (s !== '' && s !== '[object Object]') {\n newEncodedObj.push('INSTANCE_PPRINT', 'object', s);\n } else {\n newEncodedObj.push('INSTANCE', '');\n var pairs = _.pairs(o);\n for (i = 0; i < pairs.length; i++) {\n var e = pairs[i];\n newEncodedObj.push([encodeObject(e[0]), encodeObject(e[1])]);\n }\n\n var proto = Object.getPrototypeOf(o);\n if (_.isObject(proto) && !_.isEmpty(proto)) {\n //log('obj.prototype', proto, proto.smallObjId_hidden_);\n // I think __proto__ is the official term for this field,\n // *not* 'prototype'\n newEncodedObj.push(['__proto__', encodeObject(proto)]);\n }\n }\n }\n\n return ret;\n }\n\n }\n assert(false);\n}", "function dist_index_esm_contains(obj,key){return Object.prototype.hasOwnProperty.call(obj,key);}", "function isRawPostcodeObject(o, additionalAttr, blackListedAttr) {\n\tif (!additionalAttr) additionalAttr = [];\n\tif (!blackListedAttr) blackListedAttr = [];\n\tisSomeObject(o, rawPostcodeAttributes, additionalAttr, blackListedAttr);\n}", "function _meta_(v,m){var ms=v['__meta__']||{};for(var k in m){ms[k]=m[k]};v['__meta__']=ms;return v}", "function Animal() {\n this.kind = \"Dog\"\n}", "function Kitten(name, photo, interests, isGoodWithKids, isGoodWithDogs, isGoodWithCats) {\n this.name = name;\n this.photo = photo;\n this.interests = interests;\n this.isGoodWithKids = isGoodWithKids;\n this.isGoodWithCats = isGoodWithCats;\n this.isGoodWithDogs = isGoodWithDogs;\n}", "getMeta () {\n }", "function np(e){return\"[object Object]\"===Object.prototype.toString.call(e)}", "function Obj() {}", "function isFriend(name, object) {\n//use hasWord function to check object names array\n// console.log(object);\n// console.log(name);\n//conditional to check for property\nif (object['friends'] !== undefined) {\nreturn hasWord(object.friends.join(' '), name);\n}\nelse {return false};\n \n}", "function test_fail_hole_prototype() {\n var obj = Object.create({ stuff: \"in prototype\" });\n obj.foo = \"bar\";\n\n function f1() {\n bidar.serialize(obj);\n }\n assert.throws(f1, /Hole-ful graph, but no hole filter/);\n}", "function Person(saying) {\n this.saying = saying;\n /*\n return {\n dumbObject: true\n }\n */\n}", "transient private protected internal function m182() {}", "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}", "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}", "function Surrogate(){}", "function Surrogate(){}", "function Surrogate(){}", "static serialize(obj, allowPrimitives, fallbackToJson, requireJsonType = false) {\n if (allowPrimitives) {\n if (typeof obj === \"string\") {\n return this.serializePrimitive(obj, \"string\");\n } else if (typeof obj === \"number\") {\n return this.serializePrimitive(obj, \"double\");\n } else if (Buffer.isBuffer(obj)) {\n return this.serializePrimitive(obj, \"bytes\");\n } else if (typeof obj === \"boolean\") {\n return this.serializePrimitive(obj, \"bool\");\n } else if (Long.isLong(obj)) {\n return this.serializePrimitive(obj, \"int64\");\n }\n }\n if (obj.constructor && typeof obj.constructor.encode === \"function\" && obj.constructor.$type) {\n return Any.create({\n // I have *no* idea why it's type_url and not typeUrl, but it is.\n type_url: \"type.googleapis.com/\" + AnySupport.fullNameOf(obj.constructor.$type),\n value: obj.constructor.encode(obj).finish()\n });\n } else if (fallbackToJson && typeof obj === \"object\") {\n let type = obj.type;\n if (type === undefined) {\n if (requireJsonType) {\n throw new Error(util.format(\"Fallback to JSON serialization supported, but object does not define a type property: %o\", obj));\n } else {\n type = \"object\";\n }\n }\n return Any.create({\n type_url: CloudStateJson + type,\n value: this.serializePrimitiveValue(stableJsonStringify(obj), \"string\")\n });\n } else {\n throw new Error(util.format(\"Object %o is not a protobuf object, and hence can't be dynamically \" +\n \"serialized. Try passing the object to the protobuf classes create function.\", obj));\n }\n }" ]
[ "0.527866", "0.52612406", "0.51951283", "0.518796", "0.51302594", "0.5044646", "0.48934332", "0.4857401", "0.484017", "0.48302925", "0.482028", "0.4812441", "0.4808473", "0.47852293", "0.47828078", "0.47574478", "0.47493434", "0.4739314", "0.47239366", "0.4703992", "0.4703992", "0.46990207", "0.4690639", "0.46904448", "0.46862254", "0.46716532", "0.46667543", "0.46522382", "0.46354175", "0.46053663", "0.46017453", "0.45926702", "0.45891586", "0.45877746", "0.458541", "0.45851982", "0.45847243", "0.4584686", "0.458378", "0.45767823", "0.45753202", "0.45753202", "0.45753202", "0.45713404", "0.45637134", "0.45637134", "0.4557141", "0.4557141", "0.4557141", "0.45494914", "0.45366898", "0.45342454", "0.4533338", "0.45322663", "0.45229813", "0.452288", "0.452288", "0.45159692", "0.45102093", "0.45099118", "0.45062032", "0.4506134", "0.45033473", "0.4502599", "0.44998378", "0.4497197", "0.44843012", "0.44764578", "0.44738895", "0.44715428", "0.44715428", "0.4471341", "0.44594073", "0.44552016", "0.44538808", "0.44522536", "0.44464657", "0.44464657", "0.4443469", "0.4443427", "0.44433454", "0.4437557", "0.4436382", "0.4430658", "0.4429719", "0.4428169", "0.44260293", "0.4420813", "0.44155774", "0.44130567", "0.4406073", "0.4401904", "0.44010627", "0.43994573", "0.43948644", "0.43847254", "0.43847254", "0.43830302", "0.43830302", "0.43830302", "0.4381413" ]
0.0
-1
Try/catch helper to minimize deoptimizations. Returns a completion record like context.tryEntries[i].completion. This interface could have been (and was previously) designed to take a closure to be invoked without arguments, but in all the cases we care about we already have an existing method we want to call, so there's no need to create a new function object. We can even get away with assuming the method takes exactly one argument, since that happens to be true in every case, so we don't have to touch the arguments object. The only additional allocation required is the completion record, which has a stable shape and so hopefully should be cheap to allocate.
function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tryCatch(fn, obj, arg) { // 59\n try { // 60\n return { type: \"normal\", arg: fn.call(obj, arg) }; // 61\n } catch (err) { // 62\n return { type: \"throw\", arg: err }; // 63\n } // 64\n } // 65", "function tryCatch(fn, obj, arg) { // 63\n try { // 64\n return { type: \"normal\", arg: fn.call(obj, arg) }; // 65\n } catch (err) { // 66\n return { type: \"throw\", arg: err }; // 67\n } // 68\n } // 69", "function tryCatch(fn,obj,arg){try{return {type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return {type:\"throw\",arg:err};}}", "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {\n ensureSafeMemberName(key0, fullExp);\n ensureSafeMemberName(key1, fullExp);\n ensureSafeMemberName(key2, fullExp);\n ensureSafeMemberName(key3, fullExp);\n ensureSafeMemberName(key4, fullExp);\n var eso = function(o) {\n return ensureSafeObject(o, fullExp);\n };\n var expensiveChecks = options.expensiveChecks;\n var eso0 = (expensiveChecks || isPossiblyDangerousMemberName(key0)) ? eso : identity;\n var eso1 = (expensiveChecks || isPossiblyDangerousMemberName(key1)) ? eso : identity;\n var eso2 = (expensiveChecks || isPossiblyDangerousMemberName(key2)) ? eso : identity;\n var eso3 = (expensiveChecks || isPossiblyDangerousMemberName(key3)) ? eso : identity;\n var eso4 = (expensiveChecks || isPossiblyDangerousMemberName(key4)) ? eso : identity;\n\n return !options.unwrapPromises\n ? function cspSafeGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope;\n\n if (pathVal == null) return pathVal;\n pathVal = eso0(pathVal[key0]);\n\n if (!key1) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso1(pathVal[key1]);\n\n if (!key2) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso2(pathVal[key2]);\n\n if (!key3) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso3(pathVal[key3]);\n\n if (!key4) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso4(pathVal[key4]);\n\n return pathVal;\n }\n : function cspSafePromiseEnabledGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope,\n promise;\n\n if (pathVal == null) return pathVal;\n\n pathVal = eso0(pathVal[key0]);\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = eso0(val); });\n }\n pathVal = eso0(pathVal.$$v);\n }\n\n if (!key1) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso1(pathVal[key1]);\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = eso1(val); });\n }\n pathVal = eso1(pathVal.$$v);\n }\n\n if (!key2) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso2(pathVal[key2]);\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = eso2(val); });\n }\n pathVal = eso2(pathVal.$$v);\n }\n\n if (!key3) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso3(pathVal[key3]);\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = eso3(val); });\n }\n pathVal = eso3(pathVal.$$v);\n }\n\n if (!key4) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso4(pathVal[key4]);\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = eso4(val); });\n }\n pathVal = eso4(pathVal.$$v);\n }\n return pathVal;\n };\n}", "function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {\n ensureSafeMemberName(key0, fullExp);\n ensureSafeMemberName(key1, fullExp);\n ensureSafeMemberName(key2, fullExp);\n ensureSafeMemberName(key3, fullExp);\n ensureSafeMemberName(key4, fullExp);\n var eso = function(o) {\n return ensureSafeObject(o, fullExp);\n };\n var expensiveChecks = options.expensiveChecks;\n var eso0 = (expensiveChecks || isPossiblyDangerousMemberName(key0)) ? eso : identity;\n var eso1 = (expensiveChecks || isPossiblyDangerousMemberName(key1)) ? eso : identity;\n var eso2 = (expensiveChecks || isPossiblyDangerousMemberName(key2)) ? eso : identity;\n var eso3 = (expensiveChecks || isPossiblyDangerousMemberName(key3)) ? eso : identity;\n var eso4 = (expensiveChecks || isPossiblyDangerousMemberName(key4)) ? eso : identity;\n\n return !options.unwrapPromises\n ? function cspSafeGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope;\n\n if (pathVal == null) return pathVal;\n pathVal = eso0(pathVal[key0]);\n\n if (!key1) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso1(pathVal[key1]);\n\n if (!key2) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso2(pathVal[key2]);\n\n if (!key3) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso3(pathVal[key3]);\n\n if (!key4) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso4(pathVal[key4]);\n\n return pathVal;\n }\n : function cspSafePromiseEnabledGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope,\n promise;\n\n if (pathVal == null) return pathVal;\n\n pathVal = eso0(pathVal[key0]);\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = eso0(val); });\n }\n pathVal = eso0(pathVal.$$v);\n }\n\n if (!key1) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso1(pathVal[key1]);\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = eso1(val); });\n }\n pathVal = eso1(pathVal.$$v);\n }\n\n if (!key2) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso2(pathVal[key2]);\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = eso2(val); });\n }\n pathVal = eso2(pathVal.$$v);\n }\n\n if (!key3) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso3(pathVal[key3]);\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = eso3(val); });\n }\n pathVal = eso3(pathVal.$$v);\n }\n\n if (!key4) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso4(pathVal[key4]);\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = eso4(val); });\n }\n pathVal = eso4(pathVal.$$v);\n }\n return pathVal;\n };\n}", "function c(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}", "function IteratorClose(iteratorRecord, completion) { // eslint-disable-line no-unused-vars\n\t\t// 1. Assert: Type(iteratorRecord.[[Iterator]]) is Object.\n\t\tif (Type(iteratorRecord['[[Iterator]]']) !== 'object') {\n\t\t\tthrow new Error(Object.prototype.toString.call(iteratorRecord['[[Iterator]]']) + 'is not an Object.');\n\t\t}\n\t\t// 2. Assert: completion is a Completion Record.\n\t\t// Polyfill.io - Ignoring this step as there is no way to check if something is a Completion Record in userland JavaScript.\n\n\t\t// 3. Let iterator be iteratorRecord.[[Iterator]].\n\t\tvar iterator = iteratorRecord['[[Iterator]]'];\n\t\t// 4. Let return be ? GetMethod(iterator, \"return\").\n\t\t// Polyfill.io - We name it returnMethod because return is a keyword and can not be used as an identifier (E.G. variable name, function name etc).\n\t\tvar returnMethod = GetMethod(iterator, \"return\");\n\t\t// 5. If return is undefined, return Completion(completion).\n\t\tif (returnMethod === undefined) {\n\t\t\treturn completion;\n\t\t}\n\t\t// 6. Let innerResult be Call(return, iterator, « »).\n\t\ttry {\n\t\t\tvar innerResult = Call(returnMethod, iterator);\n\t\t} catch (error) {\n\t\t\tvar innerException = error;\n\t\t}\n\t\t// 7. If completion.[[Type]] is throw, return Completion(completion).\n\t\tif (completion) {\n\t\t\treturn completion;\n\t\t}\n\t\t// 8. If innerResult.[[Type]] is throw, return Completion(innerResult).\n\t\tif (innerException) {\n\t\t\tthrow innerException;\n\t\t}\n\t\t// 9. If Type(innerResult.[[Value]]) is not Object, throw a TypeError exception.\n\t\tif (Type(innerResult) !== 'object') {\n\t\t\tthrow new TypeError(\"Iterator's return method returned a non-object.\");\n\t\t}\n\t\t// 10. Return Completion(completion).\n\t\treturn completion;\n\t}", "function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {\n ensureSafeMemberName(key0, fullExp);\n ensureSafeMemberName(key1, fullExp);\n ensureSafeMemberName(key2, fullExp);\n ensureSafeMemberName(key3, fullExp);\n ensureSafeMemberName(key4, fullExp);\n\n return !options.unwrapPromises\n ? function cspSafeGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope;\n\n if (pathVal == null) return pathVal;\n pathVal = pathVal[key0];\n\n if (pathVal == null) return key1 ? undefined : pathVal;\n pathVal = pathVal[key1];\n\n if (pathVal == null) return key2 ? undefined : pathVal;\n pathVal = pathVal[key2];\n\n if (pathVal == null) return key3 ? undefined : pathVal;\n pathVal = pathVal[key3];\n\n if (pathVal == null) return key4 ? undefined : pathVal;\n pathVal = pathVal[key4];\n\n return pathVal;\n }\n : function cspSafePromiseEnabledGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope,\n promise;\n\n if (pathVal == null) return pathVal;\n\n pathVal = pathVal[key0];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n if (pathVal == null) return key1 ? undefined : pathVal;\n\n pathVal = pathVal[key1];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n if (pathVal == null) return key2 ? undefined : pathVal;\n\n pathVal = pathVal[key2];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n if (pathVal == null) return key3 ? undefined : pathVal;\n\n pathVal = pathVal[key3];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n if (pathVal == null) return key4 ? undefined : pathVal;\n\n pathVal = pathVal[key4];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n return pathVal;\n };\n}", "function catcher () { return fn }", "function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {\n ensureSafeMemberName(key0, fullExp);\n ensureSafeMemberName(key1, fullExp);\n ensureSafeMemberName(key2, fullExp);\n ensureSafeMemberName(key3, fullExp);\n ensureSafeMemberName(key4, fullExp);\n\n return !options.unwrapPromises\n ? function cspSafeGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope;\n\n if (pathVal == null) return pathVal;\n pathVal = pathVal[key0];\n\n if (!key1) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key1];\n\n if (!key2) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key2];\n\n if (!key3) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key3];\n\n if (!key4) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key4];\n\n return pathVal;\n }\n : function cspSafePromiseEnabledGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope,\n promise;\n\n if (pathVal == null) return pathVal;\n\n pathVal = pathVal[key0];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key1) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key1];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key2) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key2];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key3) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key3];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key4) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key4];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n return pathVal;\n };\n}", "function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {\n ensureSafeMemberName(key0, fullExp);\n ensureSafeMemberName(key1, fullExp);\n ensureSafeMemberName(key2, fullExp);\n ensureSafeMemberName(key3, fullExp);\n ensureSafeMemberName(key4, fullExp);\n\n return !options.unwrapPromises\n ? function cspSafeGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope;\n\n if (pathVal == null) return pathVal;\n pathVal = pathVal[key0];\n\n if (!key1) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key1];\n\n if (!key2) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key2];\n\n if (!key3) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key3];\n\n if (!key4) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key4];\n\n return pathVal;\n }\n : function cspSafePromiseEnabledGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope,\n promise;\n\n if (pathVal == null) return pathVal;\n\n pathVal = pathVal[key0];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key1) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key1];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key2) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key2];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key3) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key3];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key4) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key4];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n return pathVal;\n };\n}", "function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {\n ensureSafeMemberName(key0, fullExp);\n ensureSafeMemberName(key1, fullExp);\n ensureSafeMemberName(key2, fullExp);\n ensureSafeMemberName(key3, fullExp);\n ensureSafeMemberName(key4, fullExp);\n\n return !options.unwrapPromises\n ? function cspSafeGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope;\n\n if (pathVal == null) return pathVal;\n pathVal = pathVal[key0];\n\n if (!key1) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key1];\n\n if (!key2) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key2];\n\n if (!key3) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key3];\n\n if (!key4) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key4];\n\n return pathVal;\n }\n : function cspSafePromiseEnabledGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope,\n promise;\n\n if (pathVal == null) return pathVal;\n\n pathVal = pathVal[key0];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key1) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key1];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key2) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key2];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key3) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key3];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key4) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key4];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n return pathVal;\n };\n}", "function _co(method, arg) {\n let res;\n\n try {\n //retrieve the promise returned by the http request if `arg` is undefined\n //if `arg` is defined it will be the data from the http request promise\n //and will be \"injected\" into `yield` and caught in a variable\n res = it[method](arg);\n } catch(err) {\n //not sure about the error handling here??\n return Promise.reject(err);\n }\n\n if (res.done) {\n if (method === 'throw') {\n return arg;\n } else {\n return res.value;\n }\n } else {\n //at this point we may resolve a promise or a value??\n //a) if we are resolving a promise we will inject it's value by calling `.next`\n //b) if we are resolving a value it will be ignored by `.next` as `yield` will be\n // the returned Promise from the http request\n return Promise.resolve(res.value)\n .then((val) => {\n return _co('next', val);\n }, (err) => {\n //not sure about the error handling here??\n return _co('throw', err);\n });\n }\n }", "completionItemResolve(item, span = new opentracing_1.Span()) {\n if (!item.data) {\n throw new Error('Cannot resolve completion item without data');\n }\n const { uri, offset, entryName } = item.data;\n const fileName = util_1.uri2path(uri);\n return this.projectManager.ensureReferencedFiles(uri, undefined, undefined, span)\n .toArray()\n .map(() => {\n const configuration = this.projectManager.getConfiguration(fileName);\n configuration.ensureBasicFiles(span);\n const details = configuration.getService().getCompletionEntryDetails(fileName, offset, entryName);\n if (details) {\n item.documentation = ts.displayPartsToString(details.documentation);\n item.detail = ts.displayPartsToString(details.displayParts);\n if (this.supportsCompletionWithSnippets &&\n (details.kind === 'method' || details.kind === 'function')) {\n const parameters = details.displayParts\n .filter(p => p.kind === 'parameterName')\n .map((p, i) => '${' + `${i + 1}:${p.text}` + '}');\n const paramString = parameters.join(', ');\n item.insertText = details.name + `(${paramString})`;\n item.insertTextFormat = vscode_languageserver_1.InsertTextFormat.Snippet;\n }\n else {\n item.insertTextFormat = vscode_languageserver_1.InsertTextFormat.PlainText;\n item.insertText = details.name;\n }\n item.data = undefined;\n }\n return item;\n })\n .map(completionItem => ({ op: 'add', path: '', value: completionItem }));\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: 'normal', arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: 'throw', arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return {\n\t type: \"normal\",\n\t arg: fn.call(obj, arg)\n\t };\n\t } catch (err) {\n\t return {\n\t type: \"throw\",\n\t arg: err\n\t };\n\t }\n\t }", "function completeValueCatchingError(exeContext, returnType, fieldNodes, info, path, result) {\n try {\n var completed;\n\n if (Object(_jsutils_isPromise__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(result)) {\n completed = result.then(function (resolved) {\n return completeValue(exeContext, returnType, fieldNodes, info, path, resolved);\n });\n } else {\n completed = completeValue(exeContext, returnType, fieldNodes, info, path, result);\n }\n\n if (Object(_jsutils_isPromise__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(completed)) {\n // Note: we don't rely on a `catch` method, but we do expect \"thenable\"\n // to take a second callback for the error case.\n return completed.then(undefined, function (error) {\n return handleFieldError(error, fieldNodes, path, returnType, exeContext);\n });\n }\n\n return completed;\n } catch (error) {\n return handleFieldError(error, fieldNodes, path, returnType, exeContext);\n }\n}", "function call_method(func, scope, args) {\n try {\n return func.apply(scope, guess_callback(args, scope));\n } catch(e) { if (!(e instanceof Break)) { throw(e); } }\n\n return undefined;\n}" ]
[ "0.5071568", "0.5061275", "0.4849881", "0.47927505", "0.47927505", "0.47927505", "0.47927505", "0.47927505", "0.47831497", "0.47831497", "0.47063333", "0.46893752", "0.46678346", "0.4655878", "0.46554154", "0.46554154", "0.46554154", "0.46371436", "0.46213374", "0.46146342", "0.46146342", "0.46146342", "0.46146342", "0.46146342", "0.46115592", "0.46081045", "0.4596039", "0.45958352", "0.45948482" ]
0.0
-1
Dummy constructor functions that we use as the .constructor and .constructor.prototype properties for functions that return Generator objects. For full spec compliance, you may wish to configure your minifier not to mangle the names of these two functions.
function Generator() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tempCtor() {}", "function temporaryConstructor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function HelperConstructor() {}", "function DummyClass() {\r\n // All construction is actually done in the construct method\r\n if ( !init && this.construct )\r\n this.construct.apply(this, arguments);\r\n }", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "function Ctor() {}", "function SomeConstructor() {\n\n}", "__init2() {this.noAnonFunctionType = false}", "function GeneratorClass () {}", "function Dummy() {}", "function Dummy() {}", "function Ctor() {\n\t// Empty...\n}", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function $makeBlank(ctor)\n{\n var blank = function() {};\n blank.prototype = ctor.prototype;\n return blank;\n}", "function new_constructor(extend, initializer, methods){\n\t\t\tvar func,\n\t\t\t\tmethodsArr,\n\t\t\t\tmethodsLen,\n\t\t\t\tk,\n\t\t\t\tprototype = Object.create(extend && extend.prototype);\t// ES5, but backup function provided above\n\t\t\t\n\t\t\tif(methods){\n\t\t\t\tmethodsArr = Object.keys(methods);\t\t\t\t\t\t// ES5, but backup function provided above\n\t\t\t\tmethodsLen = methodsArr.length;\n\t\t\t\tfor(k = methodsLen; k--;){\n\t\t\t\t\tprototype[methodsArr[k]] = methods[methodsArr[k]];\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfunc = function(){\t\t\n\t\t\t\tvar that = Object.create(prototype);\t\t\t\t\t// ES5, but backup function provided above\n\t\t\t\tif(typeof initializer === \"function\"){\n\t\t\t\t\tinitializer.apply(that, arguments);\n\t\t\t\t}\n\t\t\t\treturn that;\n\t\t\t};\n\t\t\t\n\t\t\tfunc.prototype = prototype;\n\t\t\tprototype.constructor = func;\n\t\t\treturn func;\n\t\t}", "function makeObjectWithFakeCtor() {\n function fakeCtor() {\n }\n fakeCtor.prototype = ctor.prototype;\n return new fakeCtor();\n }", "function o(e,t,n){try{return{type:\"normal\",arg:e.call(t,n)}}catch(e){return{type:\"throw\",arg:e}}}// Dummy constructor functions that we use as the .constructor and", "function r(e,t,o){try{return{type:\"normal\",arg:e.call(t,o)}}catch(e){return{type:\"throw\",arg:e}}}// Dummy constructor functions that we use as the .constructor and", "function new_constructor(initializer, methods, extend) {\n var prototype = Object.create(typeof extend === 'function'\n ? extend.prototype\n : extend);\n if (methods) {\n methods.keys().forEach(function (key) {\n prototype[key] = methods[key];\n}); }\n function constructor() {\n var that = Object.create(prototype);\n if (typeof initializer === 'function') {\n initializer.apply(that, arguments);\n }\n return that;\n }\n constructor.prototype = prototype;\n prototype.constructor = constructor;\n return constructor;\n }", "function _ctor() {\n\t}", "function simpleConstructor(bases){\n\t\treturn function(){\n\t\t\tvar a = arguments, i = 0, f, m;\n\n\t\t\tif(!(this instanceof a.callee)){\n\t\t\t\t// not called via new, so force it\n\t\t\t\treturn applyNew(a);\n\t\t\t}\n\n\t\t\t//this._inherited = {};\n\t\t\t// perform the shaman's rituals of the original dojo.declare()\n\t\t\t// 1) do not call the preamble\n\t\t\t// 2) call the top constructor (it can use this.inherited())\n\t\t\tfor(; f = bases[i]; ++i){ // intentional assignment\n\t\t\t\tm = f._meta;\n\t\t\t\tf = m ? m.ctor : f;\n\t\t\t\tif(f){\n\t\t\t\t\tf.apply(this, a);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// 3) call the postscript\n\t\t\tf = this.postscript;\n\t\t\tif(f){\n\t\t\t\tf.apply(this, a);\n\t\t\t}\n\t\t};\n\t}", "function Clazz () {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "function c(a,b,c){try{return{type:\"normal\",arg:a.call(b,c)}}catch(a){return{type:\"throw\",arg:a}}}// Dummy constructor functions that we use as the .constructor and", "function SpoofConstructor(name){\n this.name=\"I am \" + name;\n return {name:\"I am Deadpool\"};\n}", "function SimpleClass() {\n }", "function simpleConstructor(bases){\n\t\treturn function(){\n\t\t\tvar a = arguments, i = 0, f, m;\n\n\t\t\tif(!(this instanceof a.callee)){\n\t\t\t\t// not called via new, so force it\n\t\t\t\treturn applyNew(a);\n\t\t\t}\n\n\t\t\t//this._inherited = {};\n\t\t\t// perform the shaman's rituals of the original declare()\n\t\t\t// 1) do not call the preamble\n\t\t\t// 2) call the top constructor (it can use this.inherited())\n\t\t\tfor(; f = bases[i]; ++i){ // intentional assignment\n\t\t\t\tm = f._meta;\n\t\t\t\tf = m ? m.ctor : f;\n\t\t\t\tif(f){\n\t\t\t\t\tf.apply(this, a);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// 3) call the postscript\n\t\t\tf = this.postscript;\n\t\t\tif(f){\n\t\t\t\tf.apply(this, a);\n\t\t\t}\n\t\t};\n\t}", "function simpleConstructor(bases){\n\t\treturn function(){\n\t\t\tvar a = arguments, i = 0, f, m;\n\n\t\t\tif(!(this instanceof a.callee)){\n\t\t\t\t// not called via new, so force it\n\t\t\t\treturn applyNew(a);\n\t\t\t}\n\n\t\t\t//this._inherited = {};\n\t\t\t// perform the shaman's rituals of the original declare()\n\t\t\t// 1) do not call the preamble\n\t\t\t// 2) call the top constructor (it can use this.inherited())\n\t\t\tfor(; f = bases[i]; ++i){ // intentional assignment\n\t\t\t\tm = f._meta;\n\t\t\t\tf = m ? m.ctor : f;\n\t\t\t\tif(f){\n\t\t\t\t\tf.apply(this, a);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// 3) call the postscript\n\t\t\tf = this.postscript;\n\t\t\tif(f){\n\t\t\t\tf.apply(this, a);\n\t\t\t}\n\t\t};\n\t}", "function asCtor(constr) {\n return primFreeze(asCtorOnly(constr));\n }", "function Proto() {\n\n // empty functions\n}", "function createConstructor(name, opts) {\n\t var func = create.bind(null, name);\n\n\t // Assigning defaults gives a predictable definition and prevents us from\n\t // having to do defaults checks everywhere.\n\t assign(func, defaults);\n\n\t // Inherit all options. This takes into account object literals as well as\n\t // ES2015 classes that may have inherited static props which would not be\n\t // considered \"own\".\n\t utilDefineProperties(func, getAllPropertyDescriptors(opts));\n\n\t return func;\n\t}", "function markCtor(constr, opt_Sup, opt_name) {\n enforceType(constr, 'function', opt_name);\n if (isFunc(constr)) {\n fail(\"Simple functions can't be constructors: \", constr);\n }\n if (isXo4aFunc(constr)) {\n fail(\"Exophoric functions can't be constructors: \", constr);\n }\n constr.CONSTRUCTOR___ = true;\n if (opt_Sup) {\n derive(constr, opt_Sup);\n } else if (constr !== Object) {\n fail('Only \"Object\" has no super: ', constr);\n }\n if (opt_name) {\n constr.NAME___ = String(opt_name);\n }\n if (constr !== Object && constr !== Array) {\n // Iff constr is not Object nor Array, then any object inheriting from\n // constr.prototype is a constructed object which therefore tames to\n // itself by default. We do this with AS_TAMED___ and AS_FERAL___\n // methods on the prototype so it can be overridden either by overriding\n // these methods or by pre-taming with ___.tamesTo or ___.tamesToSelf.\n constr.prototype.AS_TAMED___ =\n constr.prototype.AS_FERAL___ = function() {\n return this;\n };\n }\n return constr; // translator freezes constructor later\n }", "function FooObj(){}", "function getBlockedFunctionConstructor() {\n\n\t\t\tfunction FakeFunction(execCode) {\n\t\t\t\tvar code = \"FUNCTION_CONSTRUCTOR_DETECTED\";\n\t\t\t\tvar message = \"function constructor with code: \" + execCode;\n\t\t\t\terror = {code: code, message: message};\n\n\t\t\t\treturn function() {};\n\t\t\t}\n\n\t\t\treturn FakeFunction;\n\t\t}", "constructor( ) {}", "function Foo() { /* .. */ }", "function Ctor() {\r\n }", "function Generator() {} // 80", "function YourConstructor() {\n\t// initialization\n}", "static clear() {\n CallbackConstructorRegistry.constructors = {};\n }", "function Generator() {} // 84", "constructur() {}", "function populateConstructorExports(exports,codes,HttpError){codes.forEach(function forEachCode(code){var CodeError;var name=toIdentifier(statuses[code]);switch(codeClass(code)){case 400:CodeError=createClientErrorConstructor(HttpError,name,code);break;case 500:CodeError=createServerErrorConstructor(HttpError,name,code);break;}if(CodeError){// export the constructor\nexports[code]=CodeError;exports[name]=CodeError;}});// backwards-compatibility\nexports[\"I'mateapot\"]=deprecate.function(exports.ImATeapot,'\"I\\'mateapot\"; use \"ImATeapot\" instead');}", "function ctor() {\n this.constructor = ChildFunc;\n }", "function Foo() { .. }", "function make_class(){\n\tvar isInternal;\n\tvar constructor = function(args){\n if ( this instanceof constructor ) {\n\t\tif ( typeof this.init == \"function\" ) {\n this.init.apply( this, isInternal ? args : arguments );\n\t\t}\n } else {\n\t\tisInternal = true;\n\t\tvar instance = new constructor( arguments );\n\t\tisInternal = false;\n\t\treturn instance;\n }\n\t};\n\treturn constructor;\n }", "function make_class(){\n\tvar isInternal;\n\tvar constructor = function(args){\n if ( this instanceof constructor ) {\n\t\tif ( typeof this.init == \"function\" ) {\n this.init.apply( this, isInternal ? args : arguments );\n\t\t}\n } else {\n\t\tisInternal = true;\n\t\tvar instance = new constructor( arguments );\n\t\tisInternal = false;\n\t\treturn instance;\n }\n\t};\n\treturn constructor;\n }", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}" ]
[ "0.7218366", "0.70249206", "0.69523525", "0.69523525", "0.69523525", "0.69523525", "0.69523525", "0.69523525", "0.6760518", "0.65990555", "0.6572468", "0.6572468", "0.6572468", "0.64856845", "0.644338", "0.6399951", "0.63927424", "0.6376415", "0.6376415", "0.6337515", "0.6277289", "0.6277289", "0.6277289", "0.6277289", "0.6277289", "0.6277289", "0.6277289", "0.6277289", "0.6277289", "0.6269308", "0.6205518", "0.6197294", "0.619519", "0.6126421", "0.60837233", "0.60491556", "0.6044655", "0.6017004", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.6007891", "0.59810776", "0.59648794", "0.59469587", "0.59156984", "0.59156984", "0.589385", "0.5885278", "0.5856197", "0.5854358", "0.5825156", "0.57986796", "0.579023", "0.5786165", "0.57843846", "0.57536197", "0.57440233", "0.5738886", "0.5733964", "0.5728288", "0.5698952", "0.5681179", "0.5680722", "0.5674501", "0.5674501", "0.5670438", "0.5670438", "0.5670438", "0.5670438" ]
0.0
-1
Helper for defining the .next, .throw, and .return methods of the Iterator interface in terms of a single ._invoke method.
function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function(method) { prototype[method] = function(arg) { return this._invoke(method, arg); }; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function defineIteratorMethods(prototype){[\"next\",\"throw\",\"return\"].forEach(function(method){prototype[method]=function(arg){return this._invoke(method,arg);};});}", "function defineIteratorMethods(prototype){[\"next\",\"throw\",\"return\"].forEach(function(method){prototype[method]=function(arg){return this._invoke(method,arg);};});}", "function defineIteratorMethods(prototype){[\"next\",\"throw\",\"return\"].forEach(function(method){prototype[method]=function(arg){return this._invoke(method,arg);};});}", "function defineIteratorMethods(prototype){[\"next\",\"throw\",\"return\"].forEach(function(method){prototype[method]=function(arg){return this._invoke(method,arg);};});}", "function defineIteratorMethods(prototype){[\"next\",\"throw\",\"return\"].forEach(function(method){prototype[method]=function(arg){return this._invoke(method,arg);};});}", "function defineIteratorMethods(prototype){[\"next\",\"throw\",\"return\"].forEach(function(method){prototype[method]=function(arg){return this._invoke(method,arg);};});}", "function defineIteratorMethods(prototype) { // 114\n [\"next\", \"throw\", \"return\"].forEach(function(method) { // 115\n prototype[method] = function(arg) { // 116\n return this._invoke(method, arg); // 117\n }; // 118\n }); // 119\n } // 120", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function (method) {\n\t prototype[method] = function (arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function (method) {\n\t prototype[method] = function (arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function (method) {\n\t prototype[method] = function (arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t define(prototype, method, function(arg) {\n\t return this._invoke(method, arg);\n\t });\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t define(prototype, method, function(arg) {\n\t return this._invoke(method, arg);\n\t });\n\t });\n\t }", "function defineIteratorMethods(prototype) {\r\n ['next', 'throw', 'return'].forEach(function(method) {\r\n prototype[method] = function(arg) {\r\n return this._invoke(method, arg);\r\n };\r\n });\r\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function (method) {\n\t prototype[method] = function (arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n define(prototype, method, function (arg) {\n return this._invoke(method, arg);\n });\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n define(prototype, method, function (arg) {\n return this._invoke(method, arg);\n });\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n ['next', 'throw', 'return'].forEach(function (method) {\n define(prototype, method, function (arg) {\n return this._invoke(method, arg);\n });\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n ['next', 'throw', 'return'].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }" ]
[ "0.74821436", "0.74821436", "0.74821436", "0.74821436", "0.74821436", "0.74821436", "0.71796995", "0.6995674", "0.6995674", "0.6973852", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.69677955", "0.6952658", "0.6952658", "0.6909098", "0.6857905", "0.6825829", "0.68245625", "0.68245625", "0.68145424", "0.67915004", "0.67915004", "0.6788172", "0.6786131", "0.6786131", "0.67834884", "0.6782078", "0.6779685", "0.6779685", "0.6779685", "0.6779685", "0.6779685", "0.6779685", "0.6779685", "0.6779685", "0.6779685", "0.6779685", "0.6779685", "0.6779685", "0.6779685", "0.6779685" ]
0.0
-1
Return a string as "" if undefined
function text0(t){ if(t!=undefined && t.length!=undefined) return t; else return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _undefinedCoerce() {\n return '';\n}", "function String$empty() {\n return '';\n }", "function String$empty() {\n return '';\n }", "function defaultString(value){\n\tif (!(value) || value == \"undefined\") {\n\t\treturn \"\";\n\t} \n\treturn value;\t\n}", "function _nullCoerce() {\n return '';\n}", "function checkUndefined(value) {\n if (JSON.stringify(value) === undefined) {\n return \"\";\n } else {\n return value;\n }\n }", "function printableStringOrDefault(val, defVal) {\n\tswitch (typeof val) {\n\tcase \"number\":\n\t\tif (isNaN(val)) {\n\t\t\treturn defVal;\n\t\t}\n\t\tbreak;\n\tcase \"object\":\n\t\tif (val === null) {\n\t\t\treturn defVal;\n\t\t} else if (Array.isArray(val)) {\n\t\t\treturn val.join(\", \");\n\t\t}\n\t\treturn \"[object]\";\n\tcase \"function\":\n\tcase \"undefined\":\n\t\treturn defVal;\n\t}\n\treturn String(val);\n}", "function emptyIfNull(string){\n\t\tif(string){return string;}\n\t\telse{return '';}\n\t}", "function _coalesceOutput(str){\n\t\treturn typeof(str) == \"undefined\" ? \"&nbsp\" : str;\n\t}", "function di_safevalue(val)\n{\n if(val==undefined || val=='' || val==null)\n return '';\n else\n return val; \n}", "function displayFriendlyPreparedBy(value){\n return value === undefined ? \"\"\n : value === null ? \"\"\n : value === 'null' ? \"\"\n : value;\n }", "function Common_getString(object) {\n return (object && object != null && object != '') ? object : '';\n}", "function orBlank(v) {\n return v === undefined ? '' : v;\n}", "function orBlank(v) {\n return v === undefined ? '' : v;\n}", "function f_stringify(po_value) {\n return(gm_misc.f_is_defined(po_value) ? String(po_value) : null);\n}", "function toString(val){\n return val == null ? '' : val.toString();\n }", "function toString(val){\n return val == null ? '' : val.toString();\n }", "function toString(val){return val==null?'':(typeof val===\"undefined\"?\"undefined\":_typeof2(val))==='object'?JSON.stringify(val,null,2):String(val);}", "function toString(val){return val==null?'':(typeof val===\"undefined\"?\"undefined\":_typeof2(val))==='object'?JSON.stringify(val,null,2):String(val);}", "function renderStringify(value) {\n if (typeof value === 'string')\n return value;\n if (value == null)\n return '';\n return '' + value;\n}", "function Undefined$prototype$toString() {\n return 'undefined';\n }", "function checaNullUndefined(arr){\n\treturn ((arr === null || arr === undefined) ? \"\" : arr)\n}", "function toString(val){\n\t return val == null ? '' : val.toString();\n\t }", "function format(value) {\n if (value === undefined || value === null)\n return '';\n return String(value);\n}", "function _toString(val){return val==null?'':(typeof val==='undefined'?'undefined':_typeof(val))==='object'?JSON.stringify(val,null,2):String(val);}", "function removeNull(msg) {\n if (msg) return msg;\n return '';\n}", "function nullIfEmpty(string){\n\t\tif(string === '' || string === null || string === undefined){\n\t\t\treturn null;\n\t\t}\n\t\telse{return string;}\n\t}", "function isNull(val) {\n return val || \"\"\n}", "function Get_String(variable, defaultValue)\n{\n\t//return the variable or its default value\n\treturn variable && variable != \"null\" && variable != \"undefined\" ? variable : defaultValue;\n}", "function string(s) {\n\tif (typeof s === \"string\" || typeof s === \"undefined\" || s === null) {\n\t\treturn s;\n\t}\n\treturn \"\" + s;\n}", "function emptyRender(value) {\r\n return \"\";\r\n}", "async getNoParam() {\n\t\treturn \"\";\n\t}", "function stringifyFallback(value) {\n // JSON.stringify returns `undefined` here, instead of the string \"undefined\".\n return value === undefined ? undefined : stringifyValue(value);\n }", "function replaceUndefinedColumnValue (text) {\n if (text == undefined || text === \"undefined\") {\n return \"\";\n } else {\n return text;\n }\n}", "function textify(val) {\n if (val === null) {\n return 'N/A';\n }\n return val.toString();\n }", "function handleNull(value) {\n\tif(value == null) {\n\t\treturn \"\";\n\t}\n\treturn value;\n}", "function function_setnull(fieldname){\n var result = '';\n return result;\n}", "function coerceToString(value) {\n return \"\" + (value || '');\n}", "function hello(string) {\n if(string === undefined){\n return 'Hello World!';\n }\n return `Hello ${string}!`;\n}", "function setBlankIfNull(value){\n return value == null ? \"\" : value;\n }", "function toString(val) {\n return val == null ? '' : (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' ? JSON.stringify(val, null, 2) : String(val);\n}", "function toString(val) {\n return val == null ? '' : (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' ? JSON.stringify(val, null, 2) : String(val);\n}", "function toString(val) {\n return val == null ? '' : (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' ? JSON.stringify(val, null, 2) : String(val);\n}", "function toString(val) {\n return val == null ? '' : (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' ? JSON.stringify(val, null, 2) : String(val);\n}", "function toString(val) {\n\t return val == null ? '' : (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' ? JSON.stringify(val, null, 2) : String(val);\n\t}", "function toString(val) {\n\t return val == null ? '' : (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' ? JSON.stringify(val, null, 2) : String(val);\n\t}", "function toString(value){return ''+value;}", "getAsString() { \r\n if(!Lang.isNull(this.staging)) { \r\n if((Lang.isNull(this.staging.tumorSize) || Lang.isUndefined(this.staging.tumorSize)) &&\r\n (Lang.isNull(this.staging.nodeSize) || Lang.isUndefined(this.staging.nodeSize)) &&\r\n (Lang.isNull(this.staging.metastasis) || Lang.isUndefined(this.staging.metastasis)))\r\n {\r\n return `#staging`;\r\n } else { \r\n const tString = this.getTumorSizeString(this.staging);\r\n const nString = this.getNodeSizeString(this.staging);\r\n const mString = this.getMetastasisString(this.staging);\r\n // Don't put any spaces -- the spaces should be dictated by the current reason and date\r\n return `#staging[T${tString}N${nString}M${mString}]`;\r\n }\r\n }\r\n }", "function returnSOrEmpty(num) {\n return (num === 1) ? \"\" : \"s\";\n }", "function _toString(val) {\n return val == null ? '' : (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' ? JSON.stringify(val, null, 2) : String(val);\n}", "function emptyOrString(property) {\n return !is_Empty(property) ? property : \"\";\n }", "function emptyOrString(property) {\n return !is_Empty(property) ? property : \"\";\n }", "function emptyOrString(property) {\n return !is_Empty(property) ? property : \"\";\n }", "function toString(value) {\n return '' + value;\n }", "function emptyif(text) {\n if (text === undefined || text == \"\" || text.trim() == \"\") return \"\";\n return text;\n}", "function valToString(val) { return val != null ? val.toString().replace(/~/g, \"~~\").replace(/\\//g, \"~2F\") : val; }", "function valToString(val) { return val != null ? val.toString().replace(/~/g, \"~~\").replace(/\\//g, \"~2F\") : val; }", "function valToString(val) { return val != null ? val.toString().replace(/~/g, \"~~\").replace(/\\//g, \"~2F\") : val; }", "function valToString(val) { return val != null ? val.toString().replace(/~/g, \"~~\").replace(/\\//g, \"~2F\") : val; }", "function valToString(val) { return val != null ? val.toString().replace(/~/g, \"~~\").replace(/\\//g, \"~2F\") : val; }", "function valToString(val) { return val != null ? val.toString().replace(/~/g, \"~~\").replace(/\\//g, \"~2F\") : val; }", "function valToString(val) { return val != null ? val.toString().replace(/~/g, \"~~\").replace(/\\//g, \"~2F\") : val; }", "function valToString(val) { return val != null ? val.toString().replace(/~/g, \"~~\").replace(/\\//g, \"~2F\") : val; }", "function wrap(s, nonull) {\n s = s.trim()\n return !s ? '' : '(function(v){try{v='\n\n // prefix vars (name => data.name)\n + (s.replace(reVars, function(s, _, v) { return v ? '(d.'+v+'===undefined?'+(typeof window == 'undefined' ? 'global.' : 'window.')+v+':d.'+v+')' : s })\n\n // break the expression if its empty (resulting in undefined value)\n || 'x')\n + '}catch(e){'\n + '}finally{return '\n\n // default to empty string for falsy values except zero\n + (nonull === true ? '!v&&v!==0?\"\":v' : 'v')\n\n + '}}).call(d)'\n }", "function toString(value) {\n return '' + value;\n }", "function toString(value) {\n return '' + value;\n }", "function toString(value) {\n return '' + value;\n }", "function toString(value) {\n return '' + value;\n }", "function toString(value) {\n return '' + value;\n }", "function toString(value) {\n return '' + value;\n }", "function toString(value) {\n return '' + value;\n }", "function toString(value) {\n return '' + value;\n }", "function toString(value) {\n return '' + value;\n }", "function toString(value) {\n return '' + value;\n }", "function toString(value) {\n return '' + value;\n }", "function toString(value) {\n return '' + value;\n }", "function toString(value) {\n return '' + value;\n }", "function toString(value) {\n return '' + value;\n }", "static optionalData(data) {\n if (Helper.isPresent(data) === false) {\n return '';\n } else if (typeof data === 'object') {\n // runs Helper.optionalData again to reduce to string in case something else was returned\n return Helper.optionalData(JSON.stringify(data));\n } else if (typeof data === 'function') {\n // runs the function and calls Helper.optionalData again to reduce further if it isn't a string\n return Helper.optionalData(data());\n } else {\n return String(data);\n }\n }", "function willGetUndefined(user) {\n return `Welcome ${user.firstName} ${user.lastName}`;\n}", "function cleanUnknownText(text){\n if (text != undefined){\n return text;\n }\n else{\n return 'N/A';\n }\n}", "function valToString(val) {\n return val !== null && val !== undefined ? val.toString().replace(/~/g, \"~~\").replace(/\\//g, \"~2F\") : val;\n }", "function toString(value) {\n return '' + value;\n }", "function noParse (val) {\n return String(val);\n}", "function noParse (val) {\n return String(val);\n}", "function noParse (val) {\n return String(val);\n}", "function noParse (val) {\n return String(val);\n}", "function toString(value) {\n return '' + value;\n}", "function toString(value) {\n return '' + value;\n}", "function toString(value) {\n return '' + value;\n}", "function toString(value) {\n return '' + value;\n}", "function toString(value) {\n return '' + value;\n}", "function toString(value) {\n return '' + value;\n}", "function toString(value) {\n return '' + value;\n}", "function toString(value) {\n return '' + value;\n}", "function toString(value) {\n return '' + value;\n}", "function toString(value) {\n return '' + value;\n}", "function toString(value) {\n return '' + value;\n}", "function toString(value) {\n return '' + value;\n}", "function toString(value) {\n return '' + value;\n}" ]
[ "0.76884234", "0.737703", "0.737703", "0.73487496", "0.7116591", "0.69041556", "0.6903906", "0.68849623", "0.68665075", "0.6849313", "0.67688394", "0.67657316", "0.6723922", "0.6723922", "0.6617632", "0.6596092", "0.6596092", "0.6584421", "0.6584421", "0.65658474", "0.65080935", "0.65064484", "0.64943683", "0.64187044", "0.64062554", "0.637034", "0.63658917", "0.63614035", "0.63497424", "0.6306832", "0.6300663", "0.62946004", "0.6279151", "0.62703305", "0.6246741", "0.62277174", "0.619966", "0.61958194", "0.6158217", "0.61474365", "0.6144573", "0.6144573", "0.6144573", "0.6144573", "0.6077369", "0.6077369", "0.6061528", "0.60600513", "0.6055354", "0.6048424", "0.6042304", "0.6042304", "0.60142744", "0.59902376", "0.5987012", "0.5970936", "0.5970936", "0.5970936", "0.5970936", "0.5970936", "0.5970936", "0.5970936", "0.5970936", "0.5953735", "0.5943058", "0.5943058", "0.5943058", "0.5943058", "0.5943058", "0.5943058", "0.5943058", "0.5943058", "0.5943058", "0.5943058", "0.5943058", "0.5943058", "0.5943058", "0.5943058", "0.59394026", "0.5892472", "0.5888391", "0.58874315", "0.58843637", "0.5878651", "0.5878651", "0.5878651", "0.5878651", "0.5871224", "0.5871224", "0.5871224", "0.5871224", "0.5871224", "0.5871224", "0.5871224", "0.5871224", "0.5871224", "0.5871224", "0.5871224", "0.5871224", "0.5871224" ]
0.62126267
36
Extract XML from a string
function string2xml(txt){ if (window.DOMParser){ parser=new DOMParser(); return parser.parseFromString(txt,"text/xml"); } else { // Internet Explorer xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async=false; xmlDoc.loadXML(txt); return xmlDoc; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseXmlString(str)\n{\n\tif (!str)\n\t\treturn null;\n\n\tvar parser = new DOMParser();\n\tvar dom = parser.parseFromString(str, \"text/xml\");\n\tif (dom.documentElement.nodeName === \"parsererror\")\n\t\treturn undefined;\n\n\treturn dom;\n}", "function xmlParse(str) {\n if (typeof ActiveXObject != 'undefined' && typeof GetObject != 'undefined') {\n var doc = new ActiveXObject('Microsoft.XMLDOM');\n doc.loadXML(str);\n return doc;\n }\n\n if (typeof DOMParser != 'undefined') {\n return (new DOMParser()).parseFromString(str, 'text/xml');\n }\n\n return createElement('div', null);\n}", "function StringToXML(oString) {\n //code for IE\n if (window.ActiveXObject) { \n var oXML = new ActiveXObject(\"Microsoft.XMLDOM\"); oXML.loadXML(oString);\n return oXML;\n }\n // code for Chrome, Safari, Firefox, Opera, etc. \n else {\n return (new DOMParser()).parseFromString(oString, \"text/xml\");\n }\n }", "function parseXML (XML_string) {\r\n\treturn (new DOMParser()). parseFromString (XML_string, 'text/xml');\r\n}", "function parseXML(str, opts = {}) {\n var _a;\n xml2jsParserSettings.explicitRoot = !!opts.includeRoot;\n xml2jsParserSettings.charkey = (_a = opts.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY;\n const xmlParser = new xml2js__namespace.Parser(xml2jsParserSettings);\n return new Promise((resolve, reject) => {\n if (!str) {\n reject(new Error(\"Document is empty\"));\n }\n else {\n xmlParser.parseString(str, (err, res) => {\n if (err) {\n reject(err);\n }\n else {\n resolve(res);\n }\n });\n }\n });\n}", "function parseXML(str, opts = {}) {\n var _a;\n xml2jsParserSettings.explicitRoot = !!opts.includeRoot;\n xml2jsParserSettings.charkey = (_a = opts.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY;\n const xmlParser = new xml2js__namespace.Parser(xml2jsParserSettings);\n return new Promise((resolve, reject) => {\n if (!str) {\n reject(new Error(\"Document is empty\"));\n }\n else {\n xmlParser.parseString(str, (err, res) => {\n if (err) {\n reject(err);\n }\n else {\n resolve(res);\n }\n });\n }\n });\n}", "function ParseXMLString(str)\n{\n if (window.ActiveXObject)\n {\n xmlDoc = new ActiveXObject(\"Microsoft.XMLDOM\"); \n xmlDoc.async = false;\n xmlDoc.loadXML(str);\n }\n else if (document.implementation && document.implementation.createDocument) \n {\n var parser = new DOMParser(); \n xmlDoc = parser.parseFromString(str, \"text/xml\"); \n }\n else \n return null;\n \n return xmlDoc; \n}", "function parseXML(xmlStr) {\n if (!xmlStr) {\n return $();\n }\n // HACK convince jQuery Sizzle that this is XML, not HTML\n xmlStr = xmlStr\n .replace(/<(h:)?html\\b/, \"<h:xdoc\")\n .replace(/<\\/(h:)?html\\b>/, \"</h:xdoc>\");\n return $($.parseXML(xmlStr));\n }", "function cjXMLLoadString(txt) {\n if (typeof DOMParser != \"undefined\") {\n // Mozilla, Firefox, and related browsers \n return (new DOMParser()).parseFromString(text, \"application/xml\");\n } else if (typeof ActiveXObject != \"undefined\") {\n // Internet Explorer. \n var doc = XML.newDocument(); // Create an empty document \n doc.loadXML(text); // Parse text into it \n return doc; // Return it \n } else {\n // As a last resort, try loading the document from a data: URL \n // This is supposed to work in Safari. Thanks to Manos Batsis and \n // his Sarissa library (sarissa.sourceforge.net) for this technique. \n var url = \"data:text/xml;charset=utf-8,\" + encodeURIComponent(text);\n var request = new XMLHttpRequest();\n request.open(\"GET\", url, false);\n request.send(null);\n return request.responseXML;\n }\n}", "function string2XML(xmlstr) {\n\n if (document.all) {\n\n var xmlDoc = new ActiveXObject(\"Microsoft.XMLDOM\");\n xmlDoc.async=\"false\";\n xmlDoc.loadXML(xmlstr);\n\n } else {\n\n var parser = new DOMParser();\n var xmlDoc = parser.parseFromString(xmlstr,\"text/xml\")\n\n }\n\n //don't return the datanode\n return xmlDoc;\n\n}", "function parseXmlStr(xmlStr) {\n var parseXml;\n if (typeof window.DOMParser != \"undefined\") {\n parseXml = function (xmlStr) {\n return (new window.DOMParser()).parseFromString(xmlStr, \"text/xml\");\n };\n } else if (typeof window.ActiveXObject != \"undefined\" && new window.ActiveXObject(\"Microsoft.XMLDOM\")) {\n parseXml = function (xmlStr) {\n var xmlDoc = new window.ActiveXObject(\"Microsoft.XMLDOM\");\n xmlDoc.async = \"false\";\n xmlDoc.loadXML(xmlStr);\n return xmlDoc;\n };\n } else {\n return false;\n }\n\n try {\n return parseXml(xmlStr);\n } catch (e) {\n return xmlStr;\n }\n\n }", "function parseXMLDoc(xmlString) {\n var xmlDoc;\n try //Internet Explorer\n {\n xmlDoc = new ActiveXObject(\"Microsoft.XMLDOM\");\n xmlDoc.async = \"false\";\n xmlDoc.loadXML(xmlString);\n }\n catch (e) {\n try //Firefox, Mozilla, Opera, etc.\n {\n parser = new DOMParser();\n xmlDoc = parser.parseFromString(xmlString, \"text/xml\");\n }\n catch (e) {}\n }\n return xmlDoc;\n }", "function getXmlDocument(xmlString) {\n\t\ttry {\n\t\t\treturn libxmljs.parseXmlString(xmlString, {noblanks: false});\n\t\t} catch(ex) {\n\t\t\tconsole.log('Invalid Xml !', ex);\n\t\t\tthrow 'Invalid Xml ' + ex;\n\t\t}\n\t}", "function xmlCleaner(xmlString) {\n var fixedHtml = xmlString.replace('EN\">','EN\" \"\">').replace(\"</HEAD>\",\"</head>\").replace(/<br>/g,\"<br />\").replace(\"</HTML>\",\"</html>\");\n Logger.log(\"xmlCleaner: \" + fixedHtml);\n return fixedHtml;\n}", "function decode_decodeXML(str) {\n return xmlDecoder(str, decode_DecodingMode.Strict);\n}", "function escapeXMLContent(aString) {\n\tvar tmp = String(aString);\n\ttmp = tmp.replace(/&/gi,\"&amp;\"); // &\n\ttmp = tmp.replace(/</gi,\"&lt;\"); // <\n\ttmp = tmp.replace(/>/gi,\"&gt;\"); // >\n\ttmp = tmp.replace(/\"/gi,\"&#34;\"); //\"\n\ttmp = tmp.replace(/'/gi,\"&#39;\"); // '\n\treturn tmp;\t\n}", "function parseXml(xmlString) {\r\n var domParser = new DOMParser();\r\n try {\r\n var xmlDocument = domParser.parseFromString(xmlString, \"application/xml\");\r\n //console.log(\"pidXmlString parsed to pidXml File\");\r\n return xmlDocument;\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n }", "function encodeXML(str) {\n var ret = \"\";\n var lastIdx = 0;\n var match;\n while ((match = exports.xmlReplacer.exec(str)) !== null) {\n var i = match.index;\n var char = str.charCodeAt(i);\n var next = xmlCodeMap.get(char);\n if (next !== undefined) {\n ret += str.substring(lastIdx, i) + next;\n lastIdx = i + 1;\n }\n else {\n ret += \"\".concat(str.substring(lastIdx, i), \"&#x\").concat((0, exports.getCodePoint)(str, i).toString(16), \";\");\n // Increase by 1 if we have a surrogate pair\n lastIdx = exports.xmlReplacer.lastIndex += Number((char & 0xfc00) === 0xd800);\n }\n }\n return ret + str.substr(lastIdx);\n}", "function Xparse(src) {\r\n var frag = new _frag();\r\n // remove bad \\r characters and the prolog\r\n frag.str = _prolog(src);\r\n // create a root element to contain the document\r\n var root = new _element();\r\n root.name=\"ROOT\";\r\n // main recursive function to process the xml\r\n frag = _compile(frag);\r\n // all done, lets return the root element + index + document\r\n root.contents = frag.ary;\r\n root.index = _Xparse_index;\r\n _Xparse_index = new Array();\r\n return root;\r\n}", "function decodeXML(xmlText) {\n if (new RegExp(/&amp;|&lt;|&gt;|&quot;|&apos;|&#39;/).test(xmlText)) {\n return xmlText.replace(/&amp;/g, \"&\").replace(/&lt;/g, \"<\").replace(/&gt;/g, \">\").replace(/&quot;/g, \"\\\"\").replace(/&#39;|&apos;/g, \"'\");\n } else {\n return xmlText;\n }\n}", "function parseXML(text) {\n var xmlDoc;\n\n if (typeof DOMParser != \"undefined\") {\n var parser = new DOMParser();\n xmlDoc = parser.parseFromString(text, \"text/xml\");\n } else {\n xmlDoc = new ActiveXObject(\"Microsoft.XMLDOM\");\n xmlDoc.async = \"false\";\n xmlDoc.loadXML(text);\n }\n\n return xmlDoc;\n}", "function parseXML(text) {\n var xmlDoc;\n\n if (typeof DOMParser != \"undefined\") {\n var parser = new DOMParser();\n xmlDoc = parser.parseFromString(text, \"text/xml\");\n } else {\n xmlDoc = new ActiveXObject(\"Microsoft.XMLDOM\");\n xmlDoc.async = \"false\";\n xmlDoc.loadXML(text);\n }\n\n return xmlDoc;\n}", "function extractTag(str, startIdx) {\n\t\tvar endIdx = str.indexOf('>', startIdx);\n\t\treturn str.slice(startIdx, endIdx + 1);\n\t}", "function match(re) {\n var m = xml.match(re);\n if (!m) return;\n xml = xml.slice(m[0].length);\n return m;\n }", "function match(re) {\n var m = xml.match(re);\n if (!m) return;\n xml = xml.slice(m[0].length);\n return m;\n }", "function match(re) {\n var m = xml.match(re);\n if (!m) return;\n xml = xml.slice(m[0].length);\n return m;\n }", "function decodeXmlEntities( str ) {\n return str.replace( /&gt;/g, '>' )\n .replace( /&lt;/g, '<' )\n .replace( /&amp;/g, '&' );\n }", "function vkXML (text, step) {\n const ar = text.replace(/>\\s{0,}</g, \"><\")\n .replace(/</g, \"~::~<\")\n .replace(/\\s*xmlns\\:/g, \"~::~xmlns:\")\n // .replace(/\\s*xmlns\\=/g,\"~::~xmlns=\")\n .split(\"~::~\");\n const len = ar.length;\n let inComment = false;\n let deep = 0;\n let str = \"\";\n const space = (step != null && typeof step === \"string\" ? step : \"\\t\");\n const shift = [\"\\n\"];\n for (let si = 0; si < 100; si += 1) {\n shift.push(shift[si] + space);\n }\n for (let ix = 0; ix < len; ix += 1) {\n // start comment or <![CDATA[...]]> or <!DOCTYPE //\n if (ar[ix].search(/<!/) > -1) {\n str += shift[deep] + ar[ix];\n inComment = true;\n // end comment or <![CDATA[...]]> //\n if (ar[ix].search(/-->/) > -1 || ar[ix].search(/\\]>/) > -1\n || ar[ix].search(/!DOCTYPE/) > -1) {\n inComment = false;\n }\n } else if (ar[ix].search(/-->/) > -1 || ar[ix].search(/\\]>/) > -1) {\n // end comment or <![CDATA[...]]> //\n str += ar[ix];\n inComment = false;\n } else if (/^<\\w/.exec(ar[ix - 1]) && /^<\\/\\w/.exec(ar[ix])\n && /^<[\\w:\\-\\.\\,]+/.exec(ar[ix - 1])\n == /^<\\/[\\w:\\-\\.\\,]+/.exec(ar[ix])[0].replace(\"/\", \"\")) {\n // <elm></elm> //\n str += ar[ix];\n if (!inComment) { deep -= 1; }\n } else if (ar[ix].search(/<\\w/) > -1 && ar[ix].search(/<\\//) === -1\n // <elm> //\n && ar[ix].search(/\\/>/) === -1) {\n str = !inComment ? str += shift[deep++] + ar[ix] : str += ar[ix];\n } else if (ar[ix].search(/<\\w/) > -1 && ar[ix].search(/<\\//) > -1) {\n // <elm>...</elm> //\n str = !inComment ? str += shift[deep] + ar[ix] : str += ar[ix];\n } else if (ar[ix].search(/<\\//) > -1) {\n // </elm> //\n str = !inComment ? str += shift[--deep] + ar[ix] : str += ar[ix];\n } else if (ar[ix].search(/\\/>/) > -1) {\n // <elm/> //\n str = !inComment ? str += shift[deep] + ar[ix] : str += ar[ix];\n } else if (ar[ix].search(/<\\?/) > -1) {\n // <? xml ... ?> //\n str += shift[deep] + ar[ix];\n } else if (ar[ix].search(/xmlns\\:/) > -1 || ar[ix].search(/xmlns\\=/) > -1) {\n // xmlns //\n str += shift[deep] + ar[ix];\n } else {\n str += ar[ix];\n }\n }\n return (str[0] === \"\\n\") ? str.slice(1) : str;\n}", "function Load(xmlString)\n\t{\n\t\tvar xml;\n\t\tif (typeof DOMParser != \"undefined\")\n\t\t{\n\t\t\txml = (new DOMParser()).parseFromString(xmlString, \"application/xml\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar ieDOM = [\"MSXML2.DOMDocument\", \"MSXML.DOMDocument\", \"Microsoft.XMLDOM\"];\n\t\t\tfor (var i=0; i<ieDOM.length && !xml; i++)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\txml = new ActiveXObject(ieDOM[i]);\n\t\t\t\t\txml.loadXML(xmlString);\n\t\t\t\t}\n\t\t\t\tcatch(e)\n\t\t\t\t{}\n\t\t\t}\n\t\t}\n\t\treturn xml;\n\t}", "function loadXMLString(strXml)\n{\n if (empty(strXml))\n strXml = '';\n var xml;\n if (window.DOMParser) {\n var DOMParser = new DOMParser();\n return DOMParser.parseFromString(strXml, 'text/xml');\n }\n if (window.ActiveXObject) {\n xml = new ActiveXObject('Microsoft.XMLDOM');\n xml.async = 'false';\n xml.loadXML(strXml);\n return xml;\n }\n if ((document.implementation) && (document.implementation.createDocument)) {\n xml = document.implementation.createDocument('', '', null);\n xml.async = false;\n xml.load(strXml);\n return xml;\n }\n alert('Seu navegador nao esta apto a ler um arquivo XML');\n return;\n}", "function xmlStringToObject(xmlString) {\n\tconst domparser = new window.DOMParser()\n\tconst doc = domparser.parseFromString(xmlString, 'text/xml')\n\n\treturn xmlToObject(doc)\n}", "function escapeXml(text)\n{\n var rval = '';\n \n var LT = new RegExp(\"<\", \"g\"); \n var GT = new RegExp(\">\", \"g\"); \n var AMP = new RegExp(\"&\", \"g\"); \n var TAB = new RegExp(\"\\t\", \"g\");\n \n rval = text.replace(AMP,\"&amp;\").replace(LT, \"&lt;\").replace(GT, \"&gt;\").replace(TAB, \" \");\n\n return rval;\n}", "function extract(str) {\n let idMatch = str.match(ID_RE)\n let classMatch = str.match(CLASS_RE)\n let kvMatch = str.match(KV_RE)\n let data = {\n attrs: {},\n classNames: []\n }\n\n if (idMatch) {\n data.elementName = idMatch[1]\n data.id = idMatch[2]\n }\n\n if (classMatch) {\n data.classNames = classMatch.map((cls) => cls.replace('.', ''))\n }\n\n if (kvMatch) { \n kvMatch.map(function (item) {\n let split = item.split('=')\n let key = split[0].trim()\n let val = split[1].trim().replace(/[\"']/g, '')\n data.attrs[key] = val\n })\n }\n return data\n}", "function _checkStringElem(xml, tmplRule) {\n var root = [],\n current = {\n elem: root,\n elemName: 'root',\n parent: null\n },\n parent = null,\n pattern = tmplRule.checkElem,\n matchArr = void 0,\n inTextContent = void 0,\n omittedCloseElem = null;\n\n while (matchArr = pattern.exec(xml)) {\n var textBefore = matchArr[1],\n elem = matchArr[2],\n elemName = matchArr[3],\n elemParams = matchArr[4],\n textAfter = matchArr[5];\n\n //处理上一次循环中的可省略闭合标签\n if (omittedCloseElem) {\n var _omittedCloseElem = omittedCloseElem,\n _omittedCloseElem2 = slicedToArray(_omittedCloseElem, 4),\n _elem = _omittedCloseElem2[0],\n _elemName = _omittedCloseElem2[1],\n _elemParams = _omittedCloseElem2[2],\n _textAfter = _omittedCloseElem2[3];\n\n var isEx$$1 = elem ? isExAll(elemName, tmplRule) : false;\n\n if (isEx$$1 && !isEx$$1[1] && (isPropS(elemName, tmplRule) || isStrPropS(elemName, tmplRule) || isParamsEx(isEx$$1[3]) || exCompileConfig(isEx$$1[3]).isProp)) {\n parent = current;\n current = _createCurrent(_elemName, parent);\n _setElem(_elem, _elemName, _elemParams, current.elem, null, tmplRule);\n } else {\n _setSelfCloseElem(_elem, _elemName, _elemParams, current.elem, tmplRule);\n }\n\n _setTextAfter(_textAfter, current);\n omittedCloseElem = null;\n }\n\n //Text before tag\n if (textBefore && textBefore !== '') {\n _setText(textBefore, current.elem);\n }\n\n //Element tag\n if (elem) {\n if (elem !== '<') {\n if (elem.indexOf('<!') === 0) {\n //一些特殊标签当做文本处理\n _setText(elem, current.elem);\n } else {\n var _isEx = isExAll(elemName, tmplRule);\n if (elemName[0] === '/') {\n //Close tag\n if (elemName.substr(1).toLowerCase() === inTextContent) {\n //取消纯文本子节点标记\n inTextContent = null;\n }\n\n if (_isEx || !inTextContent) {\n var cName = current.elemName;\n if (cName.indexOf(SPLIT_FLAG) < 0 ? elemName === '/' + cName : elemName.indexOf(SPLIT_FLAG) > -1) {\n //如果开始标签包含SPLIT_FLAG,则只要结束标签包含SPLIT_FLAG就认为该标签已关闭\n current = current.parent;\n }\n } else {\n _setText(elem, current.elem);\n }\n } else if (elem[elem.length - 2] === '/') {\n //Self close tag\n if (_isEx || !inTextContent) {\n _setSelfCloseElem(elem, elemName, elemParams, current.elem, tmplRule);\n } else {\n _setText(elem, current.elem);\n }\n } else {\n //Open tag\n if (_isEx || !inTextContent) {\n if (!inTextContent && OMITTED_CLOSE_TAGS$1[elemName.toLowerCase()]) {\n //img等可不闭合标签\n omittedCloseElem = [elem, elemName, elemParams, textAfter];\n } else {\n var elemNameL = elemName.toLowerCase();\n if (TEXT_CONTENT.indexOf(elemNameL) > -1) {\n //标记该标签为纯文本子节点\n inTextContent = elemNameL;\n }\n\n parent = current;\n current = _createCurrent(elemName, parent);\n _setElem(elem, elemName, elemParams, current.elem, null, tmplRule);\n }\n } else {\n _setText(elem, current.elem);\n }\n }\n }\n } else {\n //单独的\"<\"和后面的文本拼合在一起\n if (textAfter == null) {\n textAfter = '';\n }\n textAfter = elem + textAfter;\n }\n }\n\n //Text after tag\n !omittedCloseElem && _setTextAfter(textAfter, current);\n }\n\n //处理最后一次循环中遗留的可省略闭合标签\n if (omittedCloseElem) {\n var _omittedCloseElem3 = omittedCloseElem,\n _omittedCloseElem4 = slicedToArray(_omittedCloseElem3, 4),\n _elem2 = _omittedCloseElem4[0],\n _elemName2 = _omittedCloseElem4[1],\n _elemParams2 = _omittedCloseElem4[2],\n _textAfter2 = _omittedCloseElem4[3];\n\n _setSelfCloseElem(_elem2, _elemName2, _elemParams2, current.elem, tmplRule);\n _setTextAfter(_textAfter2, current);\n }\n\n return root;\n}", "function stringToDom (string) {\n const template = document.createElement('template');\n template.innerHTML = string.trim();\n return template.content.firstChild;\n}", "function messageXMLDecoder (string) {\n\n let i = 0\n let message = '', code = '', errorCode = ''\n\n let attr = false, prop = true, countProp = 0\n\n while ( i !== string.length ){\n \n if ( string.charAt(i) === '='){\n attr = true\n prop = false\n i++ //escape the space\n }\n if ( string.charAt(i) === ';' ){\n attr = false\n prop = true\n countProp++\n }\n if ( attr && countProp === 0 ){\n message = message+string.charAt(i)\n }\n if ( attr && countProp === 1 ){\n errorCode = errorCode+string.charAt(i)\n }\n if ( attr && countProp === 2 ){\n code = code+string.charAt(i)\n }\n i++\n }\n\n code = +code\n\n return {code , message}\n}", "function escapeXml(text){return _ESCAPED_CHARS.reduce(function(text,entry){return text.replace(entry[0],entry[1]);},text);}", "function cleanXML(xmlStr) {\n\txmlStr = xmlStr.replace(/<!--[\\s\\S]*?-->/g, ''); //remove commented lines\n\txmlStr = xmlStr.replace(/\\n|\\t|\\r/g, ''); //replace special characters\n\txmlStr = xmlStr.replace(/ {1,}<|\\t{1,}</g, '<'); //replace leading spaces and tabs\n\txmlStr = xmlStr.replace(/> {1,}|>\\t{1,}/g, '>'); //replace trailing spaces and tabs\n\txmlStr = xmlStr.replace(/<\\?[^>]*\\?>/g, ''); //delete docType tags\n\txmlStr = replaceSelfClosingTags(xmlStr); //replace self closing tags\n\txmlStr = replaceAloneValues(xmlStr); //replace the alone tags values\n\txmlStr = replaceAttributes(xmlStr); //replace attributes\n\treturn xmlStr;\n}", "function escapeXML(s) {\nif ( typeof s === 'number' ) return s.toString();\nvar replace = { '&': 'amp', '<': 'lt', '>': 'gt', '\"': 'quot', '\\'': 'apos' };\nfor ( var entity in replace ) {\ns = s.replace(new RegExp(entity, 'g'), '&' + replace[entity] + ';');\n}\nreturn s;\n}", "function escape_encodeXML(str) {\n let ret = \"\";\n let lastIdx = 0;\n let match;\n while ((match = escape_xmlReplacer.exec(str)) !== null) {\n const i = match.index;\n const char = str.charCodeAt(i);\n const next = xmlCodeMap.get(char);\n if (next !== undefined) {\n ret += str.substring(lastIdx, i) + next;\n lastIdx = i + 1;\n }\n else {\n ret += `${str.substring(lastIdx, i)}&#x${escape_getCodePoint(str, i).toString(16)};`;\n // Increase by 1 if we have a surrogate pair\n lastIdx = escape_xmlReplacer.lastIndex += Number((char & 0xfc00) === 0xd800);\n }\n }\n return ret + str.substr(lastIdx);\n}", "function escapeXml(text) {\n return _ESCAPED_CHARS.reduce((text, entry) => text.replace(entry[0], entry[1]), text);\n}", "function escapeXml(text) {\n return _ESCAPED_CHARS.reduce((text, entry) => text.replace(entry[0], entry[1]), text);\n}", "function escapeXml(text) {\n return _ESCAPED_CHARS.reduce((text, entry) => text.replace(entry[0], entry[1]), text);\n}", "function escapeXml(text) {\n return _ESCAPED_CHARS.reduce((text, entry) => text.replace(entry[0], entry[1]), text);\n}", "function replaceXMLAmp(str_original){\n var objRegExp = /\\&amp;/gi;\n var str_new = str_original.replace(objRegExp, '&');\n return str_new;\n}", "function escapeXml(text) {\n return _ESCAPED_CHARS.reduce(function (text, entry) {\n return text.replace(entry[0], entry[1]);\n }, text);\n }", "decodeString(string) {\n\t\tconst parser = new DOMParser();\n\t\tconst dom = parser.parseFromString(\n\t\t\t'<!doctype html><body>' + string,\n\t\t\t'text/html');\n\t\treturn dom.body.textContent;\n\t}", "function getXMLElement(xml, elementName) {\n debugAlert(\"in getXMLElemet\" + xml);\n var eltbegin = \"<\" + elementName;\n var eltend = \"</\" + elementName + \">\"\n var re = new RegExp(\"(<\" + elementName + \".*(?:(?:</\" + elementName + \">)|(?:/>)))\");\n var m = re.exec(xml);\n if (m == null) {\n debugAlert(\"no match\");\n return null;\n }\n else {\n debugAlert(\"match is \" + m[0]);\n return m[0];\n }\n}", "function xml2json(e) { var n = { toObj: function (e) { var t = {}; if (1 == e.nodeType) { if (e.attributes.length) for (var i = 0; i < e.attributes.length; i++) \"name\" !== e.attributes[i].nodeName && (t[e.attributes[i].nodeName] = (e.attributes[i].nodeValue || \"\").toString()); if (e.firstChild) { for (var r = 0, o = 0, l = !1, a = e.firstChild; a; a = a.nextSibling) 1 == a.nodeType ? l = !0 : 3 == a.nodeType && a.nodeValue.match(/[^ \\f\\n\\r\\t\\v]/) ? r++ : 4 == a.nodeType && o++; if (l) if (2 > r && 2 > o) { n.removeWhite(e); for (var a = e.firstChild; a; a = a.nextSibling) { var s = n.removePrefix(a.nodeName); if (3 == a.nodeType) t[\"#text\"] = n.escape(a.nodeValue); else if (4 == a.nodeType) t[\"#cdata\"] = n.escape(a.nodeValue); else if (t[s]) t[s] instanceof Array ? t[s][t[s].length] = n.toObj(a) : t[s] = [t[s], n.toObj(a)]; else { var f = null; a.attributes.getNamedItem(\"name\") && (f = a.attributes.getNamedItem(\"name\").nodeValue), t[f ? f : s] = n.toObj(a) } } } else e.attributes.length ? t[\"#text\"] = n.escape(n.innerXml(e)) : t = n.escape(n.innerXml(e)); else if (r) e.attributes.length ? t[\"#text\"] = n.escape(n.innerXml(e)) : t = n.escape(n.innerXml(e)); else if (o) if (o > 1) t = n.escape(n.innerXml(e)); else for (var a = e.firstChild; a; a = a.nextSibling) t[\"#cdata\"] = n.escape(a.nodeValue) } e.attributes.length || e.firstChild || (t = null) } else 9 == e.nodeType ? t = n.toObj(e.documentElement) : 8 == e.nodeType ? console.log(e.textContent) : alert(\"unhandled node type: \" + e.nodeType); return t }, toJson: function (e, t, i) { var r = t ? '\"' + t + '\"' : \"\"; if (e instanceof Array) { for (var o = 0, l = e.length; l > o; o++) e[o] = n.toJson(e[o], \"\", i + \"\t\"); r += (t ? \":[\" : \"[\") + (e.length > 1 ? \"\\n\" + i + \"\t\" + e.join(\",\\n\" + i + \"\t\") + \"\\n\" + i : e.join(\"\")) + \"]\" } else if (null == e) r += (t && \":\") + \"null\"; else if (\"object\" == typeof e) { var a = []; for (var s in e) a[a.length] = n.toJson(e[s], s, i + \"\t\"); r += (t ? \":{\" : \"{\") + (a.length > 1 ? \"\\n\" + i + \"\t\" + a.join(\",\\n\" + i + \"\t\") + \"\\n\" + i : a.join(\"\")) + \"}\" } else r += \"string\" == typeof e ? (t && \":\") + '\"' + e.toString() + '\"' : (t && \":\") + e.toString(); return r }, innerXml: function (e) { var n = \"\"; if (\"innerHTML\" in e) n = e.innerHTML; else for (var t = function (e) { var n = \"\"; if (1 == e.nodeType) { n += \"<\" + e.nodeName; for (var i = 0; i < e.attributes.length; i++) n += \" \" + e.attributes[i].nodeName + '=\"' + (e.attributes[i].nodeValue || \"\").toString() + '\"'; if (e.firstChild) { n += \">\"; for (var r = e.firstChild; r; r = r.nextSibling) n += t(r); n += \"</\" + e.nodeName + \">\" } else n += \"/>\" } else 3 == e.nodeType ? n += e.nodeValue : 4 == e.nodeType && (n += \"<![CDATA[\" + e.nodeValue + \"]]>\"); return n }, i = e.firstChild; i; i = i.nextSibling) n += t(i); return n }, escape: function (e) { return e.replace(/[\\\\]/g, \"\\\\\\\\\").replace(/[\\\"]/g, '\\\\\"').replace(/[\\n]/g, \"\\\\n\").replace(/[\\r]/g, \"\\\\r\") }, removeWhite: function (e) { e.normalize(); for (var t = e.firstChild; t;) if (3 == t.nodeType) if (t.nodeValue.match(/[^ \\f\\n\\r\\t\\v]/)) t = t.nextSibling; else { var i = t.nextSibling; e.removeChild(t), t = i } else 1 == t.nodeType ? (n.removeWhite(t), t = t.nextSibling) : t = t.nextSibling; return e }, removePrefix: function (e) { return e.substring(e.indexOf(\":\") + 1) } }; return 9 == e.nodeType && (e = e.documentElement), n.toObj(n.removeWhite(e)) }", "function parseXML(xmlText){\n var xmlDoc;\n try{\n xmlDoc=new ActiveXObject(\"Microsoft.XMLDOM\");\n xmlDoc.async=\"false\";\n xmlDoc.loadXML(xmlText);\n }\n\n catch(e){\n try{\n parser=new DOMParser();\n xmlDoc=parser.parseFromString(xmlText,\"text/xml\");\n }\n catch(e){\n alert(e.message);\n return;\n }\n }\n return xmlDoc;\n}", "function getDocPr(xmlStr) {\n let xml = parser.parseFromString(xmlStr, \"application/xml\");\n \n let tags = xml.getElementsByTagName(\"wp:docPr\");\n if (tags.length > 1) {\n console.warn(\"Selected object with more than one cNvPr tag \" + tags.length);\n }\n\n if (tags.length == 0) {\n console.log(\"Element may not have an alt text\");\n return [null, xml];\n }\n \n return [tags[0], xml];\n}", "function escapeXML(s) {\n\t\tif (typeof s === 'number')\n\t\t\treturn s.toString();\n\n\t\tvar replace = {\n\t\t\t'&' : 'amp',\n\t\t\t'<' : 'lt',\n\t\t\t'>' : 'gt',\n\t\t\t'\"' : 'quot',\n\t\t\t'\\'' : 'apos'\n\t\t};\n\n\t\tfor ( var entity in replace) {\n\t\t\ts = s.replace(new RegExp(entity, 'g'), '&' + replace[entity] + ';');\n\t\t}\n\n\t\treturn s;\n\t}", "function getArticle(str) {\n var prefix = \"<article\";\n var suffix = \"</article>\";\n var idx = str.indexOf(prefix);\n if (idx > 0) {\n str = str.substring(idx);\n }\n idx = str.indexOf(suffix);\n if (idx > 0) {\n str = str.substring(0, idx + suffix.length);\n }\n return $(str);\n }", "function readXml(xml){\r\n\tlet i=0;\r\n\tlet lines = [];\r\n\tlet newline = \"\";\r\n\r\n\twhile(i<xml.length){\r\n\t\tnewline=\"\";\r\n\t\tdo{\r\n\t\tnewline+=xml[i];\r\n\t\ti++;\r\n\t\t}while(xml.substring(i+1,i+3)[i] != \"\\n\");\r\n\r\n\t\tif(!(newline in [\"<?xml version=1.0 encoding=ISO-8859-1 ?>\",\"<productData>\",\"</productData>\"])){\r\n\t\t\tlines.push(newline);\r\n\t\t}\r\n\t\ti++;\r\n\t}\r\n\treturn lines;\r\n}", "function escapeXml(text) {\n return _ESCAPED_CHARS.reduce(function (text, entry) { return text.replace(entry[0], entry[1]); }, text);\n}", "function escapeXml(text) {\n return _ESCAPED_CHARS.reduce(function (text, entry) { return text.replace(entry[0], entry[1]); }, text);\n}", "function escapeXml(text) {\n return _ESCAPED_CHARS.reduce(function (text, entry) { return text.replace(entry[0], entry[1]); }, text);\n}", "function getXSL(xmlUrl) {\n\tvar xhr = $.ajax({\n\t\turl: xmlUrl,\n\t\tdatatype: \"xml\",\n\t\tcontentType: \"application/xml\",\n\t\tasync: false,\n\t\tsuccess: function(response) {\n }\n\t});\n\n\tvar parser = new DOMParser();\n\tvar doc = parser.parseFromString(xhr.responseText, \"application/xml\");\n\treturn doc;\n}", "function xml2jsonRecurse(xmlStr) {\n\tvar obj = {},\n\t\ttagName,\n\t\tindexClosingTag,\n\t\tinner_substring,\n\t\ttempVal,\n\t\topeningTag;\n\n\twhile (xmlStr.match(/<[^\\/][^>]*>/)) {\n\t\topeningTag = xmlStr.match(/<[^\\/][^>]*>/)[0];\n\t\ttagName = openingTag.substring(1, openingTag.length - 1);\n\t\tindexClosingTag = xmlStr.indexOf(openingTag.replace('<', '</'));\n\n\t\t// indexClosingTag is the first occurance of the closing tag, if there are same tags in other hierarchy, then this is the wrong catch\n\t\t// search for next openingTag is needed\n\t\t// if the next openingTag has smaller index than the next closingIndex then this portion must be part of the string\n\t\tlet tmpString = xmlStr.substring(openingTag.length, xmlStr.length);\n\t\tlet nextOpeningIndex = tmpString.indexOf(openingTag);\n\t\tlet nextClosingIndex = tmpString.indexOf(openingTag.replace('<', '</'));\n\t\tlet cutLength = openingTag.length + nextClosingIndex;\n\n\t\t// indexClosingTag to be replaced when not beeing itself and there is deeper level with same tagName && tempClosingIndex < nextOpeningIndex\n\t\t// repeat the search until only closing tag exists\n\t\tlet j = 1;\n\t\twhile (indexClosingTag != -1 && nextOpeningIndex != -1 && nextOpeningIndex < nextClosingIndex) {\n\t\t\t//console.log(' while ', j);\n\t\t\ttmpString = xmlStr.substring(cutLength + (openingTag.length + 1) * j, xmlStr.length);\n\t\t\tnextOpeningIndex = tmpString.indexOf(openingTag);\n\t\t\tnextClosingIndex = tmpString.indexOf(openingTag.replace('<', '</'));\n\t\t\tcutLength = cutLength + nextClosingIndex;\n\t\t\t//console.log(openingTag, ' nextClose ', nextClosingIndex);\n\t\t\t//shifting the index of closing tag to the position where no other opening detected tag with same name is found\n\t\t\tindexClosingTag = cutLength + (openingTag.length + 1) * j;\n\t\t\tj++;\n\t\t}\n\n\t\t// account for case where additional information in the openning tag\n\t\tif (indexClosingTag == -1) {\n\t\t\ttagName = openingTag.match(/[^<][\\w+$]*/)[0];\n\t\t\tindexClosingTag = xmlStr.indexOf('</' + tagName);\n\t\t\tif (indexClosingTag == -1) {\n\t\t\t\tindexClosingTag = xmlStr.indexOf('<\\\\/' + tagName);\n\t\t\t}\n\t\t}\n\t\tinner_substring = xmlStr.substring(openingTag.length, indexClosingTag);\n\t\tif (inner_substring.match(/<[^\\/][^>]*>/)) {\n\t\t\t//no need for cleanXML again\n\t\t\t//tempVal = xml2json(inner_substring);\n\t\t\ttempVal = xml2jsonRecurse(inner_substring);\n\t\t} else {\n\t\t\ttempVal = inner_substring;\n\t\t}\n\t\t// account for array or obj //\n\t\tif (obj[tagName] === undefined) {\n\t\t\tobj[tagName] = tempVal;\n\t\t} else if (Array.isArray(obj[tagName])) {\n\t\t\tobj[tagName].push(tempVal);\n\t\t} else {\n\t\t\tobj[tagName] = [ obj[tagName], tempVal ];\n\t\t}\n\n\t\txmlStr = xmlStr.substring(openingTag.length * 2 + 1 + inner_substring.length);\n\t}\n\n\treturn obj;\n}", "function escapeXml(text) {\n return _ESCAPED_CHARS.reduce(function (text, entry) {\n return text.replace(entry[0], entry[1]);\n }, text);\n}", "function $xmlParser(txt) {\r\n\t\txmlObj = false;\r\n\t\tif (ActiveXObject(\"Microsoft.XMLDOM\")) {\r\n\t\t\txmlObj = new ActiveXObject(\"Microsoft.XMLDOM\");\r\n\t\t\txmlObj.async = false;\r\n\t\t\txmlObj.loadXML(txt);\r\n\t\t}\r\n\t\tif (DOMParser) {\r\n\t\t\txmlParser = new DOMParser();\r\n\t\t\txmlObj = xmlParser.parserFromString(txt,\"text/xml\");\r\n\t\t}\r\n\t\treturn xmlObj;\r\n\t}", "function textToXML (fileData) {\n try {\n var xml = null;\n\n if ( window.DOMParser ) {\n\n var parser = new DOMParser();\n xml = parser.parseFromString(fileData, \"text/xml\" );\n\n var found = xml.getElementsByTagName( \"parsererror\" );\n\n if ( !found || !found.length || !found[ 0 ].childNodes.length ) {\n \t return xml;\n }\n\n return null;\n } else {\n\n xml = new ActiveXObject( \"Microsoft.XMLDOM\" );\n\n xml.async = false;\n xml.loadXML(fileData);\n\n return xml;\n }\n } catch ( e ) {\n // suppress\n }\n }", "function parseDom(str, mime) {\n return (new DOMParser()).parseFromString(str, mime)\n}", "function createElementFromString(str) {\nvar node, a = str.match(/<(\\w+)(\\s+)?([^>]+)?>/);\nif (a != null) {\nnode = document.createElement(a[1]);\nif (a[3] != null) {\nvar attrs = a[3].split(\" \");\nif (attrs.length > 0) {\nfor ( var i = 0; i < attrs.length; i++) {\nvar att = attrs[i].split(\"=\");\nif (att[0].length > 0 &&\natt[0] != \"/\" && att[1] && att[1].length != 2) {\nvar a_n = document.createAttribute(att[0]);\na_n.value = att[1].replace(/^['\"](.+)['\"]$/, \"$1\");\nnode.setAttributeNode(a_n);\n}\n}\n}\n}\n}\nreturn node;\n}", "function parseFromString( /**String*/ source, /**Document*/ targetDocument) /**Node*/ {\n mark('oig_dr_parseFromString');\n var document,\n documentElement,\n // @FIXME make sure to use the correct regex for attribute QName\n regEx = REGEX_NS,\n prefix,\n ns,\n m;\n\n // do we have namespaces\n // if (source.indexOf(':') > -1) {\n m = regEx.exec(source);\n //}\n document = targetDocument.implementation.createDocument(XMLNS_XHTML, 'html', null);\n documentElement = document.documentElement;\n\n if (m !== null) {\n do {\n prefix = m[2];\n if (document.lookupNamespaceURI(prefix) === null) {\n ns = targetDocument.lookupNamespaceURI(prefix);\n if (ns !== null) {\n documentElement.setAttributeNS(XMLNS, 'xmlns:' + prefix, ns);\n }\n }\n } while ((m = regEx.exec(source)) !== null);\n }\n documentElement.innerHTML = source;\n measure('oig_dr_parseFromString');\n return documentElement.firstElementChild;\n }", "function getXML(url){\n\tvar xml=Asiainfo.remoteData(url,false);\n\tif (xml != null && xml.length > 0) {\n var doc = mxUtils.parseXml(xml);\n var dec = new mxCodec(doc);\n dec.decode(doc.documentElement, graph.getModel());\n }\n}", "function parseXML(url) {\n var parser = new xml2js.Parser();\n var deferred = Q.defer();\n\n request(url, function (error, response, body) {\n if (error) {\n deferred.reject(new Error(error));\n } else if (response.statusCode == 200) {\n parser.parseString(body, function (error, result) {\n if (error) {\n deferred.reject(new Error(error));\n } else {\n deferred.resolve(result);\n }\n });\n } else {\n deferred.reject(new Error(\"Invalid response code\"));\n }\n });\n return deferred.promise;\n}", "function parseXML(){\n\tdescribe(\"Parse XML\", function(){\n\t\tit(\"Game XML should parse without errors\", function(done){\n\n\t\t\tparser.parseString(xmlString, function(err, result){\n\n\t\t\t\tif (err) throw err;\n\n\t\t\t\txmlData = result.math;\n\n\t\t\t\tdone();\n\t\t\t});\n\t\t});\n\t});\n}", "function parseXML(){\n\tdescribe(\"Parse XML\", function(){\n\t\tit(\"Game XML should parse without errors\", function(done){\n\n\t\t\tparser.parseString(xmlString, function(err, result){\n\n\t\t\t\tif (err) throw err;\n\n\t\t\t\txmlData = result.math;\n\n\t\t\t\tdone();\n\t\t\t});\n\t\t});\n\t});\n}", "function parseInvalidXmlCharacters(text){\n text = text.replace(\"&\",\"and\");\n text = text.replace(\"<\",\" \");\n text = text.replace(\">\",\" \");\n text = text.replace(\"'\",\" \");\n return text;\n }", "function xhtml(xmlString, append=false) {\n var fixed = fixEmptyTags(xmlString || \"\"),\n node = document.implementation.createHTMLDocument().createElement('div');\n if (append) {\n return $(node).append(fixed);\n }\n return $(node).html(fixed);\n }", "function removeHTMLEntities(string: string){\n\t\t\t\t\tconst parser = new DOMParser();\n\t\t\t\t\tconst dom = parser.parseFromString(\n\t\t\t\t\t\t`<!doctype html><body>${string}`, 'text/html');\n\t\t\t\t\treturn dom.getElementsByTagName('body')[0].textContent;\n\t\t\t\t\t}", "function parseXML(xml) \n{\n var parserConfig = {\n tagNameProcessors: [stripNS],\n ignoreAttrs: true,\n explicitArray: false,\n emptyTag: null\n };\n\n return new Promise((resolve, reject) => {\n parseString(xml, parserConfig, function (err, json) {\n if (err)\n {\n reject(err);\n }\n else\n {\n resolve(json);\n }\n });\n });\n}", "function formatXml(xml) {\n\t\tvar formatted = '';\n\t\tvar reg = /(>)(<)(\\/*)/g;\n\t\txml = xml.replace(reg, '$1\\r\\n$2$3');\n\t\tvar pad = 0;\n\t\tjQuery.each(xml.split('\\r\\n'), function(index , node) {\n\t\t\tvar indent = 0;\n\t\t\tif (node.match(/.+<\\/\\w[^>]*>$/))\n\t\t\t{\n\t\t\t\tindent = 0;\n\t\t\t} else if (node.match(/^<\\/\\w/))\n\t\t\t{\n\t\t\t\tif (pad != 0)\n\t\t\t\t{\n\t\t\t\t\tpad -= 1;\n\t\t\t\t}\n\t\t\t} else if (node.match(/^<\\w[^>]*[^\\/]>.*$/))\n\t\t\t{\n\t\t\t\tindent = 1;\n\t\t\t} else\n\t\t\t{\n\t\t\t\tindent = 0;\n\t\t\t}\n\t\t\tvar padding = '';\n\t\t\tfor ( var i = 0; i < pad; i++)\n\t\t\t{\n\t\t\t\tpadding += ' ';\n\t\t\t}\n\t\t\tformatted += padding + node + '\\r\\n';\n\t\t\tpad += indent;\n\t\t});\n\t\treturn formatted;\n\t}", "function parseHTML(str)\n{\n pParent = document.createElement('div');\n pParent.innerHTML = str;\n return pParent.firstChild;\n}", "function REXML(XML) {\n\tthis.XML = XML;\n\n\tthis.rootElement = null;\n\n\tthis.parse = REXML_parse;\n\tif (this.XML && this.XML !== \"\") this.parse();\n}", "function createXml(rxtFile){\n\t\tvar content=rxtFile.content.toString();\n\t\t\n\t\t\n\t\tvar fixedContent=content.replace('<xml version=\"1.0\"?>',EMPTY)\t\t\n\t\t\t\t\t .replace('</xml>',EMPTY);\n\t\treturn new XML(fixedContent);\n\t}", "function parseVastSource(source){\n\t\tvar xdoc, parser;\n\t\t\n\t\tparser = new DOMParser();\n\t\txdoc = parser.parseFromString(source, 'text/xml');\n\t\t\n\t\treturn new VastDoc(xdoc);\n\t\n\t}", "function setupXMLfilter() {\n return function hideXML(str) {\n // login wall-of-text:\n str = str.replace(/<mode id=\"GAME\"\\/>.*<\\/settings>/g, '')\n const spellsMatch = str.match(\n /^([\\s\\S\\r\\n]*)<pushStream id=\"percWindow\"\\/>[^<]+<popStream\\/>([\\s\\S\\r\\n]*)$/\n )\n if (spellsMatch) str = spellsMatch[1] + spellsMatch[2]\n str = str.replace(/<inv id='stow'>[^<]*<\\/inv>/g, '')\n str = str.replace(/<pushStream id='inv'\\/>[^<]*<popStream\\/>/gm, '')\n str = str.replace(/<clearStream id='inv' ifClosed='[^']*'\\/>/g, '')\n str = str.replace(/<right>[^<]*<\\/right>/g, '')\n str = str.replace(/<left>[^<]*<\\/left>/g, '')\n str = str.replace(/<clearStream id=\"percWindow\"\\/>/g, '')\n str = str.replace(/<clearContainer id=.\\S+.\\/>/g, '')\n str = str.replace(/<prompt.*<\\/prompt>/g, '')\n str = str.replace(/<spell.*<\\/spell>/g, '')\n str = str.replace(/<component.*\\/component>/g, '')\n str = str.replace(/<resource picture=\"\\d+\"\\/>/g, '')\n // Comment this for roomnames!\n str = str.replace(/<style id=\"roomName\" \\/>/g, '')\n str = str.replace(/<style id=\"\"\\/>/g, '')\n str = str.replace(/<preset id='roomDesc'>/g, '')\n str = str.replace(/<\\/preset>/g, '')\n str = str.replace(/<\\/?d>/g, '')\n str = str.replace(/<compass>.*<\\/compass>/g, '')\n str = str.replace(/<nav\\/>/g, '')\n str = str.replace(/<castTime value='\\d+'\\/>/g, '')\n str = str.replace(/<streamWindow .+\\/>/g, '')\n str = str.replace(/<right.*<\\/right>/g, '')\n str = str.replace(/<left.*<\\/left>/g, '')\n str = str.replace(/<inv id=.\\S+.>[^<]*<\\/inv>/g, '')\n str = str.replace(/<d cmd=\"\\S*\">/g, '') // useful for later, this is a command link\n str = str.replace(/<roundTime value='\\d+'\\/>/g, '')\n str = str.replace(/<dialogData id='minivitals'>[\\s\\S]+<\\/dialogData>/g, '')\n str = str.replace(/<castTime value='\\d+'\\/>/g, '')\n str = str.replace(/<playerID id='\\d+'\\/>/g, '')\n str = str.replace(/<settingsInfo[^\\/]+instance='\\w+'\\/>/g, '')\n str = str.replace(/<pushStream id=\"logons\"\\/>[^<]*<popStream\\/>/g, '')\n str = str.replace(/^\\s*$/gm, '') // empty lines\n str = str.replace(/^\\s*&lt;/, '<') // beginning of attack\n console.log('returning str:', str)\n return str\n }\n}", "static FromXML(xml) {\n\t\tlet selfClosing = xml.match(\n\t\t\t/<Tag(Boolean|Character|Compound|Double|Float|Int|List|Long|Short|String|Tiny|UUID)(.*?)(\\/)>/gi\n\t\t);\n\n\t\txml = xml.replace(/>(\\s*)</gi, \"><\");\n\t\tif (selfClosing && selfClosing.length > 0) {\n\t\t\txml = xml.replace(\n\t\t\t\t/<Tag(Boolean|Character|Compound|Double|Float|Int|List|Long|Short|String|Tiny|UUID)(.*?)[/]*>/gi,\n\t\t\t\tfunction(m, tag) {\n\t\t\t\t\treturn m.replace(/\\/>/gi, `></Tag${tag}>`);\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\txml = xml.replace(\n\t\t\t/<Tag(Boolean|Character|Compound|Double|Float|Int|List|Long|Short|String|Tiny|UUID)(.*?)>/gi,\n\t\t\tfunction(m, tag, attrs) {\n\t\t\t\tlet type = `\"Type\": \"Tag${tag}\"`;\n\t\t\t\tattrs = attrs.replace(\n\t\t\t\t\t/(key=\"(.*?)\"|ordinality=\"(.*?)\"|content-type=\"(.*?)\")/gi,\n\t\t\t\t\tfunction(m, p1, k, o, ct) {\n\t\t\t\t\t\tlet arr = [];\n\n\t\t\t\t\t\tif (k !== void 0) {\n\t\t\t\t\t\t\tarr.push(`\"Key\": \"${k}\"`);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (o !== void 0) {\n\t\t\t\t\t\t\tarr.push(`, \"Ordinality\": \"${o}\"`);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (ct !== void 0) {\n\t\t\t\t\t\t\tarr.push(`, \"ContentType\": \"${ct}\"`);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn arr.join(\", \");\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\treturn `{${type},${attrs}, \"Value\": [`;\n\t\t\t}\n\t\t);\n\t\txml = xml.replace(\n\t\t\t/<\\/Tag(Boolean|Character|Compound|Double|Float|Int|List|Long|Short|String|Tiny|UUID)>/gi,\n\t\t\t\"]}\"\n\t\t);\n\n\t\txml = xml.replace(/}(\\s*){/gi, \"}, {\");\n\t\txml = xml.replace(/<Value>(.*?)<\\/Value>/gi, function(m, v) {\n\t\t\treturn `${v}${String.fromCharCode(127)}`;\n\t\t});\n\t\txml = xml.replace(/]/gi, \"]\").replace(//gi, \",\"); // the blank space is NOT whitespace, it's the (unrendered) DELETE CHARACTER (ASCII #127)\n\n\t\txml = xml.replace(\n\t\t\t/Tag(Boolean|Character|Compound|Double|Float|Int|List|Long|Short|String|Tiny|UUID)/gi,\n\t\t\tfunction(m, t) {\n\t\t\t\treturn Enum.TagType.GetEnum(t);\n\t\t\t}\n\t\t);\n\n\t\txml = JSON.parse(xml);\n\n\t\tlet tag = new (Enum.TagType.GetClass(+xml.Type))(xml.Key);\n\t\ttag.Deserialize(xml);\n\n\t\treturn tag;\n\t}", "function normalize(value, inner) {\n if (!value) {\n return \"\";\n } else if (_.isString(value)) {\n if (!/[<>&]/.test(value)) {\n return value; // value contains no XML tags\n }\n value = fixGTBug(fixEmptyTags(value));\n value = inner ? $(value) : xhtml(value, true);\n }\n var xml = new XMLSerializer(),\n xmlns = / xmlns:vellum=\"http:\\/\\/commcarehq.org\\/xforms\\/vellum\"([ \\/>])/g,\n wrapper = /^<([\\w:.-]+)(?:\\s+[\\w:.-]+=([\"'])[^]*?\\2)*\\s*(?:\\/>|>([^]*)<\\/\\1>)$/g,\n // emptytag does not match <tag attr=\"a > b\"></tag>\n emptytag = /(<([\\w:.-]+)(?:\\s[^>]*|))><\\/\\2>/g,\n badOutput = /(<(output)(?:\\s[^>]*|))>([\\w\\W]+)<\\/output>/g,\n extra = / xmlns=\"http:\\/\\/www.w3.org\\/1999\\/xhtml\"/g;\n var output = value[0];\n if (output === undefined) {\n output = value;\n }\n var serialized = xml.serializeToString(output);\n if (serialized.startsWith('<output')) {\n serialized = \"<div>\" + serialized + \"</div>\";\n }\n return serialized\n .replace(extra, \"\") // remove xmlns from output tag\n .replace(wrapper, \"$3\") // remove outer tag\n .replace(emptytag, \"$1 />\") // <tag></tag> to <tag />\n .replace(badOutput, \"$1 />$3\") // <output> text</output> to <output /> text\n .replace(/&nbsp;|\\xa0/g, \" \") // &nbsp; is not a valid XML entity\n // HACK xmlns could match and remove text that is not XML (unlikely)\n .replace(xmlns, \"$1\"); // remove vellum namespace\n }", "function getXML(id){\n var httpURL = \"http://video.google.com/timedtext?lang=en&v=\" + id;\n var getCC = new XMLHttpRequest();\n\n getCC.onreadystatechange = function(){\n if(this.readyState == 4 && this.status == 200){\n $(\"#handler\").text(getCC.responseText);\n }\n }\n getCC.open(\"GET\", httpURL, false);\n getCC.send();\n\n var rawXmlTxt = $(\"#handler\").text();\n\n $(\"#handler\").text(\"\");\n\n parser = new DOMParser();\n\n xmlDoc = parser.parseFromString(rawXmlTxt, \"text/xml\");\n\n return xmlDoc;\n}", "function query(fragment) {\n // This is needed to avoid inconsistent parsing with parseXML\n fragment = fixEmptyTags(fragment);\n\n var xopen = '<xml xmlns=\"http://www.w3.org/1999/xhtml\"' +\n ' xmlns:vellum=\"http://commcarehq.org/xforms/vellum\">',\n doc = xopen + fragment + \"</xml>\",\n xquery;\n try {\n xquery = $($.parseXML(doc));\n } catch (e) {\n // fall back to HTML, which deals with all kinds of malformed stuff\n xquery = $(\"<xml></xml>\").html(fragment);\n }\n xquery.toString = function () {\n var xml = new XMLSerializer(),\n emptytag = /(<([\\w:.-]+)(?:\\s[^>]*|))><\\/\\2>/g,\n badOutput = /(<(output)(?:\\s[^>]*|))>([\\w\\W]+)<\\/output>/g;\n return xml.serializeToString(xquery[0])\n .replace(/^<xml\\b[^>]*>/, \"\") // remove <xml ...>\n .replace(/<\\/xml>$/, \"\") // remove </xml>\n .replace(emptytag, \"$1 />\") // <tag></tag> to <tag />\n .replace(badOutput, \"$1 />$3\") // <output> text</output> to <output /> text\n .replace(/\"\\/>/g, '\" />') // space before />\n .replace(/&nbsp;|\\xa0/g, \" \"); // &nbsp; is not a valid XML entity\n };\n return xquery;\n }", "function addExtractToXML(extract) {\n var extractXMLContent = \"\";\n if (extract.extractType) {\n extractXMLContent += \"<extract\"\n extractXMLContent += \" type='\" + extract.extractType + \"'\"\n extractXMLContent += \">\\n\";\n extractXMLContent += addNodeToXML(extract.nodeXML);\n extractXMLContent += addQueryListToXML(extract.queries);\n extractXMLContent += addValueToXML(extract.extractValue);\n extractXMLContent += \"</extract>\\n\";\n }\n return extractXMLContent;\n}", "function extractXmlInfo(doc_object){\r\n\tvar titleinfo;\r\n\tvar descriptinfo;\r\n\tvar dateinfo;\r\n\tvar authorinfo;\r\n\tvar linkinfo;\r\n\t\r\n\t\r\n\tdoc_childs = doc_object.childNodes;\r\n\t\r\n\t// Vaatleme \"doc\" tagi kõiki alamaid ja väärtustame muutujad\r\n\tfor (i=0;i<doc_childs.length;i++){\r\n\t\tif (doc_childs[i].nodeName == \"str\"){\r\n\t\t\tif (doc_childs[i].getAttribute(\"name\")== \"title\"){\r\n\t\t\t\ttitleinfo = doc_childs[i].childNodes[0].nodeValue;\r\n\t\t\t}\r\n\t\t\telse if (doc_childs[i].getAttribute(\"name\")== \"description\"){\r\n\t\t\t\tdescriptinfo = doc_childs[i].childNodes[0].nodeValue;\r\n\t\t\t}\r\n\t\t\telse if (doc_childs[i].getAttribute(\"name\")== \"author\"){\r\n\t\t\t\tauthorinfo = doc_childs[i].childNodes[0].nodeValue;\r\n\t\t\t}\r\n\t\t\telse if (doc_childs[i].getAttribute(\"name\")== \"link\"){\r\n\t\t\t\tlinkinfo = doc_childs[i].childNodes[0].nodeValue;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\telse if (doc_childs[i].nodeName == \"date\"){\r\n\t\t\tif(doc_childs[i].getAttribute(\"name\")== \"date\"){\r\n\t\t\t\tdateinfo = doc_childs[i].childNodes[0].nodeValue;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t// Tagastame uudise : pealkirja, kirjelduse, aja, autori, lingi uudise lehele\r\n\treturn [titleinfo,descriptinfo,dateinfo,authorinfo,linkinfo];\r\n}", "function escapeXML(value){\n return value.toString().replace(/&/g, '&amp;').replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/'/g, '&apos;').replace(/\"/g, '&quot;');\n}", "function escapeXML(value){\n return value.toString().replace(/&/g, '&amp;').replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/'/g, '&apos;').replace(/\"/g, '&quot;');\n}", "function parseHTML(str) {\n const tmp = document.implementation.createHTMLDocument();\n tmp.body.innerHTML = str;\n\n return tmp.body;\n}", "function parseXML(xml) {\n\t\tif ( window.DOMParser == undefined && window.ActiveXObject ) {\n\t\t\tDOMParser = function() { };\n\t\t\tDOMParser.prototype.parseFromString = function( xmlString ) {\n\t\t\t\tvar doc = new ActiveXObject('Microsoft.XMLDOM');\n\t\t\t\tdoc.async = 'false';\n\t\t\t\tdoc.loadXML( xmlString );\n\t\t\t\treturn doc;\n\t\t\t};\n\t\t}\n\n\t\ttry {\n\t\t\tvar xmlDoc = ( new DOMParser() ).parseFromString( xml, 'text/xml' );\n\t\t\tif ( $.isXMLDoc( xmlDoc ) ) {\n\t\t\t\tvar err = $('parsererror', xmlDoc);\n\t\t\t\tif ( err.length == 1 ) {\n\t\t\t\t\tthrow('Error: ' + $(xmlDoc).text() );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow('Unable to parse XML');\n\t\t\t}\n\t\t\treturn xmlDoc;\n\t\t} catch( e ) {\n\t\t\tvar msg = ( e.name == undefined ? e : e.name + ': ' + e.message );\n\t\t\t$(document).trigger('xmlParseError', [ msg ]);\n\t\t\treturn undefined;\n\t\t}\n\t}", "function xmlEnc(value){\n return !value ? value : String(value).replace(/&/g, \"&amp;\").replace(/>/g, \"&gt;\").replace(/</g, \"&lt;\").replace(/\"/g, \"&quot;\").replace(/\\u001b\\[\\d{1,2}m/g, '');\n}", "function parseXML(xml) {\n\t\tif ( window.DOMParser == undefined && window.ActiveXObject ) {\n\t\t\tDOMParser = function() { };\n\t\t\tDOMParser.prototype.parseFromString = function( xmlString ) {\n\t\t\t\tvar doc = new ActiveXObject('Microsoft.XMLDOM');\n\t\t\t\tdoc.async = 'false';\n\t\t\t\tdoc.loadXML( xmlString );\n\t\t\t\treturn doc;\n\t\t\t};\n\t\t}\n\n\t\ttry {\n\t\t\tvar xmlDoc = ( new DOMParser() ).parseFromString( xml, 'text/xml' );\n\t\t\tif ( $.isXMLDoc( xmlDoc ) ) {\n\t\t\t\tvar err = $('parsererror', xmlDoc);\n\t\t\t\tif ( err.length == 1 ) {\n\t\t\t\t\tthrow new Error('Error: ' + $(xmlDoc).text() );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new Error('Unable to parse XML');\n\t\t\t}\n\t\t\treturn xmlDoc;\n\t\t} catch( e ) {\n\t\t\tvar msg = ( e.name == undefined ? e : e.name + ': ' + e.message );\n\t\t\t$(document).trigger('xmlParseError', [ msg ]);\n\t\t\treturn undefined;\n\t\t}\n\t}", "function parseXML(xml) {\n\t\tif ( window.DOMParser == undefined && window.ActiveXObject ) {\n\t\t\tDOMParser = function() { };\n\t\t\tDOMParser.prototype.parseFromString = function( xmlString ) {\n\t\t\t\tvar doc = new ActiveXObject('Microsoft.XMLDOM');\n\t\t\t\tdoc.async = 'false';\n\t\t\t\tdoc.loadXML( xmlString );\n\t\t\t\treturn doc;\n\t\t\t};\n\t\t}\n\n\t\ttry {\n\t\t\tvar xmlDoc = ( new DOMParser() ).parseFromString( xml, 'text/xml' );\n\t\t\tif ( $.isXMLDoc( xmlDoc ) ) {\n\t\t\t\tvar err = $('parsererror', xmlDoc);\n\t\t\t\tif ( err.length == 1 ) {\n\t\t\t\t\tthrow new Error('Error: ' + $(xmlDoc).text() );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new Error('Unable to parse XML');\n\t\t\t}\n\t\t\treturn xmlDoc;\n\t\t} catch( e ) {\n\t\t\tvar msg = ( e.name == undefined ? e : e.name + ': ' + e.message );\n\t\t\t$(document).trigger('xmlParseError', [ msg ]);\n\t\t\treturn undefined;\n\t\t}\n\t}", "function normalize(value, inner) {\n if (!value) {\n return \"\";\n } else if (_.isString(value)) {\n if (!/[<>&]/.test(value)) {\n return value; // value contains no XML tags\n }\n value = inner ? $(value) : $(\"<div />\").append(fixGTBug(value));\n }\n var xml = new XMLSerializer(),\n wrapper = /^<([\\w:.-]+)(?:\\s+[\\w:.-]+=([\"'])[^]*?\\2)*\\s*(?:\\/>|>([^]*)<\\/\\1>)$/g,\n emptytag = /<(([\\w:.-]+)(?:\\s+[\\w:.-]+=([\"'])[^]*?\\3)*\\s*)><\\/\\2>/g;\n return xml.serializeToString(value[0]) // pure magic\n .replace(wrapper, \"$3\") // remove outer tag\n .replace(emptytag, \"<$1 />\") // <tag></tag> to <tag />\n .replace(/&nbsp;|\\xa0/g, \" \"); // &nbsp; is not a valid XML entity\n }", "function getTextFromXML( oNode, deep ) {\r\n // alert(\"getTextFromXML( oNode, deep )\")\r\n var s = \"\";\r\n var nodes = oNode.childNodes;\r\n\r\n for (var i = 0; i < nodes.length; i++) {\r\n var node = nodes[i];\r\n\r\n if (node.nodeType == Node.TEXT_NODE) {\r\n s += node.data;\r\n } else if (deep == true && (node.nodeType == Node.ELEMENT_NODE || node.nodeType == Node.DOCUMENT_NODE\r\n || node.nodeType == Node.DOCUMENT_FRAGMENT_NODE)) {\r\n s += getTextFromXML(node, true);\r\n };\r\n }\r\n\r\n ;\r\n return s;\r\n}", "function gLyphsParseStreamProcssingXML(spstreamXML) {\n if(!spstreamXML) { return undefined; }\n\n var parser = new DOMParser();\n var spstreamDOM = parser.parseFromString(spstreamXML, \"text/xml\");\n if(!spstreamDOM) { return undefined; }\n if(!spstreamDOM.documentElement) { return undefined; }\n if(spstreamDOM.documentElement.tagName != \"zenbu_script\") { return undefined; }\n\n return spstreamDOM;\n}", "function gLyphsParseStreamProcssingXML(spstreamXML) {\n if(!spstreamXML) { return undefined; }\n\n var parser = new DOMParser();\n var spstreamDOM = parser.parseFromString(spstreamXML, \"text/xml\");\n if(!spstreamDOM) { return undefined; }\n if(!spstreamDOM.documentElement) { return undefined; }\n if(spstreamDOM.documentElement.tagName != \"zenbu_script\") { return undefined; }\n\n return spstreamDOM;\n}", "function strToDOM(str) {\n let div = document.createElement('div');\n div.innerHTML = str;\n return div.firstElementChild;\n}", "sigmlText() {\nvar sigml;\n//--------\n// FIXME: it would probably be better if we got this from a file.\nreturn sigml = `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<sigml>\n<hns_sign gloss=\"mug\">\n<hamnosys_nonmanual>\n<hnm_mouthpicture picture=\"mVg\"/>\n</hamnosys_nonmanual>\n<hamnosys_manual>\n<hamfist/> <hamthumbacrossmod/>\n<hamextfingerol/> <hampalml/>\n<hamshoulders/>\n<hamparbegin/> <hammoveu/> <hamarcu/>\n<hamreplace/> <hamextfingerul/> <hampalmdl/>\n<hamparend/>\n</hamnosys_manual>\n</hns_sign>\n<hns_sign gloss=\"take\">\n<hamnosys_nonmanual>\n<hnm_mouthpicture picture=\"te_Ik\"/>\n</hamnosys_nonmanual>\n<hamnosys_manual>\n<hamceeall/> <hamextfingerol/> <hampalml/>\n<hamlrbeside/> <hamshoulders/> <hamarmextended/>\n<hamreplace/> <hamextfingerl/> <hampalml/>\n<hamchest/> <hamclose/>\n</hamnosys_manual>\n</hns_sign>\n<hns_sign gloss=\"i\">\n<hamnosys_nonmanual>\n<hnm_mouthpicture picture=\"a_I\"/>\n</hamnosys_nonmanual>\n<hamnosys_manual>\n<hamfinger2/> <hamthumbacrossmod/>\n<hamextfingeril/> <hampalmr/>\n<hamchest/> <hamtouch/>\n</hamnosys_manual>\n</hns_sign>\n</sigml>`;\n}", "function _prolog(str) {\r\n var A = new Array(); \r\n A = str.split(\"\\r\\n\");\r\n str = A.join(\"\\n\");\r\n A = str.split(\"\\r\");\r\n str = A.join(\"\\n\");\r\n var start = str.indexOf(\"<\");\r\n if(str.substring(start,start + 3) == \"<?x\" || str.substring(start,start + 3) == \"<?X\" ) {\r\n var close = str.indexOf(\"?>\");\r\n str = str.substring(close + 2,str.length);\r\n }\r\n var start = str.indexOf(\"<!DOCTYPE\");\r\n if(start != -1) {\r\n var close = str.indexOf(\">\",start) + 1;\r\n var dp = str.indexOf(\"[\",start);\r\n if(dp < close && dp != -1) {\r\n close = str.indexOf(\"]>\",start) + 2;\r\n }\r\n str = str.substring(close,str.length);\r\n }\r\n return str;\r\n}", "function formatXml(xml, escape) {\n\t xml = vkbeautify.xml(xml);\n\t if (escape) {\n\t xml = xml.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;');\n\t }\n\t return xml;\n\t }" ]
[ "0.65475", "0.64442295", "0.6390108", "0.63166445", "0.6019271", "0.6019271", "0.5932779", "0.588254", "0.5860697", "0.5846781", "0.58400106", "0.58024496", "0.57854074", "0.57619023", "0.5733347", "0.57297844", "0.57187873", "0.55843866", "0.5569096", "0.5542005", "0.54871583", "0.54871583", "0.5483889", "0.54684794", "0.54684794", "0.54684794", "0.5464035", "0.5461876", "0.54516953", "0.5438668", "0.5386574", "0.5374249", "0.53496903", "0.5338046", "0.5325355", "0.53010494", "0.5255236", "0.52164567", "0.51873326", "0.5175492", "0.51444626", "0.51444626", "0.51444626", "0.51444626", "0.51092947", "0.51034546", "0.5093514", "0.5080229", "0.50697756", "0.5065865", "0.50624037", "0.5046636", "0.50212264", "0.5019772", "0.501466", "0.501466", "0.501466", "0.50135213", "0.5004187", "0.50027114", "0.49851716", "0.4980783", "0.496522", "0.49624753", "0.4961067", "0.49587014", "0.49585384", "0.49508888", "0.49508888", "0.49231553", "0.49038887", "0.48906377", "0.48712912", "0.48579735", "0.48490658", "0.4847597", "0.4821258", "0.48191118", "0.4803159", "0.47995484", "0.47945213", "0.47736576", "0.47736442", "0.47492737", "0.47453395", "0.47425398", "0.47425398", "0.4737153", "0.47330213", "0.47260174", "0.47182363", "0.47182363", "0.47182137", "0.47073442", "0.4699182", "0.4699182", "0.46931136", "0.46810246", "0.4670485", "0.46683213" ]
0.6470154
1
const url = "http:localhost:3000/"; empty email & password
async function testLogin() { try { driver.get(url + "login"); driver.findElement(By.id("normal_login_email")).sendKeys(""); driver.findElement(By.id("normal_login_password")).sendKeys(""); driver.findElement(By.className("login-form-button")).click(); setTimeout(async () => { const a = await driver .findElement(By.className("ant-form-item-explain-error")) .getText(); if (typeof a === "string") { testLogin1(); } console.log(a); }, 5000); } catch (err) { console.error("Something went wrong!\n", err.stack, "\n"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(user, url){//url for password reset\n this.to = user.email;\n this.firstName = user.name.split(' ')[0]; \n this.url = url;\n this.from = `Joseph Wimalasuriya 👻 <${process.env.EMAIL_FROM}>`;\n }", "emailUrl (baseUrl,username){\n browser.get(baseUrl + username + \"/_settings/emails\");\n }", "static changeBrokerURL() {\n const input = document.getElementById('broker_address');\n const address = input.value;\n\n Controller.Api.post('/change_address', { address: address })\n .then(response => {\n console.log(response.data);\n })\n .catch(error => {\n console.log(error);\n });\n\n console.log('url: ', address);\n input.value = '';\n }", "function loginUser () {\n const username = document.getElementById(\"email\").value\n const password = document.getElementById(\"password\").value\n const userUrl = urlBase + 'user/' + username\n console.log(userUrl)\n const user = {\n 'username': username,\n 'password': password,\n }\n loginUrl = urlBase + 'user/login'\n generalPost(loginUrl, user)\n \n \n}", "function fail(req, res){\n\tres.send('https://zl15finalfrontend.herokuapp.com/#/Login')\n}", "get url() {return '/';}", "function insert(email, username, password) {\n let url = \"/insertSignUp/email/\" + email + \"/username/\" + username + \"/password/\" + password;\n if(typeof window == \"undefined\") {\n return url; \n } else {\n console.log(url); \n window.location.replace(url);\n }\n}", "function setCreds(evt) {\n const addressField = document.getElementById(\"address\");\n address = addressField.value;\n\n const userField = document.getElementById(\"username\");\n username = userField.value;\n\n requestUrl = 'http://' + address + '/api/' + username + '/';\n responseDiv.innerHTML = 'address: ' + address\n + '<br>username: ' + username;\n}", "function patchUrl(url) {\n const regex = /^([\\w\\\\+]+:\\/\\/)(?:([^:/]*)(?:(:)(.*))?(@))?(.*)$/;\n return url.replace(regex, (match, scheme, username, sep, password, at, extra) => {\n const parts = [scheme];\n if (username) {\n parts.push(encodeURIComponent(username));\n }\n if (sep) {\n parts.push(sep);\n }\n if (password) {\n parts.push(encodeURIComponent(password));\n }\n if (at) {\n parts.push(at);\n }\n if (extra) {\n parts.push(extra);\n }\n return parts.join('');\n });\n}", "changeUserEmail() {\n const bodyData = { changeemail: document.getElementsByClassName('uprofEmail')[0].value, email: localStorage.getItem('userEmail') };\n const fetchData = {\n method: 'PUT',\n body: JSON.stringify(bodyData),\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json'\n }\n };\n return this.fetch(`${process.env.BackendUrl}/auth/changeemail`, fetchData)\n .then(response => response.json())\n .then((data) => {\n if (data.message) {\n // console.log(data.message);\n const messagediv = document.getElementsByClassName('formerrors')[0];\n messagediv.innerHTML = `<p style=\"text-align:left; padding-left:12px\">${data.message}</p>`;\n } else {\n let feurl = 'http://localhost:7000';\n /* istanbul ignore if */\n if (process.env.FrontendUrl !== undefined) {\n feurl = process.env.FrontendUrl;\n }\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'test') {\n window.location.href = `${feurl}/userutil/?changeemail=${document.getElementsByClassName('uprofEmail')[0].value}`;\n }\n }\n })\n .catch((error) => {\n console.log(error);\n });\n }", "function resetpwRoute() {\n return \"/resetpw?username=\" + encodeURIComponent(user.username) + \"&schoolCode=\" + req.body.schoolCode + \"&school=\" + (user.school ? encodeURIComponent(user.school.name) : \"none\");\n }", "function signup() {\n\n if (usernameAvailabe && numberAvailabe && emailAvailable) {\n fetch('https://desolate-thicket-70111.herokuapp.com/v1/webapi/signup/', {\n method: 'POST', // or 'PUT'\n headers: {\n 'Content-Type': 'application/json',\n 'Access-Control-Allow-Origin' : '*'\n },\n body: JSON.stringify({\n username: username,\n email: email,\n telefoonnummer: telefoonnummer\n }),\n })\n .then(response => response.json())\n .then(data => {\n console.log(data);\n router.push('/aangemeld')\n })\n .catch((error) => {\n console.error('Error:', error);\n });\n } else {\n console.log(\"Dit werkt niet\")\n }\n }", "function handleSubmit(e) {\n axios.get('http://localhost:8081/login/' + input.username + \"/\" + input.password )\n e.preventDefault(); // prevent default action of page refresh \n }", "function callAPI() {\n var options = {\n method: 'POST',\n url: 'http://localhost:3000/user/signup',\n headers: {\n 'cache-control': 'no-cache',\n 'content-type': 'application/x-www-form-urlencoded'\n },\n form: {\n username: 'demo',\n email: 'demo@linkeriot.io',\n password: '1234qwer'\n }\n };\n\n request(options, function(error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n });\n\n}", "async function RegistrationInvalidLaunchUrl () {\n\n let imgPath = 'Registration_InvalidLaunchUrl.png';\n\n // Open browser and navigate to app registration page\n const browser = await puppeteer.launch();\n const page = await browser.newPage();\n await page.goto(sso + '/add');\n\n // Input title\n await page.type('#title', appTitle);\n\n // Input launch url\n await page.type('#launchUrl', 'app url');\n\n // Input invalid email\n await page.type('#email', appEmail); \n\n // Input user deletion url\n await page.type('#deleteUrl', appDeleteUrl);\n await page.click('button');\n await timeout(1000);\n\n await page.screenshot({path: imgPath});\n\n await browser.close()\n}", "getServerUrl() {\n const {\n host,\n port\n } = this.serverConfig;\n return `//${host || 'localhost'}:${port}`;\n }", "login(url) {\n return self.options.loginUrl ? self.options.loginUrl : '/login';\n }", "static get API_URL() {\r\n const port = 1337; // Change this to your server port\r\n return `http://localhost:${port}/`;\r\n }", "function redactUrlField(url){\n if(url && urlValidator.isHttpsUri(url)){\n const urlParts = urlParser.parse(url);\n return urlParts.protocol.concat(\"//\", urlParts.host);\n } else {\n return url;\n }\n}", "signUp() {\n const email = document.querySelector('.signup_form_mail').value;\n const password = document.querySelector('.signup_form_pass').value;\n auth.createUserWithEmailAndPassword(email, password).then(cred => {\n signupForm.reset();\n document.location.reload(true);\n })\n .catch(err => {\n console.log(err.message);\n });\n }", "function testel() {\n if (validacaoLogin()) {\n var nomeDeLogin = window.document.getElementById(\"userinput\").value;\n var senhaDeLogin = window.document.getElementById(\"passwordinput\").value;\n let methodGet = {\n method: \"GET\"\n };\n fetch(`http://localhost:4567/pegarlog?query=${nomeDeLogin}//${senhaDeLogin}`, methodGet)\n .then(response => response.json())\n .then(data => {\n if (testeSupremo(data)) {\n alert(\"bem vindo\");\n ficarOnline(data);\n Home();\n\n } else {\n alert(\"Who is Who\");\n }\n });\n }\n\n}", "static get API_URL() {\n const port = 1337; // Change this to your server port\n return `http://localhost:${port}`;\n }", "function createUrl(val){\n return `http://localhost:3000/api/${val}`;\n \n}", "function setupEndpoint() {\n if (host.val().indexOf('/') != -1) {\n var hostArr = host.val().split('/');\n\n path = \"http://\" + hostArr[0] + \":\" + port.val();\n hostArr.shift(); // remove host\n\n if (hostArr.length > 0) { // anything left?\n path += \"/\" + hostArr.join('/');\n }\n } else {\n path = \"http://\" + host.val() + \":\" + port.val();\n }\n endpoint = path;\n }", "async function resetPass(){\r\n try{\r\n const response = await axios.post(\"https://resetpassword1312.herokuapp.com/reset\",{\r\n email:name\r\n })\r\n setResult(response.data)\r\n console.log(response.data)\r\n }catch(error){\r\n console.log(error)\r\n }\r\n \r\n }", "function autenticar_API(){\n const proxyurl = \"https://cors-anywhere.herokuapp.com/\";\n let request = {}\n request.username = usernameAPI;\n request.password = passwordAPI;\n axios\n .post(proxyurl+\"http://200.134.18.85:19881/login\", request)\n .then((res) => {\n setToken(res.data.token);\n }).catch((err) => {\n console.log(err);\n })\n }", "constructor({ production, userName, password, redirectUrl }) {\n this.Account = !production\n ? {\n userName,\n password,\n baseUrl: \"https://uat-proxy.aps.iq:5443\",\n redirectUrl: redirectUrl,\n }\n : {\n userName,\n password,\n baseUrl: \"https://ecommerce.aps.iq:4443\",\n redirectUrl: redirectUrl,\n };\n }", "function submitLogin(email, password){\n const user = {\n email:email,\n password:password\n };\n API.login(user)\n .then((response)=>{\n if(response){\n if(response.data.response){\n setResponse(response.data.response);\n if(response.data.action === \"clear all\"){\n emailInput.current.value = \"\";\n passwordInput.current.value = \"\";\n }else if(response.data.action === \"clear password\"){\n passwordInput.current.value = \"\";\n }\n }else if(response.data.user[0]){\n const newUser = response.data.user[0];\n setUser(newUser);\n }\n }else{\n passwordInput.current.value = \"\";\n }\n }).catch(err=>console.log(err));\n }", "constructor() {\n super();\n this.url = '';\n }", "function dangnhap() {\n let username = 'Nguyen Dinh Phuc'\n let password = '11111111'\n\n fetch('https://www.cfdtraining.vn/api/dang-nhap', {\n method: \"POST\",\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n username,\n password\n })\n })\n .then(res => res.json())\n .then(res = {\n\n })\n}", "buildUrl() {\n let url = this.hostname;\n\n if (this.port !== 80) {\n url += ':' + this.port;\n }\n\n let path = this.path;\n if (path.substring(0, 1) !== '/') {\n path = '/' + path;\n }\n\n url += path;\n\n url = replaceUrlParams(url, this.givenArgs);\n url = url.replace('//', '/');\n url = 'https://' + url;\n return url;\n }", "function loginUser({ email, password }) {\n fetch(\"/api/users/login\", {\n method: \"POST\",\n body: JSON.stringify({\n email,\n password,\n }),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n })\n .then((r) => r.json())\n .then(() => {\n window.location.replace(\"/dashboard\");\n })\n .catch((err) => {\n console.error(err.responseText);\n });\n}", "function recoverPassword(){\n var email=document.getElementsByName(\"email\").value;\n alert(email);\n axios({\n url: 'https://apibyashu.herokuapp.com/api/recoverpassword',\n method: 'post',\n data: 'pavan.baretha7@infobeans.com'\n }).then((response) => {\n console.log(response.data.message)\n }, (error) => {\n console.log(error);\n\n })\n}", "function login()\n{\n\temail = document.getElementById(\"inputEmail\").value;\n\tpassword = document.getElementById(\"inputPassword\").value;\n\tmakeRequest('GET', \"http://138.197.7.194/api/users/?email=\" + email + \"&password=\" + password + \"&action=login\", null, true, userLoginResponse);\n\tevent.preventDefault();\n}", "function logindatas(){\r\n var username = document.getElementById(\"username\").value;\r\n var password = document.getElementById(\"password\").value;\r\n \r\n postData(\"http://localhost:8080/auth/login\", {username:username,password:password})\r\n .then(data => {\r\n location.assign(\"http://localhost:8080/homed.html\");\r\n })\r\n .catch((error)=>{\r\n console.log(error);\r\n })\r\n}", "function clearValue() {\n setEmail(\"\");\n setPassword(\"\");\n }", "async function resetpass() {\n\n var userToken = JSON.parse(localStorage.getItem('token'));\n var token = userToken.data.token;\n console.log(\"data\", password, confirmPassword, token)\n let item = { password, confirmPassword, token };\n let result = await fetch(\"https://jobs-api.squareboat.info/api/v1/auth/resetpassword\", {\n method: 'POST',\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(item)\n });\n result = await result.json();\n console.log(\"result\", result)\n if (result.code == 200) {\n history.push(\"/login\")\n }\n\n }", "constructor(props) {\n super(props);\n\n const { cookies } = props\n\n cookies.remove('email', { path: '/' })\n\n // window.location.reload()\n }", "local(url) {\n return url.replace(/^(https?:)?\\/\\/[^/]+/, '');\n }", "function disableautoserveraddress() {\n $(\"#fulladdress\").removeAttr(\"disabled\");\n $(\"#serverport\").removeAttr(\"disabled\");\n $(\"#altfulladdress\").removeAttr(\"disabled\");\n\n configdata[\"Connection\"][\"UseURLAddress\"] = false;\n}", "function setURL() {\n var proto;\n var url;\n var port;\n if (window.location.protocol == \"http:\") {\n proto = \"ws://\";\n port = \"8080\";\n } else {\n proto = \"wss://\";\n port = \"8443\";\n }\n\n url = proto + window.location.hostname + \":\" + port;\n return url;\n}", "function userLogin(e) {\n e.preventDefault();\n const formContent = {\n userEmail: document.getElementById('userEmail').value,\n password: document.getElementById('password').value,\n };\n fetch(`${portPath}/auth/login`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(formContent),\n })\n .then(res => res.json())\n .then((data) => {\n // const credentials = []; // how do you separate these values, you can't separate by comma\n // credentials.push(data.token);\n // credentials.push(data.userId);\n // credentials.push(data.userPriviledge);\n // credentials.push(data.userName);\n if (data.token) {\n localStorage.setItem('token', data.token);\n localStorage.setItem('userId', data.userId);\n localStorage.setItem('userPriviledge', data.userPriviledge);\n localStorage.setItem('userName', data.userName);\n localStorage.setItem('cart', '');\n localStorage.removeItem('cartItems');\n redirect: window.location.replace('../../UI/dashboard.html');\n console.log(localStorage);\n } else {\n let errormsg = [];\n if (data.userEmail) {\n errormsg.push(data.userEmail);\n }\n if (data.password) {\n errormsg.push(`<br>${data.password}`);\n }\n if (data.message) {\n errormsg.push(`<br>${data.message}`);\n }\n\n document.getElementById('errorDisplay').innerHTML = `${errormsg}`;\n // document.getElementById('errorDisplay2').innerHTML = `${data.message}`;\n }\n })\n .catch(error => console.log(error.message));\n}", "function setupLogin() {\n\t$(\"#guest-username-input\").val(\"\"); // clear guest username\n}", "async reset({ request, params, response }) {\n /*** get the user update inputs */\n let { password } = request.only([\"password\"]);\n\n /** get the target user */\n try {\n const user = await User.query().where(\"id\", params.id).first();\n if (!user) {\n return response.status(404).send({\n message: \"not found\",\n });\n }\n /** update the user details */\n user.email = password;\n await user.save();\n\n return response.status(200).send({\n message: \"password updated\",\n });\n } catch (error) {\n return response.status(404).send({\n message: \"fail\",\n error: error,\n });\n }\n }", "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n }", "validateEmail() {\n var re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.+-]+\\.edu$/g;\n var validEmailString = re.test(String(this.state.email).toLowerCase());\n if (validEmailString === false) {\n this.setState({\n validEmail: false\n });\n return false;\n }\n\n fetch('http://localhost:3000/api/users/email?email=' + this.state.email)\n .then(res => res.json())\n .then((result) => {\n if (result.status === \"success\") {\n this.setState({\n validEmail: false\n })\n }\n else {\n this.setState({\n validEmail: true\n })\n this.validatePassword();\n }\n });\n }", "function mungeURL(url) {\n let rbase = process.env.SOLID_REMOTE_BASE;\n if(!url) return\n if( url.match(/^https:\\/[^/]/) ){\n url = url.replace(/^https:\\//,\"https://\")\n }\n if( url.match(/^\\//) && rbase ){\n return rbase + url;\n }\n else if( url.match(/^\\.\\//) ){\n return lbase + url.replace(/\\./,'');\n }\n else if( !url.match(/^(http|file|app)/) ){\n console.log(url);\n console.log(\"URL must start with https:// or file:// or / or ./\")\n return false\n }\n return url\n}", "function Email() {\n\n const [email,setEmail] = useState('')\n const [emailR,setEmailR] = useState('')\n\n async function Cod_email(){\n /*try{\n const req = await Apil.EnviarSenha(email,emailR)\n return req;\n }catch(e){\n toast.error(e.response.data.error)\n }*/\n \n }\n return(\n <Page>\n \n <FormField\n label = 'E-mail'\n type = 'text'\n name = 'email'\n value = {email}\n onChange = {(e) => setEmail(e.target.value)}\n />\n\n <FormField\n label = 'E-mail de recupeção de conta'\n type = 'text'\n name = 'email'\n value = {emailR}\n onChange = {(e) => setEmailR(e.target.value)}\n />\n \n {/*<Link to = '/reset/codigo' >\n <ButtonGrande onClick = {Cod_email}\n children = 'Enviar codigo'\n />\n </Link>*/}\n </Page>\n );\n}", "constructor(http) {\n this.http = http;\n //url2: string ='http://localhost:3000/getCredential'; //route to be added into node server.\n this.url = 'http://localhost:3000/app/ImgUplod';\n this.url2 = 'http://localhost:3000/app/extract';\n }", "login(email, password) {\n return axios.post(`${API_URL}/auth/login`, {\n email,\n password\n })\n }", "function apiCall() {\r\n const userId = document.getElementById('email').value;\r\n const password = document.getElementById('paswrd').value;\r\n const errorEle = document.getElementById('emailError');\r\n hideError(errorEle);\r\n if (userId === '' || password === '') {\r\n setError(errorEle, 'Please enter Email and Password');\r\n }\r\n else {\r\n document.getElementById('loginbtn').style.display = 'none';\r\n document.getElementById('btnLoader').style.display = 'block';\r\n const Url = ''; // API URL here\r\n const data = {\r\n username: userId,\r\n password: password\r\n };\r\n const otherParams = {\r\n headers: {\r\n 'content-type': 'application/json'\r\n },\r\n body: JSON.stringify(data),\r\n method: 'POST'\r\n };\r\n fetch(Url, otherParams)\r\n .then(data => { return data.json() })\r\n .then(res => {\r\n afterMailHandler(res, errorEle);\r\n })\r\n .catch(error => console.log(error))\r\n }\r\n\r\n}", "function url(path){\n return process.env.NODE_ENV === \"development\"?\n `http://localhost:3333${path}`: path\n}", "constructor(\n user = config.user,\n password = config.password,\n host = config.host\n ) {\n this.user = user;\n this.password = password;\n this.host = host;\n }", "settingsUrl (baseUrl,username){\n browser.get(baseUrl + username + \"/_settings\");\n }", "function sign_up() {\n // let user_info = {\n // username : username,\n // email : email,\n // password : password,\n // password2 : password2\n // };\n // console.log(user_info);\n\n // axios.post('/server_app/sign_up', user_info)\n // .then(response => {\n // // sucessful response\n // console.log(\"Response: \", response.data);\n // })\n // .catch(error => {\n // console.error('Error: ', error);\n // });\n\n axios.get('https://nazim-django-server.herokuapp.com/hello')\n .then(response => {\n // sucessful response\n console.log(\"Response: \", response.data);\n })\n .catch(error => {\n console.error('Error: ', error);\n });\n\n }", "constructor() {\n this.api_url = process.env.REACT_APP_API_ENDPOINT;\n }", "function UserAuthenticate() {\n\n var email = $(\"#inputEmail\").val();\n\tlocalStorage.setItem('emailId',email);\n var password = $(\"#inputPassword\").val();\n var requestUrl = url + \"userauthenticate\";\n var jsonBody = JSON.stringify({\n \"emailId\": email,\n \"password\": password\n });\n var request = new Request(requestUrl, {method: 'POST', headers: headerData, body: jsonBody});\n\n fetch(request)\n .then(response => response.json())\n .then(function (responseData) {\n console.log('data', responseData.response);\n if (responseData.response.errors.length === 0) {\n console.log(responseData.response);\n window.location.replace(\"web/index.html\");\n }\n else {\n alert(\"Error : \" + responseData.response.errors[0].reason);\n $(\"inputPassword\").val('');\n }\n })\n .catch(function (error) {\n alert('Request Failed :' + error);\n $(\"inputPassword\").val(null);\n $(\"inputEmail\").val(null);\n });\n}", "constructor(username, email) {\n this.username = username;\n this.email = email;\n }", "async function LoginData() {\r\n const { email, password } = LoginUser;\r\n if (email && password) {\r\n if (validation(email)) {\r\n const result = await axios.post('http://localhost:4000/login', LoginUser)\r\n if (result.data) {\r\n usehistory.push(\"/dashboard\");\r\n localStorage.setItem(\"token\", LoginUser.email);\r\n }\r\n else {\r\n alert(\"Invalid Email or Password!\");\r\n }\r\n }\r\n else {\r\n alert(\"Email Format is not Valid!\")\r\n }\r\n\r\n }\r\n else {\r\n alert(\"Fill All Fields!\");\r\n }\r\n\r\n\r\n }", "async function login () {\n // 로그인 데이터\n const data = {\n 'login_id': 'hhk9292@gmail.com',\n 'password': process.env.MATTER_PW\n }\n try {\n return await axios.post(BASE_URL+'/users/login', data)\n } catch (error) {\n console.error(error);\n }\n}", "login(email, password) {\n const body = {\n email: email,\n password: password\n };\n console.log(body);\n return axios__WEBPACK_IMPORTED_MODULE_2___default.a.post(this.URL + 'token/login/', body);\n }", "function checkURL(req, res, next) {\n console.log(req.query.url);\n if (req.query.url === undefined) {\n res.status(400).json({\n success: false,\n message: \"Invalid URL\",\n });\n } else {\n next();\n }\n}", "function Home(){\n // var str = randomstring.generate()\n let auth_params={\n \"CLIENT_ID\":\"ZVHaqsAlP5pA3vvVUJY2X0rd0tZM1h2JUg0qE2s7\",\n \"REDIRECT_URI\":\"http://127.0.0.1:3000/login\",\n \"STATE_STRING\":'random_string',\n }\n const handleButtonClick = (e) => {\n e.preventDefault();\n window.location.href = \"https://channeli.in/oauth/authorise/?client_id=\"+auth_params.CLIENT_ID+\"&redirect_uri=\"+auth_params.REDIRECT_URI+\"&state=\"+auth_params.STATE_STRING;\n }\n \n return(\n <div>\n\n <button onClick={handleButtonClick}>Login</button>\n </div>\n );\n}", "static get API_URL(){\n\t\tconst port = 8081;\n\t\treturn `http://localhost:${port}`\n\t}", "onSubmitData() {\n if (this.state.email == '' || this.state.password == '')\n alert(\"Please fill out all fields!\");\n else if(this.state.email != '' && this.state.password != '' && this.validInput(this.state.email))\n Actions.reset('dashBoard'); // Navigate to dashBoard screen\n }", "function checkURL(req, res, next) {\n console.log(req.query.url);\n if (req.query.url === undefined) {\n res.status(400).json({\n success: false,\n message: \"Invalid URL\"\n });\n } else {\n next();\n }\n}", "function auth() {\n var url = 'http://158.38.101.146:8080/login?email=' + document.getElementById('email').value + \"&password=\" + document.getElementById('password').value;\n var client = new HttpClient();\n client.get(url, function (response) {\n document.getElementById(\"authResult\").innerHTML = response;\n });\n}", "function gotoServer(email, name, type) {\n $http.post(RestURL.baseURL + 'j_spring_social_security_check?email=' + email + '&username=' + name + '&socialtype=' + type)\n .success(function (data) {\n $log.log(\"Valid login: \", JSON.stringify(data));\n if (data.status == \"failed\") {\n $scope.errormessage = \" Your user name or password is wrong. Please try again!\";\n loginform['email'].$dirty = true;\n loginform['password'].$dirty = true;\n } else {\n var user = data;\n authFactory.setUser(user);\n $location.url(\"/en-US/projects\");\n }\n }).error(function () {\n console.log(\"ERROR WITH SOCIAL SIGNIN\");\n });\n }", "getEmail() {}", "function login() {\n var mail = document.getElementById('staticEmail2').value\n var pass = document.getElementById('inputPassword2').value;\n const data = { mail, pass };\n //console.log(data)\n\n fetch(url, {\n method: 'POST',\n headers: {\n 'content-type': 'application/json'\n },\n credentials: 'omit',\n body: JSON.stringify(data)\n })\n .then(response => response.text())\n .then(response=> \n sessionStorage.setItem('accessToken', response))\n window.location.href='file:///C:/Users/Emich/Google%20Drive/Acamica/ENTREGAS/4TO%20PROYECTO/data_warehouse/docs/bienvenido.html'\n \n}", "makeAPICall(mail, password1, password2) {\n \n let result = this.validateFields(mail, password1, password2);\n if (result === true) {\n const user = {\n email: mail,\n pwd: password1\n };\n\n const options = {\n method: 'POST',\n body: JSON.stringify(user),\n headers: {\n 'Content-Type': 'application/json'\n }\n };\n\n return fetch('http:///185.176.41.137:3000/register', options)\n .then(res => {\n if (res.ok) {\n showMessage({\n message: \"Registrierung erfolgreich.\",\n type: \"success\",\n floating: \"true\",\n });\n\n return res.json();\n } else {\n return Promise.reject(res.status);\n }\n })\n .catch(err => console.log('Error with message: ' + err));\n\n } else {\n return false;\n }\n }", "function register() {\n setLoading(true);\n fetch(\"https://password-reset-task3.herokuapp.com/users/signup\", {\n method: \"POST\",\n headers: {\n \"Access-Control-Allow-Origin\": \"*\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(v)\n })\n .then((res) => res.json())\n .then((data) => {\n console.log(\"-----SUCCESSFULL REGISTRATION------\", data);\n\n if (data.newuser.name) {\n afterlogin(\"Registration success !!!\");\n history.push(\"/login\");\n e.target.reset();\n }\n })\n .catch((err) => {\n console.log(\"err in registration !!!\", err.message);\n\n afterlogin(\"Error in Registration\");\n });\n }", "function userEmail() {\n return (req, res, next) => {\n const { email } = req.body;\n //if no email, please enter one\n if (!email) {\n return res.json({ no_email_provided: \"please enter an email\" });\n }\n //send email back to user\n req.email = email;\n //next stack\n next();\n };\n}", "set URL(url=\"\") {\n\t\t// 유효성 검사\n\t\tif(typeof url !== 'string') {\n\t\t\treturn \"\";\n\t\t}\n\n\t\t/*\n\t\tWS는 HTTP와 는 별도의 프로토콜을 사용하지만, HTTP와 같은 방식으로 TCP 기반에서 통신합니다.\n\t\t또한 WSS 역시 HTTPS와 는 별도의 프로토콜을 사용하지만, HTTPS와 같은 방식으로 TCP 기반에서 TLS를 이용하여 통신합니다. \n\t\tURL로 사용되는 것을 보면, \"ws://~~\"로 사용되고, 보안 통신을 위해서는 \"wss://~~\"로 사용됩니다.\n\t\t*/\n\t\tthis.url = url;\n\t\tthis.url = this.url.replace(/^http(s?):\\/\\//i, \"\"); // http:// 또는 https:// 제거\n\t\tthis.url = /^ws:\\/\\//i.test(this.url) || /^wss:\\/\\//i.test(this.url) ? this.url : (() => {\n\t\t\treturn window.location.protocol === 'https:' ? `wss://${this.url}` : `ws://${this.url}`;\n\t\t})();\n\t}", "resolveLocalHost(url) {\n let strToReplace = url.toString();\n //strToReplace = strToReplace.replace('localhost', '192.168.1.7'); //put here the address of localMachine\n strToReplace = strToReplace.replace('localhost', 'http://www.futuradata.com.br/acback'); //put here the address of localMachine\n return strToReplace;\n }", "function SafeUrl(){}", "registro(username, first_name, last_name, email, password, re_password) {\n const body = {\n username: first_name + last_name,\n first_name: first_name,\n last_name: last_name,\n email: email,\n password: password,\n re_password: re_password\n };\n console.log(body);\n return axios__WEBPACK_IMPORTED_MODULE_2___default.a.post(this.URL + 'users/', body);\n }", "async function authenticateUser(){\n\temail = getUserEmail();\n\tpassword = getUserPassword();\n\tconst url = `http://localhost:3000/?user=${email}password=${password}`;\n\tconst response = await fetch(url);\n\tconst data = await response.json();\n\tif(data){\n\t\tnoteMenuView();\n\t}\n\telse{\n\t\terrorMessage();\n\t}\t\t\n\t\t\n}", "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "function resetEndpoint(endpoint) {\n return endpoint = \"https://localhost:44367/api/movie/\";\n }", "function userProfileUrl() { return \"{{conf.reqUrl}}/api/userprofile/\"; }", "makeAPICall(mail, password) {\n\n let result = this.validateFields(mail, password);\n if (result === true) {\n const user = {\n email: mail,\n pwd: password\n };\n\n const options = {\n method: 'POST',\n body: JSON.stringify(user),\n headers: {\n 'Content-Type': 'application/json'\n }\n }\n\n return fetch('http:/185.176.41.137:3000/login', options)\n .then(res => {\n if (res.ok) {\n return res.json();\n } else {\n showMessage({\n message: \"Login fehlgeschlagen!\",\n description: \"Bitte überprüfe den Input.\",\n type: \"danger\",\n floating: \"true\",\n });\n return Promise.reject(res.status);\n }\n })\n .then(\n res => {\n try {\n this.setUserToken(res['token']);\n } catch (error) {\n console.log('Key couldn\\'t be set!', error);\n }\n }\n )\n .catch(err => console.log('Error with message: ' + err));\n\n } else {\n return false;\n }\n }", "function SafeUrl() { }", "function SafeUrl() { }", "function SafeUrl() { }", "async function RegistrationInvalidDeleteUrl () {\n\n let imgPath = 'Registration_InvalidDeleteUrl.png';\n\n // Open browser and navigate to app registration page\n const browser = await puppeteer.launch();\n const page = await browser.newPage();\n await page.goto(sso + '/add');\n\n // Input title\n await page.type('#title', appTitle);\n\n // Input launch url\n await page.type('#launchUrl', appLaunchUrl);\n\n // Input invalid email\n await page.type('#email', appEmail); \n\n // Input user deletion url\n await page.type('#deleteUrl', 'app url');\n await page.click('button');\n await timeout(1000);\n\n await page.screenshot({path: imgPath});\n\n await browser.close()\n}", "function SafeUrl() {}", "function SafeUrl() {}", "function SafeUrl() {}", "function SafeUrl() {}", "function SafeUrl() {}" ]
[ "0.608535", "0.6019824", "0.5877053", "0.58494705", "0.58214897", "0.5678482", "0.5618781", "0.56127286", "0.55512255", "0.5464522", "0.54482114", "0.5427585", "0.54255277", "0.5419925", "0.5395762", "0.53914464", "0.5390861", "0.5386061", "0.53791356", "0.5362236", "0.53382957", "0.5301629", "0.5298884", "0.52831274", "0.5282508", "0.5274283", "0.52519435", "0.52513736", "0.52481675", "0.52439415", "0.52226347", "0.52180666", "0.5209585", "0.5208238", "0.5205809", "0.5205073", "0.5189418", "0.51863414", "0.51758933", "0.517324", "0.5171011", "0.5167151", "0.5163738", "0.51578707", "0.51518506", "0.51388234", "0.5137805", "0.5135184", "0.51293766", "0.51234436", "0.51234037", "0.5118974", "0.5118513", "0.51081264", "0.51064116", "0.5093115", "0.50893915", "0.5088719", "0.5087929", "0.5079446", "0.5077574", "0.5071975", "0.506881", "0.50678396", "0.5063138", "0.50618875", "0.5060778", "0.50568306", "0.5055103", "0.50539225", "0.50512", "0.50478333", "0.5046698", "0.50451386", "0.50449586", "0.5042836", "0.5036277", "0.5034363", "0.5033592", "0.5033592", "0.5033592", "0.5033592", "0.5033592", "0.5033592", "0.5033592", "0.5033592", "0.5033592", "0.5033592", "0.5033592", "0.50318205", "0.5031712", "0.50313205", "0.5026729", "0.5026729", "0.5026729", "0.50232565", "0.50212663", "0.50212663", "0.50212663", "0.50212663", "0.50212663" ]
0.0
-1
incorrect email & password
async function testLogin1() { try { driver.get(url + "login"); driver.findElement(By.id("normal_login_email")).sendKeys("12345@gmail.com"); driver.findElement(By.id("normal_login_password")).sendKeys("abc888888888"); driver.findElement(By.className("login-form-button")).click(); } catch (err) { console.error("Something went wrong!\n", err.stack, "\n"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function error(){\n return \"Invaild e-mail or password!\";\n }", "function handleRecoverPassword(){\n if(emailValid()){\n console.log(`send me my password to: ${email}`)\n setEmail('')\n }else{\n console.log('invalid')\n }\n }", "function validate_email() {\n if (!valid_email(vm.email_address)) {\n vm.error_message = 'Please enter a valid email address';\n return;\n }\n reset_password();\n }", "function invalidPassword(err) {\n log.warn(err);\n throw new HttpErrors.HttpUnauthorizedError();\n}", "function AndIEnterAnInvalidPassword() {\n cy.get(\"input[name=code]\").type(Cypress.env(\"validTrustAdminCode\"));\n cy.get(\"input[name=password]\").type(\"wrong\");\n }", "function AndIEnterAnInvalidPassword() {\n cy.get(\"input[name=code]\").type(Cypress.env(\"validAdminCode\"));\n cy.get(\"input[name=password]\").type(\"wrong\");\n }", "function invalidAuth(req, res, next) {\r\n\tconst user = {\r\n\t\tname: 'joe@smith.com',\r\n\t\tpass: 'passord',\r\n\t}\r\n\r\n\tif (user.name && user.pass) {\r\n\t\tUser.authenticate(user.name, user.pass, function(error, user) {\r\n\t\t\tif (error || !user) {\r\n\t\t\t\tvar err = new Error('Wrong email or password.')\r\n\t\t\t\terr.status = 401\r\n\t\t\t\treturn next(err)\r\n\t\t\t} else {\r\n\t\t\t\tres.locals.user = user\r\n\t\t\t\treturn next()\r\n\t\t\t}\r\n\t\t})\r\n\t} else {\r\n\t\tvar err = new Error('Email and password are required.')\r\n\t\terr.status = 401\r\n\t\treturn next(err)\r\n\t}\r\n}", "function failedPasswordConfirmation(){\n req.flash('error', \"Incorrect current password.\");\n return res.redirect(\"/account\");\n }", "function getInvalidPasswordResponse(password) {\n return 'Invalid password: ' + password + '. Should match: min-length=8 max-length=30 no-whitespace';\n}", "static old_password_error() {\n \n }", "async checkForExactWrongUserCredentials(username, password, callback) {\n const query = 'SELECT * FROM user WHERE user.username=?';\n\n try {\n const [result] = await mysql.getConnection().execute(query, [username]);\n const user = _.first(result);\n\n if (!result.length)\n return callback(\"NOT FOUND\");\n\n if (!crypto.isValidPassword(user.password, password))\n return callback(\"WRONG PASSWORD\");\n\n // Check for validation\n if (user && !user['verified'])\n return callback(\"NOT VERIFIED\");\n\n callback(); // Pass On\n } catch (err) {\n callback(true);\n }\n }", "validateLogin(username, password) {\n\t\tconsole.log(\"Validating input\");\n\t\tif (!username | !password) throw \"Must input an email and password!\";\n\t\tif (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(username)) throw \"You entered an invalid email!\"\n\t}", "disableSubmit() {\n const { authError } = this.props\n const { error, email, password, passwordConfirm } = this.state\n let formNotCompleted = email.length === 0 && password.length === 0 && passwordConfirm.length === 0\n let formNotValid = (authError && authError.length !== 0) || error.length !== 0\n let wrongPassword = password !== passwordConfirm\n return formNotCompleted || formNotValid || wrongPassword\n }", "processPassRep() {\n if (this.password.value !== this.passwordRepeat.value) {\n this.passwordRepeat.err = true;\n this.passwordRepeatErr.seen = true;\n this.valid = false;\n this.passwordRepeatErr.text = \"رمز عبور و تکرار آن یکسان نیستند\";\n } else {\n this.passwordRepeat.err = false;\n this.passwordRepeatErr.seen = false;\n }\n }", "function checkPassword(){ \n\n\t\t\t\t\n\t\t\t\t\n var password1 = document.getElementById(\"psw\");\n var password2 = document.getElementById(\"psw-repeat\");\n var e1 = document.getElementById(\"email1\");\n\n var p1=password1.value;\n var p2=password2.value;\n var e2=e1.value;\n if(e2 === '')\n {\n alert(\"enter email.Please try again! \");\n return false;\n }\n \n if(p1 === '')\n {\n alert(\"enter password.Please try again! \");\n return false;\n }\n if(p2 === '')\n {\n alert(\"enter password.Please try again! \");\n return false;\n }\n if(p1.length <8){\n alert(\"value is less than 8\");\n\n }\n if ( p1!=p2) { \n alert (\"\\nPassword did not match: Please try again...\") \n return false; \n } \n var mailformat = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\n if(e1.value.match(mailformat))\n {\n // return true;\n }\n else\n {\n alert(\"You have entered an invalid email address!\");\n return false;\n }\n \n }", "validateCredentials() {\n Keyboard.dismiss();\n this.setState({ errors: \"\" });\n let valid = false;\n if (!(this.state.email.match(/^([\\w.%+-]+)@([\\w-]+\\.)+([\\w]{2,})$/i))) {\n this.refs.toast.show(\"Please enter a valid email\")\n }\n else if (this.state.password.length < 8) {\n this.refs.toast.show(\"Password should be at least of 8 characters\")\n } else {\n this.signinUser();\n }\n }", "function mensagemErro(email, passi) {\r\n let mensagem = \"\"\r\n\r\n if (email) { //Ou seja o email não existe\r\n mensagem = \"O mail que introduziu não existe\"\r\n }\r\n else if (passi) { //Se o mail existe mas a pass é true, então é porque o mail e a pass não correspondem\r\n mensagem = \"A password está errada\"\r\n }\r\n\r\n return mensagem\r\n}", "ondoesNotMatch() {\n this.passwordValidationState = 'has-error';\n toastr.error(this.passwordDoesNotMatchMessage);\n this.passwordDoesNotMatchMessage = 'Passwords do not match.';\n }", "function validateInfo(email, password, confirmPassword) {\n if (password == confirmPassword) {\n return true;\n }\n else {\n return false;\n }\n}", "function checkforgotpassword()\r\n\t{\r\n\t\tif(document.forgot.email.value==\"\")\r\n\t\t{\r\n\t\t\talert(lng_plsenteremailadd);\r\n\t\t\tdocument.forgot.email.focus();\r\n\t\t\tdocument.forgot.email.select();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(!validate_email_forgot(document.forgot.email.value,lng_entervalidemail))\r\n\t\t\t\t{\r\n\t\t\t\t\tdocument.forgot.email.select();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t}\r\n\t}", "function validateEmail(){\n\tvar re = /^([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$/i;\n var result = re.test($.txtfieldMail.value);\n if(result == 0){\n \t$.txtfieldMail.value = \"\";\n \tutilities.showAlert(Alloy.Globals.selectedLanguage.forgotUsername,Alloy.Globals.selectedLanguage.invalidmail,function(){});\n }\n}", "function validateUser()\n\t{\n\t\tvar msg = '';\n\t\tif($scope.password != $scope.confirm_password){\n\t\t\tmsg = msg + \"\\n\"+$i18next.t(\"validate_confirm_password\");\n\t\t}\n\t\tif($scope.password.length < 8){\n\t\t\tmsg = msg + \"\\n\"+$i18next.t(\"validate_password\");\n\t\t}\n\t\tif($scope.username.length <4){\n\t\t\tmsg = msg + \"\\n\"+$i18next.t(\"validate_username\");\n\t\t}\n\t\tif (!/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test($scope.email)){\n\t\t\tmsg = msg + \"\\n\"+$i18next.t(\"validate_email\");\n\t\t}\n\t\treturn msg;\n\t}", "validate(value) {\r\n if (value.toLowerCase().includes('password'))\r\n throw new Error('Password cannot contain password, come on');\r\n }", "function deny (){\n mess = \"Incorrect Password for \";\n userVal = userName;\n return mess, userVal;\n}", "async verifyPassword(email, password) {\n // First, find the user with the given email address and get their id\n let query = 'SELECT id FROM users WHERE email=?';\n let args = [email];\n let rows = await this.connection.query(query, args);\n\n // If no such email exists, return an empty array\n if(rows.length === 0) {\n // console.log(\"no such email\");\n return {user_id: -1, agent_id: null, display_name: \"\"};\n }\n\n let id = rows[0].id;\n query = 'SELECT salt, password, agent_id, display_name FROM users WHERE id=?';\n args = [id];\n rows = await this.connection.query(query, args);\n\n // Retrieve the salt and hashed password from the database\n let salt = rows[0].salt;\n let dbHashedPassword = rows[0].password;\n\n // Now with that salt, hash the new password.\n let hashedPassword = this.hashPassword(salt, password);\n \n // Does the hashed password from the database match the new password? If so, it's the same password.\n if (hashedPassword.toString() === dbHashedPassword.toString()) {\n let agent_id = (rows[0].agent_id == \"null\") ? null : rows[0].agent_id;\n return {user_id: id, agent_id: agent_id, display_name: rows[0].display_name};\n } else {\n // console.log(\"password doesn't match\");\n return {user_id: -1, agent_id: null, display_name: \"\"};\n }\n }", "function email(){\n var emailReg =/[a-z].*(@)[a-z]*(.)[a-z]{2,}$/;\n var validEmail = document.getElementById('email').value;\n if (emailReg.test(validEmail) === false)\n {\n throw \"invalid email address\";\n }\n }", "function validatePassword(){var r=document.getElementById(\"passwordfield\").value,e=document.getElementById(\"confirmPasswordfield\").value;e!=r?document.getElementById(\"confirmPasswordfield\").setCustomValidity(\"Passwords Don't Match\"):document.getElementById(\"confirmPasswordfield\").setCustomValidity(\"\")}", "async forgotPassword(req, res) {\n try {\n if (req.body.role == \"Job-Provider\") schema = JobProviderDetails;\n if (req.body.role == \"Job-Seeker\") schema = JobSeekerDetails;\n if (!req.body.role) return res.send({error:\"Incorrect Credentials\"})\n \n const user = await schema.findOne({ email: req.body.email, aadhaarNumber: req.body.aadhaarNumber, isVerified: true });\n if (!user) return res.send({error:\"Incorrect Credentials or kindly activate your account by visiting the link that has been sent to you\"})\n if (user.isBlocked) return res.status(401).send({error:`${user.name}, you are blocked for the misuse of SeasonalEmployment.com.....`});\n \n const rawPassword = (Math.floor(Math.random() * 100000000)).toString();\n const hashedPassword = await hash(rawPassword, 10)\n user.password = hashedPassword;\n user.save();\n forgotPasswordMailing(req.body.email, rawPassword)\n return res.status(202).send({message:\"A System generated password has been sent to your email successfully. Login with that password and edit your password in profile section if needed\"})\n } catch (err) {\n return res.status(500).send({error:err.message})\n }\n }", "async forgetPassword({auth,request,response}){\n try{\n let userDetails=await User.findBy('email',request.body.email);\n let buffer = require('crypto').randomBytes(24);\n let token = buffer.toString('hex');\n userDetails.passwordToken = token;\n await userDetails.save();\n\n Email.sendEmail(request.body.email,token,userDetails.id);\n return _RL.apiResponseOk(response,Antl.formatMessage('messages.emailSent')); \n }\n catch(e){\n console.log(e);\n return _RL.notFound(response,Antl.formatMessage('messages.accountNotFound'));\n }\n \n }", "static authenticate(email, password) {\n const query = 'SELECT id, password, is_disabled FROM Members WHERE email = $1 LIMIT 1';\n\n return db.oneOrNone(query, [email]).then(user => {\n if (!user) {\n throw new Error('Incorrect username or password.');\n }\n\n if (user.password === password) {\n // User account disabled.\n if (user.is_disabled) {\n throw new Error('User account disabled.');\n }\n\n // Successful.\n return user.id;\n } else {\n // Wrong password.\n throw new Error('Incorrect username or password.');\n }\n });\n }", "validate(value) {\n if (value.toLowerCase().includes(\"password\")) {\n // biar gak asal input password jadi password\n throw Error(\"Your password is invalid!\");\n }\n }", "function verify(){\n\n //get the value on inputs\n const unameVal = uname.value;\n const emailVal = email.value;\n const fcodeVal = fcode.value;\n const lcodeVal = lcode.value;\n\n\n //check \n\n \n //check for correct input for username\n if(unameVal === \"\" || unameVal===null){\n //code to executed\n uname.style.border = \"1px solid red\" \n uname.style.borderRadius = \"4px\"\n error1.innerHTML = \"enter your username!\"\n return false;\n }else{\n //checking length of username\n if(unameVal.length <= 3 ){\n \n uname.style.border = \"1px solid red\"\n uname.style.borderRadius = \"4px\"\n error1.innerHTML = \"enter username correctly!\"\n return false;\n }else{\n uname.style.border = \"none\"\n error1.remove();\n }\n \n }\n\n //validation check for email\n if(emailVal.indexOf(\"@\")== -1 || emailVal.length < 6){\n error2.innerHTML = \"Enter Valid Email\"\n email.style.border = \"1px solid red\" \n email.style.borderRadius = \"4px\"\n return false;\n }else{\n error2.remove();\n email.style.border = \"none\" \n\n }\n //validation check for passcode\n if(fcodeVal === \"\" || fcodeVal === null){\n error3.innerHTML = \"enter password\"\n fcode.style.border = \"1px solid red\"\n fcode.style.borderRadius = \"4px\"\n return false;\n }else{\n if(fcodeVal.length < 6 ){\n error3.innerHTML = \"Password must be more than 6 characters\"\n fcode.style.border = \"1px solid red\"\n fcode.style.borderRadius = \"4px\"\n return false;\n }else{\n error3.remove();\n fcode.style.border = \"none\"\n \n }\n }\n\n //validate if passwords are the same\n if(lcodeVal === \"\" || lcodeVal === null){\n error4.innerHTML = \"Please Confrim Password! \"\n return false;\n }else{\n if(lcodeVal != fcodeVal){\n error4.innerHTML = \"Password do not match! \"\n return false;\n }else{\n error4.remove();\n }\n }\n \n \n //alert for submition\n alert1.innerHTML = `Welcome ${unameVal}`\n alert1.style.color = \"blue\"\n //alert(\"Sign in Successful\")\n\n return true;\n //end\n}", "function fixEmail() {\n var decision = Browser.msgBox(\"WARNING\", \"Are you sure you want to change your email?\", Browser.Buttons.YES_NO);\n if (decision == 'yes') {\n var email = Browser.inputBox('Enter email');\n var password = Browser.inputBox('Enter password');\n\t\tUserProperties.setProperty('email', email);\n\t\tUserProperties.setProperty('password', password);\n\t}\n}", "enterBadEmail(email) {\n this.emailInput.setValue(email);\n }", "function AndIEnterAnInvalidCode() {\n cy.get(\"input[name=code]\").type(\"wrong\");\n cy.get(\"input[name=password]\").type(Cypress.env(\"validAdminPassword\"));\n }", "function validate_login(){\n\tvar email = document.getElementById(\"emailL\").value;\n\tvar password = document.getElementById(\"passwordL\").value;\n\tif ( email == null || email == \"\"){\n\t\talert (\"Please enter the email.\");\n\t\treturn false;\n\t}\n\tif ( password == null || password == \"\"){\n\t\talert (\"Please enter the password.\");\n\t\treturn false;\n\t}\n}", "function uPassword() {\n\t\tvar u_pass = $('#user_pass').val();\n\t\tvar pass_pattern = /^[a-zA-Z0-9]+$/;\n\t\tvar pass_len = u_pass.length;\n\n\t\tif (u_pass == '') {\n\t\t\t$('#alert_pass').text('this field cannot be empty');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t} else if (pass_len < 8 || pass_len > 15 || !u_pass.match(pass_pattern)) {\n\t\t\t$('#alert_pass').text('please enter password between 8-15 alphanumeric characters');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function printError() {\n if (!validatePasswd()) {\n isPasswdValid = false;\n var html = \"<img src ='image/Error-icon.png'></img><span style = 'color:red'>The two password don't Match!</span>\";\n document.getElementById('validatepasswd').innerHTML = html; \n } else {\n isPasswdValid = true;\n }\n if (!isCorrectEmail) {\n var email = document.getElementById('email').value \n if ( !validateEmail(email)) { errorMessage(\"Please input valid email address!\"); }\n else { errorMessage(\"The email was Registered!\");}\n }\n}", "function checkCreds() {\n checkEmail();\n return false;\n }", "function AndIEnterAnInvalidCode() {\n cy.get(\"input[name=code]\").type(\"wrong\");\n cy.get(\"input[name=password]\").type(Cypress.env(\"validTrustAdminPassword\"));\n }", "async TestWrongEmailOrPass(){\n const user_obj = {id :4, Lastname : \"Ibrahim\", Firstname : \"Eshraq\", email : \"eshraq.ibrahim@gmail.com\", password : \"eshu123\" \n , dateOfBirth : '1997/11/27', createdAt: '2020-04-02 10:35:00', modifiedAt : '2020-04-02 10:35:00', role : 1};\n \n var response = await user.validUser(user_obj.email,user_obj.password);\n if(response == null){\n console.log(\"\\x1b[32m%s\\x1b[0m\",\"TestWrongEmailOrPass Passed\");\n }else{\n console.log(\"\\x1b[31m%s\\x1b[0m\",\"TestWrongEmailOrPass Failed\");\n }\n\n }", "function forgotPassord(email){\n return $http({\n method: 'POST',\n url: 'http://woutverhoeven.webhosting.be/api/auth/recovery',\n params:{\n email: email,\n }\n });\n }", "function check_ForgetPassword_form() {\n var username = document.getElementById(\"UsernameText\").value;\n\n\n var reg = new RegExp(\"^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$\"); //Verify the email address\n\n\n\n if (!reg.test(username)) {\n alert(\"Please input the right email address!!\");\n return false;\n }\n\n\n return true;\n\n}", "function check_Modify_password_form() {\n var emailcode = document.getElementById(\"emailcodeText\").value;\n var password = document.getElementById(\"passwordText\").value;\n var confirm_password = document.getElementById(\"Confirm_passwordText\").value;\n\n if(emailcode.length ==0){\n alert(\"Please enter the code\");\n return false;\n }\n if (password.length <6) {\n alert(\"Please enter the 6 digital password\");\n return false;\n }\n if (password != confirm_password) {\n alert(\"The passwords are not match, Please enter again\");\n return false;\n }\n\n return true;\n\n}", "function authenticateEmail (e) {\n var email = e.target.value;\n firebase.auth().fetchSignInMethodsForEmail(email).then(function (signInMethods) {\n if (signInMethods.length == 0) {\n //User does not exist\n login.emailBox.addClass('is-invalid');\n login.submit.prop('disabled', true);\n } else {\n //Enable Password\n login.emailBox.removeClass('is-invalid');\n login.emailBox.addClass('is-valid');\n login.submit.prop('disabled', false);\n }\n }).catch(e => {\n //Bad input\n login.emailBox.addClass('is-invalid');\n login.submit.prop('disabled', true);\n });\n}", "function validatePassword(password) {\n\t// validate password\n}", "function validateEmailReset() {\n if (checkIfEmpty(email)) return;\n if (!containsCharacters(email, 5)) return;\n if (!CheckFieldInDbReset(email, form_j, dataUrlEmail)) return;\n return true;\n}", "function checkEmail() {}", "function validate(email, password, name) {\n\tlet strongRegex = new RegExp(\"^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})\")\n // true means invalid, so our conditions got reversed\n\n return {\n email: email.length === 0 || !email.includes('@') || !email.includes('.', email.indexOf('@')),\n password: password.length < 8 || !strongRegex.test(password),\n name: name.length < 3\n };\n}", "function loginFailed(){\n}", "function checkUserData(req, res, next) {\n var email = req.body.email,\n password = req.body.password;\n\n // Let's retrieve user by e-mail\n db.one('SELECT password FROM users WHERE email = $1', email)\n .then(function (data) {\n // If we retrieved user, let's compare it's password\n bcrypt.compare(password, data.password, function (error, result) {\n // If true, then let's return success message\n if (result) {\n return res.status(200)\n .json({\n status: 'success',\n message: {\n param: 'generalError',\n msg: 'Incorrect e-mail or password'\n }\n });\n } else { // Return error message that password or e-mail is wrong\n return res.status(200)\n .json({\n status: 'error',\n message: {\n param: 'generalError',\n msg: 'Incorrect e-mail or password'\n }\n });\n }\n });\n })\n .catch(function (err) {\n // If it wasn't possible to retrieve user - return that password or e-mail is incorrect\n return res.status(200)\n .json({\n status: 'error',\n message: {\n param: 'generalError',\n msg: 'Incorrect e-mail or password'\n }\n });\n });\n}", "function validateUserInfo() {\n if (userEmail.value === lsEmail && userPass.value === lsPass) {\n alert(\"You're logged in!\");\n } else {\n alert(\n \"Sorry, either your email or password is incorrect. Please try again!\"\n );\n }\n}", "validate(value) {\n if (value.length < 6) {\n // if password too short or equals password, throw error\n throw new Error('password too short');\n // can use value.includes() can pass in multiple invalid passwords\n } else if (value === 'password') {\n throw new Error('pick a better password');\n }\n }", "checkUsernameAndEmail(req, res, next){\n\n db.query(queries.selectUserWithUsernameAndEmail, [req.body.username, req.body.email], (err, result, fields) => {\n\n if (err) throw err;\n\n if (result.length == 0){\n res.status(400).send(`User with username ${req.body.username} and email ${req.body.email} does not exist.`);\n } else {\n next();\n }\n });\n \n }", "function needsPassword() {\n // no password is set neither in the user table nor in the staged record.\n // the user must pick a password\n res.json({\n success: true,\n email: email,\n needs_password: true\n });\n }", "validatePassword () {\n\t\tif (!this.attributes.password) { return; }\n\t\tlet error = this.userValidator.validatePassword(this.attributes.password);\n\t\tif (error) {\n\t\t\treturn { password: error };\n\t\t}\n\t}", "onRegisterFail(errorMessage) {\n console.log(\"error\", errorMessage);\n this.emailValidationState = 'has-error';\n this.helpBlock = errorMessage;\n this.registerMessage = 'Email or password is not correct. Please try again.';\n toastr.error(this.registerMessage);\n }", "function UserPWVerifier (email, pw){\n for (var user in users){\n let comparingPW = users[user]['password'];\n if ( (users[user]['email'] === email) && (bcrypt.compareSync(pw, comparingPW)) ){\n const CheckID = users[user]['id'];\n return CheckID;\n }\n }\n return false\n}", "function validarEmail(email) {\n\n expr = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n if ( !expr.test(email) )\n swal(\"Error: Correo Incorrecto\", \"\", \"info\");\n \n\n }//end function validarEmail", "function validatePassword() {\n let oldPass = new Password(dom('#oldPassword').value)\n let newPass = new Password(dom('#newPassword').value)\n let newPassConfirm = new Password(dom('#newPassword2').value)\n let errorPrompt = dom('#passwordError')\n\n if (!newPass.match(newPassConfirm)) {\n errorPrompt.innerText = \"Passwords do not match\"\n return false\n }\n if (newPass.lessEq(7) || newPassConfirm.lessEq(7)) {\n errorPrompt.innerText = \"New password must be at least 8 characters\"\n return false\n }\n if (!oldPass.matchStr(\"test\")) {\n errorPrompt.innerText = \"Incorrect password\"\n return false\n }\n errorPrompt.innerText = \"\"\n return true\n}", "function validateRecoveryForm()\n{\n\tif(validateEmail(\"passwordRecoveryForm\"))\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "function validateEmailForForgotPwd(formobj){\r\n\tvar errMsg = \"\";\r\n\tvar femailId = formobj.femailId.value.trim();\r\n\r\n\tif(!femailId.length>0)\r\n\t\terrMsg = errMsg+\"EMAIL ID Can't be empty.\\n\";\r\n\telse {\r\n\t\tif(!checkEmail(femailId))\r\n\t\t\terrMsg = errMsg+\"Please Enter Proper Email.\\n\";\r\n\t}\r\n\tif ( errMsg.length > 0 ){\r\n\t\talert(errMsg);\r\n\t\treturn false;\r\n\t}\r\n\tformobj.femailId.value = (formobj.femailId.value.trim()).toLowerCase();\r\n\r\n//\tformobj.submit();\r\n}", "function validate_form(){\n\n\t//FORM FIELDS\n\t var first_name = document.getElementById('first_name').value;\n\t var last_name = document.getElementById('last_name').value;\n\t var email = document.getElementById('email').value;\n \t var password = document.getElementById('password').value;\n\t var password2 = document.getElementById('password2').value;\n\t\n\t//PASSWORD REG EXP CHECK\n\t var password_check = /^(?=.*[0-9])(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{7,15}$/;\n\t\n\n\t//CHECK FOR EMPTY FIELDS\n\tif(\n\t\tfirst_name == \"\" ||\n\t\tlast_name == \"\" ||\n\t\temail == \"\" ||\n\t\tpassword == \"\" ||\n\t\tpassword2 == \"\"\n\t ) \n\t\t{ \n\t\t\tfirst_name = \"First Name\"\n\t\t\tdocument.getElementById('error_msg').innerHTML = \"Fields cannot be empty\";\n\t\t\tdocument.getElementById(\"error_msg\").focus();\n\t\t\treturn false;\n\t\t}else{}\n\t\n\t//CHECK FOR VALID EMAIL\n\tif(/(.+)@(.+){2,}\\.(.+){2,}/.test(email)) \n\t{}else{\n\t\tdocument.getElementById('error_msg').innerHTML = \"Email provided is not valid\";\n\t\tdocument.getElementById(\"error_msg\").focus();\n return false\n\t}\n\n\t//CHECK FOR STRONG PASSWORD ENTRY\n\tif(password.length >= 8)\n\t{ \n\t\tif(password.match(password_check)){}\n\t\telse{\n\t\tdocument.getElementById('error_msg').innerHTML = \"Password must contain at least an Uppercase, Lowercase and a Special Character. E.g. <b>ABcDef$G@ </b><br><i><b>This ensures tighter Security</b></i>\";\n\t\tdocument.getElementById(\"error_msg\").focus();\n return false;}\n }else{\n\t\tdocument.getElementById('error_msg').innerHTML = \"Password must be up to 8 characters long.<br><i><b>This ensures tighter Security</b></i>\";\n\t \tdocument.getElementById(\"error_msg\").focus();\n\t\treturn false;\n\t}\n\t\n \t//CHECK FOR PASSWORD MATCH\n\tif(password != password2) \n\t{ \n\t\tdocument.getElementById('error_msg').innerHTML = \"Passwords do not match,\";\n\t\tdocument.getElementById(\"error_msg\").focus();\n return false;\n }else{return true;}\n}", "function validation(){\n\tvar password= document.getElementById(\"password\").value\n\tvar username = document.getElementById(\"username\").value\n\n\tif (username == null || username == \"\") {\n\t\talert(\"Name must be filled out\")\n\t} else if(password == null || password == \"\") {\n\t\talert(\"The password must be filled\")\n\t} else if (password !== \"12345\") {\n\t\talert(\"INCORRECT password\")\n\t} else if(password == \"12345\" || username ==\"imelda\") {\n\t\talert(\"PREMIUM ACCESS\")\n\t}\n}", "function isValidPassword(password) {\n\n\n}", "function authLogin(req, res, next) {auth(req) ?\n User.findOne({ emailAddress: auth(req).name}).exec(function(err, user) {\n user ? next() : res.status(400)\n .send({ message: \"You didn't signup\" });\n\n }) : next();\n}", "function validatePassword() {\n\n // empty array for the final if statement to check\n var errors = [];\n\n if (confirmLowerCase === true) {\n if (finalPass.search(/[a-z]/) < 0) {\n errors.push(\"lower\");\n }\n }\n if (confirmUpperCase === true) {\n if (finalPass.search(/[A-Z]/) < 0) {\n errors.push(\"upper\");\n }\n }\n if (confirmNumeric === true) {\n if (finalPass.search(/[0-9]/i) < 0) {\n errors.push(\"numeric\");\n }\n }\n if (confirmSpecialChar === true) {\n if (finalPass.search(/[!?@#$%^&*]/i) < 0) {\n errors.push(\"specialchar\");\n }\n }\n // if error array has contents, clear password string and regenerate password\n if (errors.length > 0) {\n finalPass = \"\"\n return passwordGen();\n }\n }", "function forgotPassword(divid,url,mailid,type,fid){\n\t var emailvalue=document.getElementById(mailid).value;\n\t \n\t\t\t emailvalue=rm_trim(emailvalue);\n\t\t\t if(emailvalue==''){\n\t\t\t alert(\"Please Enter Email\");\n\t\t\t document.getElementById(mailid).focus();\n\t\t\t return false;\n\t\t\t }\n\t\t\t else if(!emailValidator(emailvalue)){\n\t\t\t\t\talert(\"Invalid Email \");\n\t\t\t\t\tdocument.getElementById(divid).innerHTML=\"\";\n\t\t\t\t\tdocument.getElementById(mailid).value=\"\";\n\t\t\t\t\tocument.getElementById(mailid).focus();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t }\n\t\t\t\t\t // alert(url);\n\t\t\turl=url+\"&email=\"+emailvalue;\n\t\t\tgetServerResponse(divid,url,\"\",true)\n}", "function checkEmailAndPassword(emailAddress,password,callback){\n // Exceptions\n if (typeof emailAddress!='string' || typeof password!='string'){\n throw \"checkEmailAndPassword: emailAddress and password must be strings.\";\n }\n if (typeof callback!='function'){\n throw \"checkEmailAndPassword: callback must be a function.\";\n }\n var queryDum = `\n SELECT\n user_id ,\n password_hash ,\n password_salt ,\n email_verified\n FROM\n users\n WHERE\n email_address = ?\n `;\n var columnVals = [emailAddress];\n queryXSS(queryDum,columnVals,function(err,rows,fields){\n if (err) console.log(err);\n if (rows.length==0){\n callback(\"no match\");\n } else {\n var bcrypt = require('bcrypt-nodejs');\n var salt = rows[0]['password_salt'];\n var passwordHash = bcrypt.hashSync(password,salt);\n if (passwordHash==rows[0]['password_hash']){\n if (rows[0]['email_verified']==1){\n callback('success',rows[0]['user_id']);\n } else {\n callback('not verified');\n }\n } else {\n callback('no match');\n }\n }\n });\n}", "function validateEmail() {\n let reg = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\n if (reg.test(state.email) === false) {\n isError = true;\n errors.emailError = \"Enter valid Email\";\n }\n else {\n isError = false;\n }\n if(isError){\n setState({\n ...state,\n ...errors})\n}\n }", "validateBeforeLogin() {\n const { email, password } = this.state\n let { emailError, passwordError } = this.state\n\n // set empty input error message if any of inputs are empty\n emailError = !email ? 'Email should not be empty' : emailError\n passwordError = !password ? 'Password should not be empty' : passwordError\n this.setState({ emailError, passwordError })\n\n // return false if the form contains any error\n return !emailError && !passwordError\n }", "async validateEmailAndUsername(db, email, username) {\n try {\n let user = await this.getUsersByEmail(db, email);\n if (user) throw new ValidationError('email', 'Email is already in use');\n user = await this.getUsersByName(db, username);\n if (user)\n throw new ValidationError('username', 'Username is already in use');\n } catch (e) {\n throw e;\n }\n }", "async matchCredentials(email, password) {\n const userExists = await this.checkUserExists(email);\n let status = {};\n if (!userExists) {\n status = {\n message: \"User does not exist\",\n matched: false,\n userInfo: null,\n };\n } else {\n if (await bcrypt.compare(password, userExists.password)) {\n delete userExists.params;\n status = {\n message: \"Credentials matched\",\n matched: true,\n userInfo: userExists,\n };\n } else {\n status = {\n message: \"Credentials does not matched\",\n matched: false,\n userInfo: null,\n };\n }\n }\n\n return status;\n }", "function checkForm(frm) {\r\n var eror = 0; // to store errors, determine to return TRUE or FALSE\r\n\r\n // for fields Users\r\n if(frm.username) var username = frm.username.value;\r\n if(frm.pass) var pass = frm.pass.value;\r\n if(frm.pass2) var pass2 = frm.pass2.value;\r\n if(frm.passnew) var passnew = frm.passnew.value;\r\n if(frm.email) var email = frm.email.value;\r\n if(frm.codev) var codev = frm.codev.value;\r\n if(document.getElementById('codev0')) var codev0 = document.getElementById('codev0').innerHTML;\r\n\r\n // gets form fields values Message\r\n if(frm.emailc) {\r\n var email = frm.emailc.value;\r\n if(email == 'optional') { frm.emailc.value = ''; email = ''; }\r\n }\r\n if(frm.coment) var coment = frm.coment.value;\r\n\r\n // check fields value, if incorrect, sets error in \"eror\"\r\n // validate the email\r\n if(frm.email && email.search(regx_mail)==-1) {\r\n alert(texts['email']);\r\n eror = frm.email;\r\n }\r\n else if(frm.emailc && email.length>0 && email.search(regx_mail)==-1) {\r\n alert(texts['email']);\r\n eror = frm.emailc;\r\n }\r\n // validate user name\r\n else if(frm.username && (username.length<3 || username.length>32 || username.search(regx_chr) == -1)) {\r\n alert(texts['name']);\r\n eror = frm.username;\r\n }\r\n // Check password length and to contains only the characters from \"regx_chr\"\r\n else if (frm.pass && (pass.length<7 || pass.search(regx_chr) == -1)) {\r\n alert(texts['pass']);\r\n eror = frm.pass;\r\n }\r\n // Check if it's the same password in \"Retype password\"\r\n else if (frm.pass2 && pass2!=pass) {\r\n alert(texts['pass2']);\r\n eror = frm.pass2;\r\n }\r\n // Check the length of the new password (the form in \"usrbody.php\")\r\n else if (frm.passnew && (passnew.length<7 || passnew.search(regx_chr) == -1)) {\r\n alert(texts['passnew']);\r\n eror = frm.passnew;\r\n }\r\n // check the verification code\r\n else if (frm.codev && codev0 && codev!=codev0) {\r\n alert(texts['codev']);\r\n eror = frm.codev;\r\n }\r\n // check the message /comment\r\n else if(frm.coment && (coment.length<5 || coment.length>600)) {\r\n alert(texts['coment']);\r\n eror = frm.coment;\r\n }\r\n\r\n // if no error in 'eror', returns true, else, select incorrect field,and returns false\r\n if (eror==0) return true;\r\n else {\r\n eror.focus();\r\n eror.select();\r\n return false;\r\n }\r\n}", "function validateAuthEmailValid(req, res, next) {\n // Resolve our action\n var action = res.locals.action;\n assert(action);\n\n // Define revocation methods\n req.deleteAuthEmailInfo = function () {\n delete req.session.authEmail;\n delete req.session.authEmailAttempts;\n delete req.session.authEmailTokenHash;\n delete req.session.authEmailExpiresAt;\n };\n\n // If our auth request is invalid or expired\n if (!req.session.authEmail || req.session.authEmailAttempts === undefined ||\n !req.session.authEmailTokenHash || !req.session.authEmailExpiresAt ||\n req.session.authEmailExpiresAt < Date.now()) {\n // Revoke our auth email info\n req.deleteAuthEmailInfo();\n\n // Redirect our user back to their original auth page\n var loggingInStr = action === 'sign_up' ? 'signing up' : 'logging in';\n req.session.authError = 'Email authentication request has expired. Please try ' + loggingInStr + ' again';\n return res.redirect(action === 'sign_up' ? '/sign-up' : '/login');\n }\n\n // Expose our email and continue\n res.locals.authEmail = req.session.authEmail;\n next();\n}", "checkForError() {\n if (this.state.attemptedSubmit && this.state.changePassword) {\n if (!this.compareOldPasswords())\n return (\n <div className=\"alert alert-danger\">\n Old password does not match current password.\n </div>\n );\n if (this.compareNewPasswords())\n return (\n <div className=\"alert alert-danger\">New passwords do not match.</div>\n );\n }\n return null;\n }", "function verifyUser(req, res) {\n const { email, password } = req.body;\n // console.log(req.body);\n const values = [email, password];\n // console.log(values);\n const verifyUserStr = 'SELECT * FROM users WHERE user_email = $1 AND user_password = $2;';\n pgClient.query(verifyUserStr, values, (err, result) => {\n if (err) res.status(500).json({ error: 'error' });\n else if (result.rows.length === 0) res.status(400).json({ error: 'Incorrect email or password' });\n else res.status(200).json(result.rows[0]);\n });\n}", "function warnPasswordIsBad(){\n var dumStr = $('#passwordValue').val();\n if (!(passwordLength(dumStr) || dumStr=='')){\n $(\"#passwordMessage\").html('<p style=\"color:red;\">Password must be six characters long or longer.</p>');\n }\n}", "_authenticationFailed() {\n\t\tthis._password = null;\n\n\t\t// New authentication session\n\t\tthis.startAuthentication();\n\t\tthis._passwordInput.value = '';\n\n\t\t// Error messages/UI\n\t\tthis._passwordBox.classList.add('authentication-failed');\n\t\tthis._tooltipPassword.innerText = this._returnRandomErrorMessages();\n\t\tthis._tooltipPassword.classList.add('tooltip-error');\n\n\t\t// Shake animation\n\t\tthis._passwordInputContainer.classList.add('shake');\n\t\tsetTimeout(\n\t\t\t() => {\n\t\t\t\t// Stop shaking\n\t\t\t\tthis._passwordInputContainer.classList.remove('shake');\n\t\t\t},\n\t\t\t500\n\t\t);\n\t}", "async resetPassword({auth,request,response}){\n try{\n // let password = await Hash.make(request.body.newPassword);\n let userDetails=await User.find(request.body.id);\n if(request.body.token && userDetails.passwordToken == request.body.token){\n userDetails.password = request.body.newPassword;\n userDetails.passwordToken = null;\n await userDetails.save();\n return _RL.apiResponseOk(response,Antl.formatMessage('messages.passwordReset'));\n }\n else{\n return _RL.unauthorized(response,Antl.formatMessage('messages.unauthorized'));\n } \n }\n catch(e){\n console.log(e)\n return _RL.unauthorized(response,Antl.formatMessage('messages.unauthorized'));\n } \n }", "function checkemailadd(form99,email)\n{ \n\tvar reg = /^([A-Za-z0-9_\\-\\.])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,4})$/;\n\tvar emailaddress = document.forms[\"form99\"].elements[\"email\"].value;\n\tvar errordiv = document.getElementById(\"error-panel\");\n\t\n\tif(reg.test(emailaddress) == false) {\n\t errordiv.style.display = 'block';\n\t errordiv.innerHTML = \"Invalid email addess. Please try <a href=\\\"https://hclibrary.org/mobile/forgotbarcode.php\\\">again</a>\";\n\t return false;\n\t }else{\n\t\t return true;\n\t }\n}", "validateForm(values){\n const errors = {};\n const {email, password} = values;\n const atpos = email.indexOf(\"@\");\n const dotpos = email.lastIndexOf(\".\");\n\n if(!email || atpos < 0 || dotpos < atpos+1 || dotpos+2 > email.length) {\n errors.email = 'Enter valid email!';\n }\n if(password.search(/[0-9]/) < 0){\n errors.password = 'Your password should contain at least 1 number!';\n }\n if(password.search(/[a-z]/) < 0){\n errors.password = 'Your password should contain at least 1 lowercase letter!';\n }\n if(password.search(/[A-Z]/) < 0){\n errors.password = 'Your password should contain at least 1 uppercase letter!';\n }\n if(password.length < 6) {\n errors.password = 'Your password should be at least 6 characters long!';\n }\n\n return errors;\n }", "function _validateData() {\n const { identifier, password, ip } = user;\n var success = false;\n var error_name, error_code;\n\n if (\n identifier.length < 6 ||\n identifier.length > 254 ||\n identifier === \"undefined\"\n ) {\n error_name = \"username or email\";\n error_code = \"0003\";\n } else if (\n password.length < 8 ||\n password.length > 254 ||\n password === \"undefined\"\n ) {\n error_name = \"password\";\n error_code = \"0004\";\n } else if (!ipValidator(ip) || ip === \"undefined\") {\n error_name = \"ip\";\n error_code = \"0004\";\n } else {\n success = true;\n }\n //respuesta 409 - error del cliente\n switch (success) {\n case false:\n res.cookie(\"refreshToken\", null, {\n maxAge: 0,\n });\n res.status(400).send({\n error_code: `ERROR_SIGN_IN_${error_code}`,\n message: `Invalid ${error_name}.`,\n success: false,\n });\n return false;\n default:\n return true;\n }\n }", "validateEmail () {\n\t\tif (!this.attributes.email) { return; }\n\t\tlet error = this.userValidator.validateEmail(this.attributes.email);\n\t\tif (error) {\n\t\t\treturn { email: error };\n\t\t}\n\t}", "function validateConfPass() {\n if (user_conf.value === user_pass.value) {\n document.getElementById(\"alert_conf_pass\").innerHTML = \"\";\n return true;\n }\n document.getElementById(\"alert_conf_pass\").innerHTML =\n \"Password did'nt matched \";\n return false;\n}", "function onFailGrabAuth(msg, req, res) {\n res.json({\n result: false,\n 'msg': msg\n });\n}", "function validateEmail() {\n $scope.errorEmail = false;\n\t\t\tif(!/^([\\da-z_\\.-]+)@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})$/.test($scope.email)) {\n\t\t\t\t$scope.errorEmail = true;\n $scope.messageEmail = 'E-mail address has a wrong format.';\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar data = {\n\t\t\t\t\taction: \"validateEmail\",\n\t\t\t\t\temail: $scope.email\n\t\t\t\t};\n\n // Calls the validate e-mail method in the registration factory.\n RegistrationFactory.validateEmail(data)\n .then(function(response) {\n if(typeof(response) == 'string') {\n $scope.errorEmail = true;\n $scope.messageEmail = 'An unexpected error occurred while e-mail address is validated. Please try again.';\n }\n else if (response[0]) {\n $scope.errorEmail = true;\n $scope.messageEmail = 'E-mail address is already registered.';\n }\n });\n\t\t\t}\n }", "function validateEmail() {\n let ans = 'no';\n for (let i = 0; i < usersArray.length; i++) {\n if (usersArray[i].email === email.value && usersArray[i].password === password.value) {\n ans = 'yes';\n login.style.display = 'none';\n //console.log('match');\n } \n }\n if (ans === 'no') {\n alert('invalid email or password');\n } \n return false;\n }", "function validateEmail(){\n if (!formValue.email) {\n setErrors({...errors,email:'Email is required'})\n } else if (!/^[\\w-.]+@([\\w-]+.)+[\\w-]{2,4}$/.test(formValue.email)) {\n setErrors({...errors,email:'Email address is invalid'})\n }\n \n else setErrors({...errors,email:undefined}); \n \n }", "validate(value) {\n if (!validator.isEmail(value)) {\n throw new Error(\"Email tidak valid\")\n }\n }", "recoverPassword({ Bert }, { email }) {\n // Call forgot password procedure\n Accounts.forgotPassword({\n email,\n }, (error) => {\n if (error) {\n Bert.alert(error.reason, 'warning');\n } else {\n Bert.alert('Check your inbox for a reset link!', 'success');\n }\n });\n }", "function rvalidate() {\n\tvar name = document.getElementById(\"uname\").value;\n\tvar n = /^[A-Za-z\\s]+$/;\n\tvar mob = document.getElementById(\"unumber\").value;\n\tvar m = /^[0-9]{10}$/;\n\tvar email = document.getElementById(\"uemail\").value;\n\tvar e = /^([A-Za-z0-9\\.\\_])+\\@(([A-za-z0-9\\_]+\\.)+([A-Za-z]{2,3}))$/;\n\tvar pass1 = document.getElementById(\"pass1\").value;\n\tvar pass2 = document.getElementById(\"pass2\").value;\n\tvar p = /^[A-Za-z0-9]{6,8}$/;\n\tif (!name.match(n)) {\n\t\talert('Enter valid name');\n\t\treturn false;\n\t}\n\telse if (!mob.match(m)) {\n\t\talert('Invalid mobile number');\n\t\treturn false;\n\t}\n\telse if (!email.match(e)) {\n\t\talert('Enter valid email');\n\t\treturn false;\n\t}\n\telse if (!pass1.match(p)) {\n\t\talert('Enter valid password...password must be 6-8 aplhabets or digits');\n\t\treturn false;\n\t}\n\telse if (pass1 != pass2) {\n\t\talert('both password not match');\n\t\treturn false;\n\t}\n\telse {\n\t\treturn true;\n\t}\n}", "function verify_register()\n{\n\tvar name = document.getElementById(\"user_register_name\").value;\n\tvar email = document.getElementById(\"user_register_email\").value;\n\tvar password = document.getElementById(\"user_register_password\").value;\n\t\n\tvar email_format = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z]{2,4})+$/;\n\tvar name_format = /^\\w+$/;\n\tvar password_format = /^\\w{5,20}$/;\n\t// Verify input name\n\tif (name === \"\")\n\t{\n\t\tdocument.getElementById(\"user_register_name_message\").innerHTML = \"Name cannot be empty!\";\n\t}\n\telse if (!name_format.test(name)) \n\t{\n\t\tdocument.getElementById(\"user_register_name_message\").innerHTML = \"Name can only contain letters, numbers and underline.\";\n\t} \n\telse\n\t{\n\t\tdocument.getElementById(\"user_register_name_message\").innerHTML = \"\";\n\t}\n\t// Verify input email\n\tif (email === \"\")\n\t{\n\t\tdocument.getElementById(\"user_register_email_message\").innerHTML = \"E-mail cannot be empty!\";\n\t}\n\telse if (!email_format.test(email)) \n\t{\n\t\tdocument.getElementById(\"user_register_email_message\").innerHTML = \"The format of E-mail is invalid.\";\n\t} \n\telse\n\t{\n\t\tdocument.getElementById(\"user_register_email_message\").innerHTML = \"\";\n\t}\n\t// Verify input password\n\tif (password === \"\")\n\t{\n\t\tdocument.getElementById(\"user_register_password_message\").innerHTML = \"Password cannot be empty!\";\n\t}\n\telse if (!password_format.test(password)) \n\t{\n\t\tdocument.getElementById(\"user_register_password_message\").innerHTML = \"Password can only contain 5-20 letters, numbers and underline.\";\n\t} \n\telse\n\t{\n\t\tdocument.getElementById(\"user_register_password_message\").innerHTML = \"\";\n\t}\n\n\tvar name = document.getElementById(\"enterprise_register_name\").value;\n\tvar email = document.getElementById(\"enterprise_register_email\").value;\n\tvar password = document.getElementById(\"enterprise_register_password\").value;\n\t\n\tvar email_format = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z]{2,4})+$/;\n\tvar name_format = /^\\w+$/;\n\tvar password_format = /^\\w{5,20}$/;\n\t// Verify input name\n\tif (name === \"\")\n\t{\n\t\tdocument.getElementById(\"enterprise_register_name_message\").innerHTML = \"Name cannot be empty!\";\n\t}\n\telse if (!name_format.test(name)) \n\t{\n\t\tdocument.getElementById(\"enterprise_register_name_message\").innerHTML = \"Name can only contain letters, numbers and underline.\";\n\t} \n\telse\n\t{\n\t\tdocument.getElementById(\"enterprise_register_name_message\").innerHTML = \"\";\n\t}\n\t// Verify input email\n\tif (email === \"\")\n\t{\n\t\tdocument.getElementById(\"enterprise_register_email_message\").innerHTML = \"E-mail cannot be empty!\";\n\t}\n\telse if (!email_format.test(email)) \n\t{\n\t\tdocument.getElementById(\"enterprise_register_email_message\").innerHTML = \"The format of E-mail is invalid.\";\n\t} \n\telse\n\t{\n\t\tdocument.getElementById(\"enterprise_register_email_message\").innerHTML = \"\";\n\t}\n\t// Verify input password\n\tif (password === \"\")\n\t{\n\t\tdocument.getElementById(\"enterprise_register_password_message\").innerHTML = \"Password cannot be empty!\";\n\t}\n\telse if (!password_format.test(password)) \n\t{\n\t\tdocument.getElementById(\"enterprise_register_password_message\").innerHTML = \"Password can only contain 5-20 letters, numbers and underline.\";\n\t} \n\telse\n\t{\n\t\tdocument.getElementById(\"enterprise_register_password_message\").innerHTML = \"\";\n\t}\n}", "function validateFormL(){\n var email = document.forms[\"login\"][\"email\"].value;\n var emailPattern=new RegExp(\"[A-Za-z.]+[0-9]*@[A-Za-z.]+\");\n var password = document.forms[\"login\"][\"password\"].value;\n\n if(email==\"\" || !emailPattern.test(email)){\n alert(\"L'email deve rispettare il formato richiesto (es. prova@email.it)\");\n return false;\n }\n if(password==\"\"){\n alert(\"Inserire la password\");\n return false;\n }\n}", "function onFailAuth(msg, req, res) {\n if (req.query.uid == 'INVALID') return res.json({\"result\" : false, \"msg\" : msg}) \n var data = {\"Author\" : req.query.uid, \"LogType\" : ldatabase.LogType.ApiAuthFail, \"ExpTime\" : settings.settings.settings.maxFailedAttemptsTime}\n ldatabase.log(data, onSuccessLogAuth, onFailLogAuth, req, res)\n}", "function validateFields() {\n\tlname = document.getElementById(\"lname\").value;\n\tfname = document.getElementById(\"fname\").value;\n\tusername = document.getElementById(\"uname\").value;\n\t\n\tif (true) {\n\t\tvalidatePassword();\n\t}\n\tif(valForm.pwd.value != valForm.con_pwd.value){\n\t\talert(\"Error: Password MISMATCH !\");\n\t}\n\t\n\tif (fname.length <=8 ) {\n\t\talert(\"Error: First Name must contain at least 8 characters!\");\n\t}\n\tif (!validateEmail()) {\n\t\talert(\"Not a valid e-mail address ..\");\n\t}\n}", "function checkPassEmailField(origin) {\n var email = $('#edit-name').val();\n var form_error = 0;\n\n if ($('#edit-name').length) {\n\n if (!email) {\n form_error = 1;\n }\n else if (email == '') {\n form_error = 1;\n }\n else if (!origin && checkEmail(email) == false) {\n form_error = 1;\n }\n if ($('#edit-pass').length) {\n var password = $('#edit-pass').val();\n if (!password) {\n form_error = 1;\n } else if (password == '') {\n form_error = 1;\n }\n }\n\n if (form_error == 0) {\n $('#btnSelectDO').css('opacity','1');\n $('#btnSelectDO').unbind('click');\n $('#btnSelectDO').click(function(e) {\n if (origin && origin == 'login') {\n submitLoginForm('login', null, e);\n }\n else {\n submitPassForm();\n }\n });\n }\n else {\n $('#btnSelectDO').css('opacity','0.5');\n $('#btnSelectDO').unbind('click');\n }\n }\n}", "validateNewEmail(e) {\n e.preventDefault();\n const passRegExp = /^\\w{8,12}$/;\n const passValue = document.querySelector('#user-password').value;\n \n if(passRegExp.test(passValue)) {\n //sends token info to the server\n const userDetails = {\n secret: this.props.match.params.secret,\n token: this.props.match.params.token,\n userPassword: passValue\n }\n\n fetch('/ressetpassword', {\n method: 'post',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(userDetails)\n }) \n .then((response) => { \n return response.json();\n })\n .then((result) => {\n if(result.passUpdated) {\n this.setState({passUpdated : result.passUpdated}) \n } \n if(result.signatureError) {\n this.setState({signatureError: result.signatureError}) \n } \n if(result.emailNotValid) {\n this.setState({emailNotValid: result.emailNotValid})\n }\n if(result.passNotValid) {\n this.setState({passNotValid: result.passNotValid})\n }\n })\n } else {\n this.setState({passNotValid: 'true'});\n }\n }", "function validatePassword(userPassword, reqPassword, req, res, next) {\n let password = crypto.pbkdf2Sync(reqPassword, req.userDetails.salt, 1000, 32, 'sha512').toString('hex');\n if(req.userDetails.password === password) {\n next();\n } else {\n res.status(409).json({status : 'error', message : 'User ID or Password is invalid. Please enter correct credentials to Sign In into ' + configs.appName + '.'});\n }\n}", "function validate() {\n\n\tvar reqBody = locals.body;\n\n\tif (!reqBody.email)\n\t\tthrow new Error('Email is required!');\n\n\tif(!GenHelper.isvalidEmail(reqBody.email))\n\t\tthrow new Error('Email required a valid format!');\n\n\tif (!reqBody.password)\n\t\tthrow new Error('Password is required!');\n}", "isCorrectPassword(enteredPassword) {\n return User.encryptPassword(enteredPassword, this.salt) === this.password;\n }" ]
[ "0.7246435", "0.6829324", "0.682296", "0.660607", "0.6554339", "0.655054", "0.65418553", "0.6535222", "0.6527247", "0.6507466", "0.6480792", "0.647122", "0.64024746", "0.6345461", "0.63171315", "0.6314648", "0.62883943", "0.6254302", "0.6252727", "0.62395704", "0.62265015", "0.6175009", "0.6165006", "0.6127866", "0.6122068", "0.6121443", "0.6116323", "0.6104824", "0.610381", "0.6102496", "0.60884714", "0.6088415", "0.60826474", "0.60735774", "0.6071632", "0.60687834", "0.6062031", "0.60589916", "0.6054796", "0.6053544", "0.604612", "0.603972", "0.60312647", "0.60268736", "0.6019759", "0.6019708", "0.6012973", "0.6007053", "0.60064936", "0.5999128", "0.5994022", "0.5991641", "0.5988153", "0.5982241", "0.5971996", "0.5969489", "0.5960034", "0.5959228", "0.59496367", "0.5943307", "0.5929192", "0.5927289", "0.59248364", "0.59186697", "0.5913814", "0.59097636", "0.5904893", "0.5893805", "0.58899367", "0.5887629", "0.5886786", "0.5884001", "0.58831716", "0.5870525", "0.5870408", "0.58658916", "0.5858775", "0.5855877", "0.5840157", "0.58399516", "0.58263683", "0.58236736", "0.5820631", "0.5820583", "0.58190906", "0.5818924", "0.5816903", "0.58165574", "0.58120275", "0.5810853", "0.580929", "0.5801322", "0.5796253", "0.5789531", "0.5785894", "0.5784168", "0.5781439", "0.57798845", "0.57779795", "0.5768841", "0.57637227" ]
0.0
-1
correct email & password
async function testLogin2() { try { driver.get(url + "login"); driver .findElement(By.id("normal_login_email")) .sendKeys("abc888@gmail.com"); driver.findElement(By.id("normal_login_password")).sendKeys("abc888"); driver.findElement(By.className("login-form-button")).click(); } catch (err) { console.error("Something went wrong!\n", err.stack, "\n"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleRecoverPassword(){\n if(emailValid()){\n console.log(`send me my password to: ${email}`)\n setEmail('')\n }else{\n console.log('invalid')\n }\n }", "function fixEmail() {\n var decision = Browser.msgBox(\"WARNING\", \"Are you sure you want to change your email?\", Browser.Buttons.YES_NO);\n if (decision == 'yes') {\n var email = Browser.inputBox('Enter email');\n var password = Browser.inputBox('Enter password');\n\t\tUserProperties.setProperty('email', email);\n\t\tUserProperties.setProperty('password', password);\n\t}\n}", "function validateInfo(email, password, confirmPassword) {\n if (password == confirmPassword) {\n return true;\n }\n else {\n return false;\n }\n}", "function validatePassword(){var r=document.getElementById(\"passwordfield\").value,e=document.getElementById(\"confirmPasswordfield\").value;e!=r?document.getElementById(\"confirmPasswordfield\").setCustomValidity(\"Passwords Don't Match\"):document.getElementById(\"confirmPasswordfield\").setCustomValidity(\"\")}", "isCorrectPassword(enteredPassword) {\n return User.encryptPassword(enteredPassword, this.salt) === this.password;\n }", "function validate_email() {\n if (!valid_email(vm.email_address)) {\n vm.error_message = 'Please enter a valid email address';\n return;\n }\n reset_password();\n }", "processPassRep() {\n if (this.password.value !== this.passwordRepeat.value) {\n this.passwordRepeat.err = true;\n this.passwordRepeatErr.seen = true;\n this.valid = false;\n this.passwordRepeatErr.text = \"رمز عبور و تکرار آن یکسان نیستند\";\n } else {\n this.passwordRepeat.err = false;\n this.passwordRepeatErr.seen = false;\n }\n }", "async verifyPassword(email, password) {\n // First, find the user with the given email address and get their id\n let query = 'SELECT id FROM users WHERE email=?';\n let args = [email];\n let rows = await this.connection.query(query, args);\n\n // If no such email exists, return an empty array\n if(rows.length === 0) {\n // console.log(\"no such email\");\n return {user_id: -1, agent_id: null, display_name: \"\"};\n }\n\n let id = rows[0].id;\n query = 'SELECT salt, password, agent_id, display_name FROM users WHERE id=?';\n args = [id];\n rows = await this.connection.query(query, args);\n\n // Retrieve the salt and hashed password from the database\n let salt = rows[0].salt;\n let dbHashedPassword = rows[0].password;\n\n // Now with that salt, hash the new password.\n let hashedPassword = this.hashPassword(salt, password);\n \n // Does the hashed password from the database match the new password? If so, it's the same password.\n if (hashedPassword.toString() === dbHashedPassword.toString()) {\n let agent_id = (rows[0].agent_id == \"null\") ? null : rows[0].agent_id;\n return {user_id: id, agent_id: agent_id, display_name: rows[0].display_name};\n } else {\n // console.log(\"password doesn't match\");\n return {user_id: -1, agent_id: null, display_name: \"\"};\n }\n }", "function checkPassword(){ \n\n\t\t\t\t\n\t\t\t\t\n var password1 = document.getElementById(\"psw\");\n var password2 = document.getElementById(\"psw-repeat\");\n var e1 = document.getElementById(\"email1\");\n\n var p1=password1.value;\n var p2=password2.value;\n var e2=e1.value;\n if(e2 === '')\n {\n alert(\"enter email.Please try again! \");\n return false;\n }\n \n if(p1 === '')\n {\n alert(\"enter password.Please try again! \");\n return false;\n }\n if(p2 === '')\n {\n alert(\"enter password.Please try again! \");\n return false;\n }\n if(p1.length <8){\n alert(\"value is less than 8\");\n\n }\n if ( p1!=p2) { \n alert (\"\\nPassword did not match: Please try again...\") \n return false; \n } \n var mailformat = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\n if(e1.value.match(mailformat))\n {\n // return true;\n }\n else\n {\n alert(\"You have entered an invalid email address!\");\n return false;\n }\n \n }", "function AndIEnterAnInvalidPassword() {\n cy.get(\"input[name=code]\").type(Cypress.env(\"validTrustAdminCode\"));\n cy.get(\"input[name=password]\").type(\"wrong\");\n }", "function checkforgotpassword()\r\n\t{\r\n\t\tif(document.forgot.email.value==\"\")\r\n\t\t{\r\n\t\t\talert(lng_plsenteremailadd);\r\n\t\t\tdocument.forgot.email.focus();\r\n\t\t\tdocument.forgot.email.select();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(!validate_email_forgot(document.forgot.email.value,lng_entervalidemail))\r\n\t\t\t\t{\r\n\t\t\t\t\tdocument.forgot.email.select();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t}\r\n\t}", "function check_Modify_password_form() {\n var emailcode = document.getElementById(\"emailcodeText\").value;\n var password = document.getElementById(\"passwordText\").value;\n var confirm_password = document.getElementById(\"Confirm_passwordText\").value;\n\n if(emailcode.length ==0){\n alert(\"Please enter the code\");\n return false;\n }\n if (password.length <6) {\n alert(\"Please enter the 6 digital password\");\n return false;\n }\n if (password != confirm_password) {\n alert(\"The passwords are not match, Please enter again\");\n return false;\n }\n\n return true;\n\n}", "function AndIEnterAnInvalidPassword() {\n cy.get(\"input[name=code]\").type(Cypress.env(\"validAdminCode\"));\n cy.get(\"input[name=password]\").type(\"wrong\");\n }", "function validatePassword() {\n\n // empty array for the final if statement to check\n var errors = [];\n\n if (confirmLowerCase === true) {\n if (finalPass.search(/[a-z]/) < 0) {\n errors.push(\"lower\");\n }\n }\n if (confirmUpperCase === true) {\n if (finalPass.search(/[A-Z]/) < 0) {\n errors.push(\"upper\");\n }\n }\n if (confirmNumeric === true) {\n if (finalPass.search(/[0-9]/i) < 0) {\n errors.push(\"numeric\");\n }\n }\n if (confirmSpecialChar === true) {\n if (finalPass.search(/[!?@#$%^&*]/i) < 0) {\n errors.push(\"specialchar\");\n }\n }\n // if error array has contents, clear password string and regenerate password\n if (errors.length > 0) {\n finalPass = \"\"\n return passwordGen();\n }\n }", "function isValidPassword(password) {\n\n\n}", "function UserPWVerifier (email, pw){\n for (var user in users){\n let comparingPW = users[user]['password'];\n if ( (users[user]['email'] === email) && (bcrypt.compareSync(pw, comparingPW)) ){\n const CheckID = users[user]['id'];\n return CheckID;\n }\n }\n return false\n}", "function validatePassword() {\n let oldPass = new Password(dom('#oldPassword').value)\n let newPass = new Password(dom('#newPassword').value)\n let newPassConfirm = new Password(dom('#newPassword2').value)\n let errorPrompt = dom('#passwordError')\n\n if (!newPass.match(newPassConfirm)) {\n errorPrompt.innerText = \"Passwords do not match\"\n return false\n }\n if (newPass.lessEq(7) || newPassConfirm.lessEq(7)) {\n errorPrompt.innerText = \"New password must be at least 8 characters\"\n return false\n }\n if (!oldPass.matchStr(\"test\")) {\n errorPrompt.innerText = \"Incorrect password\"\n return false\n }\n errorPrompt.innerText = \"\"\n return true\n}", "function checkEmail() {}", "function uPassword() {\n\t\tvar u_pass = $('#user_pass').val();\n\t\tvar pass_pattern = /^[a-zA-Z0-9]+$/;\n\t\tvar pass_len = u_pass.length;\n\n\t\tif (u_pass == '') {\n\t\t\t$('#alert_pass').text('this field cannot be empty');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t} else if (pass_len < 8 || pass_len > 15 || !u_pass.match(pass_pattern)) {\n\t\t\t$('#alert_pass').text('please enter password between 8-15 alphanumeric characters');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function confirmPassword(p1, p2 ){ if (p1.value && p1.value !== p2.value) {\n password2Ok = 0;\n showError(p2, \"Both passwords must match.\")\n} else if (p1.value && p1.value === p2.value) {\n password2Ok = 1;\n showSuccess(p2)\n}\n}", "function v_password(password,test){\n if(password == test){\n return true;\n }\n else{\n $(\"#email\").siblings(\"small\").remove();\n $('<small class=\"form-text danger\"> Email o contraseña incorrecta, inténtelo nuevamente.</small>').insertAfter(\"#email\");\n return false;\n }\n}", "function verify(){\n\n //get the value on inputs\n const unameVal = uname.value;\n const emailVal = email.value;\n const fcodeVal = fcode.value;\n const lcodeVal = lcode.value;\n\n\n //check \n\n \n //check for correct input for username\n if(unameVal === \"\" || unameVal===null){\n //code to executed\n uname.style.border = \"1px solid red\" \n uname.style.borderRadius = \"4px\"\n error1.innerHTML = \"enter your username!\"\n return false;\n }else{\n //checking length of username\n if(unameVal.length <= 3 ){\n \n uname.style.border = \"1px solid red\"\n uname.style.borderRadius = \"4px\"\n error1.innerHTML = \"enter username correctly!\"\n return false;\n }else{\n uname.style.border = \"none\"\n error1.remove();\n }\n \n }\n\n //validation check for email\n if(emailVal.indexOf(\"@\")== -1 || emailVal.length < 6){\n error2.innerHTML = \"Enter Valid Email\"\n email.style.border = \"1px solid red\" \n email.style.borderRadius = \"4px\"\n return false;\n }else{\n error2.remove();\n email.style.border = \"none\" \n\n }\n //validation check for passcode\n if(fcodeVal === \"\" || fcodeVal === null){\n error3.innerHTML = \"enter password\"\n fcode.style.border = \"1px solid red\"\n fcode.style.borderRadius = \"4px\"\n return false;\n }else{\n if(fcodeVal.length < 6 ){\n error3.innerHTML = \"Password must be more than 6 characters\"\n fcode.style.border = \"1px solid red\"\n fcode.style.borderRadius = \"4px\"\n return false;\n }else{\n error3.remove();\n fcode.style.border = \"none\"\n \n }\n }\n\n //validate if passwords are the same\n if(lcodeVal === \"\" || lcodeVal === null){\n error4.innerHTML = \"Please Confrim Password! \"\n return false;\n }else{\n if(lcodeVal != fcodeVal){\n error4.innerHTML = \"Password do not match! \"\n return false;\n }else{\n error4.remove();\n }\n }\n \n \n //alert for submition\n alert1.innerHTML = `Welcome ${unameVal}`\n alert1.style.color = \"blue\"\n //alert(\"Sign in Successful\")\n\n return true;\n //end\n}", "function check_ForgetPassword_form() {\n var username = document.getElementById(\"UsernameText\").value;\n\n\n var reg = new RegExp(\"^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$\"); //Verify the email address\n\n\n\n if (!reg.test(username)) {\n alert(\"Please input the right email address!!\");\n return false;\n }\n\n\n return true;\n\n}", "function validateEmailForForgotPwd(formobj){\r\n\tvar errMsg = \"\";\r\n\tvar femailId = formobj.femailId.value.trim();\r\n\r\n\tif(!femailId.length>0)\r\n\t\terrMsg = errMsg+\"EMAIL ID Can't be empty.\\n\";\r\n\telse {\r\n\t\tif(!checkEmail(femailId))\r\n\t\t\terrMsg = errMsg+\"Please Enter Proper Email.\\n\";\r\n\t}\r\n\tif ( errMsg.length > 0 ){\r\n\t\talert(errMsg);\r\n\t\treturn false;\r\n\t}\r\n\tformobj.femailId.value = (formobj.femailId.value.trim()).toLowerCase();\r\n\r\n//\tformobj.submit();\r\n}", "function checknewpass(x,y,z)\n{\n\tlet pone=x;\n\tlet ptwo=y;\n\tlet locz=z;\n\tlet pwd1=$('#'+pone).val();\n\tlet pwd2=$('#'+ptwo).val();\n\n\tif (pwd1==\"\" || pwd2==\"\")\n\t{\n\t\treturn;\n\t}\n\n\tif (pwd1!=pwd2) \n\t{\n\t\t$('#'+locz).html(\"<b><center>Passwords do not match!</center></b>\");\n\n\t}\n\telse\n\t{\n\t\t$('#'+locz).html(\"\");\n\n\t}\n\n}", "function checkPassword() {\n\n\n\n}", "function userUpdatePassword(req, cb){\n var email = req.body['email'] || req.user.email;\n var pass = req.body['pass'];\n log.info(\"user change password: \" + email + (email != req.user.email?\"(from: \"+req.user.email+\")\":\"\"));\n if(email != req.user.email && !req.user.isAdmin) return cb(errorsList['need-admin']);\n if(!pass) return cb(errorsList['parameter-missing']);\n users.updatePassword(email, pass, cb);\n}", "function uConfPassword() {\n\t\tvar u_conf_pass = $('#user_conf').val();\n\t\tvar u_pass = $('#user_pass').val();\n\t\tif (!(u_conf_pass == u_pass)) {\n\t\t\t$('#alert_conf_pass').text(\"Password did'nt matched \");\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_conf_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t} else if (u_conf_pass === '') {\n\t\t\t$('#alert_conf_pass').text('This field cannot be empty ');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_conf_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function validatePasswordInput() {\n let typedPassword = document.querySelector(\n \".confirmModifications_form-password input\"\n ).value;\n if (userObject.password == typedPassword) {\n // If there is a match the user is updated in the website\n\n populateUserInfo(userObject);\n\n // The user is updated in the database\n\n put(userObject);\n document.querySelector(\".modal-confirm\").style.display = \"block\";\n closeConfirmModifications();\n } else {\n document.querySelector(\n \".confirmModifications_paragraph-alertWrongPass\"\n ).style.display = \"block\";\n }\n}", "async function changeEmail(req, res) {\n /* check for needed values */\n const currentEmail = req.body.currentEmail;\n const newEmail = req.body.newEmail;\n const password = req.body.password;\n\n if (!currentEmail || !newEmail|| !password) \n return res.status(401).send('Need to enter current email, new email, and password');\n\n /* check that values are valid */\n const user_id = await encryptEmail(currentEmail);\n const user = await userWithEmail(currentEmail);\n if (user === undefined || user_id != res.locals.userid) \n return res.status(401).send('Incorrect curent email');\n\n // if user exists, check that passwords match\n const passwordMatches = await passwordMatchesUser(user, password);\n if (!passwordMatches) \n return res.status(401).send('Incorrect password');\n\n // new email should be UCLA email\n if (!isUCLAemail(newEmail))\n return res.status(401).send('New email must be a valid UCLA email');\n\n // if everything is valid, change the email, delete old user email, and auth token\n db.users[await encryptEmail(newEmail)] =\n {\n password: user.password,\n posts: user.posts,\n saved: user.saved\n };\n delete db.users[user_id];\n db.writeUsers();\n delete db.auth[user_id];\n db.writeAuth();\n\n res.status(200).send('Email updated. Login again to proceed');\n}", "isValidPassword (password) {\n // don't use plaintext passwords in production\n return password === this.password;\n }", "function verifyPassword() {\n dataservice.verifyPass(vm.inputUserName, vm.inputPassword).then(querySucceeded);\n\n function querySucceeded(data) {\n if (data[0] = \"true\") {\n $rootScope.userId = data[1];\n location.href = '#view';\n } else {\n vm.attempts += 1;\n $scope.$apply();\n }\n }\n }", "function validate(email, password, name) {\n\tlet strongRegex = new RegExp(\"^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})\")\n // true means invalid, so our conditions got reversed\n\n return {\n email: email.length === 0 || !email.includes('@') || !email.includes('.', email.indexOf('@')),\n password: password.length < 8 || !strongRegex.test(password),\n name: name.length < 3\n };\n}", "function checkEmailAndPassword(emailAddress,password,callback){\n // Exceptions\n if (typeof emailAddress!='string' || typeof password!='string'){\n throw \"checkEmailAndPassword: emailAddress and password must be strings.\";\n }\n if (typeof callback!='function'){\n throw \"checkEmailAndPassword: callback must be a function.\";\n }\n var queryDum = `\n SELECT\n user_id ,\n password_hash ,\n password_salt ,\n email_verified\n FROM\n users\n WHERE\n email_address = ?\n `;\n var columnVals = [emailAddress];\n queryXSS(queryDum,columnVals,function(err,rows,fields){\n if (err) console.log(err);\n if (rows.length==0){\n callback(\"no match\");\n } else {\n var bcrypt = require('bcrypt-nodejs');\n var salt = rows[0]['password_salt'];\n var passwordHash = bcrypt.hashSync(password,salt);\n if (passwordHash==rows[0]['password_hash']){\n if (rows[0]['email_verified']==1){\n callback('success',rows[0]['user_id']);\n } else {\n callback('not verified');\n }\n } else {\n callback('no match');\n }\n }\n });\n}", "function editUser(){\n\tconst opsw = document.getElementById(\"opsw\").value;\n\tconst npsw = document.getElementById(\"npsw\").value;\n\tconst cpsw = document.getElementById(\"cpsw\").value;\n\tif(opsw != user_psw){\n\t\talert(\"Wrong old password\");\n\t}\n\telse if(npsw==\"\"){\n\t\talert(\"Password can't be empty\")\n\t}\n\telse if(npsw != cpsw){\n\t\talert(\"New passwords don't match\");\n\t}\n\telse{\n\t\tuser = {\"id\":0, \"password\":npsw};\n\t\tpostServerData(`/ws/users/${current_user_id}`,user,navig);\n\t}\n}", "checkPassword(password) {\n return password === this.password;\n }", "function authenticateEmail (e) {\n var email = e.target.value;\n firebase.auth().fetchSignInMethodsForEmail(email).then(function (signInMethods) {\n if (signInMethods.length == 0) {\n //User does not exist\n login.emailBox.addClass('is-invalid');\n login.submit.prop('disabled', true);\n } else {\n //Enable Password\n login.emailBox.removeClass('is-invalid');\n login.emailBox.addClass('is-valid');\n login.submit.prop('disabled', false);\n }\n }).catch(e => {\n //Bad input\n login.emailBox.addClass('is-invalid');\n login.submit.prop('disabled', true);\n });\n}", "function validateEmailReset() {\n if (checkIfEmpty(email)) return;\n if (!containsCharacters(email, 5)) return;\n if (!CheckFieldInDbReset(email, form_j, dataUrlEmail)) return;\n return true;\n}", "function passwordEqual(password, verify_password) {\n return password === verify_password;\n}", "editPasswordUser(hash: string, salt: string, email: string, callback) {\n super.query(\n 'UPDATE user SET hash = ?, salt = ? WHERE email = ?',\n [hash, salt, email],\n callback,\n );\n }", "function validateConfPass() {\n if (user_conf.value === user_pass.value) {\n document.getElementById(\"alert_conf_pass\").innerHTML = \"\";\n return true;\n }\n document.getElementById(\"alert_conf_pass\").innerHTML =\n \"Password did'nt matched \";\n return false;\n}", "function validatechangePasswordForm()\n{\n\tvar currentPassword = validatePassword(\"changePasswordForm\",\"currentPassword\",\"currentPasswordSpan\");\n\tvar equal = passwordEqual(\"changePasswordForm\",\"newPassword\",\"confirmPassword\",\"newPasswordSpan\",\"confirmPasswordSpan\");\n\tif (currentPassword & equal)\n\t {\n\t \treturn true;\n\t }\n\t return false;\n}", "function validatePassword(password) {\n\t// validate password\n}", "async checkForExactWrongUserCredentials(username, password, callback) {\n const query = 'SELECT * FROM user WHERE user.username=?';\n\n try {\n const [result] = await mysql.getConnection().execute(query, [username]);\n const user = _.first(result);\n\n if (!result.length)\n return callback(\"NOT FOUND\");\n\n if (!crypto.isValidPassword(user.password, password))\n return callback(\"WRONG PASSWORD\");\n\n // Check for validation\n if (user && !user['verified'])\n return callback(\"NOT VERIFIED\");\n\n callback(); // Pass On\n } catch (err) {\n callback(true);\n }\n }", "function validPassA(pw1,currpw) {\n if(pw1 === currpw) {\n return \"Password matches old password.\";\n }\n return \"\";\n}", "function restorePassword(form, email) {\n\tvar emailValue = document.getElementById(email).value;\n\tvar auth = firebase.auth();\n\t\n\tauth.sendPasswordResetEmail(emailValue).then(function() {\n\t\t\tform.unbind().submit();\n\t\t}, function(error) {\n\t\t\t// console.log(error);\n\t\t\taddHidden(form, 'error', error.code);\n\t form.unbind().submit();\n\t\t});\n}", "static authenticate(email, password) {\n const query = 'SELECT id, password, is_disabled FROM Members WHERE email = $1 LIMIT 1';\n\n return db.oneOrNone(query, [email]).then(user => {\n if (!user) {\n throw new Error('Incorrect username or password.');\n }\n\n if (user.password === password) {\n // User account disabled.\n if (user.is_disabled) {\n throw new Error('User account disabled.');\n }\n\n // Successful.\n return user.id;\n } else {\n // Wrong password.\n throw new Error('Incorrect username or password.');\n }\n });\n }", "async TestRightEmailOrPass(){\n const user_obj = {id :4, Lastname : \"Ibrahim\", Firstname : \"Eshraq\", email : \"ahmedH@gmail.com\", password : \"eshu13\" \n , dateOfBirth : '1997/11/27', createdAt: '2020-04-02 10:35:00', modifiedAt : '2020-04-02 10:35:00', role : 1};\n const response = await user.validUserWithIncryptedPassword(user_obj.email,user_obj.password).then(async function(result){\n if(result != null){\n console.log(result)\n\n console.log(\"\\x1b[32m%s\\x1b[0m\",\"TestRightEmailOrPass Passed\");\n }else{\n console.log(\"\\x1b[31m%s\\x1b[0m\",\"TestRightEmailOrPass Failed\");\n }\n \n });\n }", "validateCredentials() {\n Keyboard.dismiss();\n this.setState({ errors: \"\" });\n let valid = false;\n if (!(this.state.email.match(/^([\\w.%+-]+)@([\\w-]+\\.)+([\\w]{2,})$/i))) {\n this.refs.toast.show(\"Please enter a valid email\")\n }\n else if (this.state.password.length < 8) {\n this.refs.toast.show(\"Password should be at least of 8 characters\")\n } else {\n this.signinUser();\n }\n }", "function passwordCheck(form){\r\n var p1=signup.pass.value.trim();\r\n var p2=signup.repass.value.trim();\r\n var errors= document.querySelector(\".errmessage\");\r\n var charstring =\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\r\n var chars= \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\r\n var numstring =\"0123456789\";\r\n var passAlpha=false; \r\n var passNum=false; \r\n var passChar=false; \r\n\r\n\r\n if(p1.length<8){\r\n clear();\r\n errors.innerHTML+= \"<p>* Password must be at least 8 characters long. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n\r\n if(chars.indexOf(p1.substr(0,1))>=0){\r\n passChar=true;\r\n }\r\n if(!passChar){\r\n clear();\r\n errors.innerHTML+= \"<p>* Password must begin with a character. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n\r\n for(var i=0; i<p1.length; i++){\r\n clear(); \r\n if(charstring.indexOf(p1.substr(i,1))>=0){\r\n passAlpha=true;\r\n }\r\n }\r\n\r\n if(!passAlpha){\r\n errors.innerHTML+= \"<p>* Password must have at least one upper case letter. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n\r\n for(var i=0; i<p1.length; i++){\r\n clear(); \r\n if(numstring.indexOf(p1.substr(i,1))>=0){\r\n passNum=true;\r\n }\r\n }\r\n if(!passNum){\r\n errors.innerHTML+= \"<p>* Password must have at least one number. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n \r\n if(p2!=\"\" && p1!=p2){\r\n clear(); \r\n errors.innerHTML+= \"<p>* Passwords do not match! <p>\";\r\n signup.repass.focus();\r\n return false; \r\n }\r\n\r\n return true; \r\n}", "async function check() {\n if (resetpw == \"reset\") {\n pw = bcrypt.hashSync(lname.toLowerCase() + hp.slice(0, 4), 10); // resets password to staff's last name and first 4 numbers of their phone number\n } else {\n User.findOne({\n where: {\n staffId: req.params.id\n }\n }).then((user) => {\n pw = user.password // retrieves original password\n }).catch((err) => {\n console.log(err);\n res.redirect('/staff/error');\n });\n }\n }", "function passPatternValid() {\n var errors = document.querySelector(\"#errors\");\n var pass = document.querySelector(\"#pass\").value;\n var password = document.querySelector(\"#secondPass\").value;\n if(pass !== password) {\n errorMessage(\"<p>Please enter a valid Password with 8 to 16 characters one upper case letter and one number!</p>\");\n return false;\n }\n return true;\n }", "function AndIEnterAnInvalidCode() {\n cy.get(\"input[name=code]\").type(\"wrong\");\n cy.get(\"input[name=password]\").type(Cypress.env(\"validTrustAdminPassword\"));\n }", "function validate_form(){\n\n\t//FORM FIELDS\n\t var first_name = document.getElementById('first_name').value;\n\t var last_name = document.getElementById('last_name').value;\n\t var email = document.getElementById('email').value;\n \t var password = document.getElementById('password').value;\n\t var password2 = document.getElementById('password2').value;\n\t\n\t//PASSWORD REG EXP CHECK\n\t var password_check = /^(?=.*[0-9])(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{7,15}$/;\n\t\n\n\t//CHECK FOR EMPTY FIELDS\n\tif(\n\t\tfirst_name == \"\" ||\n\t\tlast_name == \"\" ||\n\t\temail == \"\" ||\n\t\tpassword == \"\" ||\n\t\tpassword2 == \"\"\n\t ) \n\t\t{ \n\t\t\tfirst_name = \"First Name\"\n\t\t\tdocument.getElementById('error_msg').innerHTML = \"Fields cannot be empty\";\n\t\t\tdocument.getElementById(\"error_msg\").focus();\n\t\t\treturn false;\n\t\t}else{}\n\t\n\t//CHECK FOR VALID EMAIL\n\tif(/(.+)@(.+){2,}\\.(.+){2,}/.test(email)) \n\t{}else{\n\t\tdocument.getElementById('error_msg').innerHTML = \"Email provided is not valid\";\n\t\tdocument.getElementById(\"error_msg\").focus();\n return false\n\t}\n\n\t//CHECK FOR STRONG PASSWORD ENTRY\n\tif(password.length >= 8)\n\t{ \n\t\tif(password.match(password_check)){}\n\t\telse{\n\t\tdocument.getElementById('error_msg').innerHTML = \"Password must contain at least an Uppercase, Lowercase and a Special Character. E.g. <b>ABcDef$G@ </b><br><i><b>This ensures tighter Security</b></i>\";\n\t\tdocument.getElementById(\"error_msg\").focus();\n return false;}\n }else{\n\t\tdocument.getElementById('error_msg').innerHTML = \"Password must be up to 8 characters long.<br><i><b>This ensures tighter Security</b></i>\";\n\t \tdocument.getElementById(\"error_msg\").focus();\n\t\treturn false;\n\t}\n\t\n \t//CHECK FOR PASSWORD MATCH\n\tif(password != password2) \n\t{ \n\t\tdocument.getElementById('error_msg').innerHTML = \"Passwords do not match,\";\n\t\tdocument.getElementById(\"error_msg\").focus();\n return false;\n }else{return true;}\n}", "async forgotPassword(req, res) {\n try {\n if (req.body.role == \"Job-Provider\") schema = JobProviderDetails;\n if (req.body.role == \"Job-Seeker\") schema = JobSeekerDetails;\n if (!req.body.role) return res.send({error:\"Incorrect Credentials\"})\n \n const user = await schema.findOne({ email: req.body.email, aadhaarNumber: req.body.aadhaarNumber, isVerified: true });\n if (!user) return res.send({error:\"Incorrect Credentials or kindly activate your account by visiting the link that has been sent to you\"})\n if (user.isBlocked) return res.status(401).send({error:`${user.name}, you are blocked for the misuse of SeasonalEmployment.com.....`});\n \n const rawPassword = (Math.floor(Math.random() * 100000000)).toString();\n const hashedPassword = await hash(rawPassword, 10)\n user.password = hashedPassword;\n user.save();\n forgotPasswordMailing(req.body.email, rawPassword)\n return res.status(202).send({message:\"A System generated password has been sent to your email successfully. Login with that password and edit your password in profile section if needed\"})\n } catch (err) {\n return res.status(500).send({error:err.message})\n }\n }", "function validateUser()\n\t{\n\t\tvar msg = '';\n\t\tif($scope.password != $scope.confirm_password){\n\t\t\tmsg = msg + \"\\n\"+$i18next.t(\"validate_confirm_password\");\n\t\t}\n\t\tif($scope.password.length < 8){\n\t\t\tmsg = msg + \"\\n\"+$i18next.t(\"validate_password\");\n\t\t}\n\t\tif($scope.username.length <4){\n\t\t\tmsg = msg + \"\\n\"+$i18next.t(\"validate_username\");\n\t\t}\n\t\tif (!/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test($scope.email)){\n\t\t\tmsg = msg + \"\\n\"+$i18next.t(\"validate_email\");\n\t\t}\n\t\treturn msg;\n\t}", "function checkPasswordMatch() {\n\t\tvar password = $(\"#txtNewPassword\").val();\n\t\tvar confirmPassword = $(\"#txtConfirmPassword\").val();\n\n\t\tif (password != confirmPassword) {\n\t\t\t$(\"#txtConfirmPassword\").removeClass(\"border-success\");\n\t\t\t$(\"#txtConfirmPassword\").addClass(\"border-danger\");\n\t\t\t$(\"#divCheckPasswordMatch\").html(\"<i><small class='text-danger'>Password Harus Sama</small></i>\");\n\t\t\t$('#tbhUser').prop('disabled', true);\n\t\t} else {\n\t\t\t$(\"#txtConfirmPassword\").removeClass(\"border-danger\");\n\t\t\t$(\"#txtConfirmPassword\").addClass(\"border-success\");\n\t\t\t$(\"#divCheckPasswordMatch\").html(\"<i><small class='text-success'>Password Cocok</small></i>\");\n\t\t\t$('#tbhUser').prop('disabled', false);\n\t\t}\n\t}", "function validate() {\n const password = document.getElementById(\"password-register\").value;\n const confirmPassword = document.getElementById(\"confirm-password-register\").value;\n if(password != confirmPassword){\n document.getElementById(\"passwordChangeMsg\").innerHTML = \"Password must be same !\";\n return false;\n }else{\n document.forms[\"form-password-recovery\"].submit();\n }\n}", "verifySignUp(empID) {\n let passInput = document.getElementById('passNew');\n let confirmInput = document.getElementById('passConfirm');\n\n //If the ID and/or password input fields have been deleted, inform the user\n if (passInput === null || passInput.value === \"\" || confirmInput === null || confirmInput.value === \"\") {\n this.setState({errorMsg: \"Employee ID and Password fields cannot be blank.\"});\n }\n\n else {\n let passValue = passInput.value;\n let confirmValue = confirmInput.value;\n\n //The set of password criteria to check for\n let length = passValue.length;\n let hasLower = false; ///[a-z]/.test(passValue);\n let hasUpper = false; ///[A-Z]/.test(passValue);\n let hasNumber = false; ///[0-9]/.test(passValue);\n let hasWhitespace = false; ///[\\s]/.test(passValue);\n\n //Iterate through the password to make sure it meets the strength criteria\n for (let i = 0; i < length; i++) {\n\n if (passValue[i] >= 'a' && passValue[i] <= 'z' && !hasLower) {\n hasLower = true;\n }\n\n if (passValue[i] >= 'A' && passValue[i] <= 'Z' && !hasUpper) {\n hasUpper = true;\n }\n\n if (passValue[i] >= '0' && passValue[i] <= '9' && !hasNumber) {\n hasNumber = true;\n }\n\n if (passValue[i] === ' ' && !hasWhitespace) {\n hasWhitespace = true;\n }\n }\n\n //Verify the password on each criteria\n if (length < 8 || !hasLower || !hasUpper || !hasNumber || hasWhitespace) {\n this.setState({errorMsg: \"The password provided does not meet the required strength criteria.\"});\n }\n\n //Else if the initial password and the confirm password don't match, inform the user\n else if (passValue !== confirmValue) {\n this.setState({errorMsg: \"The provided passwords do not match. Please re-enter the new password.\"});\n }\n\n //Else, get the user's name and access level and sign them in\n else {\n let userName = getUserName(empID);\n let userType = getUserType(empID);\n\n this.props.signIn(userName, userType);\n }\n }\n }", "function AndIEnterAnInvalidCode() {\n cy.get(\"input[name=code]\").type(\"wrong\");\n cy.get(\"input[name=password]\").type(Cypress.env(\"validAdminPassword\"));\n }", "function passwordCheckOld() {\n if (\n document.querySelector(\".modifyPassword_form-password input\").value ==\n userObject.password\n ) {\n passwordCheckMatch();\n } else {\n document.querySelector(\".modifyPassword_paragraph-alert\").style.display =\n \"block\";\n document.querySelector(\".modifyPassword_paragraph-alert\").textContent =\n \"Wrong old password\";\n }\n}", "async isPasswordChangeValid() {\n const { t, currentPwdHash, generateAlert } = this.props;\n const currentPasswordHash = await getPasswordHash(this.state.currentPassword);\n if (!isEqual(currentPwdHash, currentPasswordHash)) {\n return generateAlert('error', t('incorrectPassword'), t('incorrectPasswordExplanation'));\n } else if (this.state.newPassword === this.state.currentPassword) {\n return generateAlert('error', t('oldPassword'), t('oldPasswordExplanation'));\n }\n this.passwordFields.checkPassword();\n }", "validateLogin(username, password) {\n\t\tconsole.log(\"Validating input\");\n\t\tif (!username | !password) throw \"Must input an email and password!\";\n\t\tif (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(username)) throw \"You entered an invalid email!\"\n\t}", "function comparePassword() {\n\t\tvar newPassword = $(\"#txtNewPassword\").val();\n\t\tvar newPasswordConfirm = $(\"#txtNewPasswordConfirm\").val();\n\t\t// compare\n\t\tif (newPassword == newPasswordConfirm) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function checkPasswords() {\n\n var field_new_pass = document.getElementById('new_password').value;\n var field_conf_new_pass = document.getElementById('conf_new_password').value;\n\n if(field_new_pass != field_conf_new_pass) {\n window.alert('Confirmation of password was failed');\n return false;\n }\n else if(field_new_pass != ''){\n window.alert('Success');\n }\n}", "function check_field_password(password, confirm_password) {\n if (password != confirm_password) {\n set_message('error', 'Passwords don\\'t match. Please try again.');\n clear_message();\n return true;\n }\n return false;\n}", "disableSubmit() {\n const { authError } = this.props\n const { error, email, password, passwordConfirm } = this.state\n let formNotCompleted = email.length === 0 && password.length === 0 && passwordConfirm.length === 0\n let formNotValid = (authError && authError.length !== 0) || error.length !== 0\n let wrongPassword = password !== passwordConfirm\n return formNotCompleted || formNotValid || wrongPassword\n }", "reauthenticate(password, loginSuccess, loginError) {\n // fetch the current email\n let email = localStorage.getItem('email') \n\n this.login(email, password, loginSuccess, loginError);\n }", "function passwordCheck (pass, email) {\n for (let key in users) {\n if (emailExist(email)) {\n if (users[key].password === pass) {\n return true\n }\n }\n } return false\n}", "function checkPasswordMatch() {\n var password = $(\"#password\").val();\n var confirmPassword = $(\"#confirmPassword\").val();\n \n if (password != confirmPassword)\n $(\"#divCheckPasswordMatch\").html(\"Passwords do not match!\");\n else\n $(\"#divCheckPasswordMatch\").html(\"Passwords match.\");\n }", "function handleChangeEmail(req, res) {\n var name = req.body.name;\n var password = req.body.password;\n var email = req.body.email;\n\n if (typeof name !== \"string\" ||\n typeof password !== \"string\" ||\n typeof email !== \"string\") {\n res.send(400);\n return;\n }\n\n if (!$util.isValidEmail(email) && email !== \"\") {\n sendPug(res, \"account-edit\", {\n errorMessage: \"Invalid email address\"\n });\n return;\n }\n\n db.users.verifyLogin(name, password, function (err, _user) {\n if (err) {\n sendPug(res, \"account-edit\", {\n errorMessage: err\n });\n return;\n }\n\n db.users.setEmail(name, email, function (err, _dbres) {\n if (err) {\n sendPug(res, \"account-edit\", {\n errorMessage: err\n });\n return;\n }\n Logger.eventlog.log(\"[account] \" + req.realIP +\n \" changed email for \" + name +\n \" to \" + email);\n sendPug(res, \"account-edit\", {\n successMessage: \"Email address changed.\"\n });\n });\n });\n}", "function checkPassword(password, passconf) {\n\tvar password = $(password);\n\tvar passconf = $(passconf);\n\tif (password.val().trim() == passconf.val().trim()) {\n\t\tpassconf.get(0).setCustomValidity(\"\"); // All is well, clear error message\n\t\treturn true;\n\t} else {\n\t\tpassconf.get(0).setCustomValidity(ERR_PASSWORD_MISMATCH);\n\t\treturn false;\n\t}\n}", "function validateEmail(){\n\tvar re = /^([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$/i;\n var result = re.test($.txtfieldMail.value);\n if(result == 0){\n \t$.txtfieldMail.value = \"\";\n \tutilities.showAlert(Alloy.Globals.selectedLanguage.forgotUsername,Alloy.Globals.selectedLanguage.invalidmail,function(){});\n }\n}", "checkPasswordValidity() {\n let self = this;\n if (self.userRegister.password === self.userRegister.retypedPassword) {\n self.registerForm.retypedPassword.$setValidity('notMatchingPassword', true);\n return;\n }\n self.registerForm.retypedPassword.$setValidity('notMatchingPassword', false);\n }", "function isNewPasswordValid (body) {\n if ('password' in body &&\n 'passwordConfirmation' in body &&\n validator.isLength(body['password'] + '', { min: 7, max: parseInt(maxPasswordVarcharAmount) }) &&\n validator.isLength(body['passwordConfirmation'] + '', { min: 7, max: parseInt(maxPasswordVarcharAmount) }) &&\n validator.equals(body['password'], body['passwordConfirmation'])) {\n console.log('password ' + body['password'] + ' pass')\n return true\n } else {\n console.log('password ' + body['password'] + ' fail')\n return false\n }\n}", "function validatePasswordFields(context) {\r\n var pwds = context.parentNode.getElementsByClassName('repeat_password');\r\n \r\n\r\n\tif(pwds[0].value !== pwds[1].value) {\r\n\r\n pwds[0].addClass('error').value = \"\";\r\n pwds[1].addClass('error').value = \"\";\r\n \r\n return false;\r\n }\r\n\t\r\n return true;\r\n}", "checkPassword(originalPwd){\n return bcrypt.compareSync(originalPwd, this.password);\n }", "function checkPass() {\n var pass = \"\";\n $(opts['classname']).each(function(i){\n if (i == 0) {\n pass = $(this).val();\n } else {\n if ($(this).val() != pass) {\n if (opts['messages']['confirmation']) {\n errors.push (opts['messages']['confirmation']);\n } else {\n errors.push (opts['title'] + ' confirmation mismatch');\n }\n }\n }\n });\n }", "function comparePwd(password, confPwd)\r\n{\r\n\t if(password != confPwd)\r\n\t {\r\n\t\t alert(\"Re-type the New Password in Confirm Password field\");\r\n\t\t $('#txtConfPwd').focus();\r\n\t\t return false;\r\n\t }\r\n\t else\r\n\t {\r\n\t\t return true; \r\n\t }\r\n}", "function needsPassword() {\n // no password is set neither in the user table nor in the staged record.\n // the user must pick a password\n res.json({\n success: true,\n email: email,\n needs_password: true\n });\n }", "function passwordChecker() {\n password_value = password.value;\n\n if (password_value.length < 8) {\n errorMessage.innerText = \"Password is too short\";\n register.setAttribute(\"disabled\", \"disabled\");\n } else {\n if (password_value.match(/\\d/) === null) {\n errorMessage.innerText = \"Password must contain at least one number.\";\n register.setAttribute(\"disabled\", \"disabled\");\n } else {\n if (password_value.match(/[#%\\-@_&*!]/)) {\n errorMessage.innerText = \"\";\n passwordCompare();\n } else {\n errorMessage.innerText = \"Password must contain at least one special character: #%-@_&*!\";\n register.setAttribute(\"disabled\", \"disabled\");\n }\n\n }\n }\n}", "function checkPasswordOnLogin(email, pwd){\n \n //obtain the cookie and it splits the str with the ,'s\n user = getCookie(email).split(',');\n\n //returns if the passwords are the same so the user can access to his/her profile\n return user[1] === pwd\n}", "function loginFormValidate(){\r\n\tvar isValid = true;\r\n\tvar _userIDEmail = document.forms[\"loginForm\"][\"userIDEmail\"].value;\r\n\tvar _pass = document.forms[\"loginForm\"][\"pass\"].value;\r\n\t\r\n\t// ******** [START] User ID/Email validation ********\t\r\n if (_userIDEmail == \"\") {\r\n\t\tdocument.getElementById(\"userIDEmailMsg\").innerHTML = \"[E601] User ID / Email must be input!\";\t\t\t\t\r\n\r\n\t\tif(isValid){\r\n\t\t\tdocument.forms[\"loginForm\"][\"userIDEmail\"].focus();\r\n\t\t}\r\n isValid = false;\r\n }\t\r\n\t// ******** [END] User ID/Email validation ********\r\n\t\t\r\n\t// ******** [START] Password validation ********\r\n if (_pass == \"\") {\r\n\t\tdocument.getElementById(\"passMsg\").innerHTML = \"[E602] Password must be input!\";\t\t\t\t\r\n\t\t\r\n\t\tif(isValid){\r\n\t\t\tdocument.forms[\"loginForm\"][\"pass\"].focus(); \r\n\t\t}\r\n isValid = false;\r\n }\r\n\t\r\n\t/*\r\n\t\tCheck password format and character combination\r\n\t\trule 1 : Password length must be 8 - 20 characters\r\n\t\trule 2 : Password must contain at least 2 upper case characters\r\n\t\trule 3 : Password must contain at least 2 lower case characters\r\n\t\trule 4 : Password must contain at least 2 numeric characters\r\n\t\trule 5 : Password must contain at least 2 special characters\r\n\t*/\r\n\tif(_pass != \"\"){\r\n\t\tvar anUpperCase = /[A-Z]/;\r\n\t\tvar aLowerCase = /[a-z]/; \r\n\t\tvar aNumber = /[0-9]/;\r\n\t\tvar aSpecial = /[!|@|#|$|%|^|&|*|(|)|-|_]/;\r\n\t\tvar passValid = true;\r\n\t\t\r\n\t\tif(_pass.length < 8 || _pass.length > 20){\r\n\t\t\tdocument.getElementById(\"passMsg\").innerHTML = \"[E603] Password length must be 8 - 20 characters!\";\t\r\n\t\t\tdocument.forms[\"loginForm\"][\"pass\"].value=\"\";\r\n\t\t\t\r\n\t\t\tif(isValid){\r\n\t\t\t\tdocument.forms[\"loginForm\"][\"pass\"].focus(); \r\n\t\t\t}\r\n\t\t\tisValid = false;\r\n\t\t\tpassValid = false;\r\n\t\t}\r\n\r\n\t\tvar numUpper = 0;\r\n\t\tvar numLower = 0;\r\n\t\tvar numNums = 0;\r\n\t\tvar numSpecials = 0;\r\n\t\tfor(var i=0; i<_pass.length; i++){\r\n\t\t\tif(anUpperCase.test(_pass[i])){\r\n\t\t\t\tnumUpper++;\r\n\t\t\t}else if(aLowerCase.test(_pass[i])){\r\n\t\t\t\tnumLower++;\r\n\t\t\t}else if(aNumber.test(_pass[i])){\r\n\t\t\t\tnumNums++;\r\n\t\t\t}else if(aSpecial.test(_pass[i])){\r\n\t\t\t\tnumSpecials++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(numUpper < 2 && passValid){\r\n\t\t\tdocument.getElementById(\"passMsg\").innerHTML = \"[E604] Password must contain at least 2 upper case characters!\";\r\n\t\t\tdocument.forms[\"loginForm\"][\"pass\"].value=\"\";\r\n\t\t\t\r\n\t\t\tif(isValid){\r\n\t\t\t\tdocument.forms[\"loginForm\"][\"pass\"].focus(); \r\n\t\t\t}\r\n\t\t\tisValid = false;\r\n\t\t\tpassValid = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(numLower < 2 && passValid){\r\n\t\t\tdocument.getElementById(\"passMsg\").innerHTML = \"[E605] Password must contain at least 2 lower case characters!\";\r\n\t\t\tdocument.forms[\"loginForm\"][\"pass\"].value=\"\";\r\n\t\t\t\r\n\t\t\tif(isValid){\r\n\t\t\t\tdocument.forms[\"loginForm\"][\"pass\"].focus(); \r\n\t\t\t}\r\n\t\t\tisValid = false;\r\n\t\t\tpassValid = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(numNums < 2 && passValid){\r\n\t\t\tdocument.getElementById(\"passMsg\").innerHTML = \"[E606] Password must contain at least 2 numeric characters!\";\r\n\t\t\tdocument.forms[\"loginForm\"][\"pass\"].value=\"\";\r\n\t\t\t\t\r\n\t\t\tif(isValid){\r\n\t\t\t\tdocument.forms[\"loginForm\"][\"pass\"].focus(); \r\n\t\t\t}\r\n\t\t\tisValid = false;\r\n\t\t\tpassValid = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(numSpecials <2 && passValid){\r\n\t\t\tdocument.getElementById(\"passMsg\").innerHTML = \"[E607] Password must contain at least 2 special characters!\";\t\r\n\t\t\tdocument.forms[\"loginForm\"][\"pass\"].value=\"\";\r\n\t\t\t\r\n\t\t\tif(isValid){\r\n\t\t\t\tdocument.forms[\"loginForm\"][\"pass\"].focus(); \r\n\t\t\t}\r\n\t\t\tisValid = false;\r\n\t\t\tpassValid = false;\r\n\t\t}\t\r\n\t}\t\r\n\t// ******** [END] Password validation ********\t\t\t\r\n\treturn isValid;\r\n}", "function checkCreds() {\n checkEmail();\n return false;\n }", "validatePassword () {\n\t\tif (!this.attributes.password) { return; }\n\t\tlet error = this.userValidator.validatePassword(this.attributes.password);\n\t\tif (error) {\n\t\t\treturn { password: error };\n\t\t}\n\t}", "function validatePassword() {\n\n //Match 6 to 15 character string with at least one upper case letter, one lower case letter, and one digit\n var passwordRegex = /^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{6,15}$/;\n\n //password\n if($('#txt-password').val().match(passwordRegex)){\n $('#txt-password').css('border-color', 'green');\n } else {\n $('#txt-password').css('border-color', 'red');\n }\n\n //passwordConfirm\n if($('#txt-passwordConfirm').val().match(passwordRegex) && $('#txt-passwordConfirm').val() == $('#txt-password').val()) {\n $('#txt-passwordConfirm').css('border-color', 'green');\n } else {\n $('#txt-passwordConfirm').css('border-color', 'red');\n }\n\n //Enable submit, when fields are correctly filled out\n if($('#txt-password').val().match(passwordRegex) && $('#txt-passwordConfirm').val().match(passwordRegex)\n && $('#txt-password').val() == $('#txt-passwordConfirm').val()) {\n $('#btn-changePassword-submit').prop('disabled', false);\n } else {\n $('#btn-changePassword-submit').prop('disabled', true);\n }\n }", "function validate_password()\n {\n const icon = DOM.new_password_validation_icon;\n const password = DOM.new_password_input.value;\n\n icon.style.visibility = \"visible\";\n\n if (security.is_valid_password(password))\n {\n icon.src = \"/icons/main/correct_white.svg\";\n return true;\n }\n else\n {\n icon.src = \"/icons/main/incorrect_white.svg\";\n return false;\n }\n }", "function checkPassword() {\n\tvar password = document.getElementById(\"password\").value;\n\tvar retypePassword = document.getElementById(\"retypePassword\").value;\n\tvar hasNumber = /\\d/;\n\tvar hasSpecialCharacter = /\\W/;\n\t//Password must contain at least one number and one special character\n\tif ((password === retypePassword) && (hasNumber.test(password)) && (hasSpecialCharacter.test(password))) {\n\t\tdocument.getElementById(\"passwordError\").innerHTML = \"\";\n\t\tdocument.getElementById(\"retypePasswordError\").innerHTML = \"\";\n\t}\n\telse {\n\t\tdocument.getElementById(\"passwordError\").innerHTML = \"Password must match, have a number and a special character.\";\n\t\tdocument.getElementById(\"retypePasswordError\").innerHTML = \"Retyped password must match, have a number and a special character.\";\n\t}\n}", "function verify() {\n var user = document.getElementById(\"alias\").value;\n var passw = document.getElementById(\"pass\").value;\n if (user == \"ambuj\" && passw == \"kumar\") {\n alert(\"The user \" + user + \" is verified.\");\n } else {\n alert(\"The user is invalid.\");\n }\n}", "function authPasswordAndConfirm($form) {\n var $passwordGroup = $form.find('.password-form-group');\n var $passwordInput = $passwordGroup.find('input');\n var $confirmGroup = $form.find('.confirm-form-group');\n var $confirmInput = $confirmGroup.find('input');\n\n var password = $passwordInput.val();\n if (!validPassword(password)) {\n $passwordGroup.addClass('has-error');\n $confirmGroup.addClass('has-error');\n display_alert(\"Password must be at least 16 characters.\", \"error\")\n\n return false; // don't submit form\n }\n if ($confirmInput.val() != password) {\n $passwordGroup.addClass('has-error');\n $confirmGroup.addClass('has-error');\n display_alert(\"Passwords do not match\", \"error\")\n\n return false; // don't submit form\n }\n\n $form.find('.hidden-password').val(authSecret(password));\n return true; // submit form\n }", "function verify_register()\n{\n\tvar name = document.getElementById(\"user_register_name\").value;\n\tvar email = document.getElementById(\"user_register_email\").value;\n\tvar password = document.getElementById(\"user_register_password\").value;\n\t\n\tvar email_format = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z]{2,4})+$/;\n\tvar name_format = /^\\w+$/;\n\tvar password_format = /^\\w{5,20}$/;\n\t// Verify input name\n\tif (name === \"\")\n\t{\n\t\tdocument.getElementById(\"user_register_name_message\").innerHTML = \"Name cannot be empty!\";\n\t}\n\telse if (!name_format.test(name)) \n\t{\n\t\tdocument.getElementById(\"user_register_name_message\").innerHTML = \"Name can only contain letters, numbers and underline.\";\n\t} \n\telse\n\t{\n\t\tdocument.getElementById(\"user_register_name_message\").innerHTML = \"\";\n\t}\n\t// Verify input email\n\tif (email === \"\")\n\t{\n\t\tdocument.getElementById(\"user_register_email_message\").innerHTML = \"E-mail cannot be empty!\";\n\t}\n\telse if (!email_format.test(email)) \n\t{\n\t\tdocument.getElementById(\"user_register_email_message\").innerHTML = \"The format of E-mail is invalid.\";\n\t} \n\telse\n\t{\n\t\tdocument.getElementById(\"user_register_email_message\").innerHTML = \"\";\n\t}\n\t// Verify input password\n\tif (password === \"\")\n\t{\n\t\tdocument.getElementById(\"user_register_password_message\").innerHTML = \"Password cannot be empty!\";\n\t}\n\telse if (!password_format.test(password)) \n\t{\n\t\tdocument.getElementById(\"user_register_password_message\").innerHTML = \"Password can only contain 5-20 letters, numbers and underline.\";\n\t} \n\telse\n\t{\n\t\tdocument.getElementById(\"user_register_password_message\").innerHTML = \"\";\n\t}\n\n\tvar name = document.getElementById(\"enterprise_register_name\").value;\n\tvar email = document.getElementById(\"enterprise_register_email\").value;\n\tvar password = document.getElementById(\"enterprise_register_password\").value;\n\t\n\tvar email_format = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z]{2,4})+$/;\n\tvar name_format = /^\\w+$/;\n\tvar password_format = /^\\w{5,20}$/;\n\t// Verify input name\n\tif (name === \"\")\n\t{\n\t\tdocument.getElementById(\"enterprise_register_name_message\").innerHTML = \"Name cannot be empty!\";\n\t}\n\telse if (!name_format.test(name)) \n\t{\n\t\tdocument.getElementById(\"enterprise_register_name_message\").innerHTML = \"Name can only contain letters, numbers and underline.\";\n\t} \n\telse\n\t{\n\t\tdocument.getElementById(\"enterprise_register_name_message\").innerHTML = \"\";\n\t}\n\t// Verify input email\n\tif (email === \"\")\n\t{\n\t\tdocument.getElementById(\"enterprise_register_email_message\").innerHTML = \"E-mail cannot be empty!\";\n\t}\n\telse if (!email_format.test(email)) \n\t{\n\t\tdocument.getElementById(\"enterprise_register_email_message\").innerHTML = \"The format of E-mail is invalid.\";\n\t} \n\telse\n\t{\n\t\tdocument.getElementById(\"enterprise_register_email_message\").innerHTML = \"\";\n\t}\n\t// Verify input password\n\tif (password === \"\")\n\t{\n\t\tdocument.getElementById(\"enterprise_register_password_message\").innerHTML = \"Password cannot be empty!\";\n\t}\n\telse if (!password_format.test(password)) \n\t{\n\t\tdocument.getElementById(\"enterprise_register_password_message\").innerHTML = \"Password can only contain 5-20 letters, numbers and underline.\";\n\t} \n\telse\n\t{\n\t\tdocument.getElementById(\"enterprise_register_password_message\").innerHTML = \"\";\n\t}\n}", "function passwordMatch(password) {\n return password === admin.password;\n}", "function checkUserDetail()\n{\nvar goodname;\nvar theFields=new Array(\"admin_id\",\"oldpassword\",\"password\",\"repassword\");\nvar theCaption=new Array(\"user name\",\"old password\",\"password\",\"re password\");\nfor(var i=0;i<4;i++){\n\tvar thevalue=document.getElementById(theFields[i]).value;\n\t//alert(thevalue);\n\tthevalue=rm_trim(thevalue);\n\tif(thevalue==''){\n\t\t\n\t\talert(\"Please enter \"+theCaption[i]);\n\t\tdocument.getElementById(theFields[i]).focus();\n\t\treturn false;\n\t}\n}\n\n\tvar p1=document.getElementById(\"password\").value;\n\tvar p2=document.getElementById(\"repassword\").value;\n\tif(document.getElementById(theFields[2]).value != document.getElementById(theFields[3]).value){\n\t\talert(\"Password not matched\");\n\t\tdocument.getElementById(theFields[2]).focus();\n\t\treturn false;\n\t}\n\n\tif((document.getElementById(theFields[2]).value).length < 6 || (document.getElementById(theFields[3]).value).length < 6){\n\t\talert(\"password should be 6 charactor long\")\n\t\tdocument.getElementById(theFields[2]).focus();\n\t\treturn false;\n\t}\n\t\t\t\t\t\t\nreturn true;\t\t\n}", "onupdateConfirmPassword(event) {\n this.password = event.target.value;\n this.passwordValidationState = '';\n }", "function setPswd (email, passwordold, passwordnew, callback) {\n authUsr(email, passwordold, function(e, r) {\n if (e) return callback(new Error(\"Password was wrong\"));\n if (r) {\n log(\"Update password for \" + email + \"from \" + passwordold + \" to \" + passwordnew);\n var salt = crypto.randomBytes(128).toString('base64');\n \n hash(passwordnew, salt, function(err, hashedPassword){\n if (err) throw err;\n credentials = {\"salt\": salt, \"password\": hashedPassword, \"verified\": r.verified}\n //TODO: Update log using a log object paradigm (log.js)\n\n client.HSET(NS+email, \"credentials\", JSON.stringify(credentials), callback);\n });\n } else {\n return callback(new Error(\"Password was wrong\"));\n };\n });\n}", "recoverPassword({ Bert }, { email }) {\n // Call forgot password procedure\n Accounts.forgotPassword({\n email,\n }, (error) => {\n if (error) {\n Bert.alert(error.reason, 'warning');\n } else {\n Bert.alert('Check your inbox for a reset link!', 'success');\n }\n });\n }", "function validatePassword(pw)\n{\n if(pw == \"********\") // indicates password has not been changed\n {\n return(true);\n }\n else if(pw.length < 6)\n {\n return(\"Password must be at least 6 characters\");\n }\n else if(hasNumbers(pw)==false)\n {\n return(\"Password must contain at least two digits\");\n }\n else\n {\n return(true);\n }\n}", "function validatePasswordForm(){\n\tvar old_password = document.getElementById(\"old_password\");\n\tvar oldPasswordError = document.getElementById(\"oldPasswordError\");\n\tvar new_password = document.getElementById(\"new_password\");\n\tvar newPasswordError = document.getElementById(\"newPasswordError\");\n\tvar new_password_confirmation = document.getElementById(\"new_password_confirmation\");\n\tvar passwordConfirmationError = document.getElementById(\"passwordConfirmationError\");\n\n\n\tif(old_password.value.trim().length < 1){\n\t\told_password.focus();\n\t\toldPasswordError.innerHTML = \"Old password field can not be empty\";\n\t\told_password.style.border=\"1px solid red\";\n\t\tevent.preventDefault();\n\t}else if(old_password.value.trim().length > 60){\n\t\told_password.focus();\n\t\toldPasswordError.innerHTML = \"Too long password\";\n\t\told_password.style.border=\"1px solid red\";\n\t\tevent.preventDefault();\n\t}else{\n\t\toldPasswordError.innerHTML = \"\";\n\t\told_password.style.border=\"1px solid #efefef\";\n\t}\n\n// new pass\n\tif(new_password.value.trim().length < 1){\n\t\tnew_password.focus();\n\t\tnewPasswordError.innerHTML = \"New password field can not be empty\";\n\t\tnew_password.style.border=\"1px solid red\";\n\t\tevent.preventDefault();\n\t}else if(new_password.value.trim().length > 0 && new_password.value.trim().length < 8 ){\n\t\tnew_password.focus();\n\t\tnewPasswordError.innerHTML = \"New password should be mininum 8 charachters\";\n\t\tnew_password.style.border=\"1px solid red\";\n\t\tevent.preventDefault();\n\t}\n\telse if(new_password.value.trim().length > 60){\n\t\tnew_password.focus();\n\t\tnewPasswordError.innerHTML = \"Too long password\";\n\t\tnew_password.style.border=\"1px solid red\";\n\t\tevent.preventDefault();\n\t}else if(old_password.value.trim() === new_password.value.trim()){\n\t\tnew_password.focus();\n\t\tnewPasswordError.innerHTML = \"Your new password should not be same as old password\";\n\t\tnew_password.style.border=\"1px solid red\";\n\t\tevent.preventDefault();\n\t}else if(new_password_confirmation.value.trim() !== new_password.value.trim()){\n\t\tnew_password.focus();\n\t\tnewPasswordError.innerHTML = \"Password confirmation does not match\";\n\t\tnew_password.style.border=\"1px solid red\";\n\t\tevent.preventDefault();\n\t}else{\n\t\tnewPasswordError.innerHTML = \"\";\n\t\tnew_password.style.border=\"1px solid #efefef\";\n\t}\t\n\n// confirmation pass\n\tif(new_password_confirmation.value.trim().length < 1){\n\t\tnew_password_confirmation.focus();\n\t\tpasswordConfirmationError.innerHTML = \"password confirmation field can not be empty\";\n\t\tnew_password_confirmation.style.border=\"1px solid red\";\n\t\tevent.preventDefault();\n\t}else{\n\t\tpasswordConfirmationError.innerHTML = \"\";\n\t\tnew_password_confirmation.style.border=\"1px solid #efefef\";\n\t}\n}", "function checkPasswordMatch() {\n const password = $(\"#password\").val();\n const confirmPassword = $(\"#password2\").val();\n const feedback = $(\"#divCheckPasswordMatch\");\n\n if (password !== confirmPassword) {\n feedback.html(\"Wachtwoorden zijn niet gelijk!\").removeClass('text-success').addClass('text-danger');\n return;\n }\n\n feedback.html(\"Wachtwoorden zijn gelijk.\").removeClass('text-danger').addClass('text-success');\n }", "function updatePassword() {\n if (!newpassword || !confirmpassword) {\n res.send({ \"message\": \"fill all entries\" });\n }\n else {\n if (newpassword != confirmpassword) {\n res.send({ \"mesaage\": \"pasword not match\" });\n }\n else {\n bcrypt.genSalt(10, (err, salt) => {\n bcrypt.hash(newpassword, salt, (err, hash) => {\n if (err) throw err;\n newpassword = hash;\n\n var sql = require('mssql');\n const pool = new sql.ConnectionPool({\n user: 'sa',\n password: 'abcd',\n server: 'DESKTOP-VOMOOC8',\n database: 'auth'\n })\n\n var conn = pool;\n conn.connect().then(function (err) {\n if (err) console.log(err);\n var request = new sql.Request(conn);\n var q1 = \"update auth set password = '\" + newpassword + \"' where email = '\" + email + \"'\";\n request.query(q1, function (err, response) {\n if (err) { res.send(err); }\n res.send({ \"mesaage\": \"password has been changed\" });\n });\n })\n\n });\n });\n }\n }\n }", "function checkPasswordMatch(input1 , input2){\n if(input1.value !== input2.value){\n showError(input2,'Password do not match');\n }\n}" ]
[ "0.69363123", "0.6887896", "0.6843431", "0.65083116", "0.65059584", "0.6496943", "0.64844275", "0.6482547", "0.6435437", "0.6409922", "0.64084536", "0.63846445", "0.6354864", "0.6302953", "0.6286257", "0.62448907", "0.62359786", "0.61888665", "0.6188254", "0.6170463", "0.61619985", "0.6161505", "0.6156363", "0.6129547", "0.611525", "0.61125433", "0.61082315", "0.6091386", "0.60895336", "0.6087067", "0.6079897", "0.60790586", "0.60774255", "0.6059761", "0.6038707", "0.6030538", "0.60303223", "0.6015276", "0.6013069", "0.6009144", "0.6004607", "0.5991007", "0.5990853", "0.5986868", "0.59854084", "0.5980795", "0.5973282", "0.597263", "0.5970101", "0.59670717", "0.5964927", "0.5964086", "0.59631306", "0.5959229", "0.59573096", "0.595196", "0.5950042", "0.5944083", "0.59320533", "0.5930088", "0.59253466", "0.59214276", "0.59199595", "0.5919014", "0.5913884", "0.59137523", "0.59135413", "0.59110975", "0.5907329", "0.59066767", "0.59035707", "0.5899762", "0.58988476", "0.5896141", "0.58952874", "0.5889442", "0.58878297", "0.5882903", "0.5881879", "0.58789325", "0.58787197", "0.58740455", "0.5873309", "0.58707833", "0.5865587", "0.58641064", "0.58624345", "0.5851754", "0.5850453", "0.5849124", "0.5847994", "0.5846317", "0.5846159", "0.5844577", "0.583953", "0.5837495", "0.5834177", "0.58333087", "0.5832929", "0.58320755", "0.58286554" ]
0.0
-1
Reference for box type (e.g. SKU or description)
getReference() { mustInherit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get type() {\n return typeof this._content == \"number\" ? exports.BlockType.Text :\n Array.isArray(this._content) ? this._content : this._content.type;\n }", "getType(){\n return \"Square\";\n }", "function getBlock(type) {\n switch (type) {\n case 'Radio':\n case 'Bool':\n return Radio;\n\n case 'Checkbox':\n return Checkbox;\n\n case 'Number':\n return Number;\n\n case 'Select':\n return Select;\n\n case 'Image':\n return Image;\n\n case 'Text':\n return Text;\n\n case 'Input':\n return Input;\n\n case 'Textarea':\n return Textarea;\n\n case 'Data':\n return Data;\n\n case 'Evaluation':\n return Evaluation;\n\n case 'FetchOrg':\n return FetchOrg;\n\n case 'Table':\n return Table;\n\n case 'Signature':\n return Signature;\n\n case 'Summary':\n return Summary;\n\n case 'Sum':\n return Sum;\n\n case 'Switch':\n return Switch;\n\n case 'Information':\n return Information;\n\n default:\n return null;\n }\n}", "getType() {}", "function createBox (box_type,size, scene) {\n var mat = new BABYLON.StandardMaterial(\"mat\", scene);\n var texture = new BABYLON.Texture(\"images/textures/box_atlas.png\", scene);\n mat.diffuseTexture = texture;\n var columns = 8; // 6 columns\n var rows = 8; // 4 rows\n var faceUV = new Array(6);\n\n switch (box_type) {\n case \"wood\":\n for (var i = 0; i < 6; i++) {\n faceUV[i] = new BABYLON.Vector4(6 / columns, 3 / rows, 7 / columns, 4 / rows);\n }\n break;\n case \"tnt\":\n var Ubottom_left = 3 / columns;\n var Vbottom_left = 3 / rows;\n var Utop_right = 4 / columns;\n var Vtop_right = 4 / rows;\n //select the face of the cube\n faceUV[0] = new BABYLON.Vector4(Utop_right, Vtop_right, Ubottom_left, Vbottom_left);\n faceUV[1] = new BABYLON.Vector4(Ubottom_left, Vbottom_left, Utop_right, Vtop_right);\n faceUV[2] = new BABYLON.Vector4(Utop_right, Vtop_right, Ubottom_left, Vbottom_left);\n faceUV[3] = new BABYLON.Vector4(Utop_right, Vtop_right, Ubottom_left, Vbottom_left);\n for (var i = 4; i < 6; i++) {\n faceUV[i] = new BABYLON.Vector4(4 / columns, 3 / rows, 5 / columns, 4 / rows);\n }\n\n\n break;\n }\n var box = BABYLON.MeshBuilder.CreateBox('box', {size:size,faceUV: faceUV}, scene);\n box.isPickable = true;\n box.material = mat;\n box.position = position;\n return box;\n }", "type() {\n return this._type.name;\n }", "get type() {}", "function Type() {}", "function Type() {\r\n}", "function getType() {\n if (interest.Koopprijs && !interest.Huurprijs) {\n return 'koop';\n } else {\n return 'huur';\n }\n }", "getType(){return this.__type}", "get type() { return this._type; }", "get type() { return this._type; }", "get type() { return this._type; }", "get type() {\n return this.startSide < this.endSide ? exports.BlockType.WidgetRange\n : this.startSide <= 0 ? exports.BlockType.WidgetBefore : exports.BlockType.WidgetAfter;\n }", "function Type() {\n}", "getType () {\n\t\treturn this.type;\n\t}", "getType() {\n\t\treturn this.type;\n\t}", "setType(type) { }", "getType()\n {\n return this.type;\n }", "getType() {\n return this._data.type;\n }", "get type () {\r\n\t\treturn this._type;\r\n\t}", "get type () {\r\n\t\treturn this._type;\r\n\t}", "function createBox()\n\t{\n\t\tbox = that.add('rect', {\n\t\t\tcolor: style.boxColor,\n\t\t\tborderWidth: style.borderWidth,\n\t\t\tborderColor: style.borderColor,\n\t\t\tdepth: that.depth\n\t\t}, fw.dockTo(that));\n\t}", "get_type_id( name ){ return this.names.get( name ); }", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "type() {\n return this.#type;\n }", "function UrdfBox(options) {\n this.dimension = null;\n this.type = UrdfTypes.URDF_BOX;\n\n // Parse the xml string\n var xyz = options.xml.getAttribute('size').split(' ');\n this.dimension = new Vector3({\n x : parseFloat(xyz[0]),\n y : parseFloat(xyz[1]),\n z : parseFloat(xyz[2])\n });\n}", "function UrdfBox(options) {\n this.dimension = null;\n this.type = UrdfTypes.URDF_BOX;\n\n // Parse the xml string\n var xyz = options.xml.getAttribute('size').split(' ');\n this.dimension = new Vector3({\n x : parseFloat(xyz[0]),\n y : parseFloat(xyz[1]),\n z : parseFloat(xyz[2])\n });\n}", "function getEditorType(type) {\n var types = {\n 4 : Slick.Editors.Date,\n 12 : Slick.Editors.Date,\n 16 : Slick.Editors.Checkbox,\n 1024 : Slick.Editors.Float,\n 5000 : Slick.Editors.SelectContact,\n 5001 : Slick.Editors.SelectContactSimple // without create new\n };\n\n if(types[type]) {\n return types[type];\n }\n //1024 - money\n return Slick.Editors.Text;\n }", "getType() {\n return this.type;\n }", "static get types() {\n return {\n PAWN: \"pawn\",\n BISHOP: \"bishop\",\n KNIGHT: \"knight\",\n ROOK: \"rook\",\n KING: \"king\",\n QUEEN: \"queen\"\n }\n }", "function getType() {\n if (result.Koopprijs && !result.Huurprijs) {\n return 'koop';\n } else {\n return 'huur';\n }\n }", "function boxmode() {\n mode = \"box\"\n}", "get type() {\n return this.getAsElem(0).getIf(\"type\");\n }", "get type() {\n return this.getAsElem(0).getIf(\"type\");\n }", "get type() {\n return this._type;\n }", "get type() {\n return this._type;\n }", "get type() {\n return this._type;\n }", "get type() {\n return this._type;\n }", "getType(){\n return \"Ellipse\";\n }", "get type () {\n let t = this.properties.geometry.type\n switch (this.properties.geometry.type) {\n case 'gml:MultiPolygonPropertyType':\n case 'gml:PolygonPropertyType':\n t='polygon';\n break;\n \n case 'gml:MultiLineStringPropertyType':\n case 'gml:LineStringPropertyType':\n t='polyline';\n break;\n\n case 'gml:MultiPointPropertyType':\n case 'gml:PointPropertyType':\n t='point';\n break; \n }\n\n return t\n \n }", "function _GetNodeType ( type ) {\n var type = GAME_OBJ[ type ];\n if (!type) return (null);\n\n // init if needed\n if (type.canvas) return (type);\n\n var w = type.width || SHADOW_W;\n var h = type.height || SHADOW_H;\n\n if (type.cwidth) {\n w = type.cwidth;\n h = type.cheight;\n }\n\n if (type.qv)\n {\n // var modify = false;\n if (type.qv === 256)\n {\n if (w > 256 || h > 256)\n {\n w = (w / 2) >> 0;\n h = (h / 2) >> 0;\n\n // modify = true;\n }\n }\n else if (type.qv === 1)\n {\n w = (w / 2) >> 0;\n h = (h / 2) >> 0;\n\n // modify = true;\n }\n\n /*\n if (modify)\n {\n // if (w % 2 === 0) w += 1;\n // if (h % 2 === 0) h += 1;\n\n if (!type.width) {\n type.width = w;\n type.height = h;\n }\n }\n */\n }\n\n // create a canvas for this element -- as big as it's requested dimensions\n var c = d.createElement ('canvas');\n c.width = w; c.height = h;\n type.canvas = c;\n\n return (type);\n }", "function Box(id, name, color, x, y) {\n\tthis.id = id;\n\tthis.name = name;\n\tthis.color = color;\n\tthis.x = x;\n\tthis.y = y;\n }", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "getType()\r\n {\r\n return \"Water\";\r\n }", "get type() {\n return this.getStringAttribute('type');\n }", "get type() {\n return this.getStringAttribute('type');\n }", "get type() {\n return this.getStringAttribute('type');\n }", "get type() {\n return this.getStringAttribute('type');\n }", "function Box() {\n this.x = 0;\n this.y = 0;\n this.w = 1; // default width and height?\n this.h = 1;\n this.fill = '#444444';\n this.sector = '0';\n this.pricenum = '0';\n this.state= 0;\n this.place= 0;\n this.line = 0;\n this.cell = 0;\n}", "function billType(leg) {\n\t\t\tvar str = \"House\";\n\t\t\tif (leg) {\n\t\t\t\tif (leg.billID ) {\n\t\t\t\t\tif ( leg.billType === \"s\" ) {\n\t\t\t\t\t\tstr = \"Senate\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn str;\n\t\t}", "function addBox(data) {\n \t// Store the type for later use\n var type = data.instantActionType;\n \n if (type === undefined) {\n // It's an account\n type = \"account\";\n }\n\n // Get the colour for the left hand box and the label descriptions\n var gradient = null;\n \n // Data differs based on type\n var amount = null;\n var contentLabel = null;\n var contentSubLabel = null;\n var accountDescription = null;\n var description = null;\n \n switch (type) {\n case \"bet\":\n amount = data.unitStake;\n if (amount < 5.01) {\n gradient = \"bggrey\";\n } else if (amount < 15.01) {\n gradient = \"bggrey\";\n } else if (amount < 25.01) {\n gradient = \"bggrey\";\n } else {\n gradient = \"bggold\";\n }\n \n gradient = \"bggrey\";\n \n contentLabel = \"£\" + amount;\n contentSubLabel = data.transactionSubTypeDescription;\n accountDescription = data.accountDescription;\n description = data.description;\n break;\n case \"account\":\n gradient = \"bggreen\";\n contentLabel = \"New\";\n contentSubLabel = \"Account\";\n accountDescription = data.lastName + \", \" + data.firstName;\n description = data.email;\n break;\n case \"failed_bet\":\n gradient = \"bgred\";\n amount = data.unitStake;\n contentLabel = \"£\" + amount;\n contentSubLabel = \"Failed Bet\";\n accountDescription = data.account.lastName + \", \" + data.account.firstName;\n description = data.description;\n break;\n case \"payrec\" :\n gradient = \"bgbronze\";\n amount = data.credit > 0 ? data.credit : data.debit;\n contentLabel = \"£\" + amount;\n contentSubLabel = \"Payrec\";\n accountDescription = data.account.lastName + \", \" + data.account.firstName;\n description = data.description;\n break;\n }\n\n // Use Mustache to populate the template\n var result = mustache.render(template, { \n \"background_gradient\" : gradient,\n \"left_content\" : contentLabel, \n \"left_sub_label\" : contentSubLabel,\n \"account_description\" : accountDescription, \n \"account_username\" : data.userName ? data.userName.toLowerCase() : (data.username ? data.username.toLowerCase() : data.account.userName.toLowerCase()),\n \"account_number\" : data.accountNumber,\n \"description\" : description,\n \"right_footer_left\" : type === \"bet\" ? \"Potential Win £\" + data.potentialWin : \"\",\n \"right_footer_middle\" : type === \"bet\" ? \"Total Stake £\" + data.betTotalCost : \"\",\n \"right_footer_right\" : \"\" \n });\n \n // Add the result to the page\n content.prepend(result);\n boxCount++;\n \n var justAdded = $(\"#content .box\").first();\n justAdded.addClass(type);\n justAdded.data(\"data\", data);\n \n // Update time\n updateTime(justAdded); \n \n // Check to see if we should be displaying this box\n boxFilter(justAdded);\n\n // Hide fields that are meant to be hidden\n if ($(\"#showUsername\").prop(\"checked\")) {\n justAdded.find(\".account_username\").show();\n } else {\n justAdded.find(\".account_username\").hide();\n }\n \n if ($(\"#showAccountNumber\").prop(\"checked\")) {\n justAdded.find(\".account_number\").show();\n } else {\n justAdded.find(\".account_number\").hide();\n }\n\n // If we have more than max row items we need to start removing the older ones. Note, once it's gone it's gone, if the max rows is increased it's too bad.\n if (boxCount > +$(\"#max-rows\").val()) {\n $(\"#content .box\").last().remove();\n }\n\t}", "get type() {\n return this._type;\n }", "function getTypeIdentifier(Repr){\n return Repr[$$type] || Repr.name || 'Anonymous';\n }", "typeInfoLabel(){\n const { typeInfo, context, schemas } = this.props;\n if (typeInfo && typeInfo.title){\n return (\n <span className=\"type-info inline-block\" data-tip={(typeInfo && typeInfo.description) || null}>\n { typeInfo && typeInfo.title }\n </span>\n );\n }\n\n var baseItemType = Schemas.getBaseItemType(context);\n var itemType = Schemas.getItemType(context);\n\n if (itemType === baseItemType) return null;\n\n const baseTypeInfo = Schemas.getSchemaForItemType(baseItemType, schemas || null);\n const title = (baseTypeInfo && baseTypeInfo.title) || baseItemType;\n const detailTypeInfo = Schemas.getSchemaForItemType(itemType, schemas || null);\n const detailTitle = (detailTypeInfo && detailTypeInfo.title && (detailTypeInfo.title + ' (\\'' + itemType + '\\')')) || itemType;\n\n return (\n <span className=\"type-info inline-block\" data-tip={(baseTypeInfo ? 'Base' : 'Abstract') + \" type of this \" + detailTitle + \" Item\"}>\n { title }\n </span>\n );\n }", "get type()\n {\n //Returning the type value\n return this._type;\n }", "get type()\n {\n //Returning the type value\n return this._type;\n }", "function get(type) {\n \treturn type;\n}", "function addBox(width, height, center = [0, 0, 1]) {\n let object = {\n name: '',\n type: 'box',\n width: width,\n height: height,\n center: center,\n fill: '#FFFFFF',\n stroke: '#000000',\n actualStroke: '#000000',\n T: Math.identity(),\n R: Math.identity(),\n S: Math.identity(),\n angleRotation: 0\n }\n objectSelected = objects.push(object)\n drawObjects()\n return objectSelected\n }", "function ComponentType() {}", "function parseBlock(Type) {\n\t\tif (Type === 1)\t//Ground\n\t\t{\n\t\t\treturn \"ground\";\n\t\t}\n\t\telse if (Type === 2) //Ground going up\n\t\t{\n\t\t\treturn \"groundUp\";\n\t\t}\n\t\telse if (Type === 3) //Building\n\t\t{\n\t\t\treturn \"building\";\n\t\t}\n\t\telse if (Type === 4) //Building going up\n\t\t{\n\t\t\treturn \"buildingUp\";\n\t\t}\n\t\telse if (Type === 5) //Building going down\n\t\t{\n\t\t\treturn \"buildingDown\";\n\t\t}\n\t}", "getType() {\n return this.root.getType();\n }", "get_type(){\n return this.type;\n }", "function getTypeReference(typeInfo, type) {\n return {\n kind: 'Type',\n schema: typeInfo.schema,\n type: type || typeInfo.type\n };\n}", "typeText(int) {\n const index = this.typeInt(int);\n return tileTypes[index].type;\n }", "get cullingType() {}", "getType(){\n return this.type;\n }", "type (prm) {\n try {\n return this.member(\n 'type',\n ['top', 'right', 'bottom', 'left'],\n prm\n );\n } catch (e) {\n console.error(e.stack);\n }\n }", "function createCargoTypeItem(cargoObj) {\n const cargoTypeItem = document.createElement(\"li\");\n cargoTypeItem.classList.add(\n \"legend__cargo-types-item\",\n `legend__cargo-types-item--${cargoObj.type}`,\n `legend__cargo-types-item--${cargoObj.id}`\n );\n\n const colorBox = document.createElement(\"span\");\n colorBox.classList.add(\"color-box\", \"color-box--legend\");\n colorBox.style.background = cargoObj.color;\n\n const cargoName = document.createElement(\"span\");\n cargoName.classList.add(\"legend__cargo-type-name\");\n cargoName.textContent = cargoObj.type;\n\n cargoTypeItem.appendChild(colorBox);\n cargoTypeItem.appendChild(cargoName);\n\n return cargoTypeItem;\n}", "get type() {\n\t\tconst { constructor } = this;\n\t\tconst { type } = constructor;\n\n\t\treturn type;\n\t}", "get type () { return this._doc.type; }", "function makeBox() {\n\n}", "function getBox(number) {\n\t\treturn document.getElementById(\"s\" + number).innerText;\n\t}", "get type() {\n\t\treturn wm.get(this).type;\n\t}", "static get type() {\n return \"meal_type\";\n }", "function ComponentType() { }", "get type() {\n return this._lfo.type;\n }" ]
[ "0.62278664", "0.6143823", "0.61225855", "0.59410375", "0.59393823", "0.5914142", "0.5852843", "0.582413", "0.5725587", "0.5720874", "0.56968355", "0.5680796", "0.5680796", "0.5680796", "0.56688243", "0.564862", "0.563966", "0.5583724", "0.5571146", "0.55680734", "0.5565702", "0.5552715", "0.5552715", "0.55468833", "0.55036485", "0.5495554", "0.5495554", "0.5495554", "0.5495554", "0.5495554", "0.5495554", "0.5495554", "0.5495554", "0.5495554", "0.5495554", "0.5495554", "0.5495554", "0.5495554", "0.54918253", "0.54661894", "0.54661894", "0.5465591", "0.54522663", "0.5414527", "0.5408472", "0.5395131", "0.53748083", "0.53748083", "0.5371276", "0.5371276", "0.5371276", "0.5371276", "0.5368415", "0.5368263", "0.5361626", "0.53475165", "0.5328058", "0.5328058", "0.5328058", "0.5328058", "0.5328058", "0.5328058", "0.5328058", "0.5328058", "0.5328058", "0.5328058", "0.5328058", "0.5328058", "0.53159153", "0.53143144", "0.53143144", "0.53143144", "0.53143144", "0.53128016", "0.5307865", "0.5306726", "0.5299988", "0.52859604", "0.5280682", "0.5280526", "0.5280526", "0.5277085", "0.52667683", "0.52658284", "0.52573514", "0.5247607", "0.5240183", "0.52345186", "0.522602", "0.52251226", "0.5221137", "0.52153677", "0.5213013", "0.52110636", "0.5206094", "0.5181854", "0.51805896", "0.51780844", "0.51711416", "0.5159692", "0.51505214" ]
0.0
-1
Outer width in mm
getOuterWidth() { mustInherit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getWidth() {\n return Math.round(obj.width * scale);\n }", "getWidthUnit(){return this.__widthUnit}", "getInnerWidth() {\n mustInherit();\n }", "getPictureWidth() {\n const mwm = (this.camera.MatrixWidth / 10000); /* Matrix Width in meters */\n const { altitude } = this.mission;\n const fm = (this.camera.Focal / 10000); /* focal in meters */\n return ((mwm * altitude) / fm).toFixed(2);\n }", "function getWidth(uses) {\n\treturn 1 + Math.min(Math.round(uses/150), 6);\n}", "function currentWidth(){\n var widthPerMin = 41/(24*60);\n var currentDay = moment().day();\n if(currentDay < 7)\n return widthPerMin * minutesSinceMid() + (widthPerMin * 1440 * (moment().day() - 1));\n }", "function _c_width() { \n\t\t\t\t\treturn _width + _padding.l + _padding.r; \n\t\t\t\t}", "function $width(percent) {return window.innerWidth / 100 * percent;}", "function _calc() {\n var winW = $w.width() < $t.width() ? $t.width() : $w.width();\n var realW = winW - 2 * cfg.navWidth - cfg.perNumber;\n var itemW = Math.floor(realW / cfg.perNumber);\n return itemW;\n }", "function getOuterWidth(el) {\n var pattern = /\\d/, // check if value contains digital number\n width = el.offsetWidth,\n style = el.currentStyle || getComputedStyle(el),\n marginLeft = (pattern.exec(style.marginLeft) === null) ? \"0px\" : style.marginLeft,\n marginRight = (pattern.exec(style.marginRight) === null) ? \"0px\" : style.marginRight;\n\n width += parseInt(Length.toPx(el, marginLeft)) + parseInt(Length.toPx(el, marginRight));\n return width;\n}", "function getUnitWidth() {\n var width;\n if ($(\".visible-phone\").is(\":visible\")) {\n width = $isocontainer.width() / 2;\n } else if ($(\".visible-tablet\").is(\":visible\")) {\n width = $isocontainer.width() / 3;\n } else {\n width = $isocontainer.width() / 5;\n }\n return width;\n }", "getWidth() {\n return screen.width / this.width;\n }", "getWidth() {\n return screen.width / this.width;\n }", "getMaxWidthUnit(){return this.__maxWidthUnit}", "function e(e, r) {\n var i = r || e.extent,\n o = e.width,\n c = Object(_core_unitUtils_js__WEBPACK_IMPORTED_MODULE_0__[\"getMetersPerUnitForSR\"])(i && i.spatialReference);\n return i && o ? i.width / o * c * _core_unitUtils_js__WEBPACK_IMPORTED_MODULE_0__[\"inchesPerMeter\"] * 96 : 0;\n }", "function getGraphWidth() {\n\t\treturn width - xOffset * 2;\n\t}", "function innerWidth(el){\n var style = window.getComputedStyle(el, null);\n return el.clientWidth -\n parseInt(style.getPropertyValue('padding-left'), 10) -\n parseInt(style.getPropertyValue('padding-right'), 10);\n }", "get _width() {\n // The container event's width is determined by the maximum number of\n // events in any of its rows.\n if (this.rows) {\n const columns =\n this.rows.reduce((max, row) => {\n return Math.max(max, row.leaves.length + 1) // add itself\n }, 0) + 1 // add the container\n\n return 100 / columns\n }\n\n const availableWidth = 100 - this.container._width\n\n // The row event's width is the space left by the container, divided\n // among itself and its leaves.\n if (this.leaves) {\n return availableWidth / (this.leaves.length + 1)\n }\n\n // The leaf event's width is determined by its row's width\n return this.row._width\n }", "function width(bb) {\n return (bb[1][0] - bb[0][0])\n }", "function width(bb) {\n return (bb[1][0] - bb[0][0])\n }", "function getWidth(self) {\r\n return (\r\n parseInt(self.clientWidth) -\r\n parseInt(window.getComputedStyle(self).getPropertyValue(\"padding-left\")) -\r\n parseInt(window.getComputedStyle(self).getPropertyValue(\"padding-right\"))\r\n );\r\n}", "ggw() {\n return this.cr.canvas.width / this.cr.options.scaleFactor;\n }", "function width(bb) {\n\t\treturn (bb[1][0] - bb[0][0])\n\t\t}", "function innerCanvasWidth(width) {\n var innerCanvasWidth = width;\n var numBlocks = innerCanvasWidth * blockWidth();\n return numBlocks + 'px'\n }", "get maxWidth() {}", "get width()\n\t{\n\t\tlet width = Math.max(this._width, this.minWidth);\n\n\t\tif (this.tree.theme.hasGridBehavior)\n\t\t{\n\t\t\tlet step = this.tree.theme.gridSize;\n\t\t\twidth = Math.ceil(width / step) * step;\n\t\t}\n\n\t\treturn width;\n\t}", "getWidth() {\n return this.$node.innerWidth();\n }", "function calcUnit(num){\n\t\treturn (document.documentElement.clientWidth / num); \n\t}", "getWidth() {\n return this._$mountPoint.width();\n }", "function calcUnit(num){\n\t\treturn (document.documentElement.clientWidth / num);\n\t}", "get fullWidth() {\n\t\t\treturn this.width + self.margin.right + self.margin.left;\n\t\t}", "get width() {\n\t\treturn this._viewport[2];\n\t}", "get cellWidth() {\n return (min(width, height) - 2*GRID_BUFFER) / this.cols;\n }", "function getWidth(element) {\n return element[0].offsetWidth;\n }", "get drawWidth() {\n if (this._camera) {\n return this.scaledWidth / this._camera.z / this.pixelRatio;\n }\n return this.scaledWidth / this.pixelRatio;\n }", "function calcUnit(num){\n return (document.documentElement.clientWidth / num);\n}", "function h(t){return t.width/t.resolution}", "function outerWidth(el) {\r\n var width = el.offsetWidth;\r\n var style = getComputedStyle(el);\r\n\r\n width += parseInt(style.marginLeft) + parseInt(style.marginRight);\r\n return width;\r\n }", "getWidth() { return this.width; }", "getWidth() {\n return this.face.width();\n }", "function getWidth(el) {\n var pattern = /\\d/, // check if value contains digital number\n width = el.clientWidth,\n style = el.currentStyle || getComputedStyle(el),\n paddingLeft = (pattern.exec(style.paddingLeft) === null) ? \"0px\" : style.paddingLeft,\n paddingRight = (pattern.exec(style.paddingRight) === null) ? \"0px\" : style.paddingRight;\n\n width -= (parseInt(Length.toPx(el, paddingLeft)) + parseInt(Length.toPx(el, paddingRight)));\n return width;\n}", "function vw (w){\n \treturn (w*window.innerWidth)/100;\n }", "getWidth() {\n return this.getSize().width;\n }", "get width() {\n // w = width\n return this._w;\n }", "function Browser_InnerWidth()\n{\n\t//use the body\n\treturn document.body.offsetWidth;\n}", "findSize() {\n var height = window.innerHeight - 180;\n var width = window.innerWidth;\n this.csize = height/width > 1 ? Math.floor(0.9 * width / 4) : Math.floor(0.9 * height / 4);\n }", "getWidth() {\n return this.content >> 22 /* WIDTH_SHIFT */;\n }", "function getWidth(ev) {\n var durationInMinutes = ev.duration;\n var hrs = parseFloat(durationInMinutes)/parseFloat(60);\n var width = parseFloat(hrs)*parseFloat(RECTANGLE_WIDTH);\n var roundedWidth = Math.round(parseFloat(width)/parseFloat(STEP_WIDTH)) * STEP_WIDTH;\n return roundedWidth;\n}", "dpi () {\n return this.chart.width / this.interval.width * this.zoom.value;\n }", "function computeTimeUnitSize(duration){\n\treturn $(\"#diagram\").width()/duration ;\n}", "function widthOfEltInDiap () {//the width of any Element in diapo\n\t\treturn Math.floor(fd_ulDiapo[0].offsetWidth / 12);\n\t}", "getWidth(){return this.__width}", "function getVWSize(num) {\n return 1.08 / (num / 100);\n}", "function calcNestColWidth(){\n var windowWidth = $window.width();\n if (windowWidth > 1024) {\n return windowWidth / 14;\n } else if (windowWidth < 768) {\n return windowWidth / 4;\n } else {\n return windowWidth / 9;\n }\n }", "function w(d, outer) {\n\t\tvar width = self.options.cellSize*self._domainType[self.options.subDomain].column(d) + self.options.cellPadding*self._domainType[self.options.subDomain].column(d);\n\t\tif (arguments.length === 2 && outer === true) {\n\t\t\treturn width += self.domainHorizontalLabelWidth + self.options.domainGutter + self.options.domainMargin[1] + self.options.domainMargin[3];\n\t\t}\n\t\treturn width;\n\t}", "function w(d, outer) {\n\t\tvar width = self.options.cellSize*self._domainType[self.options.subDomain].column(d) + self.options.cellPadding*self._domainType[self.options.subDomain].column(d);\n\t\tif (arguments.length === 2 && outer === true) {\n\t\t\treturn width += self.domainHorizontalLabelWidth + self.options.domainGutter + self.options.domainMargin[1] + self.options.domainMargin[3];\n\t\t}\n\t\treturn width;\n\t}", "get size() {\n var padding = this.padding;\n var width = 0;\n var height = DEFAULT_EXPR_HEIGHT;\n var sizes = this.getHoleSizes();\n var scale_x = this.scale.x;\n\n if (this._stackVertically) {\n width = EMPTY_EXPR_WIDTH;\n height = 0;\n }\n\n if (sizes.length === 0) return { w:this._size.w, h:this._size.h };\n\n sizes.forEach((s) => {\n if (this._stackVertically) {\n height += s.h;\n width = Math.max(width, s.w);\n }\n else {\n height = Math.max(height, s.h);\n width += s.w + padding.inner;\n }\n });\n\n if (this._stackVertically) {\n width += padding.right + padding.left;\n }\n else {\n width += padding.right; // the end\n }\n\n return { w:width, h: height };\n }", "heightToCM(){\n return this.height * 2.54; \n }", "getDim(){\n let n = (this.state.size);\n //toFixed(someNum) used to set floating point accuracy\n let width = (100/(2*n-1)).toFixed(2);\n let margin = (100/(4.5*n-1)).toFixed(2);\n // console.log(width,margin);\n return {width,margin}\n}", "function va(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=n(\"span\",\"xxxxxxxxxx\"),r=n(\"pre\",[t]);a(e.measure,r);var f=t.getBoundingClientRect(),o=(f.right-f.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}", "get width () {return this._p.width;}", "function largeMagazineWidth() {\n\t\n\treturn 2214;\n\n}", "getPictureWidthWithSidelap() {\n const sidelap = (this.mission.sidelap * 0.01);\n return (this.getPictureWidth() - (this.getPictureWidth() * sidelap)).toFixed(2);\n }", "get halfWidth() {\n return this.width / 2\n }", "function _calculateActualBeakWidthInPixels(beakWidth) {\r\n return Math.sqrt(beakWidth * beakWidth * 2);\r\n}", "beamWidth() {\n return binding.GetModelBeamWidth(this._impl);\n }", "function thirdWidth() {\n\t\treturn window.innerWidth/3;\n\t}", "function innerCanvasArea() {\n var total = parseInt(innerCanvas.style.width) * 2;\n return total;\n }", "function _calculateActualBeakWidthInPixels(beakWidth) {\n return Math.sqrt(beakWidth * beakWidth * 2);\n}", "function _calculateActualBeakWidthInPixels(beakWidth) {\n return Math.sqrt(beakWidth * beakWidth * 2);\n}", "function _calculateActualBeakWidthInPixels(beakWidth) {\n return Math.sqrt(beakWidth * beakWidth * 2);\n}", "function _calculateActualBeakWidthInPixels(beakWidth) {\n return Math.sqrt(beakWidth * beakWidth * 2);\n}", "function _calculateActualBeakWidthInPixels(beakWidth) {\n return Math.sqrt(beakWidth * beakWidth * 2);\n}", "getMinWidthUnit(){return this.__minWidthUnit}", "get mapWidth() {return ~~(Math.abs(zeach.mapLeft) + zeach.mapRight)}", "function largeMagazineWidth() {\n\treturn 1844;\n}", "function setOuterWidth() {\n outerWidth = wrap.offsetWidth;\n dragBarPos = calcDragBarPosFromCss() || Math.floor(outerWidth / 2) - 5;\n }", "koofScreenX () {\n return ('clientWidth' in this) && (+this.clientWidth) !== 0 ? this.width / this.clientWidth : 1;\n }", "function Fensterweite () {\n\t\t\tif (window.innerWidth) {\n\t\t\t\treturn window.innerWidth;\n\t\t\t} else if (document.body && document.body.offsetWidth) {\n\t\t\t\treturn document.body.offsetWidth;\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}", "function getWidth() {\n\tvar width = document.getElementById(\"clientText\").clientWidth - PADDING_PX;\n\twidth = width * PX_TO_INCH * INCH_TO_METER * METER_TO_CM;\n\treturn width.toFixed(2);\n}", "function width() {\n return canvas.width;\n }", "getWidth() {\n return this._executeAfterInitialWait(() => this.currently.getWidth());\n }", "getContainerWidth() {\n return getWidth(this.container);\n }", "get width() {\n return this._boundingBox.width;\n }", "getWidth() {\n return this.width;\n }", "getWidth() {\n return this.width;\n }", "function _calculateActualBeakWidthInPixels(beakWidth) {\n return Math.sqrt(beakWidth * beakWidth * 2);\n }", "function _calculateActualBeakWidthInPixels(beakWidth) {\n return Math.sqrt(beakWidth * beakWidth * 2);\n }", "function getDimensionWeight() {\n\tvar dimensionWeight;\n\tdimensionWeight = (getWidth() * getHeight() * THICKNESS_CM) / DIMENSION_WEIGHT_CONVERT;\n\treturn dimensionWeight.toFixed(2);\n}", "width() {\n\t\t\treturn this.data.width;\n\t\t}", "function GetEraBlockWidth(current_window) \r\n\t{\r\n\t\tif (current_window.era_rc != null && current_window.era_rc[\"Width\"] != null) \r\n\t\t{\r\n\t\t\t\treturn GetStringWithQuotes(current_window.era_rc[\"Width\"]);\r\n\t\t} \r\n\t\t\r\n\t\treturn GetStringWithQuotes(500);\r\n\t}", "lengthSq() {\n return this.w * this.w + this.xyz.clone().lengthSq();\n }", "getLargeurDessin()\n\t{\n\t\treturn this._canvas.width;\n\t}", "getUsedWidth() {\n return this.usedWidth;\n }", "get halfDrawWidth() {\n return this.drawWidth / 2;\n }", "calcContainerWidth() {\n const { width } = this.getWindowDimensions();\n const dotPatternSize = this.getDotPatternSize();\n const divider = width / dotPatternSize;\n const containerWidth = Math.max(dotPatternSize * Math.floor(divider), 744);\n this.setState({ containerWidth });\n }", "function tp_min_width(layers)\n{\n\tvar min_width = Number.MAX_VALUE;\n\tfor (var i = 0; i < layers.length; i++)\n\t\tmin_width = Math.min(min_width, layers[i].bounds[2].value - layers[i].bounds[0].value);\n\n\treturn min_width;\n}", "get width() {\n return this.widthIn;\n }", "function GetSpaceOuterOfViewport() {\n function Space(aProp) {\n var sizeView = 0, sizePag = 0;\n for (i = aProp.length - 1; i >= 0; i--) {\n sizeView += M.PInt(va.$viewport.css(aProp[i]));\n sizePag += M.PInt(va.$pag.css(aProp[i]));\n }\n return sizeView - sizePag;\n }\n va.viewSpace = {\n 'hor': Space(['padding-left', 'padding-right', 'border-left-width', 'border-right-width']),\n 'ver': Space(['padding-top', 'padding-bottom', 'border-top-width', 'border-bottom-width'])\n };\n }", "function dxt1etc1Size(width, height) {\n return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8;\n }" ]
[ "0.7092086", "0.7010623", "0.67779326", "0.6768356", "0.67501664", "0.6730846", "0.6710201", "0.6699483", "0.666454", "0.66532904", "0.6565102", "0.65552497", "0.65552497", "0.6461429", "0.64580005", "0.64422476", "0.6437272", "0.64337164", "0.64259595", "0.64259595", "0.6403504", "0.6397022", "0.6386684", "0.637395", "0.6371497", "0.636641", "0.6345714", "0.63332385", "0.6312855", "0.63032246", "0.6301752", "0.6296602", "0.6294977", "0.62947124", "0.6287904", "0.62810415", "0.62631613", "0.6261955", "0.62580884", "0.62505937", "0.62433815", "0.6235834", "0.62282246", "0.62272406", "0.62193346", "0.6209865", "0.6203073", "0.6202263", "0.6197875", "0.61960703", "0.61911625", "0.61862886", "0.6180003", "0.6173556", "0.6154579", "0.6154579", "0.6133664", "0.6125462", "0.6119063", "0.6113093", "0.61000896", "0.6086682", "0.6080423", "0.60726464", "0.6055613", "0.6054177", "0.6053252", "0.605131", "0.60425466", "0.60425466", "0.60425466", "0.60425466", "0.60425466", "0.60408133", "0.6024602", "0.6023336", "0.6016715", "0.6012979", "0.6011159", "0.6007404", "0.6007238", "0.6006876", "0.600628", "0.5993329", "0.59893525", "0.59893525", "0.5980882", "0.5980882", "0.5971999", "0.596994", "0.5967756", "0.5963324", "0.59603065", "0.59572464", "0.59571767", "0.59546584", "0.5950495", "0.5942079", "0.5936842", "0.5934502" ]
0.68736744
2
Outer length in mm
getOuterLength() { mustInherit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "lengthSq() {\n return this.w * this.w + this.xyz.clone().lengthSq();\n }", "length() {\n return Math.sqrt(this.w * this.w + this.xyz.clone().lengthSq() );\n }", "getPictureWidth() {\n const mwm = (this.camera.MatrixWidth / 10000); /* Matrix Width in meters */\n const { altitude } = this.mission;\n const fm = (this.camera.Focal / 10000); /* focal in meters */\n return ((mwm * altitude) / fm).toFixed(2);\n }", "function e(e, r) {\n var i = r || e.extent,\n o = e.width,\n c = Object(_core_unitUtils_js__WEBPACK_IMPORTED_MODULE_0__[\"getMetersPerUnitForSR\"])(i && i.spatialReference);\n return i && o ? i.width / o * c * _core_unitUtils_js__WEBPACK_IMPORTED_MODULE_0__[\"inchesPerMeter\"] * 96 : 0;\n }", "heightToCM(){\n return this.height * 2.54; \n }", "getWidthUnit(){return this.__widthUnit}", "function width(bb) {\n return (bb[1][0] - bb[0][0])\n }", "function width(bb) {\n return (bb[1][0] - bb[0][0])\n }", "function getWidth() {\n return Math.round(obj.width * scale);\n }", "function computeTimeUnitSize(duration){\n\treturn $(\"#diagram\").width()/duration ;\n}", "getInnerLength() {\n mustInherit();\n }", "function innerWidth(el){\n var style = window.getComputedStyle(el, null);\n return el.clientWidth -\n parseInt(style.getPropertyValue('padding-left'), 10) -\n parseInt(style.getPropertyValue('padding-right'), 10);\n }", "function width(bb) {\n\t\treturn (bb[1][0] - bb[0][0])\n\t\t}", "function len(feet, inches, eigths) {\n var l = (12 * (feet || 0)) + (inches || 0) + ((eigths || 0) / 8); \n return pixels(l);\n}", "function getWidth(uses) {\n\treturn 1 + Math.min(Math.round(uses/150), 6);\n}", "function _c_width() { \n\t\t\t\t\treturn _width + _padding.l + _padding.r; \n\t\t\t\t}", "get newLength() {\n let result = 0;\n for (let i = 0; i < this.sections.length; i += 2) {\n let ins = this.sections[i + 1];\n result += ins < 0 ? this.sections[i] : ins;\n }\n return result;\n }", "getInnerWidth() {\n mustInherit();\n }", "getBackendFullLen(len){\n\treturn (1+ 2*this.margin_percent/100) * len;\n }", "function _calc() {\n var winW = $w.width() < $t.width() ? $t.width() : $w.width();\n var realW = winW - 2 * cfg.navWidth - cfg.perNumber;\n var itemW = Math.floor(realW / cfg.perNumber);\n return itemW;\n }", "calcLength(limb) {\n var upper = this.skeleton.bones[limb.upper];\n var lower = this.skeleton.bones[limb.lower];\n var scaling = this.rootMesh.scaling.x;\n limb.upperLength = upper.getAbsolutePosition().subtract(lower.getAbsolutePosition()).length()*scaling;\n if ( lower.children && lower.children[0] ) {\n limb.lowerLength = lower.getAbsolutePosition().subtract(lower.children[0].getAbsolutePosition()).length()*scaling;\n } else {\n limb.lowerLength = 0;\n }\n limb.length = limb.upperLength+limb.lowerLength;\n this.log(\"Length of \"+upper.name+\": \"+limb.upperLength+\", \"+lower.name+\": \"+limb.lowerLength);\n }", "function toRem(length) {\r\n return (parseInt(length) / rem());\r\n }", "function toRem(length) {\r\n return (parseInt(length) / rem());\r\n }", "function subRingLength(inNo) {\n return 70 + inNo * 55;\n}", "getOuterWidth() {\n mustInherit();\n }", "totalLength(){\n\n let clen = 0;\n let pts;\n\n for(let i = 0; i < this.nCurves; i++){\n let idx = i*2;\n pts = [ p5.Vector.add(this.cpts[idx], this.cpts[idx+1]).mult(0.5),\n this.cpts[idx+1],\n this.cpts[idx+2],\n p5.Vector.add(this.cpts[idx+2], this.cpts[idx+3]).mult(0.5)\n ];\n \n clen += this.segmentLength(pts);\n }\n\n return clen;\n\n }", "function calcUnit(num){\n\t\treturn (document.documentElement.clientWidth / num); \n\t}", "function h(t){return t.width/t.resolution}", "function getOuterWidth(el) {\n var pattern = /\\d/, // check if value contains digital number\n width = el.offsetWidth,\n style = el.currentStyle || getComputedStyle(el),\n marginLeft = (pattern.exec(style.marginLeft) === null) ? \"0px\" : style.marginLeft,\n marginRight = (pattern.exec(style.marginRight) === null) ? \"0px\" : style.marginRight;\n\n width += parseInt(Length.toPx(el, marginLeft)) + parseInt(Length.toPx(el, marginRight));\n return width;\n}", "function calcUnit(num){\n return (document.documentElement.clientWidth / num);\n}", "get len() { // added to normailze the speed of the ball when it starts\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y);\n\t}", "function getUnitWidth() {\n var width;\n if ($(\".visible-phone\").is(\":visible\")) {\n width = $isocontainer.width() / 2;\n } else if ($(\".visible-tablet\").is(\":visible\")) {\n width = $isocontainer.width() / 3;\n } else {\n width = $isocontainer.width() / 5;\n }\n return width;\n }", "function calcUnit(num){\n\t\treturn (document.documentElement.clientWidth / num);\n\t}", "getFocalLength() {\n\n\t\tconst vExtentSlope = Math.tan( DEG2RAD * 0.5 * this.fov );\n\n\t\treturn 0.5 * this.getFilmHeight() / vExtentSlope;\n\n\t}", "get length() {\n return Math.sqrt(Math.pow(this.x, 2) + Math.pow(this.y, 2));\n }", "function innerCanvasArea() {\n var total = parseInt(innerCanvas.style.width) * 2;\n return total;\n }", "static lengthQV(qv) {\nreturn Math.sqrt(this.innerProductQV(qv, qv));\n}", "getFocalLength() {\n\n\t\t\tconst vExtentSlope = Math.tan( DEG2RAD * 0.5 * this.fov );\n\n\t\t\treturn 0.5 * this.getFilmHeight() / vExtentSlope;\n\n\t\t}", "getSurfaceArea() {\n const surfaceArea = 6 * Math.pow(this.length, 2);\n return +surfaceArea.toFixed(3);\n }", "getMaxWidthUnit(){return this.__maxWidthUnit}", "length () {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }", "length () {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }", "function getArea(width, length, unit) {\n var area = width * length;\n return area + \" \" + unit;\n}", "function length_v2(v) { return Math.sqrt(v[0] * v[0] + v[1] * v[1]); }", "length() {\n let length = this.end - this.begin;\n if (length < 0) {\n length = this.doubledCapacity + length;\n }\n return length;\n }", "function currentWidth(){\n var widthPerMin = 41/(24*60);\n var currentDay = moment().day();\n if(currentDay < 7)\n return widthPerMin * minutesSinceMid() + (widthPerMin * 1440 * (moment().day() - 1));\n }", "function getsnakelength() {\r\n var length = 0;\r\n for (var i = 0; i < this.snake.length; i++) {\r\n var cur = this.snake[i];\r\n var next = this.snake[(i + 1) % this.snake.length];\r\n length += distance(cur, next);\r\n }\r\n return length;\r\n }", "getDim(){\n let n = (this.state.size);\n //toFixed(someNum) used to set floating point accuracy\n let width = (100/(2*n-1)).toFixed(2);\n let margin = (100/(4.5*n-1)).toFixed(2);\n // console.log(width,margin);\n return {width,margin}\n}", "function getArea(width, length, unit) {\n var area = width * length;\n return area + \" \" + unit;\n}", "ggw() {\n return this.cr.canvas.width / this.cr.options.scaleFactor;\n }", "get length() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }", "getPictureWidthWithSidelap() {\n const sidelap = (this.mission.sidelap * 0.01);\n return (this.getPictureWidth() - (this.getPictureWidth() * sidelap)).toFixed(2);\n }", "function largeMagazineWidth() {\n\t\n\treturn 2214;\n\n}", "get size() {\n var padding = this.padding;\n var width = 0;\n var height = DEFAULT_EXPR_HEIGHT;\n var sizes = this.getHoleSizes();\n var scale_x = this.scale.x;\n\n if (this._stackVertically) {\n width = EMPTY_EXPR_WIDTH;\n height = 0;\n }\n\n if (sizes.length === 0) return { w:this._size.w, h:this._size.h };\n\n sizes.forEach((s) => {\n if (this._stackVertically) {\n height += s.h;\n width = Math.max(width, s.w);\n }\n else {\n height = Math.max(height, s.h);\n width += s.w + padding.inner;\n }\n });\n\n if (this._stackVertically) {\n width += padding.right + padding.left;\n }\n else {\n width += padding.right; // the end\n }\n\n return { w:width, h: height };\n }", "function getVWSize(num) {\n return 1.08 / (num / 100);\n}", "getPixelPerMeter() {\n\t\tlet ppm = new vec2(this.#_fusion.targetOutSize.x/this.#_augmentaScene.scene.x,this.#_fusion.targetOutSize.y/this.#_augmentaScene.scene.y);\n\t\treturn ppm;\n\t}", "getWidth() {\n return this.face.width();\n }", "function N() {\n var t = p.getBoundingClientRect(),\n e = \"offset\" + [\"Width\", \"Height\"][i.ort];\n return 0 === i.ort ? t.width || p[e] : t.height || p[e]\n }", "function getGraphWidth() {\n\t\treturn width - xOffset * 2;\n\t}", "getLength() {\n\n\t\tconst lens = this.getCurveLengths();\n\t\treturn lens[ lens.length - 1 ];\n\n\t}", "function periRect(wid, len){\n\n var perimeter = wid * 2 + len * 2;\n //var perimeter = (number) wid + (number) len;\n\n //Return the perimeter\n return perimeter;\n\n\n\n }", "function area(length, width) {\n console.log(length * width);\n}", "function getNormalizedSize(count) {\n return 1 + (count - min) / diff;\n }", "function scaleImageLength(l) {\n return modelView.model2px(0.01 * l);\n }", "function getWidth(self) {\r\n return (\r\n parseInt(self.clientWidth) -\r\n parseInt(window.getComputedStyle(self).getPropertyValue(\"padding-left\")) -\r\n parseInt(window.getComputedStyle(self).getPropertyValue(\"padding-right\"))\r\n );\r\n}", "getLength() {\n var x1 = this.point1.getX();\n var y1 = this.point1.getY();\n var x2 = this.point2.getX();\n var y2 = this.point2.getY();\n return Math.hypot(x1 - x2, y1 - y2);\n }", "dpi () {\n return this.chart.width / this.interval.width * this.zoom.value;\n }", "function findPerimeter(length, width) {\n\tvar p = 2 * length + 2 * width\n return p\n}", "function len (p1, p2) {\n return Math.sqrt((p2.x - p1.x) * (p2.x - p1.x) + (p2.y - p1.y) * (p2.y - p1.y))\n }", "function outerWidth(el) {\r\n var width = el.offsetWidth;\r\n var style = getComputedStyle(el);\r\n\r\n width += parseInt(style.marginLeft) + parseInt(style.marginRight);\r\n return width;\r\n }", "getLength() {\n\n\t\tconst lengths = this.getLengths();\n\t\treturn lengths[ lengths.length - 1 ];\n\n\t}", "getLength() {\n\n\t\tconst lengths = this.getLengths();\n\t\treturn lengths[ lengths.length - 1 ];\n\n\t}", "function eqtHeight(side_length) {\n return side_length * Math.sqrt(3) / 2\n}", "function getLength(q){\n h = 1 / 128;\n var hh = h * 2;\n var m = [q[3][0] - q[0][0] + 3 * (q[1][0] - q[2][0]),\n q[0][0] - 2 * q[1][0] + q[2][0],\n q[1][0] - q[0][0]];\n var n = [q[3][1] - q[0][1] + 3 * (q[1][1] - q[2][1]),\n q[0][1] - 2 * q[1][1] + q[2][1],\n q[1][1] - q[0][1]];\n var k = [ m[0] * m[0] + n[0] * n[0],\n 4 * (m[0] * m[1] + n[0] * n[1]),\n 2 * ((m[0] * m[2] + n[0] * n[2]) + 2 * (m[1] * m[1] + n[1] * n[1])),\n 4 * (m[1] * m[2] + n[1] * n[2]), m[2] * m[2] + n[2] * n[2] ];\n var fc = function(t, k){\n return Math.sqrt(t * (t * (t * (t * k[0] + k[1]) + k[2]) + k[3]) + k[4]) || 0 };\n var sm = (fc(0, k) - fc(1, k)) / 2;\n for(var t = h; t < 1; t += hh) sm += 2 * fc(t, k) + fc(t + h, k);\n return sm * hh;\n}", "function getArea(width, length) {\n return width * length;\n}", "get halfWidth() {\n return this.width / 2\n }", "function getWidth(ev) {\n var durationInMinutes = ev.duration;\n var hrs = parseFloat(durationInMinutes)/parseFloat(60);\n var width = parseFloat(hrs)*parseFloat(RECTANGLE_WIDTH);\n var roundedWidth = Math.round(parseFloat(width)/parseFloat(STEP_WIDTH)) * STEP_WIDTH;\n return roundedWidth;\n}", "function size() {\n out = 1;\n for (var dim in dimensions) {\n out *= dimensions[dim].members.length;\n }\n return out;\n }", "function innerCanvasWidth(width) {\n var innerCanvasWidth = width;\n var numBlocks = innerCanvasWidth * blockWidth();\n return numBlocks + 'px'\n }", "get mapWidth() {return ~~(Math.abs(zeach.mapLeft) + zeach.mapRight)}", "snpMDG(v) {\n // console.log(v)\n // console.log(Math.round(v/this.cellSize/this.scale) * this.cellSize/this.scale)\n return Math.round(v/this.cellSize) * this.cellSize\n }", "computeBoundaryLengths() {\n\t\tthis.l = DenseMatrix.zeros(this.nB, 1);\n\t\tfor (let he of this.boundary.adjacentHalfedges()) {\n\t\t\tlet i = this.bVertexIndex[he.vertex];\n\n\t\t\tthis.l.set(geometry.length(he.edge), i, 0);\n\t\t}\n\t}", "function getPerimeter(width, length) {\n return (width * 2) + (length * 2);\n}", "function widthOfEltInDiap () {//the width of any Element in diapo\n\t\treturn Math.floor(fd_ulDiapo[0].offsetWidth / 12);\n\t}", "get length() {\n let result = 0;\n for (let i = 0; i < this.sections.length; i += 2)\n result += this.sections[i];\n return result;\n }", "function largeMagazineWidth() {\n\treturn 1844;\n}", "get referencePixelsPerUnit() {}", "getWidth() {\n return this._$mountPoint.width();\n }", "function magnitudeSize(magnitude) {\r\n return magnitude * 40000;\r\n}", "function getArea(length, width) {\n return length * width;\n}", "getWidth() {\n return screen.width / this.width;\n }", "getWidth() {\n return screen.width / this.width;\n }", "getDrawSize () {\r\n return Math.ceil(this.calories / this.gestation * 10)\r\n }", "get drawWidth() {\n if (this._camera) {\n return this.scaledWidth / this._camera.z / this.pixelRatio;\n }\n return this.scaledWidth / this.pixelRatio;\n }", "squaredLength() {\n return this.dotProduct(this);\n }", "get maxWidth() {}", "function w(d, outer) {\n\t\tvar width = self.options.cellSize*self._domainType[self.options.subDomain].column(d) + self.options.cellPadding*self._domainType[self.options.subDomain].column(d);\n\t\tif (arguments.length === 2 && outer === true) {\n\t\t\treturn width += self.domainHorizontalLabelWidth + self.options.domainGutter + self.options.domainMargin[1] + self.options.domainMargin[3];\n\t\t}\n\t\treturn width;\n\t}", "function w(d, outer) {\n\t\tvar width = self.options.cellSize*self._domainType[self.options.subDomain].column(d) + self.options.cellPadding*self._domainType[self.options.subDomain].column(d);\n\t\tif (arguments.length === 2 && outer === true) {\n\t\t\treturn width += self.domainHorizontalLabelWidth + self.options.domainGutter + self.options.domainMargin[1] + self.options.domainMargin[3];\n\t\t}\n\t\treturn width;\n\t}", "function perimeterOfRectangle(length, width) {\n return (length + length + width + width);\n}", "function length(v) {\n return sqrt(v[0] * v[0] + v[1] * v[1]);\n}" ]
[ "0.6579067", "0.6408338", "0.6282983", "0.625458", "0.61553556", "0.6122219", "0.602042", "0.602042", "0.5974171", "0.59614027", "0.5954632", "0.5927671", "0.5917606", "0.5872624", "0.58679175", "0.58454126", "0.5838271", "0.58140904", "0.5800109", "0.57900447", "0.5770162", "0.574904", "0.574904", "0.57440066", "0.57385546", "0.5737517", "0.571089", "0.5697498", "0.5694254", "0.5690918", "0.568882", "0.56808305", "0.56773305", "0.56693286", "0.56634593", "0.566185", "0.56480426", "0.5645936", "0.5642344", "0.5622756", "0.5617429", "0.5617429", "0.56164765", "0.561086", "0.55937266", "0.5590911", "0.55770165", "0.55701816", "0.5567439", "0.5559226", "0.5558981", "0.555589", "0.5555299", "0.55535364", "0.5542323", "0.55374694", "0.5532297", "0.55271363", "0.55168104", "0.5514518", "0.5510007", "0.5507559", "0.5503761", "0.54913944", "0.5488233", "0.5486207", "0.54861265", "0.5485738", "0.5481316", "0.54792064", "0.54784966", "0.54784966", "0.5476834", "0.5475832", "0.54704875", "0.5468943", "0.5467014", "0.54655594", "0.54651284", "0.54630125", "0.5460924", "0.5456979", "0.5454138", "0.5453303", "0.5453101", "0.5448758", "0.54436976", "0.5434854", "0.5433271", "0.54312634", "0.5430354", "0.5430354", "0.54284877", "0.5427207", "0.5423761", "0.5413744", "0.54069626", "0.54069626", "0.54042095", "0.54019386" ]
0.62420255
4
Outer depth in mm
getOuterDepth() { mustInherit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDepth(mag) {\n return (mag/10) \n }", "function _depth() { \n\t\t\t\t\treturn Math.max( Math.min( _pointA.z, _pointB.z ), 0.0001 ); \n\t\t\t\t}", "get Depth() {}", "get depth() {}", "getInnerDepth() {\n mustInherit();\n }", "depth() {\n return 0;\n }", "computeMaxDepth() {\n let d = 0;\n for (const child of this.components) {\n d = Math.max(d + 1, child.children.computeMaxDepth());\n }\n return d;\n }", "function calculateZ(depth,zInLevel){var zb=depth * Z_BASE + zInLevel;return (zb - 1) / zb;}", "function avgDepth(min, max){\n\treturn (min + max) / 2;\n}", "function calcMaxRecursionDepth() {\n return min(7, floor(log2(pixelCount)))\n}", "getClosetDepth() { return this.faces.get(FaceOrientation.BASE).depth(); }", "getDepth() {\n return this.depth;\n }", "function calculateZ(depth, zInLevel) {\n\t var zb = depth * Z_BASE + zInLevel;\n\t return (zb - 1) / zb;\n\t}", "function calculateZ(depth, zInLevel) {\n\t var zb = depth * Z_BASE + zInLevel;\n\t return (zb - 1) / zb;\n\t }", "getModuleDepth(){return this.module_base_face_dimensions_axes[2];}", "function calculateZ(depth, zInLevel) {\n var zb = depth * Z_BASE + zInLevel;\n return (zb - 1) / zb;\n}", "function calculateZ(depth, zInLevel) {\n var zb = depth * Z_BASE + zInLevel;\n return (zb - 1) / zb;\n}", "function calculateZ(depth, zInLevel) {\n var zb = depth * Z_BASE + zInLevel;\n return (zb - 1) / zb;\n}", "function calculateZ(depth, zInLevel) {\n var zb = depth * Z_BASE + zInLevel;\n return (zb - 1) / zb;\n}", "function calculateZ(depth, zInLevel) {\n var zb = depth * Z_BASE + zInLevel;\n return (zb - 1) / zb;\n}", "function calculateZ(depth, zInLevel) {\n var zb = depth * Z_BASE + zInLevel;\n return (zb - 1) / zb;\n}", "getPixelPerMeter() {\n\t\tlet ppm = new vec2(this.#_fusion.targetOutSize.x/this.#_augmentaScene.scene.x,this.#_fusion.targetOutSize.y/this.#_augmentaScene.scene.y);\n\t\treturn ppm;\n\t}", "function calculateZ(depth, zInLevel) {\n var zb = depth * Z_BASE + zInLevel;\n return (zb - 1) / zb;\n }", "getUsedDepth() {\n return this.usedDepth;\n }", "calcTreeDensity () {\n return this.numberOfTrees / this.parkArea;\n }", "function compute_width(depth, areas) {\n if (areas.length == 0) {\n return 0;\n } else {\n area = sum_array(areas);\n return area / depth;\n };\n}", "get depth() {\n\t\treturn this._depth;\n\t}", "minDepth() {\n if (!this.root) {\n return 0;\n }\n const solver = (node) => {\n if (node.left === null && node.right === null) {\n return 1;\n }\n if (node.left === null) {\n return solver(node.right) + 1;\n }\n if (node.right === null) {\n return solver(node.left) + 1;\n }\n return Math.min(solver(node.left), solver(node.right)) + 1;\n };\n return solver(this.root);\n }", "function calculateWidestLevel(root) {}", "depth() {\n if (this.#depth !== undefined)\n return this.#depth;\n if (!this.parent)\n return (this.#depth = 0);\n return (this.#depth = this.parent.depth() + 1);\n }", "function getHeight(root) {}", "function PlanMaxDepth(plan_array){\n var a = 0;\n var max_dp = 1.0;\n for(j = 0 ; j < (plan_array.length/3) ; j++){\n if(plan_array[a+1]*1.0 > max_dp){\n max_dp = plan_array[a+1]*1.0;\n }\n a = a + 3;\n }\n return max_dp;\n}", "minDepth () {\n\t\tif (this.root === null) return 0;\n\n\t\tconst shortest = (node) => {\n\t\t\tif (node.left === null && node.right === null) return 1;\n\t\t\tif (node.left === null) return shortest(node.right) + 1;\n\t\t\tif (node.right === null) return shortest(node.left) + 1;\n\t\t\treturn Math.min(shortest(node.left), shortest(node.right)) + 1;\n\t\t};\n\n\t\treturn shortest(this.root);\n\t}", "function Z(){var e=l.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?e.width||l[t]:e.height||l[t]}", "function Z(){var e=l.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?e.width||l[t]:e.height||l[t]}", "get depth() {\n return this._depth;\n }", "get depth() {\n return this._depth;\n }", "function a$6(a){a.include(a$9),a.code.add(t$i`float linearDepthFromFloat(float depth, vec2 nearFar) {\nreturn -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n}\nfloat linearDepthFromTexture(sampler2D depthTex, vec2 uv, vec2 nearFar) {\nreturn linearDepthFromFloat(rgba2float(texture2D(depthTex, uv)), nearFar);\n}`);}", "function Z(){var e=c.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?e.width||c[t]:e.height||c[t]}", "function getDepth(token) {\n var level = 0;\n var context = token.state.context;\n while (context) {\n level++;\n context = context.prev;\n }\n return level;\n }", "minDepth() {\n\n // check if root exists. \n if (!this.root) return 0;\n\n function minDepthLeftHelper(node) {\n // is leaf node?\n if (node.left === null && node.right === null) return 1;\n if (node.left !== null) return minDepthLeftHelper(node.left) + 1; \n }\n\n function minDepthRightHelper(node) {\n // is leaf node?\n if (node.left === null && node.right === null) return 1;\n if (node.right !== null) return minDepthLeftHelper(node.right) + 1; \n }\n\n let leftNodes = minDepthLeftHelper(this.root);\n let rightNodes = minDepthRightHelper(this.root);\n\n return Math.min(leftNodes, rightNodes);\n }", "function calcVolume (width, height, depth) {\n return width * height * depth;\n}", "function N() {\n var t = p.getBoundingClientRect(),\n e = \"offset\" + [\"Width\", \"Height\"][i.ort];\n return 0 === i.ort ? t.width || p[e] : t.height || p[e]\n }", "maxDepth () {\n\t\tif (this.root === null) return 0;\n\n\t\tconst longest = (node) => {\n\t\t\tif (node.left === null && node.right === null) return 1;\n\t\t\tif (node.left === null) return longest(node.right) + 1;\n\t\t\tif (node.right === null) return longest(node.left) + 1;\n\t\t\treturn Math.max(longest(node.left), longest(node.right)) + 1;\n\t\t};\n\n\t\treturn longest(this.root);\n\t}", "maxDepth() {\n if (!this.root) {\n return 0;\n }\n\n const solver = (node) => {\n if (node.left === null && node.right === null) {\n return 1;\n }\n if (node.left === null) {\n return solver(node.right) + 1;\n }\n if (node.right === null) {\n return solver(node.left) + 1;\n }\n return Math.max(solver(node.left), solver(node.right)) + 1;\n };\n return solver(this.root);\n }", "function localDepth(depth, units) {\n if (typeof depth === 'undefined' || depth == null) {\n return '';\n } else if (units === \"f\") {\n return (depth * 3.28084).toFixed(2) + \" ft\";\n } else {\n return depth.toFixed(2) + \" m\";\n }\n}", "function getControlRatio( depth ) {\n\t\t\t\n\t\t\tif ( depth > 5 ) {\n\t\t\t\t\n\t\t\t\treturn 1;\n\t\t\t\t\n\t\t\t} else if ( depth >= 3 && depth < 5 ) {\n\t\t\t\t\n\t\t\t\treturn 1.5;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\treturn 2;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}", "get m() { return this._edges.length(1); }", "get size() {\n var padding = this.padding;\n var width = 0;\n var height = DEFAULT_EXPR_HEIGHT;\n var sizes = this.getHoleSizes();\n var scale_x = this.scale.x;\n\n if (this._stackVertically) {\n width = EMPTY_EXPR_WIDTH;\n height = 0;\n }\n\n if (sizes.length === 0) return { w:this._size.w, h:this._size.h };\n\n sizes.forEach((s) => {\n if (this._stackVertically) {\n height += s.h;\n width = Math.max(width, s.w);\n }\n else {\n height = Math.max(height, s.h);\n width += s.w + padding.inner;\n }\n });\n\n if (this._stackVertically) {\n width += padding.right + padding.left;\n }\n else {\n width += padding.right; // the end\n }\n\n return { w:width, h: height };\n }", "function normalizeEm (z) {return z / (keyFrame - 1) / n;}", "function innerCanvasArea() {\n var total = parseInt(innerCanvas.style.width) * 2;\n return total;\n }", "GetTreeQuality() {\n return this.m_contactManager.m_broadPhase.GetTreeQuality();\n }", "function frmDepth(thisFrame,ofrm) {\r\n\tvar retVal = '';\r\n\r\n\tfor (var i = 0; i<thisFrame.length; i++) {\r\n\t\tif (thisFrame[i].length > 0) { \r\n\t\t\tretVal = frmDepth(thisFrame[i],ofrm);\r\n\t\t\tif (retVal == '') continue;\r\n\t\t} else if (thisFrame[i] != ofrm) continue;\r\n\t\tretVal = '[' + i + ']' + retVal;\r\n\t\tbreak;\r\n\t}\r\n\r\n\treturn retVal;\r\n}", "get referencePixelsPerUnit() {}", "function levelWidth(root) {\n\tvar answer = [0];\n\tvar tree = [root, 'eor'];\n\n\twhile (tree.length > 1) {\n\t\tvar node = tree.shift();\n\t\tif (node === 'eor') {\n\t\t\tanswer.push(0);\n\t\t\ttree.push('eor');\n\t\t} else {\n\t\t\ttree.push(...node.children);\n\t\t\tanswer[answer.length - 1]++;\n\t\t}\n\t}\n\n\treturn answer;\n}", "function minNodeEntries () {\n return M/2;\n }", "function size() {\n out = 1;\n for (var dim in dimensions) {\n out *= dimensions[dim].members.length;\n }\n return out;\n }", "maxDepth() {\n // check if root exists. \n if (!this.root) return 0;\n\n function minDepthLeftHelper(node) {\n // is leaf node?\n if (node.left === null && node.right === null) return 1;\n if (node.left !== null) return minDepthLeftHelper(node.left) + 1; \n }\n\n function minDepthRightHelper(node) {\n // is leaf node?\n if (node.left === null && node.right === null) return 1;\n if (node.right !== null) return minDepthLeftHelper(node.right) + 1; \n }\n\n let leftNodes = minDepthLeftHelper(this.root);\n let rightNodes = minDepthRightHelper(this.root);\n\n return Math.max(leftNodes, rightNodes);\n }", "function findDimensions()\n{\n var pasca = genTwoPascal(7);\n// var pasc = genTwoPascal(12);\n// var pasc = makeSevenBruitForce();\nvar pasc = pascGen(pasca,5,7,0,pasca)\n//var pasc = testRecursion()\n var map =[]\n dimensionRecurse(pasc,map);\n// Logger.log(map);\n \n}", "surfaceArea() {\n return 2 * (this.length * this.width + this.length * this.height + this.width * this.height);\n }", "function coneDepth(p_x, p_y, cone_x, cone_y) {\n // cone math --> dist to center of cone\n // we have height to radius ratio\n // find height of cone at this radius\n // this is depth to be returned\n\n var distance = sqrt((p_x - cone_x) * (p_x - cone_x) + (p_y - cone_y) * (p_y - cone_y));\n\n // for this, all cones will have height to radius ratio of h: 2, r: 1. so c = h / r = 2.\n const c = 2.0;\n\n return distance * c;\n}", "function computeDimension(topLeft, topRight, bottomLeft, matrix) {\n var moduleSize = (sum(countBlackWhiteRun(topLeft, bottomLeft, matrix, 5)) / 7 + // Divide by 7 since the ratio is 1:1:3:1:1\n sum(countBlackWhiteRun(topLeft, topRight, matrix, 5)) / 7 +\n sum(countBlackWhiteRun(bottomLeft, topLeft, matrix, 5)) / 7 +\n sum(countBlackWhiteRun(topRight, topLeft, matrix, 5)) / 7) / 4;\n var topDimension = Math.round(distance(topLeft, topRight) / moduleSize);\n var sideDimension = Math.round(distance(topLeft, bottomLeft) / moduleSize);\n var dimension = Math.floor((topDimension + sideDimension) / 2) + 7;\n switch (dimension % 4) {\n case 0:\n dimension++;\n break;\n case 2:\n dimension--;\n break;\n }\n return { dimension: dimension, moduleSize: moduleSize };\n}", "getOuterHeight() {\n return this.getHeight();\n }", "get mapWidth() {return ~~(Math.abs(zeach.mapLeft) + zeach.mapRight)}", "calculateDepth() {\n for (let object of this.objects) {\n if (object.isNatural() || object.transitionsToward.length === 0) {\n this.setObjectDepth(object, new Depth({value: 0, craftable: object.isNatural()}));\n }\n }\n }", "getDepth(n) {\r\n return this.getDepthHelper(this.head, n)\r\n }", "function getMaxDepth( bvh ) {\n\n\treturn getBVHExtremes( bvh )[ 0 ].depth.max;\n\n}", "function getSize(width, height, depth){\n let area = (2*width*height)+(2*height*depth) + (2*width*depth);\n let volume = width* height* depth;\n return [area, volume];\n }", "function getLevel() {\n let level = new Uint16Array(1 + (walls.length * 5) + (platforms.length * 4) + (gates.length * 4));\n level[0] = 0;\n for (let i = 0; i < walls.length; i++) {\n let start = (i * 5) + 1;\n level[start] = 0;\n level[start + 1] = walls[i].top;\n level[start + 2] = walls[i].left;\n level[start + 3] = walls[i].height;\n level[start + 4] = walls[i].width;\n }\n for (let i = 0; i < platforms.length; i++) {\n let start = (i * 4) + 1 + (walls.length * 5);\n level[start] = 1;\n level[start + 1] = platforms[i].top;\n level[start + 2] = platforms[i].left;\n level[start + 3] = platforms[i].width;\n }\n for (let i = 0; i < gates.length; i++) {\n let start = (i * 4) + 1 + (walls.length * 5) + (platforms.length * 4);\n level[start] = 2;\n level[start + 1] = gates[i].top;\n level[start + 2] = gates[i].left;\n level[start + 3] = gates[i].side;\n }\n return level;\n}", "getRemainingDepth() {\n return this.remainingDepth;\n }", "size() {\n let _size = node => node === null ? 0 : 1 + _size(node.left) + _size(node.right)\n return _size(this.root)\n }", "function getMetersPerPixel() {\n if (!_map) return 0;\n var y = _map.getSize().y,\n x = _map.getSize().x;\n // calculate the distance the one side of the map to the other using the haversine formula\n var maxMeters = _map.containerPointToLatLng([0, y]).distanceTo(_map.containerPointToLatLng([x, y]));\n return maxMeters / x;\n }", "function getInnerDimentions() {\r\n\t\tvar inner = $(\"#inner\");\r\n\t\t$['mapsettings'].initTop = parseInt(inner.css('top'));\r\n\t\t$['mapsettings'].initLeft = parseInt(inner.css('left'));\r\n\t}", "function computeTreeDepth(tree) {\n let depth = 0\n let p = tree\n let q = [p]\n while (q.length > 0) {\n let qq = []\n for (const x of q) {\n if (x.children) {\n for (const y of x.children) {\n qq.push(y)\n }\n }\n }\n if (qq.length > 0) depth += 1\n q = qq\n }\n\n return depth\n}", "function computeDepth(x) {\n\tvar range1 = \"0123456789\";\n\tvar range2 = \"\";\n\tvar depth = 0;\n\tvar currentX;\n\n\twhile (range2.length < range1.length) {\n\t\tdepth++;\n\t\tcurrentX = (x * depth).toString().split(\"\");\n\n\t\tfor (i = 0; i < currentX.length; i++) {\n\t\t\tif (range2.indexOf(currentX[i]) == -1) {\n\t\t\t\trange2 += currentX[i];\n\t\t\t}\n\t\t}\n\t}\n\treturn depth;\n}", "minDepth() {\n\n if (this.root === null) return 0;\n let depth = 1;\n let nodesToVisit = [this.root];\n let leafFound = false;\n\n while (!leafFound){\n\n let current = nodesToVisit.shift();\n\n if ((current.left === null) && (current.right === null)){\n leafFound = true;\n }\n\n else{\n depth++;\n nodesToVisit.push(current.left);\n nodesToVisit.push(current.right);\n }\n }\n\n return depth;\n }", "get outlineDistance() {\n\t\treturn this.__Internal__Dont__Modify__.outlineDistance;\n\t}", "function t(r,{isPrimitive:t,width:n,depth:o,height:c}){const s=t?10:1;if(null==n&&null==c&&null==o)return [s*r[0],s*r[1],s*r[2]];const i=t$1(n,o,c);let u;for(let e=0;e<3;e++){const t=i[e];if(null!=t){u=t/r[e];break}}for(let e=0;e<3;e++)null==i[e]&&(i[e]=r[e]*u);return i}", "function calculateArea(width, heigth, depth) {\n\tvar area = width * heigth;\n\tvar volume = width * heigth * depth;\n\tvar sizes = [area, volume];\n\treturn sizes;\n}", "function MapSize(levelOfDetail){\n return Math.floor(256 << levelOfDetail);\n}", "sharedDepth(pos) {\n for (let depth = this.depth; depth > 0; depth--)\n if (this.start(depth) <= pos && this.end(depth) >= pos)\n return depth;\n return 0;\n }", "length() {\n return Math.sqrt(this.w * this.w + this.xyz.clone().lengthSq() );\n }", "function levelWidth(root) {\n const arr = [root, 'marker'];\n const widths = [0];\n\n /* do the breadth first traversal, but add a \n marker at the end of each level\n */\n while (arr.length > 1) { // is marker the only thing thats left?\n let elem = arr.shift();\n if (elem === 'marker') {\n // starting a new level\n widths.push(0);\n arr.push('marker');\n } else {\n // on the same level, keep incrementing the counter\n arr.push(...elem.children);\n widths[widths.length - 1]++;\n }\n }\n\n return widths;\n}", "function S(){var e=le.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][n.ort];return 0===n.ort?e.width||le[t]:e.height||le[t]}", "function getMetersPerPixel() {\n if (!_map) return 0;\n var y = _map.getSize().y,\n x = _map.getSize().x;\n // calculate the distance the one side of the map to the other using the haversine formula\n var maxMeters = _map.containerPointToLatLng([0, y]).distanceTo(_map.containerPointToLatLng([x, y]));\n return maxMeters / x;\n}", "function W(){var t=l.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][i.ort];return 0===i.ort?t.width||l[e]:t.height||l[e]}", "function guessDepth(name, maxDepth) {\n\tvar depth = 0;\n\tvar words = name.split(\" \");\n\t//search each word\n\tfor(var i = 0; i<words.length; ++i) {\n\t\tvar n = words[i].search(/Z/i);\n\t\tif(n >= 0){//found \" Z \"\n\t\t\tif(i < words.length - 1){\n\t\t\t\t// case insensitive search for mm\n\t\t\t\tvar m = words[i+1].search(/mm/i);\n\t\t\t\t//case insensitive seach for in\n\t\t\t\tvar inch = words[i+1].search(/in/i);\n\n\t\t\t\t//through\n\t\t\t\tvar thru1 = words[i+1].search(/thru/i);\n\t\t\t\tvar thru2 = words[i+1].search(/through/i);\n\n\t\t\t\tif(m >=0){\n\t\t\t\t\treturn parseFloat(words[i+1]);\n\t\t\t\t}\n\t\t\t\telse if(inch >=0){\n\t\t\t\t\treturn parseFloat(words[i+1]);\n\t\t\t\t}\n\t\t\t\telse if(thru1 >=0 || thru2 >=0){\n\t\t\t\t\treturn maxDepth;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn depth;\n}", "function computeDepth (x){\n let digits = [];\n let multiplier = 1;\n let ctr = 0;\n \n while(digits.length != 10){\n let value = x * multiplier;\n value.toString().split('').map(val => {\n if(!digits.includes(parseInt(val))){\n digits.push(parseInt(val));\n };\n });\n ctr++;\n multiplier++;\n };\n \n return ctr;\n}", "set depth(value) {}", "static flattenDepth() {\n let array = [1, [2, [3, [4]], 5]];\n console.log(_.flattenDepth(array, 30));\n array = [[[[[[{b: 34}]]], {a: 34}]]];\n console.log(_.flattenDepth(array, 2));\n }", "maxDepth() {\n if (this.root === null) return 0;\n let depth = 1;\n let nodesToVisit = [this.root];\n\n while (nodesToVisit.length){\n\n let current = nodesToVisit.pop();\n if ((current.left !== null) || current.right !== null){\n depth++;\n }\n\n if (current.left !== null){\n nodesToVisit.push(current.left);\n }\n if (current.right !== null){\n nodesToVisit.push(current.right);\n }\n }\n return depth;\n }", "getNumActiveDiagnosed() { return this.E1[1] + this.I0[1] + this.I1[1] + this.I2[1] + this.I3[1]; }", "function depth(board){\r\n let count = 0;\r\n board.forEach(row => row.forEach(item => { if (item === BLANK) { count++ } } ));\r\n return count;\r\n}", "getPictureWidth() {\n const mwm = (this.camera.MatrixWidth / 10000); /* Matrix Width in meters */\n const { altitude } = this.mission;\n const fm = (this.camera.Focal / 10000); /* focal in meters */\n return ((mwm * altitude) / fm).toFixed(2);\n }", "function livingVolume(height,width,depth){\n return height*width*depth; \n}", "findSize() {\n var height = window.innerHeight - 180;\n var width = window.innerWidth;\n this.csize = height/width > 1 ? Math.floor(0.9 * width / 4) : Math.floor(0.9 * height / 4);\n }", "function calculateTotalNodes(breath, depth) {\n return ((Math.pow(breath, depth+1)-1) / (breath-1));\n}", "function levelFor(n) {\n return Math.floor((-4 + Math.sqrt(16 + 16*n)) / 8);\n}", "function get_dimensions(elem) {\n\tconsole.log('getting dimensions for: ')\n\tconsole.log(elem)\n\tconsole.log('width:', elem.width())\n\tconsole.log('height:', elem.height())\n\tconsole.log('outerheight:', elem.outerHeight(true))\n\tconsole.log('outerwidth:', elem.outerWidth(true))\n\tconsole.log('offsetHeight:', elem.offsetHeight)\n\tconsole.log('offsetWidth:', elem.offsetWidth)\n}", "function width_at_depth (points, percent_depth){\n var lowest = 1000000;\n var highest = -1000000;\n for (var i = 0; i < points.length; i++){\n if (points[i][1] < lowest){\n lowest = points[i][1];\n }\n if (points[i][1] > highest){\n highest = points[i][1];\n }\n }\n var pair1 = [];\n var pair2 = []; // defines the line segments that intersect with y = -max_depth/2\n var target_y = highest - (Math.abs(highest-lowest)*percent_depth);\n console.log(target_y);\n for (var i = 0; i < points.length; i++){\n if (i === 0){\n // if on the first point, compare with the last point\n if (((points[points.length-1][1]-target_y) * (points[0][1]-target_y)) <= 0){\n // if the differences between the y-coordinates and half of max_depth have opposite signs\n if (pair1.length === 0) {\n pair1 = [points[0], points[points.length - 1]];\n } else{\n pair2 = [points[0], points[points.length - 1]];\n }\n }\n } else {\n if (((points[i-1][1]-target_y) * (points[i][1]-target_y)) <= 0){\n if (pair1.length === 0) {\n pair1 = [points[i-1], points[i]];\n } else{\n pair2 = [points[i-1], points[i]];\n }\n }\n }\n }\n // find x-coordinates of intersections\n var slope1 = (pair1[1][1]-pair1[0][1]) / (pair1[1][0]-pair1[0][0]);\n var slope2 = (pair2[1][1]-pair2[0][1]) / (pair2[1][0]-pair2[0][0]);\n var intersection1 = (target_y-pair1[0][1]) / slope1 + pair1[0][0];\n var intersection2 = (target_y-pair2[0][1]) / slope2 + pair2[0][0];\n return Math.abs(intersection1-intersection2);\n}" ]
[ "0.70453376", "0.6977591", "0.6672398", "0.659132", "0.6397629", "0.63793814", "0.63748723", "0.6357365", "0.61617774", "0.61584806", "0.6149495", "0.6092562", "0.6067058", "0.60467494", "0.5952057", "0.5902736", "0.5902736", "0.5902736", "0.5902736", "0.5902736", "0.5902736", "0.5897217", "0.58925503", "0.58273596", "0.58080035", "0.5767948", "0.57414275", "0.57217497", "0.5720692", "0.56977636", "0.5697413", "0.5640994", "0.5637081", "0.56216997", "0.56216997", "0.56165326", "0.56165326", "0.5613198", "0.5598863", "0.5578379", "0.55728275", "0.55668527", "0.556449", "0.55620354", "0.5559185", "0.55213755", "0.54728997", "0.54715383", "0.54451525", "0.5443245", "0.5408903", "0.5407454", "0.54073983", "0.54052633", "0.54034746", "0.5392375", "0.5389168", "0.53852105", "0.53797334", "0.5371345", "0.5351736", "0.53358036", "0.533104", "0.5326983", "0.5326158", "0.53169674", "0.5311194", "0.5310514", "0.5300914", "0.52950937", "0.5292427", "0.52891284", "0.5284501", "0.52750885", "0.5263084", "0.52613056", "0.5260475", "0.52588433", "0.52509505", "0.5245854", "0.52456355", "0.5245258", "0.52449316", "0.52435225", "0.52422714", "0.5235841", "0.522358", "0.522139", "0.52176327", "0.51890826", "0.51772577", "0.51743555", "0.51728684", "0.5160515", "0.5153457", "0.51527673", "0.51527", "0.51497215", "0.51423705", "0.5141821" ]
0.63906366
5
Empty weight in g
getEmptyWeight() { mustInherit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get weights() { return this.w; }", "function Weight() {\n\tthis.value = Math.random() * .2 - .1;\n\tthis.gradient = 0;\n}", "get weight() {}", "get weighting() { return this._weighting; }", "set weight(value) {}", "countWeights() {\n throw new Error('Unimplemented.');\n }", "function desirableWeight() {\n var desirableWeight = userInfo[\"desirable-weight\"];\n var weight = userInfo[\"weight\"];\n var step1 = weight - desirableWeight;\n var step2 = step1 * 0.32;\n var DW = step2 + desirableWeight;\n return DW;\n}", "weight(e, w=null) {\n\t\tif (w != null) {\n\t\t\tif (!this.hasWeights) this.addWeights();\n\t\t\tthis._weight[e] = w;\n\t\t}\n\t\treturn this.hasWeights ? this._weight[e] : 0;\n\t}", "getMaxWeight() {\n mustInherit();\n }", "get weights() {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }", "function refine_weights(){\n\tfor (var k=0; k<init_weight_structure().length; k += 1){\n\t\tvar m = 0;\n\t\tfor (var l=0; l<w[k].length; l+=1){\n\t\t\tm += abs(w[k][l]);\n\t\t}\n\t\tm /= w[k].length;\n\t\tfor (var l=0; l<w[k].length; l+=1){\n\t\t\tif (m){\n\t\t\t\tw[k][l] *= (1/m);\n\t\t\t}\n\t\t}\n\t}\n}", "get HOUSING_WEIGHTS() { \n return [.180, .300, .170, .160, .090, .050, .040, .010];\n }", "get nonTrainableWeights() {\n return this.layer.nonTrainableWeights;\n }", "get nonTrainableWeights() {\n return this.layer.nonTrainableWeights;\n }", "getWeights() {\n return this.model.getWeights();\n }", "getWeights() {\n return this.model.getWeights();\n }", "getRemainingWeight() {\n return this.remainingWeight;\n }", "subtreeWeight () {\n const localWeight = this.template && this.template.weight;\n\n return this.components.reduce(\n (sum, component) => sum + component.subtreeWeight(),\n localWeight\n );\n }", "weighdown() {\n if(this.type === Node.TARGET || this.type === Node.START) return;\n if(this.type === Node.WALL) this.makeNormal();\n this.pweighted = true;\n this.psquare.classList.add('square--weighted');\n }", "function node_weight(d) {\r\n d.weight = links.filter(function(l) {\r\n return l.source.index == d.index // || l.target.index == d.index \r\n }).length\r\n return d.weight\r\n }", "function stung(weight){\n\tvar stingsPerLb = 8 + 2/3; // stings needed per lb to kill given\n\tvar stun; //defines variable for future to define stings\n\tstun = stingsPerLb * weight; // calculates the stings needed to kill\n\treturn stun; //returns the calculation\n}", "function init_weight_structure(){\n var x = [];\n var wireNum;\n var tempW;\n for (var layer=0; layer<nodesPerLayer.length-1; layer+=1){\n x.push([]);\n wireNum = nodesPerLayer[layer]*nodesPerLayer[layer+1];\n for (var wire=0; wire<wireNum; wire+=1){\n tempW = 0;\n if (nodesPerLayer.length > 2){\n\t tempW = 1;//(10**nodesPerLayer.length) * (10**-5)\n }\n x[layer].push(tempW);\n }\n }\n return x;\n}", "get Weight()\n {\n return fnCalcWeight(this.Shaft, this.Length);\n }", "function hitungBmi(weight, height) {\n return weight / (height * height);\n}", "function computeWeight(i) {\n\t if(dead[i]) {\n\t return Infinity\n\t }\n\t //TODO: Check that the line segment doesn't cross once simplified\n\t var s = inv[i]\n\t var t = outv[i]\n\t if((s<0) || (t<0)) {\n\t return Infinity\n\t } else {\n\t return errorWeight(positions[i], positions[s], positions[t])\n\t }\n\t }", "function computeWeight(i) {\n\t if(dead[i]) {\n\t return Infinity\n\t }\n\t //TODO: Check that the line segment doesn't cross once simplified\n\t var s = inv[i]\n\t var t = outv[i]\n\t if((s<0) || (t<0)) {\n\t return Infinity\n\t } else {\n\t return errorWeight(positions[i], positions[s], positions[t])\n\t }\n\t }", "function suppressWeight(iouThreshold, scale, iou) {\n const weight = Math.exp(scale * iou * iou);\n return iou <= iouThreshold ? weight : 0.0;\n}", "function hb(a,b,c){G.call(this,c);this.g=a||0;this.f=void 0===b?Infinity:b}", "function computeWeight(i) {\n if(dead[i]) {\n return Infinity\n }\n //TODO: Check that the line segment doesn't cross once simplified\n var s = inv[i]\n var t = outv[i]\n if((s<0) || (t<0)) {\n return Infinity\n } else {\n return errorWeight(positions[i], positions[s], positions[t])\n }\n }", "function Gb(){}", "function tightTree(t, g) {\n\t function dfs(v) {\n\t _.forEach(g.nodeEdges(v), function (e) {\n\t var edgeV = e.v,\n\t w = v === edgeV ? e.w : edgeV;\n\n\t if (!t.hasNode(w) && !slack(g, e)) {\n\t t.setNode(w, {});\n\t t.setEdge(v, w, {});\n\t dfs(w);\n\t }\n\t });\n\t }\n\n\t _.forEach(t.nodes(), dfs);\n\n\t return t.nodeCount();\n\t }", "function GridWithWeights(squareGrid) {\n\tthis.squareGrid = squareGrid;\n\tthis.weights = {};\n\n\t// a - from; b - to\n\tthis.cost = function(a, b) {\n\t\t// this implementation doesn't rely on 'from'. In this case, if destination is in weights, return b's cost\n\t\t// else return 1\n\t\tvar to = '' + b[0] + ',' + b[1]; // step we have to do for JavaScript since Object keys are always strings\n\t\treturn this.weights[to] === undefined ? 1 : this.weights[to];\n\t}\n\n\tthis.drawWeightedGrid = function() {\n\t\tvar xLength = this.squareGrid.width,\n\t\t\tyLength = this.squareGrid.height;\n\n\t\tfor (var y = 0; y < yLength; ++y) {\n\t\t\tvar row = '';\n\t\t\tfor (var x = 0; x < xLength; ++x) {\n\t\t\t\tvar val = this.weights['' + x + ',' + y];\n\t\t\t\tif (val !== Infinity) {\n\t\t\t\t\tif (val < 10) {\n\t\t\t\t\t\trow += val + ' ';\n\t\t\t\t\t} else {\n\t\t\t\t\t\trow += val + ' ';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\trow += '###';\n\t\t\t\t}\n\t\t\t}\n\t\t\tconsole.log(row);\n\t\t}\n\t\tconsole.log('\\n');\n\t}\n\n\tthis.drawWeightedGridWithParents = function(start, goal, search) {\n\t\tvar wallObjArr = {};\n\t\tfor (var i = 0; i < this.squareGrid.walls.length; ++i) {\n\t\t\twallObjArr[this.squareGrid.walls[i]] = true;\n\t\t}\n\n\t\tvar parents = search(this, start, goal)[0];\n\n\t\tfor (var y = 0; y < this.squareGrid.height; ++y) {\n\t\t\tvar row = '';\n\t\t\tfor (var x = 0; x < this.squareGrid.width; ++x) {\n \t\t\t\tif (x === goal[0] && y === goal[1]) {\t// print goal\n\t\t\t\t\trow += 'ZZZ';\n\t\t\t\t} \n\t\t\t\telse if (wallObjArr[[x,y]] === true) {\t// print wall\n\t\t\t\t\trow += '###';\n\t\t\t\t} else if (parents[[x,y]] === undefined) {\t// print '.' to signify that this was untouched\n\t\t\t\t\trow += '. ';\n\t\t\t\t} else {\n\t\t\t\t\tvar parent = parents[[x,y]]\n\n\t\t\t\t\tif (parent === null) {\t// we reached the start node\n\t\t\t\t\t\trow += 'AAA';\n\t\t\t\t\t} else if (x === parent[0] - 1) {\n\t\t\t\t\t\trow += '-> '\n\t\t\t\t\t} else if (x === parent[0] + 1) {\n\t\t\t\t\t\trow += '<- ';\n\t\t\t\t\t} else if (y === parent[1] - 1) {\n\t\t\t\t\t\trow += ' v ';\n\t\t\t\t\t} else if (y === parent[1] + 1) {\n\t\t\t\t\t\trow += ' ^ ';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tconsole.log(row);\n\t\t}\n\t\tconsole.log('\\n')\n\t}\t\t\n\n\tthis.reconstructPath = function(start, goal, search) {\n\t\tvar current = goal;\n\t\tvar path = [current];\t\t\n\t\tvar nodes = {};\n\t\tnodes[current] = 1;\n\n\t\tvar cameFrom = search(this, start, goal)[0];\n\n\t\twhile (current[0] !== start[0] || current[1] !== start[1]) {\n\t\t\tcurrent = cameFrom[current];\n\t\t\tpath.push(current);\n\t\t\tnodes[current] = 1;\n\t\t}\n\n\t\tvar xLength = this.squareGrid.width,\n\t\t\tyLength = this.squareGrid.height;\n\n\t\tfor (var y = 0; y < yLength; ++y) {\n\t\t\tvar row = '';\n\t\t\tfor (var x = 0; x < xLength; ++x) {\n\t\t\t\tif (x === start[0] && y === start[1]) {\n\t\t\t\t\trow += 'SSS';\n\t\t\t\t} else if (x === goal[0] && y === goal[1]) {\n\t\t\t\t\trow += 'GGG';\n\t\t\t\t} else {\n\t\t\t\t\tvar tmp = '' + x + ',' + y;\n\t\t\t\t\tif (nodes[tmp] !== undefined) {\n\t\t\t\t\t\trow += '@@@';\n\t\t\t\t\t} else {\n\t\t\t\t\t\trow += ' . ';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tconsole.log(row);\n\t\t}\n\t\tconsole.log('\\n');\t\t\n\t}\n}", "function calculateNetWeight() {\n var grossWeight = 0;\n var palletTare = 0;\n var productTare = 0;\n var palletPackagingTare = 0;\n\n if (!isNaN(parseFloat(getFieldValueById('gross_weight')))) {\n\t grossWeight = parseFloat(getFieldValueById('gross_weight'));\n }\n\n if (!isNaN(parseFloat(getFieldValueById('pallet_tare')))) {\n \tpalletTare = parseFloat(getFieldValueById('pallet_tare'));\n }\n\n if (!isNaN(parseFloat(getFieldValueById('product_tare_total')))) {\n productTare = parseFloat(getFieldValueById('product_tare_total'));\n }\n\n if (!isNaN(parseFloat(getFieldValueById('pallet_packaging_tare')))) {\n palletPackagingTare = parseFloat(getFieldValueById('pallet_packaging_tare'));\n }\n\n\tvar netWeight = grossWeight - (palletTare + productTare + palletPackagingTare);\n\tif (!isNaN(netWeight) && netWeight > 0) {\n\t\tsetFieldValueById('net_weight', netWeight);\n\t} else {\n\t\tsetFieldValueById('net_weight', '0');\n\t}\n}", "f(x1) {\n // output = w1x1 + w2x2 + w3 = 0, => x2 = (-w1x1 - w3) / w2\n return (-this.weights[0]*x1 -this.weights[2]) / this.weights[1];\n }", "function nurbs_weight(idx, t, degree, U) {\r\n // arr will contain the values of the weight functions at different levels\r\n // first, calculate the values of the level zero weight functions\r\n arr.fill(0);\r\n // at level zero find the knot range that return 1 for the parameter value t\r\n for ( var x = idx + degree; x >= idx; --x ) {\r\n if ( t >= U[x] ) {\r\n // if knot range is invalid then return 0 (to eliminate NaN return value)\r\n if ( U[x] == U[x + 1] ) {\r\n return 0;\r\n }\r\n arr[x - idx] = 1;\r\n break;\r\n }\r\n }\r\n // compute the values of the weight functions from level one to level p (degree)\r\n var level = 1;\r\n // on level one there are p (degree) weight functions, the next level with one less, and so on...\r\n for ( x = degree; x >= 1; --x ) {\r\n // at the given level compute all values of weight functions\r\n for ( var y = 0; y < x; ++y ) {\r\n let ii = idx + y;\r\n if ( arr[y] != 0 ) {\r\n arr[y] = ((t - U[ii]) / (U[ii + level] - U[ii])) * arr[y];\r\n }\r\n if ( arr[y + 1] != 0 ) {\r\n arr[y] += ((U[ii + level + 1] - t) / (U[ii + level + 1] - U[ii + 1])) * arr[y + 1];\r\n }\r\n }\r\n ++level;\r\n }\r\n // arr[0] is the value of the N(idx, p)(t) from the formula\r\n return arr[0];\r\n}", "function beeStung(weight) {\n \n //calculate for bee stings\n var stings=8.666666667*weight\n \n //Return number of Bee stings\n return stings;\n}", "function doseInML(weight, mgPerKg, mgPerML) {\n return (weight * mgPerKg) / parseFloat(mgPerML);\n}", "function updateSummationWeights(value) {\n total_weight += value;\n}", "function tightTree(t, g) {\n function dfs(v) {\n _.each(g.nodeEdges(v), function(e) {\n var edgeV = e.v,\n w = (v === edgeV) ? e.w : edgeV;\n if (!t.hasNode(w) && !slack(g, e)) {\n t.setNode(w, {});\n t.setEdge(v, w, {});\n dfs(w);\n }\n });\n }\n\n _.each(t.nodes(), dfs);\n return t.nodeCount();\n}", "function weightSum(source) {\n var dropSum = 0;\n\n for (var drop in source.list) {\n dropSum = dropSum + source.list[drop][1];\n }\n\n dropSum = dropSum + source.none;\n\n return dropSum;\n }", "function tightTree(t, g) {\n function dfs(v) {\n _.forEach(g.nodeEdges(v), function(e) {\n var edgeV = e.v,\n w = (v === edgeV) ? e.w : edgeV;\n if (!t.hasNode(w) && !slack(g, e)) {\n t.setNode(w, {});\n t.setEdge(v, w, {});\n dfs(w);\n }\n });\n }\n\n _.forEach(t.nodes(), dfs);\n return t.nodeCount();\n}", "function tightTree(t, g) {\n function dfs(v) {\n _.forEach(g.nodeEdges(v), function(e) {\n var edgeV = e.v,\n w = (v === edgeV) ? e.w : edgeV;\n if (!t.hasNode(w) && !slack(g, e)) {\n t.setNode(w, {});\n t.setEdge(v, w, {});\n dfs(w);\n }\n });\n }\n\n _.forEach(t.nodes(), dfs);\n return t.nodeCount();\n}", "function tightTree(t, g) {\n function dfs(v) {\n _.forEach(g.nodeEdges(v), function(e) {\n var edgeV = e.v,\n w = (v === edgeV) ? e.w : edgeV;\n if (!t.hasNode(w) && !slack(g, e)) {\n t.setNode(w, {});\n t.setEdge(v, w, {});\n dfs(w);\n }\n });\n }\n\n _.forEach(t.nodes(), dfs);\n return t.nodeCount();\n}", "function tightTree(t, g) {\n function dfs(v) {\n _.forEach(g.nodeEdges(v), function(e) {\n var edgeV = e.v,\n w = (v === edgeV) ? e.w : edgeV;\n if (!t.hasNode(w) && !slack(g, e)) {\n t.setNode(w, {});\n t.setEdge(v, w, {});\n dfs(w);\n }\n });\n }\n\n _.forEach(t.nodes(), dfs);\n return t.nodeCount();\n}", "function tightTree(t, g) {\n function dfs(v) {\n lodash_1.forEach(g.nodeEdges(v), function(e) {\n var edgeV = e.v,\n w = (v === edgeV) ? e.w : edgeV;\n if (!t.hasNode(w) && !slack$1(g, e)) {\n t.setNode(w, {});\n t.setEdge(v, w, {});\n dfs(w);\n }\n });\n }\n\n lodash_1.forEach(t.nodes(), dfs);\n return t.nodeCount();\n}", "function DoomMD5Weight() {\n\n\tthis.joint = 0; // int\n\tthis.bias = 0.0; // float\n\tthis.pos = vec3.create([0.0, 0.0, 0.0]);\n}", "function noNegs(x) {\n for (var i=0; i<x.length; i++) {\n if (x[i]<0) {\n x[i]=0;\n }\n }\n return x;\n}", "function simplify(g){var simplified=(new Graph).setGraph(g.graph());_.forEach(g.nodes(),function(v){simplified.setNode(v,g.node(v))});_.forEach(g.edges(),function(e){var simpleLabel=simplified.edge(e.v,e.w)||{weight:0,minlen:1},label=g.edge(e);simplified.setEdge(e.v,e.w,{weight:simpleLabel.weight+label.weight,minlen:Math.max(simpleLabel.minlen,label.minlen)})});return simplified}", "constructor (weights) {\n this.weights = weights\n if (weights && weights.length) {\n this.capacityWeight = weights[0].value\n this.seniorityWeight = weights[1].value\n this.ageWeight = weights[2].value\n this.genderWeight = weights[3].value\n this.demeanorWeight = weights[4].value\n this.tenureWeight = weights[5].value\n this.leaveWeight = weights[6].value\n this.productivityWeight = weights[7].value\n this.stockWeight = weights[8].value\n this.valuationWeight = weights[9].value\n this.projectionWeight = weights[10].value\n }\n }", "weights() {\n const iterations = i || 1;\n const averagedWeights = {};\n for (const feature in weights) {\n const classes = weights[feature];\n const accumulatedClasses = accumulatedWeights[feature] || {};\n const averagedClasses = {};\n averagedWeights[feature] = averagedClasses;\n for (const label in classes) {\n const weight = classes[label];\n const [total = 0, timestamp = 0] = accumulatedClasses[label] || [];\n const newTotal = total + weight * (iterations - timestamp);\n averagedClasses[label] = newTotal / iterations;\n }\n }\n\n return averagedWeights;\n }", "getWeight(b) {\nreturn this.weight[b];\n}", "getWeights() {\n const weights = [];\n for (const cell of this.cells) {\n weights.push(...cell.weights);\n }\n return Object(_variables__WEBPACK_IMPORTED_MODULE_12__[\"batchGetValue\"])(weights);\n }", "function slack(g,e){return g.node(e.w).rank-g.node(e.v).rank-g.edge(e).minlen}", "function heuristics(weight) {\n choice = 1;\n w = weight;\n}", "function getNewUniformDotValue() {\n return 0.\n }", "function calculateOptimalWeights() {\n var records = JSON.parse(sessionStorage.getItem('records'));\n var vecB = calculateBVector(records);\n var matA = calculateAMatrix(records);\n var transposeMatA = math.transpose(matA);\n var squareMatA = math.multiply(transposeMatA, matA);\n\n if (math.det(squareMatA) == 0) {\n return {\n w0: 0,\n alpha: 0,\n gamma: 0,\n valid: false\n }\n }\n\n var optimalWeights = math.multiply(math.inv(squareMatA), math.multiply(transposeMatA, vecB));\n\n // This is a hacky way to get the data, but I don't know how else to get these\n // values\n return {\n w0: math.exp(optimalWeights._data[0]),\n alpha: optimalWeights._data[1],\n gamma: optimalWeights._data[2],\n valid: true\n };\n}", "function zero(){ return 0;}", "function normalizeCustomWeights() {\n let sum = 0;\n for (let i = 0; i < customWeights.length; ++i) {\n sum += customWeights[i];\n }\n for (let i = 0; i < customWeights.length; ++i) {\n customWeights[i] /= sum;\n }\n}", "function weight(w, p0, p1, p2, p3) {\n return {\n x: w[0] * p0.left + w[1] * p1.left + w[2] * p2.left + w[3] * p3.left,\n y: w[0] * p0.top + w[1] * p1.top + w[2] * p2.top + w[3] * p3.top\n };\n }", "getEmpty() {\n\t\treturn this.direction[4][0];\n\t}", "function tightTree(t,g){function dfs(v){_.forEach(g.nodeEdges(v),function(e){var edgeV=e.v,w=v===edgeV?e.w:edgeV;if(!t.hasNode(w)&&!slack(g,e)){t.setNode(w,{});t.setEdge(v,w,{});dfs(w)}})}_.forEach(t.nodes(),dfs);return t.nodeCount()}", "setWeight(v) {\n this.distance = 1 / Math.abs(parseFloat(v) || 0);\n return this;\n }", "function hungryDog(weight, age) {\n \n if(age >= 1 && weight <= 5) {\n return weight * 0.05\n }else if(age >= 1 && weight <= 6 && weight <= 10) {\n return weight * 0.04\n }else if(age >= 1 && weight <= 11 && weight <= 15) {\n return weight * 0.03\n }else if(age >= 1 && weight <15) {\n return weight * 0.02\n }else if(age < .75 && age >= 0.583) {\n return weight * 0.\n }else if(age < .5 && age >= 0.333) {\n return weight * 0.05\n }else if(age < .33 && age >= 0.333) {\n return weight * 0.05\n }\n \n }", "getEffectiveWeight() {\n\n\t\treturn this._effectiveWeight;\n\n\t}", "function calculateWeightsAndValues(value, weight){\r\n return(value * weight)\r\n}", "get_graph(w) {\n let matrix = [...Array(this.nodes.length)].map(e => Array(this.nodes.length).fill(Z_open()));\n for(let e of this.edges) {\n matrix[e.i][e.j] = e.get_impedance(w);\n matrix[e.j][e.i] = matrix[e.i][e.j];\n }\n return matrix;\n }", "function simplify(g) {\n\t var simplified = new Graph().setGraph(g.graph());\n\n\t _.forEach(g.nodes(), function (v) {\n\t simplified.setNode(v, g.node(v));\n\t });\n\n\t _.forEach(g.edges(), function (e) {\n\t var simpleLabel = simplified.edge(e.v, e.w) || {\n\t weight: 0,\n\t minlen: 1\n\t },\n\t label = g.edge(e);\n\t simplified.setEdge(e.v, e.w, {\n\t weight: simpleLabel.weight + label.weight,\n\t minlen: Math.max(simpleLabel.minlen, label.minlen)\n\t });\n\t });\n\n\t return simplified;\n\t }", "function rateLetterStamped(weight) {\n if (weight <= 1.0) {\n return 0.50;\n } else if (weight <= 2.0) {\n return 0.71;\n } else if (weight <= 3.0) {\n return 0.92;\n } else if (weight <= 3.5) {\n return 1.13;\n } else {\n return rateLargeFlat(weight);\n }\n}", "function deviationBound(G) {\n arr = [0,0,0,0];\n for (i = 0; i < G.vertices.length; i += 1) {\n arr[G.vertices[i].color]++;\n }\n num_of_used_colors = 0;\n arr.forEach(function(a){if(a != 0) num_of_used_colors++;});\n return (num_of_used_colors*max(arr)/G.vertices.length) - 1;\n}", "findMinSpanningTree() {\n let vertexCount = 0\n let weight = 0\n\n let current = this.g[0]\n current.visited = true\n vertexCount++\n\n while (vertexCount < this.g.length) {\n let smallest = null\n\n for (let i = 0; i < this.e.length; i++) {\n if (!this.e[i].visited) {\n if (this.e[i].src.visited && !this.e[i].dest.visited) {\n if (!smallest || this.e[i].weight < smallest.weight) {\n smallest = this.e[i]\n }\n }\n }\n }\n\n smallest.visited = true\n smallest.dest.visited = true\n weight += smallest.weight\n vertexCount++\n }\n return weight\n }", "function weight(w, p0, p1, p2, p3) {\n return {\n x: w[0] * p0.left + w[1] * p1.left + w[2] * p2.left + w[3] * p3.left,\n y: w[0] * p0.top + w[1] * p1.top + w[2] * p2.top + w[3] * p3.top\n };\n }", "function b ( i ) {\n\t\tvar n = sq( w1 ) - sq( w0 ) + ( ( i ? -1 : 1 ) * Math.pow( rho, 4 ) * sq( u1 - u0 ) );\n\t\tvar d = 2 * ( i ? w1 : w0 ) * sq( rho ) * ( u1-u0 );\n\t\treturn n / d;\n\t}", "_gravity() {\n\t for (let x = 0; x < this.columns; x++) {\n\t let columnCondensed = this.coins[x]\n\t .filter(element => !_.isNull(element));\n\n\t // replace nulls:\n\t columnCondensed = columnCondensed\n\t .concat(Array(this.rows - columnCondensed.length).fill(null));\n\n\t this.coins[x] = columnCondensed;\n\t }\n\t }", "function Neuron() {\n\tthis.error = 0;\n\tthis.weightedSum = 0;\n\tthis.activation = 0;\n\tthis.bias = Math.random() * .2 - .1;\n\tthis.biasGradient = 0;\n}", "function weight_field(node) {\n return find_property(node, \"weight\");\n}", "function empty_graph(){\n\tglobal_graph = new bbop.model.graph();\n\tfocus_nodes = {};\n\tjQuery(demo_output_elt).empty();\n }", "get_sum(all_weights) {\n return all_weights;\n }", "function rateLetterMetered(weight) {\n if (weight <= 1.0) {\n return 0.47;\n } else if (weight <= 2.0) {\n return 0.68;\n } else if (weight <= 3.0) {\n return 0.89;\n } else if (weight <= 3.5) {\n return 1.10;\n } else {\n return rateLargeFlat(weight);\n }\n}", "function simplify(g) {\n var simplified = new Graph().setGraph(g.graph());\n _.forEach(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); });\n _.forEach(g.edges(), function(e) {\n var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 };\n var label = g.edge(e);\n simplified.setEdge(e.v, e.w, {\n weight: simpleLabel.weight + label.weight,\n minlen: Math.max(simpleLabel.minlen, label.minlen)\n });\n });\n return simplified;\n}", "function simplify(g) {\n var simplified = new Graph().setGraph(g.graph());\n _.forEach(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); });\n _.forEach(g.edges(), function(e) {\n var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 };\n var label = g.edge(e);\n simplified.setEdge(e.v, e.w, {\n weight: simpleLabel.weight + label.weight,\n minlen: Math.max(simpleLabel.minlen, label.minlen)\n });\n });\n return simplified;\n}", "function simplify(g) {\n var simplified = new Graph().setGraph(g.graph());\n _.forEach(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); });\n _.forEach(g.edges(), function(e) {\n var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 };\n var label = g.edge(e);\n simplified.setEdge(e.v, e.w, {\n weight: simpleLabel.weight + label.weight,\n minlen: Math.max(simpleLabel.minlen, label.minlen)\n });\n });\n return simplified;\n}", "static isValidWeightInKg(weightInKg) {\n return (!Number.isNaN(weightInKg) && weightInKg > BMI.minWeightInKg && weightInKg <= BMI.maxWeightInKg)\n }", "function n0(v) { return nwp(v, 0); }", "function G(){}", "processHeuristicWeight(x,y, currentWeight) {\n this.field[x][y].weight = currentWeight + 5;\n }", "function G(){this.i=0,this.j=0,this.S=new Array}", "function G(){this.i=0,this.j=0,this.S=new Array}", "function weightedClue(clue) {\n return clue ? clue : -10;\n }", "function geo_distnot(prob, k) {\n if (0 < prob <= 1) {\n return Math.pow(1 - prob, k) * prob;\n } else throw \"prob must be between 0 and 1\";\n}", "checkTrainableWeightsConsistency() {\n if (this.collectedTrainableWeights == null) {\n return;\n }\n if (this.trainableWeights.length !==\n this.collectedTrainableWeights.length) {\n console.warn('Discrepancy between trainableweights and collected trainable ' +\n 'weights. Did you set `model.trainable` without calling ' +\n '`model.compile()` afterwards?');\n }\n }", "function CalcFromStartToCurrent_gg(){ //2. Step 2 // LeavesActiveInScene = name & LeafAllWeights = weights\n\t\tfor (var a : int = 0; a < LeavesActiveInSceneInt.Length; a++ ){ \n\t\t\tWeighTheLeaves(LeavesActiveInSceneInt[a], FromStartToCurrentWeight_gg[a]);} \n\t}", "function computeWeight(mat)\n{\n var sum=0;\n for(var int in mat)\n {\n sum+=mat[int];\n }\n if(sum>0)\n return sum;\n else\n return 1.0;\n}", "function normalizeNGramNode (node) {\n var nextTotal = 0.0\n for (var k in node)\n nextTotal += node[k].prob\n for (var k in node) {\n node[k].prob /= nextTotal\n normalizeNGramNode(node[k].backw)\n normalizeNGramNode(node[k].forw)\n }\n}", "function NaN() {}", "function NaN() {}", "function simplify(g) {\n var simplified = new Graph().setGraph(g.graph());\n _.forEach(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); });\n _.forEach(g.edges(), function(e) {\n var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 },\n label = g.edge(e);\n simplified.setEdge(e.v, e.w, {\n weight: simpleLabel.weight + label.weight,\n minlen: Math.max(simpleLabel.minlen, label.minlen)\n });\n });\n return simplified;\n}", "constructor(){\r\n\t\tthis.G = undefined;\r\n\t\tthis.d = undefined;\r\n\t\tthis.dist = undefined;\r\n\t\tthis.steepness = 20;\r\n\t\tthis.inflexiosPontHelye = 0.5;\r\n\t\tthis.shapeOfDif = 1/2;\r\n\t\tthis.z = 3;\r\n\t}", "getEffectiveWeight() {\n\n\t\t\treturn this._effectiveWeight;\n\n\t\t}", "function slack(g, e) {\n\t return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen;\n\t }", "get legStretch() {}" ]
[ "0.66362786", "0.65051657", "0.6379043", "0.63547117", "0.60776156", "0.6066616", "0.59922487", "0.59713954", "0.5887605", "0.5861206", "0.5820973", "0.57785285", "0.5735205", "0.5735205", "0.5666869", "0.5666869", "0.55926895", "0.5547955", "0.5538137", "0.55301785", "0.5526953", "0.54769075", "0.54574627", "0.5433139", "0.54296243", "0.54296243", "0.54295874", "0.54003125", "0.5390738", "0.5390179", "0.53522205", "0.5334856", "0.5331716", "0.53242636", "0.5306675", "0.52842456", "0.5258468", "0.5254417", "0.5249293", "0.5237467", "0.5231778", "0.52301997", "0.52301997", "0.52301997", "0.5214017", "0.5205817", "0.5197471", "0.5191238", "0.51780766", "0.5176108", "0.5169019", "0.51640767", "0.5163344", "0.5137977", "0.5128573", "0.5125987", "0.5116738", "0.51141495", "0.5094942", "0.50945395", "0.5090971", "0.5089077", "0.50885886", "0.50870925", "0.50787324", "0.50758415", "0.5073737", "0.5071347", "0.50687575", "0.5068077", "0.50613356", "0.5059577", "0.50587773", "0.50432795", "0.5042656", "0.50424826", "0.503516", "0.50299835", "0.50231415", "0.50231415", "0.50231415", "0.50216186", "0.5014389", "0.5013622", "0.5004878", "0.5002832", "0.5002832", "0.49960077", "0.4991963", "0.4985127", "0.49848312", "0.4976037", "0.49680448", "0.49616632", "0.49616632", "0.49596408", "0.49572405", "0.49546307", "0.49491245", "0.49447852" ]
0.76582706
0
Inner width in mm
getInnerWidth() { mustInherit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getWidthUnit(){return this.__widthUnit}", "function getWidth() {\n return Math.round(obj.width * scale);\n }", "getOuterWidth() {\n mustInherit();\n }", "function currentWidth(){\n var widthPerMin = 41/(24*60);\n var currentDay = moment().day();\n if(currentDay < 7)\n return widthPerMin * minutesSinceMid() + (widthPerMin * 1440 * (moment().day() - 1));\n }", "function getUnitWidth() {\n var width;\n if ($(\".visible-phone\").is(\":visible\")) {\n width = $isocontainer.width() / 2;\n } else if ($(\".visible-tablet\").is(\":visible\")) {\n width = $isocontainer.width() / 3;\n } else {\n width = $isocontainer.width() / 5;\n }\n return width;\n }", "getPictureWidth() {\n const mwm = (this.camera.MatrixWidth / 10000); /* Matrix Width in meters */\n const { altitude } = this.mission;\n const fm = (this.camera.Focal / 10000); /* focal in meters */\n return ((mwm * altitude) / fm).toFixed(2);\n }", "get maxWidth() {}", "function getWidth(uses) {\n\treturn 1 + Math.min(Math.round(uses/150), 6);\n}", "function _calc() {\n var winW = $w.width() < $t.width() ? $t.width() : $w.width();\n var realW = winW - 2 * cfg.navWidth - cfg.perNumber;\n var itemW = Math.floor(realW / cfg.perNumber);\n return itemW;\n }", "function computeTimeUnitSize(duration){\n\treturn $(\"#diagram\").width()/duration ;\n}", "getWidth() {\n return this.$node.innerWidth();\n }", "getMaxWidthUnit(){return this.__maxWidthUnit}", "function $width(percent) {return window.innerWidth / 100 * percent;}", "function innerWidth(el){\n var style = window.getComputedStyle(el, null);\n return el.clientWidth -\n parseInt(style.getPropertyValue('padding-left'), 10) -\n parseInt(style.getPropertyValue('padding-right'), 10);\n }", "getWidth() {\n return screen.width / this.width;\n }", "getWidth() {\n return screen.width / this.width;\n }", "function getOuterWidth(el) {\n var pattern = /\\d/, // check if value contains digital number\n width = el.offsetWidth,\n style = el.currentStyle || getComputedStyle(el),\n marginLeft = (pattern.exec(style.marginLeft) === null) ? \"0px\" : style.marginLeft,\n marginRight = (pattern.exec(style.marginRight) === null) ? \"0px\" : style.marginRight;\n\n width += parseInt(Length.toPx(el, marginLeft)) + parseInt(Length.toPx(el, marginRight));\n return width;\n}", "getWidth() {\n return this.content >> 22 /* WIDTH_SHIFT */;\n }", "get _width() {\n // The container event's width is determined by the maximum number of\n // events in any of its rows.\n if (this.rows) {\n const columns =\n this.rows.reduce((max, row) => {\n return Math.max(max, row.leaves.length + 1) // add itself\n }, 0) + 1 // add the container\n\n return 100 / columns\n }\n\n const availableWidth = 100 - this.container._width\n\n // The row event's width is the space left by the container, divided\n // among itself and its leaves.\n if (this.leaves) {\n return availableWidth / (this.leaves.length + 1)\n }\n\n // The leaf event's width is determined by its row's width\n return this.row._width\n }", "function getWidth(element) {\n return element[0].offsetWidth;\n }", "getDim(){\n let n = (this.state.size);\n //toFixed(someNum) used to set floating point accuracy\n let width = (100/(2*n-1)).toFixed(2);\n let margin = (100/(4.5*n-1)).toFixed(2);\n // console.log(width,margin);\n return {width,margin}\n}", "function innerCanvasWidth(width) {\n var innerCanvasWidth = width;\n var numBlocks = innerCanvasWidth * blockWidth();\n return numBlocks + 'px'\n }", "function calcUnit(num){\n\t\treturn (document.documentElement.clientWidth / num); \n\t}", "function width(bb) {\n return (bb[1][0] - bb[0][0])\n }", "function width(bb) {\n return (bb[1][0] - bb[0][0])\n }", "function va(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=n(\"span\",\"xxxxxxxxxx\"),r=n(\"pre\",[t]);a(e.measure,r);var f=t.getBoundingClientRect(),o=(f.right-f.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}", "heightToCM(){\n return this.height * 2.54; \n }", "function widthOfEltInDiap () {//the width of any Element in diapo\n\t\treturn Math.floor(fd_ulDiapo[0].offsetWidth / 12);\n\t}", "function calcUnit(num){\n\t\treturn (document.documentElement.clientWidth / num);\n\t}", "function calcUnit(num){\n return (document.documentElement.clientWidth / num);\n}", "getWidth() {\n return this._$mountPoint.width();\n }", "get width() {\n\t\treturn this._viewport[2];\n\t}", "function width(bb) {\n\t\treturn (bb[1][0] - bb[0][0])\n\t\t}", "function getWidth(el) {\n var pattern = /\\d/, // check if value contains digital number\n width = el.clientWidth,\n style = el.currentStyle || getComputedStyle(el),\n paddingLeft = (pattern.exec(style.paddingLeft) === null) ? \"0px\" : style.paddingLeft,\n paddingRight = (pattern.exec(style.paddingRight) === null) ? \"0px\" : style.paddingRight;\n\n width -= (parseInt(Length.toPx(el, paddingLeft)) + parseInt(Length.toPx(el, paddingRight)));\n return width;\n}", "getWidth() { return this.width; }", "get width()\n\t{\n\t\tlet width = Math.max(this._width, this.minWidth);\n\n\t\tif (this.tree.theme.hasGridBehavior)\n\t\t{\n\t\t\tlet step = this.tree.theme.gridSize;\n\t\t\twidth = Math.ceil(width / step) * step;\n\t\t}\n\n\t\treturn width;\n\t}", "getWidth() {\n return this.getSize().width;\n }", "function e(e, r) {\n var i = r || e.extent,\n o = e.width,\n c = Object(_core_unitUtils_js__WEBPACK_IMPORTED_MODULE_0__[\"getMetersPerUnitForSR\"])(i && i.spatialReference);\n return i && o ? i.width / o * c * _core_unitUtils_js__WEBPACK_IMPORTED_MODULE_0__[\"inchesPerMeter\"] * 96 : 0;\n }", "function _c_width() { \n\t\t\t\t\treturn _width + _padding.l + _padding.r; \n\t\t\t\t}", "function setRemUnit() { //将根元素的宽度划分成10份\n var rem = docEl.clientWidth / 10\n docE1.style.fontSize = rem + 'px'\n }", "function largeMagazineWidth() {\n\t\n\treturn 2214;\n\n}", "function getWidth(ev) {\n var durationInMinutes = ev.duration;\n var hrs = parseFloat(durationInMinutes)/parseFloat(60);\n var width = parseFloat(hrs)*parseFloat(RECTANGLE_WIDTH);\n var roundedWidth = Math.round(parseFloat(width)/parseFloat(STEP_WIDTH)) * STEP_WIDTH;\n return roundedWidth;\n}", "getWidth(){return this.__width}", "getWidth() {\n return this.face.width();\n }", "function getVWSize(num) {\n return 1.08 / (num / 100);\n}", "get cellWidth() {\n return (min(width, height) - 2*GRID_BUFFER) / this.cols;\n }", "function getWidth(self) {\r\n return (\r\n parseInt(self.clientWidth) -\r\n parseInt(window.getComputedStyle(self).getPropertyValue(\"padding-left\")) -\r\n parseInt(window.getComputedStyle(self).getPropertyValue(\"padding-right\"))\r\n );\r\n}", "dpi () {\n return this.chart.width / this.interval.width * this.zoom.value;\n }", "function getGraphWidth() {\n\t\treturn width - xOffset * 2;\n\t}", "function h(t){return t.width/t.resolution}", "get size() {\n var padding = this.padding;\n var width = 0;\n var height = DEFAULT_EXPR_HEIGHT;\n var sizes = this.getHoleSizes();\n var scale_x = this.scale.x;\n\n if (this._stackVertically) {\n width = EMPTY_EXPR_WIDTH;\n height = 0;\n }\n\n if (sizes.length === 0) return { w:this._size.w, h:this._size.h };\n\n sizes.forEach((s) => {\n if (this._stackVertically) {\n height += s.h;\n width = Math.max(width, s.w);\n }\n else {\n height = Math.max(height, s.h);\n width += s.w + padding.inner;\n }\n });\n\n if (this._stackVertically) {\n width += padding.right + padding.left;\n }\n else {\n width += padding.right; // the end\n }\n\n return { w:width, h: height };\n }", "getWidth() {\n return this._executeAfterInitialWait(() => this.currently.getWidth());\n }", "function largeMagazineWidth() {\n\treturn 1844;\n}", "function Browser_InnerWidth()\n{\n\t//use the body\n\treturn document.body.offsetWidth;\n}", "get width() {\n // w = width\n return this._w;\n }", "get width() { return this.#format.width; }", "function estimateWidth(item) {\n currFontHeight = fontSize(item);\n return estimate(textValue(item));\n }", "get width () {return this._p.width;}", "get halfWidth() {\n return this.width / 2\n }", "function estimateWidth(item) {\n currFontHeight = fontSize(item);\n return estimate(textValue(item));\n}", "function getWidth() {\n\tvar width = document.getElementById(\"clientText\").clientWidth - PADDING_PX;\n\twidth = width * PX_TO_INCH * INCH_TO_METER * METER_TO_CM;\n\treturn width.toFixed(2);\n}", "function innerCanvasArea() {\n var total = parseInt(innerCanvas.style.width) * 2;\n return total;\n }", "ggw() {\n return this.cr.canvas.width / this.cr.options.scaleFactor;\n }", "function dxt1etc1Size(width, height) {\n return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8;\n }", "get fullWidth() {\n\t\t\treturn this.width + self.margin.right + self.margin.left;\n\t\t}", "function scaleWidth(num) {\n return num * myGanttDiagram._widthFactor;\n}", "getWidth() {\n return this.width;\n }", "getWidth() {\n return this.width;\n }", "get drawWidth() {\n if (this._camera) {\n return this.scaledWidth / this._camera.z / this.pixelRatio;\n }\n return this.scaledWidth / this.pixelRatio;\n }", "get width() {\n return this._boundingBox.width;\n }", "function outerWidth(el) {\r\n var width = el.offsetWidth;\r\n var style = getComputedStyle(el);\r\n\r\n width += parseInt(style.marginLeft) + parseInt(style.marginRight);\r\n return width;\r\n }", "dimension() {\n if (!this.item.width) {\n return '';\n }\n return `${this.item.width}px * ${this.item.height}px`;\n }", "getContainerWidth() {\n return getWidth(this.container);\n }", "width() {\n\t\t\treturn this.data.width;\n\t\t}", "function innerWidth(el) {\n var style = window.getComputedStyle(el, null);\n // Hidden iframe in Firefox returns null, https://github.com/malte-wessel/react-textfit/pull/34\n if (!style) return el.clientWidth;\n return el.clientWidth - parseInt(style.getPropertyValue(\"padding-left\"), 10) - parseInt(style.getPropertyValue(\"padding-right\"), 10);\n}", "measureSize(value) {\n return DomHelper.measureSize(value, this.subGrid ? this.subGrid.element : undefined);\n }", "measureSize(value) {\n return DomHelper.measureSize(value, this.subGrid ? this.subGrid.element : undefined);\n }", "function elementWidth(el) {\n var rect = el.getBoundingClientRect();\n return rect.right - rect.left;\n }", "function computeCustomizedWidth(){\n\tvar note_div = document.querySelector('#note_div');\n\tvar largeWidth = note_div.offsetWidth;\n\tvar margin = NOTE_MARGIN;\n\t//border = 2px\n\tvar border = window.getComputedStyle(note_div).borderWidth[0];\n\treturn (largeWidth - (2*border))/numOfKey -(2*margin) -1;\n}", "function innerDimensions (element) {\n var style = element.ownerDocument.defaultView.getComputedStyle(element);\n return {\n width: parseFloat(style.width) - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight),\n height: parseFloat(style.height) - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom)\n };\n }", "function estimateWidth(item) {\n fontHeight = height(item);\n return estimate(textValue(item));\n}", "function estimateWidth(item) {\n fontHeight = height(item);\n return estimate(textValue(item));\n}", "get width() {\n return this.widthIn;\n }", "function pxScale(input) {\n return input * width / blocks;\n }", "getWidth() {\n return this.content >> Content.WIDTH_SHIFT;\n }", "function calcSize(doc, value) {\r\n var unitType = 'mm';\r\n var width = Math.round(doc.width.value); // Remove unit type from width\r\n var height = Math.round(doc.height.value); // Remove unit type from height\r\n var newWidth = width;\r\n var newHeight = height;\r\n // Convert unit only for large layout >=1000x1000 mm\r\n if (value == true && width >= 1000 && height >= 1000) {\r\n if (isInteger(width / 1000) && isInteger(height / 1000)) {\r\n newWidth = convertUnit(width, '000');\r\n newHeight = convertUnit(height, '000');\r\n unitType = 'm';\r\n } else if (isInteger(width / 10) && isInteger(height / 10)) {\r\n newWidth = convertUnit(width, '0');\r\n newHeight = convertUnit(height, '0');\r\n unitType = 'cm';\r\n }\r\n }\r\n return { 'unit': unitType, 'w': newWidth, 'h': newHeight };\r\n}", "get halfDrawWidth() {\n return this.drawWidth / 2;\n }", "function getDimensionWeight() {\n\tvar dimensionWeight;\n\tdimensionWeight = (getWidth() * getHeight() * THICKNESS_CM) / DIMENSION_WEIGHT_CONVERT;\n\treturn dimensionWeight.toFixed(2);\n}", "get referencePixelsPerUnit() {}", "findSize() {\n var height = window.innerHeight - 180;\n var width = window.innerWidth;\n this.csize = height/width > 1 ? Math.floor(0.9 * width / 4) : Math.floor(0.9 * height / 4);\n }", "getWidth(widget, includeParagraphMark) {\n let width = 0;\n let paraFormat = widget.paragraph.paragraphFormat;\n if (this.isParagraphFirstLine(widget) && !paraFormat.bidi) {\n width += HelperMethods.convertPointToPixel(paraFormat.firstLineIndent);\n }\n for (let i = 0; i < widget.children.length; i++) {\n width += widget.children[i].margin.left + widget.children[i].width;\n }\n if (includeParagraphMark && widget.paragraph.childWidgets.indexOf(widget) === widget.paragraph.childWidgets.length - 1\n && isNullOrUndefined(widget.paragraph.nextSplitWidget)) {\n width += this.viewer.textHelper.getParagraphMarkWidth(widget.paragraph.characterFormat);\n }\n return width;\n }", "getUsedWidth() {\n return this.usedWidth;\n }", "getLargeurDessin()\n\t{\n\t\treturn this._canvas.width;\n\t}", "calcContainerWidth() {\n const { width } = this.getWindowDimensions();\n const dotPatternSize = this.getDotPatternSize();\n const divider = width / dotPatternSize;\n const containerWidth = Math.max(dotPatternSize * Math.floor(divider), 744);\n this.setState({ containerWidth });\n }", "pictureWidth() {\n // Fatboot guard because Node does not have know about this.element\n if (this.isFastBoot) {\n return 320;\n }\n return parseInt(window.getComputedStyle(this.element.parentElement).width);\n }", "function calcNestColWidth(){\n var windowWidth = $window.width();\n if (windowWidth > 1024) {\n return windowWidth / 14;\n } else if (windowWidth < 768) {\n return windowWidth / 4;\n } else {\n return windowWidth / 9;\n }\n }", "get width() { return this._width; }", "getDrawSize () {\r\n return Math.ceil(this.calories / this.gestation * 10)\r\n }", "getInnerLength() {\n mustInherit();\n }", "getPictureWidthWithSidelap() {\n const sidelap = (this.mission.sidelap * 0.01);\n return (this.getPictureWidth() - (this.getPictureWidth() * sidelap)).toFixed(2);\n }" ]
[ "0.71577454", "0.71162516", "0.6757734", "0.67464036", "0.6691984", "0.6663913", "0.6650815", "0.66479796", "0.6621035", "0.660719", "0.65977895", "0.6577248", "0.6563518", "0.6560085", "0.6555368", "0.6555368", "0.65507513", "0.6543067", "0.6541954", "0.6538459", "0.6520852", "0.6517276", "0.6494686", "0.64946103", "0.64946103", "0.6475078", "0.64693815", "0.64662", "0.64627767", "0.64519066", "0.64513266", "0.64507926", "0.64485794", "0.64483994", "0.64367515", "0.64303654", "0.6429259", "0.6425975", "0.64040214", "0.6389241", "0.637744", "0.6361277", "0.6351623", "0.6346105", "0.6342574", "0.63407767", "0.6330952", "0.63118804", "0.6295182", "0.6281592", "0.6278483", "0.6277161", "0.62747175", "0.6256033", "0.6253483", "0.6252624", "0.6241878", "0.6229005", "0.6223984", "0.62193906", "0.6208061", "0.62068146", "0.62021", "0.6191816", "0.61865544", "0.6183215", "0.61768544", "0.61768544", "0.6168411", "0.61627036", "0.61605763", "0.6157517", "0.6157102", "0.6149408", "0.61330086", "0.6130026", "0.6130026", "0.6121634", "0.6119694", "0.61158663", "0.6112113", "0.6112113", "0.61022174", "0.61022043", "0.61018294", "0.6099384", "0.6096471", "0.6095863", "0.60955787", "0.6089909", "0.6083255", "0.60817075", "0.60787386", "0.607707", "0.6061748", "0.60510045", "0.6049792", "0.6045823", "0.60199267", "0.60116905" ]
0.70616734
2
Inner length in mm
getInnerLength() { mustInherit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "heightToCM(){\n return this.height * 2.54; \n }", "function computeTimeUnitSize(duration){\n\treturn $(\"#diagram\").width()/duration ;\n}", "lengthSq() {\n return this.w * this.w + this.xyz.clone().lengthSq();\n }", "getOuterLength() {\n mustInherit();\n }", "function len(feet, inches, eigths) {\n var l = (12 * (feet || 0)) + (inches || 0) + ((eigths || 0) / 8); \n return pixels(l);\n}", "getPictureWidth() {\n const mwm = (this.camera.MatrixWidth / 10000); /* Matrix Width in meters */\n const { altitude } = this.mission;\n const fm = (this.camera.Focal / 10000); /* focal in meters */\n return ((mwm * altitude) / fm).toFixed(2);\n }", "length() {\n return Math.sqrt(this.w * this.w + this.xyz.clone().lengthSq() );\n }", "getDim(){\n let n = (this.state.size);\n //toFixed(someNum) used to set floating point accuracy\n let width = (100/(2*n-1)).toFixed(2);\n let margin = (100/(4.5*n-1)).toFixed(2);\n // console.log(width,margin);\n return {width,margin}\n}", "getDrawSize () {\r\n return Math.ceil(this.calories / this.gestation * 10)\r\n }", "getWidthUnit(){return this.__widthUnit}", "function e(e, r) {\n var i = r || e.extent,\n o = e.width,\n c = Object(_core_unitUtils_js__WEBPACK_IMPORTED_MODULE_0__[\"getMetersPerUnitForSR\"])(i && i.spatialReference);\n return i && o ? i.width / o * c * _core_unitUtils_js__WEBPACK_IMPORTED_MODULE_0__[\"inchesPerMeter\"] * 96 : 0;\n }", "function width(bb) {\n return (bb[1][0] - bb[0][0])\n }", "function width(bb) {\n return (bb[1][0] - bb[0][0])\n }", "get newLength() {\n let result = 0;\n for (let i = 0; i < this.sections.length; i += 2) {\n let ins = this.sections[i + 1];\n result += ins < 0 ? this.sections[i] : ins;\n }\n return result;\n }", "function getWidth() {\n return Math.round(obj.width * scale);\n }", "calcLength(limb) {\n var upper = this.skeleton.bones[limb.upper];\n var lower = this.skeleton.bones[limb.lower];\n var scaling = this.rootMesh.scaling.x;\n limb.upperLength = upper.getAbsolutePosition().subtract(lower.getAbsolutePosition()).length()*scaling;\n if ( lower.children && lower.children[0] ) {\n limb.lowerLength = lower.getAbsolutePosition().subtract(lower.children[0].getAbsolutePosition()).length()*scaling;\n } else {\n limb.lowerLength = 0;\n }\n limb.length = limb.upperLength+limb.lowerLength;\n this.log(\"Length of \"+upper.name+\": \"+limb.upperLength+\", \"+lower.name+\": \"+limb.lowerLength);\n }", "function toRem(length) {\r\n return (parseInt(length) / rem());\r\n }", "function toRem(length) {\r\n return (parseInt(length) / rem());\r\n }", "getBackendFullLen(len){\n\treturn (1+ 2*this.margin_percent/100) * len;\n }", "function size() {\n out = 1;\n for (var dim in dimensions) {\n out *= dimensions[dim].members.length;\n }\n return out;\n }", "function largeMagazineWidth() {\n\t\n\treturn 2214;\n\n}", "function width(bb) {\n\t\treturn (bb[1][0] - bb[0][0])\n\t\t}", "function scaleImageLength(l) {\n return modelView.model2px(0.01 * l);\n }", "getInnerWidth() {\n mustInherit();\n }", "get length() {\n let result = 0;\n for (let i = 0; i < this.sections.length; i += 2)\n result += this.sections[i];\n return result;\n }", "function innerCanvasArea() {\n var total = parseInt(innerCanvas.style.width) * 2;\n return total;\n }", "get referencePixelsPerUnit() {}", "measureSize(value) {\n return DomHelper.measureSize(value, this.subGrid ? this.subGrid.element : undefined);\n }", "measureSize(value) {\n return DomHelper.measureSize(value, this.subGrid ? this.subGrid.element : undefined);\n }", "function getVWSize(num) {\n return 1.08 / (num / 100);\n}", "length() {\n let length = this.end - this.begin;\n if (length < 0) {\n length = this.doubledCapacity + length;\n }\n return length;\n }", "getPixelPerMeter() {\n\t\tlet ppm = new vec2(this.#_fusion.targetOutSize.x/this.#_augmentaScene.scene.x,this.#_fusion.targetOutSize.y/this.#_augmentaScene.scene.y);\n\t\treturn ppm;\n\t}", "calcMaxLength () {\n let maxima = [0.0, 0.0, 0.0]\n let minima = [0.0, 0.0, 0.0]\n let spans = [0.0, 0.0, 0.0]\n\n function comp (v, i) {\n if (i === 0) return v.x\n if (i === 1) return v.y\n if (i === 2) return v.z\n }\n\n let atom = this.getAtomProxy()\n for (let iDim = 0; iDim < 3; iDim++) {\n for (let iAtom = 0; iAtom < this.getAtomCount(); iAtom += 1) {\n let pos = atom.load(iAtom).pos\n if (minima[iDim] > comp(pos, iDim)) {\n minima[iDim] = comp(pos, iDim)\n }\n if (maxima[iDim] < comp(pos, iDim)) {\n maxima[iDim] = comp(pos, iDim)\n }\n }\n spans[iDim] = maxima[iDim] - minima[iDim]\n }\n this.maxLength = Math.max(spans[0], spans[1], spans[2])\n }", "function magnitudeSize(magnitude) {\r\n return magnitude * 40000;\r\n}", "get size() {\n var padding = this.padding;\n var width = 0;\n var height = DEFAULT_EXPR_HEIGHT;\n var sizes = this.getHoleSizes();\n var scale_x = this.scale.x;\n\n if (this._stackVertically) {\n width = EMPTY_EXPR_WIDTH;\n height = 0;\n }\n\n if (sizes.length === 0) return { w:this._size.w, h:this._size.h };\n\n sizes.forEach((s) => {\n if (this._stackVertically) {\n height += s.h;\n width = Math.max(width, s.w);\n }\n else {\n height = Math.max(height, s.h);\n width += s.w + padding.inner;\n }\n });\n\n if (this._stackVertically) {\n width += padding.right + padding.left;\n }\n else {\n width += padding.right; // the end\n }\n\n return { w:width, h: height };\n }", "function calcUnit(num){\n\t\treturn (document.documentElement.clientWidth / num); \n\t}", "get len() { // added to normailze the speed of the ball when it starts\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y);\n\t}", "function largeMagazineWidth() {\n\treturn 1844;\n}", "getEmSize( elem ) {\n return Number(\n getComputedStyle( elem, '' ).fontSize.match(/\\d*\\.?\\d*/)[0]\n );\n }", "get maxWidth() {}", "function getWidth(uses) {\n\treturn 1 + Math.min(Math.round(uses/150), 6);\n}", "function calcUnit(num){\n return (document.documentElement.clientWidth / num);\n}", "function innerWidth(el){\n var style = window.getComputedStyle(el, null);\n return el.clientWidth -\n parseInt(style.getPropertyValue('padding-left'), 10) -\n parseInt(style.getPropertyValue('padding-right'), 10);\n }", "function getsnakelength() {\r\n var length = 0;\r\n for (var i = 0; i < this.snake.length; i++) {\r\n var cur = this.snake[i];\r\n var next = this.snake[(i + 1) % this.snake.length];\r\n length += distance(cur, next);\r\n }\r\n return length;\r\n }", "function calcUnit(num){\n\t\treturn (document.documentElement.clientWidth / num);\n\t}", "totalLength(){\n\n let clen = 0;\n let pts;\n\n for(let i = 0; i < this.nCurves; i++){\n let idx = i*2;\n pts = [ p5.Vector.add(this.cpts[idx], this.cpts[idx+1]).mult(0.5),\n this.cpts[idx+1],\n this.cpts[idx+2],\n p5.Vector.add(this.cpts[idx+2], this.cpts[idx+3]).mult(0.5)\n ];\n \n clen += this.segmentLength(pts);\n }\n\n return clen;\n\n }", "getColumnsAmount() { //metodo para calcular a quantidade de coluna disponivel baseado no tamanho do bloco, para saber as dimensoes do celular\n const width = Dimensions.get('window').width\n return Math.floor(width / this.blockSize)\n }", "function visualLength(text)\n\t{\n\t\tvar ruler = document.getElementById(\"ruler\");\n\t\truler.innerHTML = text;\n\t\treturn ruler.offsetWidth;\n\t}", "function pixels(length) {\n return length * pxPerIn;\n}", "get length() {\n return Math.sqrt(Math.pow(this.x, 2) + Math.pow(this.y, 2));\n }", "getHeightInFeetAndInches(cm) {\n let feetAndInches = (cm * 0.032808).toFixed(2)\n let feetAndInchesArray = feetAndInches.split('.')\n\n return `${feetAndInchesArray[0]}ft/${feetAndInchesArray[1]}in`\n }", "calculateByMetric() {\n\t\tthis.height = this.height/100; // convert cm to meter\n const result = (this.weight) / Math.pow(this.height, 2);\n return Math.round(result* 100) / 100;\n }", "@computed\n get maxAnnotationLength() {\n if (this.rawAnnotations.length == 0) {\n return 0;\n }\n let maxLen = 0;\n this.rawAnnotations.forEach(d => {\n maxLen = Math.max(maxLen, d.endOffset - d.startOffset + 1);\n });\n return maxLen;\n }", "function h(t){return t.width/t.resolution}", "getMaxWidthUnit(){return this.__maxWidthUnit}", "getDotSize(data) {\r\n var container = $(`#${this.container_id}`);\r\n var diameter = Math.floor(container.width() / data.length);\r\n\r\n return {\r\n diameter: diameter,\r\n unit_height: Math.floor((container.height()-diameter) / (Math.max.apply(null, data)))\r\n };\r\n }", "function _calc() {\n var winW = $w.width() < $t.width() ? $t.width() : $w.width();\n var realW = winW - 2 * cfg.navWidth - cfg.perNumber;\n var itemW = Math.floor(realW / cfg.perNumber);\n return itemW;\n }", "dpi () {\n return this.chart.width / this.interval.width * this.zoom.value;\n }", "snpMDG(v) {\n // console.log(v)\n // console.log(Math.round(v/this.cellSize/this.scale) * this.cellSize/this.scale)\n return Math.round(v/this.cellSize) * this.cellSize\n }", "elementSize() {\n const offset = this.bb.__offset(this.bb_pos, 14);\n return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;\n }", "function N() {\n var t = p.getBoundingClientRect(),\n e = \"offset\" + [\"Width\", \"Height\"][i.ort];\n return 0 === i.ort ? t.width || p[e] : t.height || p[e]\n }", "function markerSize(magnitud) {\n return magnitud;\n}", "getPictureHeight() {\n const mhm = (this.camera.MatrixHeight / 10000); /* matrix height in meters */\n const { altitude } = this.mission;\n const fm = (this.camera.Focal / 10000); /* focal in meters */\n return ((mhm * altitude) / fm).toFixed(2);\n }", "function getSize(magnitude) {\n return magnitude * 5\n}", "function getUnitWidth() {\n var width;\n if ($(\".visible-phone\").is(\":visible\")) {\n width = $isocontainer.width() / 2;\n } else if ($(\".visible-tablet\").is(\":visible\")) {\n width = $isocontainer.width() / 3;\n } else {\n width = $isocontainer.width() / 5;\n }\n return width;\n }", "getLength() {\n\n\t\tconst lengths = this.getLengths();\n\t\treturn lengths[ lengths.length - 1 ];\n\n\t}", "getLength() {\n\n\t\tconst lengths = this.getLengths();\n\t\treturn lengths[ lengths.length - 1 ];\n\n\t}", "function getNormalizedSize(count) {\n return 1 + (count - min) / diff;\n }", "function dxt1etc1Size(width, height) {\n return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8;\n }", "function getGridCellSize() {\n return (min(width, height) / 2 - 50) / gridSize;\n}", "getMaxArea() {\r\n\t\treturn this.width * this.length;\r\n\t}", "dimension() {\n if (!this.item.width) {\n return '';\n }\n return `${this.item.width}px * ${this.item.height}px`;\n }", "length () {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }", "length () {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }", "function innerDimensions (element) {\n var style = element.ownerDocument.defaultView.getComputedStyle(element);\n return {\n width: parseFloat(style.width) - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight),\n height: parseFloat(style.height) - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom)\n };\n }", "function subRingLength(inNo) {\n return 70 + inNo * 55;\n}", "function getArea(width, length, unit) {\n var area = width * length;\n return area + \" \" + unit;\n}", "function calcParagraphLength() {\n\treturn Math.ceil(Math.random() * 2);\n}", "getLargeurDessin()\n\t{\n\t\treturn this._canvas.width;\n\t}", "get length() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }", "getLength() {\n return this.currently.getLength();\n }", "function segmentSize(n) {\n return Math.max(Math.trunc(Math.sqrt(n)), 7);\n}", "function determineMaxSize() {\n if (!structureControl) {\n return;\n }\n\n var result = 'calc(100%';\n\n var margin = 0;\n\n if (dimension === dimensions.vertical) {\n margin += parseFloat(structureControl.domElement.css('margin-top')) + parseFloat(structureControl.domElement.css('margin-bottom'));\n } else {\n margin += 3;\n\n margin += parseFloat(structureControl.domElement.css('margin-left')) + parseFloat(structureControl.domElement.css('margin-right'));\n }\n\n if (margin) {\n result += ' - ' + margin.toString() + 'px';\n }\n\n result += ')';\n\n return result;\n }", "function size(d) {\n\n switch (d.nodeType) {\n case \"likerNode\":\n return Math.sqrt(d.size) * 5 || 6;\n case \"taggedNode\":\n return Math.sqrt(d.size) * 5 || 4;\n case \"postNode\":\n return Math.sqrt(d.size) * 5 || 4.5;\n case \"coreNode\":\n return 20;\n case \"year\":\n return Math.sqrt(d.size) / 5 || 8;\n default:\n return Math.sqrt(d.size) * 5 || 4.5;\n }\n }", "getSurfaceArea() {\n const surfaceArea = 6 * Math.pow(this.length, 2);\n return +surfaceArea.toFixed(3);\n }", "getWidth() {\n return this.face.width();\n }", "function markerSize(magnitude) {\n return magnitude / 0.00005;\n }", "function getSizeBrutal(unit, element) {\n\t var testDIV = document.createElement('div')\n\t testDIV.style['font-size'] = '128' + unit\n\t element.appendChild(testDIV)\n\t var size = getPropertyInPX(testDIV, 'font-size') / 128\n\t element.removeChild(testDIV)\n\t return size\n\t}", "function getSizeBrutal(unit, element) {\n\t var testDIV = document.createElement('div')\n\t testDIV.style['font-size'] = '128' + unit\n\t element.appendChild(testDIV)\n\t var size = getPropertyInPX(testDIV, 'font-size') / 128\n\t element.removeChild(testDIV)\n\t return size\n\t}", "get size() {\n if (this.isEmpty)\n return 0;\n let size = this.nextLayer.size;\n for (let chunk of this.chunk)\n size += chunk.value.length;\n return size;\n }", "function toCm(n, unit) {\n // as defined in http://www.w3.org/TR/css3-values/#absolute-lengths\n if (unit === 'cm') return n;else if (unit === 'mm') return n * 0.1;else if (unit === 'in') return n * 2.54;else if (unit === 'px') return n * toCm(1 / 96, 'in');else if (unit === 'pt') return n * toCm(1 / 72, 'in');else if (unit === 'pc') return n * toCm(12, 'pt');\n }", "function getArea(width, length, unit) {\n var area = width * length;\n return area + \" \" + unit;\n}", "getLength() {\n\n\t\tconst lens = this.getCurveLengths();\n\t\treturn lens[ lens.length - 1 ];\n\n\t}", "function getArea(width, length) {\n return width * length;\n}", "function getSizeBrutal(unit, element) {\n var testDIV = document.createElement('div')\n testDIV.style['font-size'] = '128' + unit\n element.appendChild(testDIV)\n var size = getPropertyInPX(testDIV, 'font-size') / 128\n element.removeChild(testDIV)\n return size\n}", "function getSizeBrutal(unit, element) {\n var testDIV = document.createElement('div')\n testDIV.style['font-size'] = '128' + unit\n element.appendChild(testDIV)\n var size = getPropertyInPX(testDIV, 'font-size') / 128\n element.removeChild(testDIV)\n return size\n}", "function getSizeBrutal(unit, element) {\n var testDIV = document.createElement('div')\n testDIV.style['font-size'] = '128' + unit\n element.appendChild(testDIV)\n var size = getPropertyInPX(testDIV, 'font-size') / 128\n element.removeChild(testDIV)\n return size\n}", "function getSizeBrutal(unit, element) {\n var testDIV = document.createElement('div')\n testDIV.style['font-size'] = '128' + unit\n element.appendChild(testDIV)\n var size = getPropertyInPX(testDIV, 'font-size') / 128\n element.removeChild(testDIV)\n return size\n}", "function getSizeBrutal(unit, element) {\n var testDIV = document.createElement('div')\n testDIV.style['font-size'] = '128' + unit\n element.appendChild(testDIV)\n var size = getPropertyInPX(testDIV, 'font-size') / 128\n element.removeChild(testDIV)\n return size\n}", "function getSizeBrutal(unit, element) {\n var testDIV = document.createElement('div')\n testDIV.style['font-size'] = '128' + unit\n element.appendChild(testDIV)\n var size = getPropertyInPX(testDIV, 'font-size') / 128\n element.removeChild(testDIV)\n return size\n}" ]
[ "0.66730547", "0.6512021", "0.64492995", "0.6371724", "0.63370806", "0.6333692", "0.62921405", "0.62853295", "0.6249162", "0.62102234", "0.61507595", "0.6150456", "0.6150456", "0.61270136", "0.6075085", "0.60734886", "0.6064577", "0.6064577", "0.6059837", "0.60574347", "0.6042007", "0.60374826", "0.6026566", "0.6001809", "0.59967715", "0.59754217", "0.5966221", "0.59242773", "0.59242773", "0.5917773", "0.5917011", "0.5908338", "0.59031934", "0.59013486", "0.58927035", "0.5878306", "0.5869621", "0.5868478", "0.58666766", "0.58551776", "0.58549595", "0.58476937", "0.5847374", "0.58433974", "0.5840176", "0.58399147", "0.58377737", "0.58366627", "0.5834901", "0.583446", "0.5830225", "0.5820348", "0.58179724", "0.58122057", "0.5809833", "0.5807359", "0.58007663", "0.5792421", "0.57906467", "0.5788763", "0.5786783", "0.5782178", "0.578124", "0.57750076", "0.57745314", "0.5770582", "0.5770582", "0.5760974", "0.5757651", "0.57441944", "0.5744106", "0.5738169", "0.5736909", "0.5736909", "0.57354426", "0.573435", "0.5717854", "0.5716313", "0.57069546", "0.57067555", "0.57062846", "0.5702427", "0.570051", "0.5691515", "0.5672939", "0.56695056", "0.56688464", "0.56679237", "0.56679237", "0.5659137", "0.56587046", "0.5654093", "0.5653419", "0.5648526", "0.5643169", "0.5643169", "0.5643169", "0.5643169", "0.5643169", "0.5643169" ]
0.6572922
1
Inner depth in mm
getInnerDepth() { mustInherit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get depth() {}", "get Depth() {}", "function getDepth(mag) {\n return (mag/10) \n }", "computeMaxDepth() {\n let d = 0;\n for (const child of this.components) {\n d = Math.max(d + 1, child.children.computeMaxDepth());\n }\n return d;\n }", "function _depth() { \n\t\t\t\t\treturn Math.max( Math.min( _pointA.z, _pointB.z ), 0.0001 ); \n\t\t\t\t}", "depth() {\n return 0;\n }", "getOuterDepth() {\n mustInherit();\n }", "getDepth() {\n return this.depth;\n }", "function calcMaxRecursionDepth() {\n return min(7, floor(log2(pixelCount)))\n}", "get depth() {\n\t\treturn this._depth;\n\t}", "getClosetDepth() { return this.faces.get(FaceOrientation.BASE).depth(); }", "get depth() {\n return this._depth;\n }", "get depth() {\n return this._depth;\n }", "function getDepth(token) {\n var level = 0;\n var context = token.state.context;\n while (context) {\n level++;\n context = context.prev;\n }\n return level;\n }", "getModuleDepth(){return this.module_base_face_dimensions_axes[2];}", "getUsedDepth() {\n return this.usedDepth;\n }", "getDepth(n) {\r\n return this.getDepthHelper(this.head, n)\r\n }", "function calculateZ(depth,zInLevel){var zb=depth * Z_BASE + zInLevel;return (zb - 1) / zb;}", "set depth(value) {}", "function avgDepth(min, max){\n\treturn (min + max) / 2;\n}", "maxDepth () {\n\t\tif (this.root === null) return 0;\n\n\t\tconst longest = (node) => {\n\t\t\tif (node.left === null && node.right === null) return 1;\n\t\t\tif (node.left === null) return longest(node.right) + 1;\n\t\t\tif (node.right === null) return longest(node.left) + 1;\n\t\t\treturn Math.max(longest(node.left), longest(node.right)) + 1;\n\t\t};\n\n\t\treturn longest(this.root);\n\t}", "getDepth(obj, path) {\n return path.split('.').reduce((value, tag) => {\n return value[tag];\n }, obj);\n }", "depth() {\n if (this.#depth !== undefined)\n return this.#depth;\n if (!this.parent)\n return (this.#depth = 0);\n return (this.#depth = this.parent.depth() + 1);\n }", "static flattenDepth() {\n let array = [1, [2, [3, [4]], 5]];\n console.log(_.flattenDepth(array, 30));\n array = [[[[[[{b: 34}]]], {a: 34}]]];\n console.log(_.flattenDepth(array, 2));\n }", "function getHeight(root) {}", "function PlanMaxDepth(plan_array){\n var a = 0;\n var max_dp = 1.0;\n for(j = 0 ; j < (plan_array.length/3) ; j++){\n if(plan_array[a+1]*1.0 > max_dp){\n max_dp = plan_array[a+1]*1.0;\n }\n a = a + 3;\n }\n return max_dp;\n}", "function calculateWidestLevel(root) {}", "function getLevelDepth( e, id, waypoint, cnt ) {\n\t\tcnt = cnt || 0;\n\t\tif ( e.id.indexOf( id ) >= 0 ) return cnt;\n\t\tif( classie.has( e, waypoint ) ) {\n\t\t\t++cnt;\n\t\t}\n\t\treturn e.parentNode && getLevelDepth( e.parentNode, id, waypoint, cnt );\n\t}", "maxDepth() {\n if (!this.root) {\n return 0;\n }\n\n const solver = (node) => {\n if (node.left === null && node.right === null) {\n return 1;\n }\n if (node.left === null) {\n return solver(node.right) + 1;\n }\n if (node.right === null) {\n return solver(node.left) + 1;\n }\n return Math.max(solver(node.left), solver(node.right)) + 1;\n };\n return solver(this.root);\n }", "getRemainingDepth() {\n return this.remainingDepth;\n }", "function getLevelDepth( e, id, waypoint, cnt ) {\n\t\tcnt = cnt || 0;\n\t\tif ( e.id.indexOf( id ) >= 0 ) return cnt;\n\t\tif( $( e).hasClass( waypoint ) ) {\n\t\t\t++cnt;\n\t\t}\n\t\treturn e.parentNode && getLevelDepth( e.parentNode, id, waypoint, cnt );\n\t}", "function getLevelDepth( e, id, waypoint, cnt ) {\n cnt = cnt || 0;\n if ( e.id.indexOf( id ) >= 0 ) return cnt;\n if( classie.has( e, waypoint ) ) {\n ++cnt;\n }\n return e.parentNode && getLevelDepth( e.parentNode, id, waypoint, cnt );\n }", "function frmDepth(thisFrame,ofrm) {\r\n\tvar retVal = '';\r\n\r\n\tfor (var i = 0; i<thisFrame.length; i++) {\r\n\t\tif (thisFrame[i].length > 0) { \r\n\t\t\tretVal = frmDepth(thisFrame[i],ofrm);\r\n\t\t\tif (retVal == '') continue;\r\n\t\t} else if (thisFrame[i] != ofrm) continue;\r\n\t\tretVal = '[' + i + ']' + retVal;\r\n\t\tbreak;\r\n\t}\r\n\r\n\treturn retVal;\r\n}", "minDepth() {\n if (!this.root) {\n return 0;\n }\n const solver = (node) => {\n if (node.left === null && node.right === null) {\n return 1;\n }\n if (node.left === null) {\n return solver(node.right) + 1;\n }\n if (node.right === null) {\n return solver(node.left) + 1;\n }\n return Math.min(solver(node.left), solver(node.right)) + 1;\n };\n return solver(this.root);\n }", "function calculateZ(depth, zInLevel) {\n\t var zb = depth * Z_BASE + zInLevel;\n\t return (zb - 1) / zb;\n\t}", "function guessDepth(name, maxDepth) {\n\tvar depth = 0;\n\tvar words = name.split(\" \");\n\t//search each word\n\tfor(var i = 0; i<words.length; ++i) {\n\t\tvar n = words[i].search(/Z/i);\n\t\tif(n >= 0){//found \" Z \"\n\t\t\tif(i < words.length - 1){\n\t\t\t\t// case insensitive search for mm\n\t\t\t\tvar m = words[i+1].search(/mm/i);\n\t\t\t\t//case insensitive seach for in\n\t\t\t\tvar inch = words[i+1].search(/in/i);\n\n\t\t\t\t//through\n\t\t\t\tvar thru1 = words[i+1].search(/thru/i);\n\t\t\t\tvar thru2 = words[i+1].search(/through/i);\n\n\t\t\t\tif(m >=0){\n\t\t\t\t\treturn parseFloat(words[i+1]);\n\t\t\t\t}\n\t\t\t\telse if(inch >=0){\n\t\t\t\t\treturn parseFloat(words[i+1]);\n\t\t\t\t}\n\t\t\t\telse if(thru1 >=0 || thru2 >=0){\n\t\t\t\t\treturn maxDepth;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn depth;\n}", "function calculateZ(depth, zInLevel) {\n\t var zb = depth * Z_BASE + zInLevel;\n\t return (zb - 1) / zb;\n\t }", "set Depth(value) {}", "function a$6(a){a.include(a$9),a.code.add(t$i`float linearDepthFromFloat(float depth, vec2 nearFar) {\nreturn -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n}\nfloat linearDepthFromTexture(sampler2D depthTex, vec2 uv, vec2 nearFar) {\nreturn linearDepthFromFloat(rgba2float(texture2D(depthTex, uv)), nearFar);\n}`);}", "function findDimensions()\n{\n var pasca = genTwoPascal(7);\n// var pasc = genTwoPascal(12);\n// var pasc = makeSevenBruitForce();\nvar pasc = pascGen(pasca,5,7,0,pasca)\n//var pasc = testRecursion()\n var map =[]\n dimensionRecurse(pasc,map);\n// Logger.log(map);\n \n}", "get m() { return this._edges.length(1); }", "maxDepth() {\n // check if root exists. \n if (!this.root) return 0;\n\n function minDepthLeftHelper(node) {\n // is leaf node?\n if (node.left === null && node.right === null) return 1;\n if (node.left !== null) return minDepthLeftHelper(node.left) + 1; \n }\n\n function minDepthRightHelper(node) {\n // is leaf node?\n if (node.left === null && node.right === null) return 1;\n if (node.right !== null) return minDepthLeftHelper(node.right) + 1; \n }\n\n let leftNodes = minDepthLeftHelper(this.root);\n let rightNodes = minDepthRightHelper(this.root);\n\n return Math.max(leftNodes, rightNodes);\n }", "function getDepth(node) {\n let d = 0;\n while (node.left != null) {\n node = node.left;\n d++;\n }\n return d;\n}", "maxDepth() {\n if (this.root === null) return 0;\n let depth = 1;\n let nodesToVisit = [this.root];\n\n while (nodesToVisit.length){\n\n let current = nodesToVisit.pop();\n if ((current.left !== null) || current.right !== null){\n depth++;\n }\n\n if (current.left !== null){\n nodesToVisit.push(current.left);\n }\n if (current.right !== null){\n nodesToVisit.push(current.right);\n }\n }\n return depth;\n }", "sharedDepth(pos) {\n for (let depth = this.depth; depth > 0; depth--)\n if (this.start(depth) <= pos && this.end(depth) >= pos)\n return depth;\n return 0;\n }", "function max_depth(d){\nfunction max_depth_rec(d, depth){\n\tif( d.children ){\n\t\tvar result = 0;\n\t\tfor(var i=0; i < d.children.length; ++i){\n\t\t\ttmp = max_depth_rec(d.children[i], depth+1);\n\t\t\tresult = Math.max(result, tmp);\n\t\t}\n\t\treturn result;\n\t}else{\n\t\treturn depth;\n\t}\n}\nreturn max_depth_rec(d, 1);\n}", "calcTreeDensity () {\n return this.numberOfTrees / this.parkArea;\n }", "function computeTreeDepth(tree) {\n let depth = 0\n let p = tree\n let q = [p]\n while (q.length > 0) {\n let qq = []\n for (const x of q) {\n if (x.children) {\n for (const y of x.children) {\n qq.push(y)\n }\n }\n }\n if (qq.length > 0) depth += 1\n q = qq\n }\n\n return depth\n}", "calculateDepth() {\n for (let object of this.objects) {\n if (object.isNatural() || object.transitionsToward.length === 0) {\n this.setObjectDepth(object, new Depth({value: 0, craftable: object.isNatural()}));\n }\n }\n }", "function maxDepth(node,depth){\n\tif(('children' in node) & (node['children'].length>0)){\n\t\tm=0;\n\t\tfor(var i=0,tot=node.children.length;i<tot;i++){\n\t\t\tm = Math.max(m,maxDepth(node.children[i]));\n\t\t}\n\t\tm=m+1;\n\t\treturn m;\n\t}\n\telse {\n\t\treturn 0;\n\t}\n}", "function getMaxDepth( bvh ) {\n\n\treturn getBVHExtremes( bvh )[ 0 ].depth.max;\n\n}", "minDepth () {\n\t\tif (this.root === null) return 0;\n\n\t\tconst shortest = (node) => {\n\t\t\tif (node.left === null && node.right === null) return 1;\n\t\t\tif (node.left === null) return shortest(node.right) + 1;\n\t\t\tif (node.right === null) return shortest(node.left) + 1;\n\t\t\treturn Math.min(shortest(node.left), shortest(node.right)) + 1;\n\t\t};\n\n\t\treturn shortest(this.root);\n\t}", "function computeDepth(x) {\n\tvar range1 = \"0123456789\";\n\tvar range2 = \"\";\n\tvar depth = 0;\n\tvar currentX;\n\n\twhile (range2.length < range1.length) {\n\t\tdepth++;\n\t\tcurrentX = (x * depth).toString().split(\"\");\n\n\t\tfor (i = 0; i < currentX.length; i++) {\n\t\t\tif (range2.indexOf(currentX[i]) == -1) {\n\t\t\t\trange2 += currentX[i];\n\t\t\t}\n\t\t}\n\t}\n\treturn depth;\n}", "function calculateZ(depth, zInLevel) {\n var zb = depth * Z_BASE + zInLevel;\n return (zb - 1) / zb;\n}", "function calculateZ(depth, zInLevel) {\n var zb = depth * Z_BASE + zInLevel;\n return (zb - 1) / zb;\n}", "function calculateZ(depth, zInLevel) {\n var zb = depth * Z_BASE + zInLevel;\n return (zb - 1) / zb;\n}", "function calculateZ(depth, zInLevel) {\n var zb = depth * Z_BASE + zInLevel;\n return (zb - 1) / zb;\n}", "function calculateZ(depth, zInLevel) {\n var zb = depth * Z_BASE + zInLevel;\n return (zb - 1) / zb;\n}", "function calculateZ(depth, zInLevel) {\n var zb = depth * Z_BASE + zInLevel;\n return (zb - 1) / zb;\n}", "function getDepth(field) {\n return field.split(\".\").length;\n }", "minDepth() {\n\n // check if root exists. \n if (!this.root) return 0;\n\n function minDepthLeftHelper(node) {\n // is leaf node?\n if (node.left === null && node.right === null) return 1;\n if (node.left !== null) return minDepthLeftHelper(node.left) + 1; \n }\n\n function minDepthRightHelper(node) {\n // is leaf node?\n if (node.left === null && node.right === null) return 1;\n if (node.right !== null) return minDepthLeftHelper(node.right) + 1; \n }\n\n let leftNodes = minDepthLeftHelper(this.root);\n let rightNodes = minDepthRightHelper(this.root);\n\n return Math.min(leftNodes, rightNodes);\n }", "function calculateZ(depth, zInLevel) {\n var zb = depth * Z_BASE + zInLevel;\n return (zb - 1) / zb;\n }", "function getDepth(node) {\n if (!node) {\n return 0;\n }\n\n var left = getDepth(node.left);\n var right = getDepth(node.right);\n\n return left > right ? left + 1 : right + 1;\n}", "depth(path = this.cwd) {\n if (typeof path === 'string') {\n path = this.cwd.resolve(path);\n }\n return path.depth();\n }", "function maxDepth2(root) {\n if (!root) return 0\n\n return 1 + Math.max(maxDepth2(root.left), maxDepth2(root.right))\n}", "minDepth() {\n\n if (this.root === null) return 0;\n let depth = 1;\n let nodesToVisit = [this.root];\n let leafFound = false;\n\n while (!leafFound){\n\n let current = nodesToVisit.shift();\n\n if ((current.left === null) && (current.right === null)){\n leafFound = true;\n }\n\n else{\n depth++;\n nodesToVisit.push(current.left);\n nodesToVisit.push(current.right);\n }\n }\n\n return depth;\n }", "height() {\n return this.heightVisitor(this.root)\n }", "function getTreeHeight(){\r\n\t\tvar res = 0;\r\n\t\tvar addingHeight = 1;\r\n\t\tif(this.name == \"\")\r\n\t\t\taddingHeight = 0;\r\n\t\t\r\n\t\tif(this.expanded){\r\n\t\t\tfor(var i = 0; i < this.childCount; i++){\r\n\t\t\t\tvar tmp = this.child[i].getHeight();\r\n\t\t\t\tif(tmp > res)\r\n\t\t\t\t\tres = tmp\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res + addingHeight;\r\n\t\t\r\n\t}", "function computeDepth(dom) {\n var maxDepth = 0;\n var minDepth = 1024; // A random large number, the depth of a\n // DOM tree mostly is less than that.\n var avgDepth = 0;\n var tempNode = 0;\n var tempDepth = 0;\n\n for (var i = 0; i < dom.length; i++) {\n tempNode = dom[i];\n tempDepth = 0;\n\n while (tempNode.parentNode) {\n tempNode = tempNode.parentNode;\n tempDepth++;\n }\n\n if (maxDepth < tempDepth) {\n maxDepth = tempDepth;\n } else if (minDepth > tempDepth) {\n minDepth = tempDepth;\n }\n\n avgDepth += tempDepth;\n }\n //The avg is the depth of each node divided by the num of nodes.\n avgDepth = avgDepth / dom.length;\n\n depths = new Array(3);\n depths[0] = maxDepth;\n depths[1] = minDepth;\n depths[2] = avgDepth;\n\n return depths;\n}", "function computeDepth (x){\n let digits = [];\n let multiplier = 1;\n let ctr = 0;\n \n while(digits.length != 10){\n let value = x * multiplier;\n value.toString().split('').map(val => {\n if(!digits.includes(parseInt(val))){\n digits.push(parseInt(val));\n };\n });\n ctr++;\n multiplier++;\n };\n \n return ctr;\n}", "function levelWidth(root) {\n const arr = [root, 'marker'];\n const widths = [0];\n\n /* do the breadth first traversal, but add a \n marker at the end of each level\n */\n while (arr.length > 1) { // is marker the only thing thats left?\n let elem = arr.shift();\n if (elem === 'marker') {\n // starting a new level\n widths.push(0);\n arr.push('marker');\n } else {\n // on the same level, keep incrementing the counter\n arr.push(...elem.children);\n widths[widths.length - 1]++;\n }\n }\n\n return widths;\n}", "async getPropertiesDepth(keys, depth) {\n let lastValidDepth = depth;\n for (let i = depth - 1; i > 0; i--) {\n if (typeof keys[i] !== 'number') { // Skip array keys\n const parentKey = await this.unaliasKeyword(keys[i], keys, i);\n if (parentKey === '@reverse') {\n return i;\n }\n else if (parentKey === '@nest') {\n lastValidDepth = i;\n }\n else {\n return lastValidDepth;\n }\n }\n }\n return lastValidDepth;\n }", "function docDepth(e) {\n if (e.parentElement === document.body) {\n return 1;\n } else {\n return 1 + docDepth(e.parentElement);\n }\n }", "initDepths(columns = this.columns, parent = null) {\n let me = this,\n maxDepth = 0;\n\n if (parent && parent.meta) parent.meta.depth++;\n\n for (let column of columns) {\n // TODO: this should maybe move\n column.meta.depth = 0;\n\n if (column.children) {\n me.initDepths(column.children, column);\n if (column.meta.depth && parent) parent.meta.depth += column.meta.depth;\n }\n\n if (column.meta.depth > maxDepth) maxDepth = column.meta.depth;\n }\n\n if (!parent) {\n this.maxDepth = maxDepth;\n }\n\n return maxDepth;\n }", "function getDepth (value) {\n if (value === false) {\n return 0\n }\n if (value === true || value === void 0) {\n return 1\n }\n\n const depth = parseInt(value, 10);\n return isNaN(depth) ? 0 : depth\n }", "function depth(element, root) {\n var depth = 1;\n while (true) {\n if (element[0] === root[0]) {\n break;\n }\n depth++;\n element = $(element).parent().parent();\n }\n return depth;\n }", "size() {\n let _size = node => node === null ? 0 : 1 + _size(node.left) + _size(node.right)\n return _size(this.root)\n }", "function localDepth(depth, units) {\n if (typeof depth === 'undefined' || depth == null) {\n return '';\n } else if (units === \"f\") {\n return (depth * 3.28084).toFixed(2) + \" ft\";\n } else {\n return depth.toFixed(2) + \" m\";\n }\n}", "function maxLevel(node,height=0){\n\tvar sum=0;\n\tif('children' in node) {\n\t\tfor(var i=0,tot=node.children.length;i<tot;i++){\n\t\t\tsum = sum+maxLevel(node.children[i],height)\n\t\t}\n\t\tsum=sum+height;\n\t}\n\treturn sum+height;\n}", "recursiveDepthCalc(el, sum) {\n if (el.parentElement.id === 'fatherNode') {\n return sum+1;\n }\n else if (el.tagName !== 'UL') {\n return this.recursiveDepthCalc(el.parentElement, sum);\n }\n else {\n return this.recursiveDepthCalc(el.parentElement, sum + 1);\n }\n }", "function levelWidth(root) {\n\tvar answer = [0];\n\tvar tree = [root, 'eor'];\n\n\twhile (tree.length > 1) {\n\t\tvar node = tree.shift();\n\t\tif (node === 'eor') {\n\t\t\tanswer.push(0);\n\t\t\ttree.push('eor');\n\t\t} else {\n\t\t\ttree.push(...node.children);\n\t\t\tanswer[answer.length - 1]++;\n\t\t}\n\t}\n\n\treturn answer;\n}", "function find_height(root) \n{\n let result = dfs(root);\n return result;\n}", "function flattenDepth(array,n)\n{\nconsole.log(array.flat(n));\n}", "function depth(board){\r\n let count = 0;\r\n board.forEach(row => row.forEach(item => { if (item === BLANK) { count++ } } ));\r\n return count;\r\n}", "function heightOfTree(root) {\n let depth = 0;\n\n const dfs = (node, levels) => {\n if (!node) return 0;\n if (levels > depth) depth = levels;\n for (let child of node.children) {\n dfs(child, levels + 1)\n }\n\n return levels;\n }\n\n dfs(root, 0)\n return depth;\n}", "GetTreeHeight() {\n return this.m_contactManager.m_broadPhase.GetTreeHeight();\n }", "function getMaxDepth(tree) {\n if (tree === null) {\n return 0;\n }\n\n let lDepth = getMaxDepth(tree.left);\n let rDepth = getMaxDepth(tree.right);\n\n if (lDepth > rDepth) {\n return (lDepth + 1);\n } else {\n return rDepth + 1;\n };\n ;\n}", "function D(e){if(null==e.parent)return null;for(var t=e.parent,a=d(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var r=0;n.children[r]!=t;++r)a+=n.children[r].chunkSize();return a+t.first}", "function ye(e){e=de(e);for(var t=0,a=e.parent,n=0;n<a.lines.length;++n){var r=a.lines[n];if(r==e)break;t+=r.height}for(var f=a.parent;f;a=f,f=a.parent)for(var o=0;o<f.children.length;++o){var i=f.children[o];if(i==a)break;t+=i.height}return t}", "GetTreeQuality() {\n return this.m_contactManager.m_broadPhase.GetTreeQuality();\n }", "function calculateTotalNodes(breath, depth) {\n return ((Math.pow(breath, depth+1)-1) / (breath-1));\n}", "function getSize(width, height, depth){\n let area = (2*width*height)+(2*height*depth) + (2*width*depth);\n let volume = width* height* depth;\n return [area, volume];\n }", "function depth(path, root) {\n var i = 0;\n while (!path.indexOf(root) && (path = sysPath.dirname(path)) !== root) {\n i++;\n }return i;\n}", "function maxDepth(root) {\n if (root){\n let left = maxDepth(root.left)\n let right = maxDepth(root.right)\n let max = left > right ? (left + 1) : (right +1)\n return max\n } else {return 0}\n}", "function getCmdMaxDepth(cmdTree, depth=0) {\n if (cmdTree.next !== undefined) {\n let depthArray = []\n for (let cmdCurr of cmdTree.next) \n depthArray.push(getCmdMaxDepth(cmdCurr, depth+1));\n return depthArray.reduce((a, b)=>{\n return Math.max(a, b);\n });\n } else {\n return depth;\n }\n}", "function setDepth(obj) {\n if (obj.children) {\n obj.children.forEach(function (d) {\n depthTemp++;\n setDepth(d);\n if (depthTemp > depth) {\n depth = depthTemp;\n }\n depthTemp = 0;\n });\n }\n depthTemp++;\n }", "getPixelPerMeter() {\n\t\tlet ppm = new vec2(this.#_fusion.targetOutSize.x/this.#_augmentaScene.scene.x,this.#_fusion.targetOutSize.y/this.#_augmentaScene.scene.y);\n\t\treturn ppm;\n\t}", "heightOfTree(root) {\n if (root === null) {\n return 0;\n }\n let leftHeight = this.heightOfTree(root.left);\n let rightHeight = this.heightOfTree(root.right);\n return 1 + Math.max(leftHeight, rightHeight)\n\n }", "function levelWidth(root) {\n let counterArray = [0];\n let traverseArray = [root, 's'];\n\n while (traverseArray.length > 1) {\n let element = traverseArray.shift();\n if (element === 's') {\n counterArray.push(0);\n traverseArray.push(element);\n } else {\n traverseArray.push(...element.children);\n counterArray[counterArray.length - 1]++;\n }\n }\n\n return counterArray;\n\n}", "function heightoftree(tree) {\n if (tree.left && tree.right)\n return Math.max(heightoftree(tree.left), heightoftree(tree.right)) + 1;\n if (tree.left) return heightoftree(tree.left) + 1;\n if (tree.right) return heightoftree(tree.right) + 1;\n return 1;\n}" ]
[ "0.7624701", "0.75333595", "0.7405723", "0.71288085", "0.70297664", "0.6967101", "0.6833227", "0.6822744", "0.65926105", "0.6571445", "0.6480202", "0.64434993", "0.64434993", "0.63490593", "0.63350344", "0.63004833", "0.6264385", "0.62560457", "0.6216885", "0.6191826", "0.61853606", "0.61738735", "0.61518335", "0.607038", "0.6059115", "0.6038749", "0.60274756", "0.6018994", "0.60174435", "0.59965205", "0.596222", "0.5954904", "0.5933097", "0.5915067", "0.58986455", "0.58942616", "0.5882496", "0.5858093", "0.58527875", "0.5852382", "0.5837556", "0.58351463", "0.58336365", "0.5833259", "0.58322626", "0.5827032", "0.5820385", "0.5819084", "0.5814297", "0.5813194", "0.58130604", "0.5791986", "0.5787234", "0.577106", "0.577106", "0.577106", "0.577106", "0.577106", "0.577106", "0.57490736", "0.5732637", "0.57163334", "0.5711982", "0.5702686", "0.56799024", "0.5674451", "0.56654316", "0.5663209", "0.5663201", "0.56590164", "0.5649499", "0.5644058", "0.56339025", "0.56269705", "0.56004447", "0.5593213", "0.5592571", "0.55887896", "0.55873305", "0.55781204", "0.55753314", "0.5569471", "0.55661273", "0.55568016", "0.55434936", "0.554269", "0.55414015", "0.55389845", "0.5538984", "0.5532414", "0.55281997", "0.55269086", "0.5513515", "0.55011517", "0.5498861", "0.5479641", "0.5478071", "0.54770786", "0.5475416", "0.54668164" ]
0.7190306
3
Total inner volume of packing in mm^3
getInnerVolume() { mustInherit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getTotalVolume() {\n return this.height * this.width * this.length;\n }", "getTotalVolume() {\n return this.height * this.width * this.length;\n }", "getVolume() {\n const volume = Math.pow(this.length, 3);\n return +volume.toFixed(3);\n }", "getVolumeUtilisation() {\n let $itemVolume = 0;\n\n /** @var Item $item */\n this.items.forEach(item => $itemVolume += item.getVolume());\n\n // return round($itemVolume / this.box.getInnerVolume() * 100, 1);\n // FIXME: this doesn't maintain the same percision\n return Math.round($itemVolume / this.box.getInnerVolume() * 100);\n }", "getVolume() {\n const volume = (4 * Math.PI * Math.pow(this.radius, 3)) / 3;\n return +volume.toFixed(3);\n }", "volume() {\n return this.length * this.width * this.height\n }", "getTotalVolume()\n {\n return this.water + this.red + this.green + this.blue;\n\n }", "getUsedVolume() {\n var used = 0.0;\n for (var index in this.goods) {\n used += this.goods[index].getTotalVolume();\n }\n return used;\n }", "getVolume() {\r\n\t\treturn this.width * this.length * this.height;\r\n\t}", "volume() {\n return this.length * this.width * this.height;\n }", "get volume() {\n return this.radius * this.radius * Math.PI * this._height\n }", "function calcVolume (width, height, depth) {\n return width * height * depth;\n}", "function livingVolume(height,width,depth){\n return height*width*depth; \n}", "function calculateVolume(width, height, length) {\n var volume = width * height * length;\n return volume;\n}", "function volume (radius, height){\n\n var volume = Math.PI * radius * radius * height;\n return volume\n\n }", "function recVolume(height) {\n let dimensions = [height];\n const _measure = (num) => {\n if (dimensions.length < 3) {\n dimensions.push(num);\n }\n if (dimensions.length === 3) {\n let sum = dimensions.reduce((acc, el) => (acc *= el));\n return sum;\n } else {\n return _measure;\n }\n };\n return _measure;\n}", "function volumeOfBox(sizes) {\n this.width = sizes.width;\n this.height = sizes.height;\n this.length = sizes.length;\n\n const x = `${this.width}` * `${this.height}` * `${this.length}`;\n return x;\n}", "getDensity() {\n const density = this.mass / this.getVolume();\n return +density.toFixed(3);\n }", "getDensity() {\n const density = this.mass / this.getVolume();\n return +density.toFixed(3);\n }", "getVolume() {\n return Math.floor(this.video.volume * 100);\n }", "function ballvolume(radius) {\n return (4 / 3) * Math.PI * radius ** 3;\n}", "function volumeOfBox(sizes) {\n let x = sizes.width * sizes.length * sizes.height;\n return x;\n}", "function volumeOfBox(sizes) {\n return sizes.length * sizes.width * sizes.height;\n }", "function roofVolume(depth, sweep, width){\n return triangleArea(depth, sweep, sweep)*width;\n}", "function getVolume()\r\n {\r\n return volume;\r\n }", "getUnUsedVolume() {\n return this.getTotalVolume() - this.getUsedVolume();\n }", "function calculateVolDensity()\n{\n var width = document.getElementById('width').value;\n var length = document.getElementById('length').value;\n var height = document.getElementById('height').value;\n var mass = document.getElementById('mass').value;\n \n \n /* calculate volume */\n result = width * length * height;\n result = result.toFixed(5);\n /* alert('result1 ='+result); */\n var volume = parseFloat(result);\n /* alert('value of volume: ='+ volume); */\n \n /* calculate density */\n result1 = mass / volume;\n result1 = result1.toFixed(5);\n /* alert('result1 ='+result1); */\n var density = parseFloat(result1);\n /* alert('value of density: ='+ density); */\n \n var sizeNine = [50,50,50,15,30,125000,0.00012,0.00024];\n var sizeEight = [40,40,40,12,14.9,64000,0.0001875,0.000234375];\n var sizeSeven = [35,35,35,10,11.9,42875,0.000233236,0.000279883];\n var sizeSix = [30,30,30,8,9.9,27000,0.000296296,0.00037037];\n var sizeFive = [25,25,25,6,7.9,15625,0.000384,0.000512];\n var sizeFour = [20,20,20,4,5.9,8000,0.0005,0.00075];\n var sizeThree = [15,15,15,3,3.9,3375,0.000888889,0.001185185];\n var sizeTwo = [10,10,10,2,2.9,1000,0.002,0.003];\n var sizeOne = [5,5,5,1,1.9,125,0.008,0.0152];\n var sizeZero = [2,2,2,0.5,0.9,8,0.0625,0.1125];\n \n /* alert('Mass '+mass); */\n var size=10;\n \n if (mass >= sizeNine[3] && mass <= sizeNine[4] || volume >sizeEight[5])\n {\n size = 9; \n }\n \n else if (mass >=sizeEight[3] && mass <= sizeEight[4] || volume > sizeSeven[5])\n { \n size = 8; \n }\n \n \n else if (mass >=sizeSeven[3] && mass <= sizeSeven[4] || volume > sizeSix[5])\n { \n size = 7; \n } \n \n else if (mass >=sizeSix[3] && mass <= sizeSix[4] || volume > sizeFive[5])\n { \n size = 6; \n }\n \n else if (mass >=sizeFive[3] && mass <= sizeFive[4] || volume > sizeFour[5])\n { \n size = 5; \n }\n \n else if (mass >=sizeFour[3] && mass <= sizeFour[4] || volume > sizeThree[5])\n { \n size = 4; \n }\n \n else if (mass >=sizeThree[3] && mass <= sizeThree[4] || volume > sizeTwo[5])\n { \n size = 3; \n }\n \n else if (mass >=sizeTwo[3] && mass <= sizeTwo[4] || volume > sizeOne[5])\n { \n size = 2; \n }\n \n else if (mass >=sizeOne[3] && mass <= sizeOne[4] || volume > sizeZero[5])\n { \n size = 1; \n }\n \n else if (mass >=sizeZero[3] && mass <= sizeZero[4] || volume <= sizeZero[5])\n { \n size = 0; \n } \n \n /*alert('size value =' +size); */\n \n \n /* return values of volume and density and size to hidden inputs HTML form */\n document.getElementById('volume').value=volume;\n document.getElementById('density').value=density;\n document.getElementById('size').value=size;\n \n}", "function volume() {\n class Cylinder {\n constructor(h, r) {\n this.raio = r\n this.altura = h\n }\n Volume() {\n return Math.PI * this.raio * this.raio * this.altura\n }\n }\n let cyl = new Cylinder(7, 4)\n show('volume = ' + cyl.Volume().toFixed(4))\n}", "shelfSize()\n {\n return this.values.size * this.values.quantity;\n }", "function getVolume(amount) {\n let bounds = amount.split('-');\n bounds.forEach((x, i, a) => {\n a[i] = Number(x.replace(/[ ,$]/g, ''));\n });\n return bounds.reduce((a, b) => a + b) / 2;\n}", "function getVolume() {\n pxsim.console.log(pxsim.board().micVolume.toString());\n return pxsim.board().micVolume;\n }", "getSurfaceArea() {\n const surfaceArea = 6 * Math.pow(this.length, 2);\n return +surfaceArea.toFixed(3);\n }", "function getVolume()\n {\n return audio.volume;\n }", "function volume(n){\n\t\treturn barsAgo(VOLUME,n);\n\t}", "function calculateArea(width, heigth, depth) {\n\tvar area = width * heigth;\n\tvar volume = width * heigth * depth;\n\tvar sizes = [area, volume];\n\treturn sizes;\n}", "function calculate(){\n const base = (ballCalcul.value*4) \n const pieCalc = (base*3.14)/3 \n ballOutput.innerText= (\"the Ball Volume is: \" + pieCalc)\n return volume = pieCalc\n \n}", "function getSize(width, height, depth){\n let area = (2*width*height)+(2*height*depth) + (2*width*depth);\n let volume = width* height* depth;\n return [area, volume];\n }", "getAverageM3() {\n\t var days = this.getDays();\n\t var m3 = this.getM3();\n\n\t var averageM3 = days > 0 ? m3/days : m3;\n\n\t return Math.round(averageM3 * 100) / 100;\n\t}", "function cupVolume(h , bigR , lilR){\n var volCup = (Math.PI/3) * h * (bigR^2+(lilR*bigR)+ lilR);\n return volCup\n\n}", "function calculateServiceDeskVolume(parent) {\r\n \tif(parent.children != null){\r\n \t\tfor(var k = 0;k < parent.children.length;k++) {\r\n \t\t\tvar child = parent.children[k];\r\n \t\tfor (var i = 0; i < $scope.dealInfo/12; i++){\r\n \t\t\tchild.distributedVolume[i].volume = Math.round((parent.distributedVolume[i].volume * child.percentage)/100);\r\n \t\t}\r\n \t\t}\r\n \t}\r\n }", "function volumeOfRectangle(w, l, h) {\n\tconsole.log(w * l * h);\n}", "getPixelPerMeter() {\n\t\tlet ppm = new vec2(this.#_fusion.targetOutSize.x/this.#_augmentaScene.scene.x,this.#_fusion.targetOutSize.y/this.#_augmentaScene.scene.y);\n\t\treturn ppm;\n\t}", "get volume() {\n\t\treturn this.volumeValue;\n\t}", "get amount () {\n return Math.abs(this.raw) / this.scale\n }", "getCurrentVolume() {\n return this.gainNode ? this.gainNode.gain.value : this.volume;\n }", "function getSizeFromSound() {\n\t var arr = new Uint8Array(analyser.frequencyBinCount);\n\t analyser.getByteFrequencyData(arr);\n\t return getAverageVolume(arr);\n\t}", "calculateByMetric() {\n\t\tthis.height = this.height/100; // convert cm to meter\n const result = (this.weight) / Math.pow(this.height, 2);\n return Math.round(result* 100) / 100;\n }", "get m(){ return this.density * this.volume;}", "getSurfaceArea() {\n const surfaceArea = 4 * Math.PI * Math.pow(this.radius, 2);\n return +surfaceArea.toFixed(3);\n }", "function volumeSphere( radius ) {\n return multiply( ( 4 / 3 ), Math.PI, cube( radius ) );\n}", "function calculateVolume(volumeArray, sampleArray, windowSize){\r\n\tif(sampleArray.length<windowSize*3){\r\n\t\tconsole.log(\"error: sample length is too short. (less than 3*windowSize)\");\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar volumeIndex = 0;\r\n\tvar lastIndex = Math.floor((sampleArray.length)/windowSize*2)-1;\r\n\r\n\tfor(;volumeIndex<lastIndex; volumeIndex++){\r\n\t\t//calculate volume\r\n\t\tvar index = volumeIndex*windowSize/2;\r\n\t\tvar squareSum = 0;\r\n\t\tif (volumeIndex >= 0 && volumeIndex != lastIndex){\r\n\t\t\t\r\n\t\t\tfor(var i = 0; i<windowSize; i++){\r\n\t\t\t\t//squareSum+= Math.pow(sampleArray[index] ,2 )\r\n\r\n\t\t\t\tsquareSum+= Math.pow(sampleArray[index] * 0.5 * (1- Math.cos(2*Math.PI*i/(windowSize))),2 )\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\r\n\t\t\t/*\r\n\t\t\tfor(var i = 0; i<windowSize; i++){\r\n\t\t\t\tsquareSum+=Math.pow((i/windowSize)*sampleArray[index-2048],2);\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\t\t\tfor(var i = 0; i<windowSize; i++){\r\n\t\t\t\tsquareSum+=Math.pow(sampleArray[index],2);\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\t\t\tfor(var i = 0; i<windowSize; i++){\r\n\t\t\t\tsquareSum+=Math.pow((1-i/windowSize)*sampleArray[index+2048],2);\r\n\t\t\t\tindex++;\r\n\r\n\t\t\t}\r\n\t\t\t*/\r\n\t\t}\r\n\t\tvolumeArray[volumeIndex] = squareSum + 0.00001; //prevent from become zero (which causes minus infinity) \r\n\t\t//volumeArray[volumeIndex] = 130*Math.log(squareSum/(2*windowSize))/Math.LN10 + 280;;\r\n\r\n\t}\r\n}", "getPotValue() {\n return !this.pot.length\n ? 0\n : this.pot.reduce((sum, bet) => sum + bet.amount, 0);\n }", "function processVolume(json,unit){\n json.w = json.w.map(function(vol){return round(vol/constants.conversions[unit],2)});\n return json.w;\n }", "volume(length){ // 1 parameter but method name same in this class\r\nreturn length**3;\r\n}", "function calculateV(){\n let area = (dims.value)*(dims.value);\n let vacant = area*vacantRatio.value;\n return Math.floor(vacant);\n}", "calculateByEnglish() {\n const result = ((this.weight) / Math.pow((this.height * 12), 2)) * 703.0704;\n return Math.round(result* 100) / 100;\n }", "function calculateServiceDeskVolume(parent) {\r\n \tif(parent.children != null){\r\n \t\tfor(var k = 0;k < parent.children.length;k++) {\r\n \t\t\tvar child = parent.children[k];\r\n \t\tfor (var i = 0; i < $scope.dealInfo/12; i++){\r\n \t\t\tchild.distributedVolume[i].volume = Math.round((parent.distributedVolume[i].volume * child.percentage)/100);\r\n \t\t}\r\n \t\t}\r\n \t\t$scope.calcServerPrice();\r\n \t}\r\n }", "function areaVolume(width,length,height){\n return [ width * length, width*length*height];\n}", "function volume(val){\n //var fraction = val / 100;\n vol.gain.value = val;\n }", "function volumeCylinder( radius, height ) {\n return multiply( Math.PI, square( radius ), height );\n}", "function cube(w, l, h)\n{\n var vol = w * l * h;\n vol = Number(vol);\n return vol;\n}", "_getMaxAssetVolume(asset, price) {\n let volumePrecision = this.getVolumePrecision(asset);\n let currencyAmount = this.wallet.getCurrencyAmount();\n\n // for safety of orders, let's assume asset price increased by 0.05% since we wanted to order\n price = price * 1.0005;\n\n // adjust volumal precision: 8 decimals for a BTC\n return Math.floor((currencyAmount / price) * Math.pow(10, volumePrecision)) / Math.pow(10, volumePrecision);\n }", "average() {\n return this.buffer.reduce((accum, current) => accum + current) / this.size;\n }", "function volumeCone( radius, height ) {\n return multiply( ( 1 / 3 ), Math.PI, square( radius ), height );\n}", "function volRectangularSolid(length, width, height) {\n// Returns the Volume of a 3D Rectangular object\n return length * width * height;\n}", "function iceBrickVolume(radius, bottleLength, rimLength) {\n return (bottleLength - rimLength) * (Math.pow(radius, 2) * 2);\n}", "total() {\n var total = 0.0\n for (var sku in this.items) {\n var li = this.items[sku]\n var price = li.quantity * li.price\n total += price\n }\n return total\n }", "function hitungVolume(a, b) // nama fungsi harus mudah dipahami / readibility\r\n{\r\n\t// var volume1 => dihapus / Perfomance\r\n\t// var volume2 => dihapus / Perfomance\r\n\t// var hasil => dihapus / Perfomance\r\n\r\n\t// volume1 = a * a * a => dihapus / Perfomance\r\n\t// volume2 = b * b * b => dihapus / Perfomance\r\n\r\n\t// hasil = a * a * a + b * b * b => dihapus / Perfomance\r\n\r\n\treturn a * a * a + b * b * b\r\n}", "fileSize () {\n if (this.isDirectory()) {\n // dirs don't have file size\n return 0\n }\n\n let sum = 0\n this.blockSizes.forEach((size) => {\n sum += size\n })\n\n if (this.data) {\n sum += this.data.length\n }\n\n return sum\n }", "function calculateBasedMem() {\n\t//var theForm = document.forms[\"capacity_form\"];\n var qtyAppNode = document.getElementById('qtyAppNode').value;\n var appNodeMem = document.getElementById('memNodeSize').value;\n var memPodSize = document.getElementById('memPodSize').value;\n var totalAppNodeMem = appNodeMem * qtyAppNode;\n var totalPodPerMem = totalAppNodeMem / memPodSize;\n return totalPodPerMem;\n\t//display the result\n //document.getElementById('ccapacity').innerHTML = \"Total pod por Mem: \"+totalPodPerMem;\n}", "function totalMU(values) {\n\t\t\tif(values === undefined || values.length == 0) return 0;\n\t\t\tvar total = 0;\n\t\t\tfor(var loop = 0; loop < values.length; loop++) total += values[loop].footprint;\n\t\t\treturn total;\n\t\t}", "function findCubeVolume(base1, base2, height, dec = 2, round = 0) {\n if (checkNum(base1, base2, height, dec)) {\n let Base = findRectArea(base1, base2);\n let calculation = Base * height;\n return fixPrecision(calculation, dec, round);\n }\n }", "surfaceArea() {\n return 2 * (this.length * this.width + this.length * this.height + this.width * this.height);\n }", "get boundingVolume() {\n return this._boundingVolume;\n }", "get boundingVolume() {\n return this._boundingVolume;\n }", "totalProduction(sp = this._milkPrice) {\n let x = 0;\n for (let [key, values] of Object.entries(this.milkProducedPerShed(sp))) {\n x += values;\n }\n return x;\n }", "get amount() {\n\t\t\treturn this.items\n\t\t\t\t.map(item => item.qty * item.price)\n\t\t\t\t.reduce((total, qty) => total += qty, 0);\n\t\t}", "getDim(){\n let n = (this.state.size);\n //toFixed(someNum) used to set floating point accuracy\n let width = (100/(2*n-1)).toFixed(2);\n let margin = (100/(4.5*n-1)).toFixed(2);\n // console.log(width,margin);\n return {width,margin}\n}", "function getAverageMass(collection){\n\tif(collection.length === 0) return 0;\n\tvar average = 0;\n\tfor(var c = 0;c < collection.length;c++){\n\t\t\taverage += collection[c][mass];\n\t\t}\n\tvar ans = new Number(average / collection.length);\n\tans.entries = collection.length;\n\tans.min = 0;\n\tans.max = Number.POSITIVE_INFINITY;\n\treturn ans;\n}", "function ContainerWeight(container)\n{\n if (disable_autocalc())\n return;\n\n var total = 0.0;\n var slots = document.getElementById(container).rows.length - 3;\n for (var i = 1; i <= slots; i++)\n {\n var num = parseFloat(sheet()[container + \"Gear\" + FormatNumber(i) + \"W\"].value);\n if (!isNaN(num))\n total += num;\n }\n\n document.getElementById(container + \"Weight\").innerHTML = total.toFixed(1);\n}", "heightToCM(){\n return this.height * 2.54; \n }", "function getVolume(playerId){\n\t\treturn mPlayers[playerId].volume;\n\t}", "_getMaxCurrencyVolume(asset, price) {\n // for safety of orders, let's assume BTC price decreased by 0.1% since last price\n price = price * 0.998;\n\n // adjust volumal precision: 1 decimals for a EUR. Round it to 0\n return Math.floor(this.wallet.getAmount(asset) * price);\n }", "function woodCalculator(chair, table, bed) {\n const oneChair = 1;\n let totalChair = Math.abs(chair) * oneChair;\n const oneTable = 3;\n let totalTable = Math.abs(table) * oneTable;\n const oneBed = 5;\n let totalBed = Math.abs(bed) * oneBed;\n let totalVolume = totalChair + totalTable + totalBed;\n return totalVolume;\n}", "function calcBoxes(bottles, boxCapacity){\n let boxesCount = Math.ceil(bottles / boxCapacity);\n return boxesCount;\n }", "function getVWSize(num) {\n return 1.08 / (num / 100);\n}", "function _volume_model(theta_iRad, alpha_rRad){\r\n\r\n var nominator = (ninetyRad.subtract(theta_iRad).add(alpha_rRad)).tan();\r\n var denominator = (ninetyRad.subtract(theta_iRad)).tan();\r\n return nominator.divide(denominator);\r\n }", "function volumeSphere(){\n event.preventDefault();\n let volume=0;\n let inputRadius = document.getElementById('radius');\n let radiusValue = inputRadius.value;\n radiusValue = Math.abs(radiusValue);\n volume = (4/3)*Math.PI*Math.pow(radiusValue, 3);\n volume = volume.toFixed(2);\n let inputVolume = document.getElementById('volume');\n inputVolume.value = volume;\n return false;\n}", "snpMDG(v) {\n // console.log(v)\n // console.log(Math.round(v/this.cellSize/this.scale) * this.cellSize/this.scale)\n return Math.round(v/this.cellSize) * this.cellSize\n }", "function IceandWaterFunc() {\n var t = [];\n var p = [];\n items.map(function (singleElement) {\n t.push(parseFloat(singleElement.eave));\n p.push(parseFloat(singleElement.valleyRM));\n });\n var x = t.reduce((a, b) => a + b, 0);\n var y = p.reduce((a, b) => a + b, 0);\n return setTotalEaves(((x + y) / 60).toFixed(1));\n }", "function calcDistributionVolume(stats) {\n\t// Both values are selected by the form\n\tconst { volume, distribution } = stats\n\n\tif(volume.total && distribution) {\n\t\tvolume.tap = volume.total * distribution.tap\n\t\tvolume.keg = volume.total * distribution.keg\n\t\tvolume.bottle = volume.total * distribution.bottle\n\t}\n\n\treturn stats\n}", "totalStockValue()\n {\n return this.shares*this.price;\n }", "function getMaterialTotalWeight() {\n\tvar material_total_weight = getFieldValueById(\"trxtransactiondetails-net_weight\");\n\tif (null != material_total_weight && material_total_weight.length > 0) {\n\t\tswitch(getMaterialConversionUnit()) {\n\t\t\tcase 'KG':\n\t\t\t material_total_weight = convertToDecimalFormat(material_total_weight, decimalPlaces);\n setFieldValueById(\"trxtransactiondetails-net_weight\", material_total_weight);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmaterial_total_weight = parseFloat(getFieldValueById(\"trxtransactiondetails-net_weight\")) * (material_conversion[getFieldValueById('trxtransactiondetails-net_unit')]['den'] /\n\t\t\t\t\t material_conversion[getFieldValueById('trxtransactiondetails-net_unit')]['num']);\n\t\t\t material_total_weight = material_total_weight.toFixed(decimalPlaces);\n\t\t\t\tbreak;\n\t\t}\n\t} else {\n\t\tmaterial_total_weight = \"0.000\";\n\t}\n\n\treturn material_total_weight;\n}", "function calcularMediaRealPlantilla() {\r\n\tvar sumaMediasReales = 0;\r\n\tvar numeroJugadores = 0;\r\n\tfor (jugador in jugadores) {\r\n\t\tnumeroJugadores++;\r\n\t\tsumaMediasReales = sumaMediasReales + jugadores[jugador][\"mediareal\"];\r\n\t}\r\n\treturn sumaMediasReales/numeroJugadores;\r\n}", "baseAmount() {return player.l3.points}", "Magnitude() {\n return Vec3.Magnitude(this);\n }", "get variance(): number {\n if(this.alpha > 2) {\n return Math.pow(this.xm, 2) * this.alpha / (Math.pow(this.alpha - 1, 2) * (this.alpha - 2));\n }\n return Infinity;\n }", "subtreeWeight () {\n const localWeight = this.template && this.template.weight;\n\n return this.components.reduce(\n (sum, component) => sum + component.subtreeWeight(),\n localWeight\n );\n }", "function getTotal() {\n var sum = 0;\n $container.each(function(){\n sum += $(this).find(\".price\").text() * 1; //\n });\n\n return sum;\n }", "promedio(){\n let promedio = 0;\n let i =0;\n for(let x of this._data){\n i = i++;\n promedio = promedio + x;\n }\n return promedio/i;\n }" ]
[ "0.7715467", "0.7715467", "0.7579748", "0.74674207", "0.74098486", "0.7195796", "0.70795625", "0.7061448", "0.70477617", "0.7046902", "0.70221907", "0.7008587", "0.6810208", "0.6736979", "0.65598583", "0.6489772", "0.64349073", "0.642167", "0.642167", "0.63921595", "0.63777906", "0.6373939", "0.63159746", "0.62882364", "0.61838937", "0.6178595", "0.6110885", "0.6086156", "0.6019229", "0.60147053", "0.60133845", "0.6010166", "0.59750295", "0.5965968", "0.59281254", "0.5919522", "0.5878698", "0.58626276", "0.5848343", "0.5843516", "0.57952046", "0.57887226", "0.5750905", "0.57296187", "0.5708138", "0.56830156", "0.5679816", "0.5676181", "0.56638074", "0.56603235", "0.5652034", "0.5637802", "0.5630876", "0.56299835", "0.5621989", "0.55848616", "0.55823547", "0.5577758", "0.55735064", "0.5536438", "0.5519844", "0.55189836", "0.55064714", "0.54929274", "0.5489272", "0.5483562", "0.54737437", "0.54721254", "0.54708344", "0.5470163", "0.54678184", "0.5462085", "0.5459818", "0.5455774", "0.5455774", "0.54520357", "0.5444909", "0.5436649", "0.5430661", "0.5430494", "0.5429578", "0.54264575", "0.54159546", "0.54077387", "0.5403083", "0.53963065", "0.5395239", "0.53933823", "0.5387113", "0.5382221", "0.53813845", "0.5374606", "0.5370732", "0.536071", "0.53511494", "0.5347668", "0.53427076", "0.5329461", "0.53204167", "0.53195155" ]
0.5545242
59
Max weight the packaging can hold in g
getMaxWeight() { mustInherit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getHighestWeight(){\n maxWeight = 1;\n\n linkWeightMap.forEach(function(d){\n if(d > maxWeight)\n maxWeight = d;\n });\n\n return maxWeight;\n}", "function desirableWeight() {\n var desirableWeight = userInfo[\"desirable-weight\"];\n var weight = userInfo[\"weight\"];\n var step1 = weight - desirableWeight;\n var step2 = step1 * 0.32;\n var DW = step2 + desirableWeight;\n return DW;\n}", "function getMaxWeightValue(d) {\n var maxWeight = Math.max.apply(null, d.weights);\n var i = d.weights.indexOf(maxWeight);\n return d.values[i]; // return highest weighted value\n }", "get weight() {}", "function knapsackLight(value1, weight1, value2, weight2, maxW) {\n//return 2\n if(weight1 + weight2 <= maxW){\n return value1 + value2;\n }\n//return 1\n else if(weight1 + weight2 > maxW){\n if(weight1 <= maxW && weight2 <= maxW){ //return max of the 2 that fit the bill\n return Math.max(value1, value2);\n }else if(weight1 <= maxW){\n return value1;\n }else if(weight2 <= maxW){\n return value2;\n }else{\n return 0;\n }\n }\n\n}", "get weighting() { return this._weighting; }", "diameterMax() {\n let Dmax = 5.8 * Math.pow(this.mass, 1.0 / 3.0);\n return Dmax;\n }", "get legStretch() {}", "function hitungBmi(weight, height) {\n return weight / (height * height);\n}", "getEffectiveWeight() {\n\n\t\treturn this._effectiveWeight;\n\n\t}", "function knapsackLight(value1, weight1, value2, weight2, maxW) {\r\n if(weight1 + weight2 <= maxW){\r\n return value1 + value2;\r\n }\r\n if(value1 >= value2 || weight2 > maxW){\r\n if(weight1 <= maxW){\r\n return value1;\r\n }\r\n }\r\n if(value2 >= value1 || weight1 > maxW){\r\n if(weight2 <= maxW){\r\n return value2;\r\n }\r\n }\r\n \r\n return 0;\r\n\r\n}", "function maxDuffelBagValue(cakeTypes, weightCapacity) {\r\n\r\n // Calculate the maximum value we can carry\r\n \r\n // S1: Make an arr that stores the maximum possible value \r\n // at every integer capacity from 0 to weightCapacity\r\n // Starting each index with value 0\r\n const maxValuesAtCaps = new Array(weightCapacity + 1).fill(0);\r\n\r\n // S2: Loop through the capacities until until our capacity\r\n for(let currentCap = 0; currentCap <= weightCapacity; currentCap++) {\r\n let currentMaxValue = 0;\r\n \r\n // Loop through the cake types.\r\n // We use a for loop instead of forEach because we have infinity in there\r\n for(let j = 0; j < cakeTypes.length; j++){\r\n const cakeType = cakeTypes[j];\r\n \r\n // Edge: If cake weights 0 and has a positive value. Infinite monies!\r\n if(cakeType.weight === 0 && cakeType.value > 0) {\r\n return Infinity;\r\n }\r\n \r\n // If cake weight is less than our capacity\r\n if(cakeType.weight <= currentCap) {\r\n // Should we use this cake? \r\n // If yes, the most weight we can include in addition to the cake\r\n // we're adding is the current capacity minus cake's weight.\r\n // So we find max value at that integer capacity in maxValuesAtCaps\r\n const maxValueUsingCake = cakeType.value + maxValuesAtCaps[currentCap - cakeType.weight];\r\n // NOW we check if we want this cake\r\n // How does the value with the cake compare to currentMaxValue?\r\n currentMaxValue = Math.max(maxValueUsingCake, currentMaxValue);\r\n }\r\n }\r\n\r\n // Add each capacity's max value to our arr so we can use them \r\n // when calculating all the remaining capacities \r\n maxValuesAtCaps[currentCap] = currentMaxValue;\r\n } \r\n \r\n // Return the value at the capacity we're looking for\r\n return maxValuesAtCaps[weightCapacity];\r\n}", "function knapsackLight(value1, weight1, value2, weight2, maxW) {\n if (weight1 + weight2 <= maxW) {\n return value1 + value2;\n } else if (weight1 > maxW && weight2 > maxW) {\n return 0;\n } else if (value1 > value2 && weight1 <= maxW) {\n return value1;\n } else if (value2 > value1 && weight2 <= maxW){\n return value2;\n }\n return value1;\n}", "function getEffectiveWeight(helmet, chest, hand, feet) {\n\thelmet = parseFloat(helmet);\n\tchest = parseFloat(chest);\n\thand = parseFloat(hand);\n\tfeet = parseFloat(feet);\n\n\tvar eweight = Math.max(0, 3*helmet + chest + feet + 2*hand - 7);\n\treturn eweight;\n}", "subtreeWeight () {\n const localWeight = this.template && this.template.weight;\n\n return this.components.reduce(\n (sum, component) => sum + component.subtreeWeight(),\n localWeight\n );\n }", "function getEffectiveWPF(wpf, ps, effectiveWeight, weaponType) {\n\n\twpf = parseInt(wpf);\n\teffectiveWeight = parseFloat(effectiveWeight);\t\t\t\t\t\n\tps = parseInt(ps);\n\n\n\n\tvar nerfed_wpf = wpf + getPowerPenalty(ps, weaponType);\n\n\n\tvar weightMulti = getWeightMulti(effectiveWeight);\n\n\n\tnerfed_wpf = weightMulti * nerfed_wpf;\n\n\n\tif (nerfed_wpf < 1) \n\t\tnerfed_wpf = 1;\t\t\t\t\t\n\t\n\t\n\treturn nerfed_wpf;\n}", "function bagTheBestDeal(n, c){\n\t\t// n: remaining items to consider\n\t\t// c: remaining capacity of the bag\n\n\t\t//console.log(`\\nConsidering item at index ${n} with weight: ${w[n]} and value: ${v[n]}`)\n\t\t//console.log(['remaining items', 'remaining capacity'])\n\t\t//console.log([n, c])\n\t\t\n\t// Base cases\n\t\t// when the result is already calculated in the past\n\t\tif (DPArr[n][c] != null) {\n\t\t\tconsole.log(`Using memo`)\n\t\t\treturn DPArr[n][c]\n\t\t}\t\n\t\t\n\t\t// when no items left, or no capacity left\n\t\tif (n==0 || c == 0){\treturn 0}\n\n\t// Recursive cases\n\t\tlet result = 0\n\t\tif (w[n] > c){ \t// dont put current item but investigate the remaining items\n\t\t\t//console.log('\\tOnly One Way to Go')\n\t\t\tresult = bagTheBestDeal(n-1, c)\t\t\t\n\t\t}else {\n\t\t\t//console.log('\\tConsidering both Options')\n\t\t\tlet putTheItem \t\t= v[n] + bagTheBestDeal(n-1, c-w[n])\n\t\t\tlet dontPutTheItem \t= \t\t bagTheBestDeal(n-1, c)\n\t\t\t\n\t\t\t// Include the item in the baggedItems array (if putTheItem is the way to go) and \n\t\t\t// return the max of the two values\n\t\t\tif (putTheItem >= dontPutTheItem){\n\t\t\t\tlet key = `item ${n}`\n\t\t\t\tif (!baggedItems.get(key)){\n\t\t\t\t\tbaggedItems.set(key, `Weight: ${w[n]}, Value: ${v[n]}`)\n\t\t\t\t} \n\t\t\t\tresult = putTheItem\n\t\t\t}else{\n\t\t\t\tresult = dontPutTheItem\n\t\t\t}\n\t\t\t//result = Math.max(putTheItem, dontPutTheItem)\t\t\t\n\t\t}\n\n\t\tDPArr[n][c] = result\n\t\treturn result\n\n\t}", "function knapsackLight(value1, weight1, value2, weight2, maxW) {\n if(weight1+weight2 <= maxW)return value1+value2\n if(weight1>maxW&&weight2>maxW)return 0\n if(weight1<=maxW&&weight2<=maxW){\n return value1>value2?value1:value2\n }\n if(weight1<=maxW) return value1\n else return value2\n}", "getEffectiveWeight() {\n\n\t\t\treturn this._effectiveWeight;\n\n\t\t}", "function computeBestAction(){\n \n var buyMin;\n var upgradeMin = computeBestUpgradeEfficiency();\n \n if(totalProduction > totalDistribution){\n buyMin = computeBestDistributionEfficiency();\n }\n else {\n buyMin = computeBestManufactorEfficiency();\n }\n \n return Math.min(buyMin,upgradeMin);\n}", "function beeStung(weight) {\n \n //calculate for bee stings\n var stings=8.666666667*weight\n \n //Return number of Bee stings\n return stings;\n}", "function getEffectiveWeight(helmet, chest, hand, feet) {\n\thelmet = parseFloat(helmet);\n\tchest = parseFloat(chest);\n\thand = parseFloat(hand);\n\tfeet = parseFloat(feet);\n\n\tvar eweight = Math.pow(Math.max(0, 2*helmet + chest + feet + 4*hand - 10), 1.12);\n\treturn eweight;\n}", "function maxKnapsack(weights, profits, capacity, currentIndex){\nlet profit1 = -1\n if (profits.length <=currentIndex || capacity < 0 ){\n return 0;\n }\n if (weights[currentIndex] <= capacity){\n profit1 = profits[currentIndex] + maxKnapsack(weights, profits, capacity - weights[currentIndex], currentIndex + 1);\n }\n \n profit2 = maxKnapsack(weights, profits,capacity,currentIndex + 1 )\n\nreturn Math.max(profit1, profit2)\n}", "set weight(value) {}", "function getMaxRunaways() {\n var considerWeightAdjustment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n var weightBuffs = considerWeightAdjustment ? (0, _kolmafia.weightAdjustment)() : 0;\n return Math.floor(((0, _kolmafia.familiarWeight)(familiar) + weightBuffs) / 5);\n}", "function getMaxGeoBuy(baseCost, ratio, maxValue){\n var A = baseCost;\n var R = ratio;\n var S = maxValue;\n\n return Math.log(1 - (1-R) * S / A) / Math.log(R);\n}", "function getEffectiveWPF(wpf, ps, effectiveWeight, weaponType) {\n\n\twpf = parseInt(wpf);\n\teffectiveWeight = parseFloat(effectiveWeight);\t\t\t\t\t\n\tps = parseInt(ps);\n\n\n\tvar weightMulti = getWeightMulti(effectiveWeight);\n\twpf = ((weightMulti * wpf) / 100);\n\tvar nerfed_wpf = wpf + getPowerPenalty(ps, weaponType);\n\n\tif (nerfed_wpf < 1) \n\t\tnerfed_wpf = 1;\t\t\t\t\t\n\t\n\treturn nerfed_wpf;\n}", "getBMIRatio() {\n const htInMeter = this.height / 100; // converts height to meter\n console.log(htInMeter);\n return this.weight / (htInMeter * htInMeter);\n }", "function getModelWithHighestWeight(solution){\n var obj = computationData.weights['solution' + solution];\n var sortedWeights = Object.keys(obj).sort(function(a,b){return obj[b]-obj[a]});\n return sortedWeights[0];\n}", "get maxIopsPerGib() {\n return this.getNumberAttribute('max_iops_per_gib');\n }", "function calculateNetWeight() {\n var grossWeight = 0;\n var palletTare = 0;\n var productTare = 0;\n var palletPackagingTare = 0;\n\n if (!isNaN(parseFloat(getFieldValueById('gross_weight')))) {\n\t grossWeight = parseFloat(getFieldValueById('gross_weight'));\n }\n\n if (!isNaN(parseFloat(getFieldValueById('pallet_tare')))) {\n \tpalletTare = parseFloat(getFieldValueById('pallet_tare'));\n }\n\n if (!isNaN(parseFloat(getFieldValueById('product_tare_total')))) {\n productTare = parseFloat(getFieldValueById('product_tare_total'));\n }\n\n if (!isNaN(parseFloat(getFieldValueById('pallet_packaging_tare')))) {\n palletPackagingTare = parseFloat(getFieldValueById('pallet_packaging_tare'));\n }\n\n\tvar netWeight = grossWeight - (palletTare + productTare + palletPackagingTare);\n\tif (!isNaN(netWeight) && netWeight > 0) {\n\t\tsetFieldValueById('net_weight', netWeight);\n\t} else {\n\t\tsetFieldValueById('net_weight', '0');\n\t}\n}", "getRemainingWeight() {\n return this.remainingWeight;\n }", "function calcMaxPossibleBTGain() {\n var a = getAge();\n var d = getDay();\n var trainingDaysLeft = getTP()/2;\n while (a <= plateau_age) {\n // use constants for the length of the offseason and preseason\n d++;\n if (d>(40+offseasonLength)) {\n d = (0-preseasonLength);\n }\n if (d>0 && d<41) {\n a++;//seasonal day, add age\n }\n trainingDaysLeft++;\n }\n return (trainingDaysLeft-1)*6;\n}", "get Weight()\n {\n return fnCalcWeight(this.Shaft, this.Length);\n }", "get weights() { return this.w; }", "getGrowthMultiplier() {\n var _a;\n let multiplier = (_a = {\n [MulchType.Boost_Mulch]: GameConstants.BOOST_MULCH_MULTIPLIER,\n [MulchType.Amaze_Mulch]: GameConstants.AMAZE_MULCH_GROWTH_MULTIPLIER,\n [MulchType.Freeze_Mulch]: GameConstants.FREEZE_MULCH_MULTIPLIER,\n }[this.mulch]) !== null && _a !== void 0 ? _a : 1;\n if (this.stage() !== PlotStage.Berry) {\n multiplier *= this.auraGrowth();\n }\n else {\n multiplier *= this.auraDecay();\n // Handle Death Aura\n if (this.berry !== BerryType.Kasib) {\n multiplier *= this.auraDeath();\n }\n }\n return multiplier;\n }", "getLatestWeight(id) {\n let latestWeight = 0;\n const memberAssessments = this.store.findBy(this.collection, { id: id});\n for (let assessment of memberAssessments) {\n latestWeight = assessment.weight;\n }\n if (latestWeight === 0) {\n latestWeight = memberStore.getMemberById(id).startingweight;\n }\n return Number(latestWeight);\n }", "function thiefsKnapsack2 (x, items) {\n items = items.sort((a, b) => a.val < b.val ? -1 : 1);\n\n let totalWeight = getWeight(items);\n let totalVal = getVal(items);\n let groupVals = [];\n\n while (totalWeight > x) {\n //console.log(items);\n for (let i = 0; i < items.length; i ++) {\n let tempItems = items.slice(0, i).concat(items.slice(i + 1));\n if (getWeight(tempItems) <= x) {\n groupVals.push(getVal(tempItems));\n }\n }\n totalWeight -= items[0].weight;\n totalVal -= items[0].val;\n items = items.slice(1);\n }\n\n groupVals = groupVals.sort((a, b) => a > b ? -1 : 1);\n //console.log(groupVals);\n return groupVals[0];\n}", "function knapSack(weight,values,capacity){\n if(capacity <= 0 || !weight.length || !values.length) return 0;\n\n function traverse(index1, index2 , capacity){\n let maxVal = 0;\n if(index1 > weight.length) return 0;\n if(capacity === 0) {\n maxVal = capacity - netWeight;\n return maxVal;\n }\n if(capacity < 0){\n return;\n }\n traverse(index1, index2 + 1, values[index]+values[index+1], capacity + weight[index]);\n traverse(index1 + 1, index1 + 1, )\n\n }\n}", "constraintDensity() {\n\t\treturn this.constraintSize() / this.variableSize();\n\t}", "computeRefuel() {\n return ((100 - this._fuelLevel) / 100) * this._capacity;\n }", "function getDimensionWeight() {\n\tvar dimensionWeight;\n\tdimensionWeight = (getWidth() * getHeight() * THICKNESS_CM) / DIMENSION_WEIGHT_CONVERT;\n\treturn dimensionWeight.toFixed(2);\n}", "check_max_eff(){\n\n\t\tlet wspitems_needed = [];\n\t\tlet wspitems_needed_lvl_now_eff = [];\n\t\t// wspitems_needed_lvl_now_eff = [];\n\n\t\tfor(let i=0; i<this.need.length; i++){\n\t\t\t\n\t\t\tfor(let j=0; j<wspitems.length; j++){\n\t\t\t\t\n\t\t\t\tif(this.need[i] === wspitems[j].lvl_tag && wspitems[j].lvl === 1){\n\n\t\t\t\t\twspitems_needed.push(wspitems[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor(let i=0; i<wspitems_needed.length; i++){\n\n\t\t\tif(wspitems_needed[i].lvl === 1){\n\n\t\t\t\twspitems_needed_lvl_now_eff.push(wspitems_needed[i].lvls[wspitems_needed[i].lvl_now-2].max_eff);\n\t\t\t}\n\n\t\t\tif(this.need.length <= 1){\n\t\t\t\tthis.max_eff_of_needed = wspitems_needed[0].lvls[wspitems_needed[0].lvl_now-2].max_eff;\n\t\t\t} else {\n\n\t\t\t\tthis.max_eff_of_needed = wspitems_needed_lvl_now_eff[0];\n\t\t\t\t\n\t\t\t\tfor(let j=0; j<wspitems_needed_lvl_now_eff.length; j++){\n\n\t\t\t\t\tconst cur = wspitems_needed_lvl_now_eff[j];\n\n\t\t\t\t\tif(cur < this.max_eff_of_needed){\n\t\t\t\t\t\tthis.max_eff_of_needed = cur;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.c_max_eff.innerHTML = this.max_eff_of_needed;\n\t}", "function showMaxCargoCapacity(array) {\n var max = array[0];\n for (let i = 0; i < array.length; i++) {\n if (parseInt(max.cargo_capacity) < parseInt(array[i].cargo_capacity)) {\n max = array[i];\n }\n }\n return max.model;\n }", "max() {\r\n return this.maxHelper(this.root);\r\n }", "weight(e, w=null) {\n\t\tif (w != null) {\n\t\t\tif (!this.hasWeights) this.addWeights();\n\t\t\tthis._weight[e] = w;\n\t\t}\n\t\treturn this.hasWeights ? this._weight[e] : 0;\n\t}", "function getTransactionPalletWeight() {\n\tvar trx_pallet_weight = '0.000';\n\tif (null != transaction_details[getFieldValueById(\"trxtransactiondetails-pallet_no\")]) {\n\t\tvar trx_pallet_weight = parseFloat(transaction_details[getFieldValueById(\"trxtransactiondetails-pallet_no\")]['pallet_weight']);\n\t}\n\treturn trx_pallet_weight;\n}", "function mostExpensive(items) {\n var current = groceries[0].cost;\n for(var i = 0; i < groceries.length; i++){\n if(groceries[i].cost > current) {\n current = groceries[i].cost;\n }\n }\n return current;\n}", "function maxVal(item) {\n if (item === \"Temperature\") return 120; // max in clean is 109.6\n if (item.includes(\"Fatalities\")) return 700; // max in clean is 587\n if (item.includes(\"Maize\")) return 40000; // max in clean is 36600\n if (item.includes(\"Rice\")) return 30000; // max in clean is 25000, but max in raw is 60000\n if (item.includes(\"Sorghum\")) return 40000;\n if (item.includes(\"Cowpeas\")) return 100000; // max in clean is 80000\n return 100;\n}", "function thiefsKnapsack1 (x, items) {\n const sorted = items.sort((a, b) => a.val > b.val ? -1 : 1);\n //console.log(sorted);\n let groupVals = [];\n\n let n = items.length;\n let i = 0;\n\n while (i < items.length) {\n while (n > i) {\n let sumWeight = items.slice(i, n).reduce((acc, cur) => acc + cur.weight, 0);\n if (sumWeight <= x) {\n let sumVal = items.slice(i, n).reduce((acc, cur) => acc + cur.val, 0);\n groupVals.push(sumVal);\n }\n n --;\n }\n n = items.length;\n i ++;\n }\n\n groupVals = groupVals.sort((a, b) => a > b ? -1 : 1);\n //console.log(groupVals);\n return groupVals[0];\n}", "gainMult() { // Returns your multiplier to your gain of the prestige resource.\n return new Decimal(1) // Factor in any bonuses multiplying gain here.\n }", "function calculateMolecularWeight(structureData) {\n return casual.integer(0,500);\n}", "function rateLargeFlat(weight) {\n if (weight <= 1.0) {\n return 1.00;\n } else if (weight <= 2.0) {\n return 1.21;\n } else if (weight <= 3.0) {\n return 1.42;\n } else if (weight <= 4.0) {\n return 1.63;\n } else if (weight <= 5.0) {\n return 1.84;\n } else if (weight <= 6.0) {\n return 2.05;\n } else if (weight <= 7.0) {\n return 2.26;\n } else if (weight <= 8.0) {\n return 2.47;\n } else if (weight <= 9.0) {\n return 2.68;\n } else if (weight <= 10.0) {\n return 2.89;\n } else if (weight <= 11.0) {\n return 3.10;\n } else if (weight <= 12.0) {\n return 3.31;\n } else if (weight <= 13.0) {\n return 3.52;\n } else {\n throw `Invalid weight \"${weight}\"`;\n }\n}", "_updateMaxRings() {\n this._vRings.forEach((ring) => {\n if (ring.typeAttr === \"V\")\n ring.maxValue = max$1(this.model.data.nodes.dataNodes, function (d) { return d.values[ring.indexAttr]; });\n else\n ring.maxValue = 0; // Copy here what was done in the addAttribute()\n });\n }", "leakyRelu(n=0) { return Math.max(n, 0.01); }", "function getNewMaxIntensity(zoom, max_weight){\n var step_factor = 2.9;\n return Math.round((max_weight * Math.log(max_weight)/Math.LN10) - Math.exp(max_weight * 0.00039) - (Math.exp((zoom - 8) * 0.15 + step_factor) - 12) * Math.pow(10, Math.floor(Math.log(max_weight)/Math.LN10-1)));\n }", "function CalcWeight()\n{\n if (disable_autocalc())\n return;\n\n var total = 0.0;\n var slots = document.getElementById(\"gear\").rows.length - 3;\n for (var i = 1; i <= slots; i++)\n {\n var num = parseFloat(sheet()[\"Gear\" + FormatNumber(i) + \"W\"].value);\n if (!isNaN(num))\n total += num;\n }\n\n document.getElementById(\"bagWeight\").innerHTML = total.toFixed(1);\n\n // Add the armor weight.\n for ( var i = 1; i <= 4; i++ )\n {\n // If the armor is flagged as not carried, then don't add it to the weight.\n if ( !sheet()[\"Armor\" + i + \"Carried\"].checked )\n continue;\n\n var num = parseFloat(sheet()[\"Armor\" + i + \"Weight\"].value);\n if (!isNaN(num))\n total += num;\n }\n\n // Add the weapon weight\n for ( var i = 1; i <= 4; i++ )\n {\n if ( sheet()[ \"Weapon\" + i + \"Carried\" ].checked )\n {\n var num = parseFloat(sheet()[\"Weapon\" + i + \"Weight\"].value);\n if (!isNaN(num))\n total += num;\n }\n }\n\n sheet().TotalWeight.value = total.toFixed(1);\n\n // Check to see if the character is encumbered. If so, then set the background\n // color of \"Total Weight\", Speed, and DexMod input fields to red.\n if ( Clean( sheet().TotalWeight.value ) > Clean( sheet().LightLoad.value ) )\n {\n debug.trace(\"Character is encumbered.\");\n var maxDexMod = 99;\n\n if ( Clean( sheet().TotalWeight.value ) > Clean( sheet().MediumLoad.value ) )\n {\n maxDexMod = 1;\n sheet().TotalWeight.title = \"Check penalty of -6 while encumbered\";\n }\n else\n {\n maxDexMod = 3;\n sheet().TotalWeight.title = \"Check penalty of -3 while encumbered\";\n }\n\n debug.trace(\"MaxDexMod = \" + maxDexMod + \" DexMod = \" + Clean( sheet().DexMod.value ) );\n if ( Clean( sheet().DexMod.value ) > maxDexMod )\n {\n sheet().DexMod.title = \"Max dex bonus to AC is +\" + maxDexMod + \" while encumbered.\";\n sheet().DexMod.style.color = \"white\";\n sheet().DexMod.style.backgroundColor = \"red\";\n }\n else\n {\n sheet().DexMod.title = sheet().DexMod.value;\n sheet().DexMod.style.color = \"black\";\n sheet().DexMod.style.backgroundColor = \"white\";\n }\n\n sheet().TotalWeight.style.color = \"white\";\n sheet().TotalWeight.style.backgroundColor = \"red\";\n\n sheet().Speed.title = \"Max speed is reduced by roughly 1/3 due to encumbrance\";\n sheet().Speed.style.color = \"white\";\n sheet().Speed.style.backgroundColor = \"red\";\n\n ACCheckMaxDex(); // Check if the dex bonus to AC should be reduced.\n }\n else\n {\n sheet().TotalWeight.title = sheet().TotalWeight.value;\n sheet().TotalWeight.style.color = \"black\";\n sheet().TotalWeight.style.backgroundColor = \"white\";\n\n sheet().DexMod.title = sheet().DexMod.value;\n sheet().DexMod.style.color = \"black\";\n sheet().DexMod.style.backgroundColor = \"white\";\n\n sheet().Speed.title = sheet().Speed.value;\n sheet().Speed.style.color = \"black\";\n sheet().Speed.style.backgroundColor = \"white\";\n }\n\n\n SkillsUpdateCheckPen();\n\n debug.trace(\"Calculated total weight.\");\n}", "function stung(weight){\n\tvar stingsPerLb = 8 + 2/3; // stings needed per lb to kill given\n\tvar stun; //defines variable for future to define stings\n\tstun = stingsPerLb * weight; // calculates the stings needed to kill\n\treturn stun; //returns the calculation\n}", "function fillKnapsack(W, items) {\n let cache = new Cache();\n let totalVal = 0;\n let totalWeight = 0;\n\n if (W == 0 || items.length === 0) {\n return 'No items can be put in the knapsack.'\n }\n\n // Prune out items that are too heavy (>W)\n // O(n), n = number of items\n let possibleItems = [];\n for (let item of items) {\n if (item.weight <= W) {\n possibleItems.push(item);\n }\n }\n\n return tryFillKnapsack(cache, W, possibleItems);\n}", "Max_E_IG(){\n var max_IG = 0;\n var search = this.regularization();\n for (var i = 0; i < search.length; i++) {\n if (this.E_IG(search[i]) > max_IG) {\n var opt = search[i];\n max_IG = this.E_IG(search[i]);\n }\n }\n // system_optimal = opt;\n this.updateSystemOptimal(opt);\n return opt;\n }", "function knapSack(capacity, values, weights) {\n var n = values.length,\n load = 0,\n i = 0,\n val = 0;\n\n for (i=0; i<n && load < capacity; i++) { //While the total load is less than the capacity, we will iterate the items\n //If we can use the total weight of the item, then we will add it to the total value (val) and update the current load of the knapsack\n if (weights[i] <= (capacity-load)) {\n val += values[i];\n load += weights[i];\n console.log('using item ' + (i+1) + ' for the solution');\n } else {\n //If we cannot use the total weight of the item, we will calculate what is the ratio (r) that we can use\n var r = (capacity-load)/weights[i]; \n val += r * values[i];\n load += weights[i];\n console.log('using ratio of ' + r + ' for item ' + (i+1) + ' for the solution');\n }\n }\n return val;\n}", "function defMb(v) {\r\n return v.fmb >= 4000 ? 4000 : v.fmb;\r\n }", "function dKnapsack(capacity, size, value, n) {\r\n\tvar K = [];\r\n\tvar retStr=\"\";\r\n\tfor (var i = 0; i <= capacity+1; i++) {\r\n\t\tK[i] = [];\r\n\t}\r\n\tfor (var i = 0; i <= n; i++) {\r\n\t\tfor (var w = 0; w <= capacity; w++) {\r\n\t\t\tif (i == 0 || w == 0) {\r\n\t\t\t\tK[i][w] = 0;\r\n\t\t\t}\r\n\t\t\telse if (size[i-1] <= w) {\r\n\t\t\t\tK[i][w] = max(value[i-1] + K[i-1][w-size[i-1]],\r\n\t\t\t\tK[i-1][w]);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tK[i][w] = K[i-1][w];\r\n\t\t\t}\r\n\t\t\tretStr+=(K[i][w] + \" \");\r\n\t\t}\r\n\t\tretStr+=\"\\n\";\r\n\t}\r\n\tconsole.log(retStr);\r\n\treturn K[n][capacity];\r\n}", "function feeMax(value){\n //Thresold given by hand\n return value <=0.00000200\n }", "get maxVolumeToDeliver() {\n\t\treturn this.__maxVolumeToDeliver;\n\t}", "maxOrderQuantity(maxValue) {\n return maxValue;\n }", "function getMultiplier(bldg) {\r\n\tlet mult = 1;\r\n\r\n\t// upgrades stack multiplicatively\r\n\tfor (let name in CONSTANTS.discounts.upgrades) {\r\n\t\tlet discount = CONSTANTS.discounts.upgrades[name];\r\n\t\tif (IO.hasDiscount(name)) mult *= (1 - discount);\r\n\t}\r\n\r\n\t// fortunes are for individual buildings, mostly\r\n\tfor (let name in CONSTANTS.discounts.fortunes) {\r\n\t\tlet discount = CONSTANTS.discounts.fortunes[name],\r\n\t\t\tnum = name;\r\n\t\tif (name === \"buildings\") {\r\n\t\t\tnum = discount[1][bldg];\r\n\t\t\tdiscount = discount[0];\r\n\t\t}\r\n\t\tif (IO.hasDiscount('fortune-'+num)) mult *= (1 - discount);\r\n\t}\r\n\r\n\t// buffs stack multiplicatively\r\n\tfor (let name in CONSTANTS.discounts.buffs) {\r\n\t\tlet discount = CONSTANTS.discounts.buffs[name];\r\n\t\tif (IO.hasDiscount(name)) mult *= (1 - discount);\r\n\t}\r\n\r\n\t// auras stack additively\r\n\tlet sum = 0;\r\n\tfor (let name in CONSTANTS.discounts.auras) {\r\n\t\tlet discount = CONSTANTS.discounts.auras[name];\r\n\t\tif (IO.hasDiscount(name)) sum += discount;\r\n\t}\r\n\tif (sum > 0) mult *= (1 - sum);\r\n\r\n\t// spirits stack multiplicatively\r\n\tfor (let name in CONSTANTS.discounts.spirits) {\r\n\t\tlet discount = CONSTANTS.discounts.spirits[name];\r\n\t\tif (IO.hasDiscount(name)) {\r\n\t\t\tif (name === 'dotjeiess') {\r\n\t\t\t\tfor (let slot in discount) {\r\n\t\t\t\t\tif (IO.discounts[name].slots[slot].checked)\r\n\t\t\t\t\tmult *= (1 - discount[slot]);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tmult *= (1 - discount);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// sell mode calculations\r\n\tif (IO.controls.sellmode.checked) {\r\n\t\tlet discount = CONSTANTS.discounts.auras['earth-shatterer'];\r\n\t\tmult *= (IO.hasDiscount('earth-shatterer') ? discount : 0.25);\r\n\t}\r\n\r\n\treturn mult;\r\n}", "function getAvailableWPP(targetLevel, targetWeaponmaster, agility) {\n\t\n\tvar totalWPP = 15 + 55 * targetWeaponmaster + 20 * (targetWeaponmaster * (targetWeaponmaster + 1) / 2) + 14 * agility;\n\t\n\treturn totalWPP;\n}", "bestPrice() {\n if (this.side === 'ASK') {\n return this.orderMap.getMinPriceLevel();\n }\n // this.side === 'BID'\n return this.orderMap.getMaxPriceLevel();\n }", "getMaxFitness() {\n var record = 0;\n for (var i = 0; i < this.population.length; i++) {\n if (this.population[i].getFitness() > record) {\n record = this.population[i].getFitness();\n }\n }\n return record;\n }", "get HOUSING_WEIGHTS() { \n return [.180, .300, .170, .160, .090, .050, .040, .010];\n }", "function maxBufferLevelForQuality(bolaState, quality) {\n return bolaState.Vp * (bolaState.utilities[quality] + bolaState.gp);\n }", "GetTreeQuality() {\n return this.m_contactManager.m_broadPhase.GetTreeQuality();\n }", "function indexOfMaxValue(arr, key) {\n var maxWeight = -Infinity;\n var idx = -1;\n arr.forEach(function(o, i) {\n if (o.weight > maxWeight) {\n idx = i;\n maxWeight = o.weight;\n }\n });\n return idx;\n }", "function calculatePGNum(osdcount, size, pgmax) {\n var pgnum = roundUpToNextPowerOfTwo(osdcount * 100 / size);\n if (pgnum > pgmax) {\n pgnum = pgmax;\n }\n return pgnum;\n }", "Fv(){\n return this.shearReinf ? Math.min(3*Math.pow(this.fm,0.5),150) : Math.min(Math.pow(this.fm,0.5),50)\n }", "function weightedClue(clue) {\n return clue ? clue : -10;\n }", "function leastExpensive(items) {\n var current2 = groceries[0].cost;\n for(var i = 0; i < groceries.length; i++){\n if(groceries[i].cost < current2) {\n current2 = groceries[i].cost;\n }\n }\n return current2;\n}", "function h_calculateMaxBuy()\n{\n\tif(choosenDrug == \"Acid\")\n\t{\n\t\tmaxPossibleBuy = Math.floor(cash / drugs.acid);\n\t\t// check if enough pocksts are available\n\t\tif(maxPossibleBuy > freePockets)\n\t\t{\n\t\t\tmaxPossibleBuy = freePockets;\n\t\t}\n\t\tif(maxPossibleBuy > acid_unit) // check if enough is available\n\t\t{\n\t\t\tmaxPossibleBuy = acid_unit;\n\t\t}\n\t\t\n\t\t$('#maxBuy').html(\"(max: \"+maxPossibleBuy+\")\");\t\t\t// update UI\n\t\t\n\t\tif(maxPossibleBuy == 0)\n\t\t{\n\t\t\tdocument.getElementById(\"acid_tick\").disabled = true;\n\t\t}\n\t}\n\t\n\tif(choosenDrug == \"Coke\")\n\t{\n\t\tmaxPossibleBuy = Math.floor(cash / drugs.coke);\n\t\t\n\t\t// consider available/free pockets\n\t\tif(maxPossibleBuy > freePockets)\n\t\t{\n\t\t\tmaxPossibleBuy = freePockets;\n\t\t}\n\t\t\n\t\t// check if enough is available\n\t\tif(maxPossibleBuy > coke_unit) \n\t\t{\n\t\t\tmaxPossibleBuy = coke_unit;\n\t\t}\n\t\t\n\t\t$('#maxBuy').html(\"(max: \"+maxPossibleBuy+\")\");\t\t\t// update UI\n\t\t\n\t\tif(maxPossibleBuy == 0)\n\t\t{\n\t\t\tdocument.getElementById(\"coke_tick\").disabled = true;\n\t\t}\n\t}\n\t\n\t// insert max value into text field\n\t$('#buyDrugs').val(maxPossibleBuy);\n}", "get maximumValue() {\r\n return this.i.bk;\r\n }", "get minIopsPerGib() {\n return this.getNumberAttribute('min_iops_per_gib');\n }", "gainMult() {\n let mult = D(1)\n if(player.grindless)mult=mult.div(3)\n return mult // Factor in any bonuses multiplying gain here.\n }", "get maximumValue() {\n return this.i.bk;\n }", "get maxCapacityInput() {\n return this._maxCapacity;\n }", "function beeStings(weight){\n //# of bee stings = victim's weight/stingsPerPound\n var numOfStings = weight/stingsPerPound;\n //returns number of stings it takes to kill animal\n return numOfStings;\n}", "function node_weight(d) {\r\n d.weight = links.filter(function(l) {\r\n return l.source.index == d.index // || l.target.index == d.index \r\n }).length\r\n return d.weight\r\n }", "function minimumBribes(q) {\n // \n}", "function getMaxMin(Layer, energy, moisture, content, potential, year){\n max = 0\n min = 99999999\n// As thermochemical facilities do not have a tag but are listed as dry we need to do the step below\nif (energy == '_dry'){\n moisture = '_dry'\n energy = ''\n }\n\n Layer.forEach(function(feature){\n type = feature.getProperty(\"Type\");\n if (type == 'crop'){\n if (moisture == ''){\n res_val = getTotalBiomass(feature, energy, '_dry', content, potential, year);\n cull_val = getTotalBiomass(feature, energy, '_wet', content, potential, year);\n biomass_val = res_val + cull_val\n }\n else {\n biomass_val = getTotalBiomass(feature, energy, moisture, content, potential, year);\n }\n }\n else {\n biomass_val = getTotalBiomass(feature, energy, moisture, content, potential, year);\n }\n if (biomass_val>max){\n max=biomass_val\n }\n if (biomass_val<min){\n min=biomass_val\n }\n })\n return ([max, min])\n }", "get armStretch() {}", "function rateFirstClassRetail(weight) {\n if (weight <= 4.0) {\n return 3.50;\n } else if (weight <= 8.0) {\n return 3.75;\n } else if (weight <= 9.0) {\n return 4.10;\n } else if (weight <= 10.0) {\n return 4.45;\n } else if (weight <= 11.0) {\n return 4.80;\n } else if (weight <= 12.0) {\n return 5.15;\n } else if (weight <= 13.0) {\n return 5.50;\n } else {\n throw `Invalid weight \"${weight}\"`;\n }\n}", "function getFuelRequirementForModule(number) {\n return Math.max(0, Math.floor(number / 3) - 2)\n}", "function reWeigh(words) {\n // It can be the case that list is empty (no countries checked).\n if (words.length == 0) {\n return words;\n }\n var highest_freq = words[0].weight;\n var lowest_freq = words[words.length - 1].weight;\n var interval = highest_freq - lowest_freq;\n for (var i = 0; i < words.length; i++) {\n // Rescale by (100/interval) and translate by 20 (minimum weight).\n words[i].weight = 20 + Math.round(((words[i].weight - lowest_freq) * 100) / interval);\n }\n return words;\n}", "function calculateProductionBonusMultiplier(userState) {\n const terrainModifier = 0; // TODO: this\n // mountain, chaos node == +5%\n // desert, forest, hill, nature node == +3%\n // Gaia's Blessing doubles the benefit from forests\n\n const buildingModified = 0\n + (userState.construction.isCompleted(Buildings.SAWMILL) ? 25 : 0)\n + (userState.construction.isCompleted(Buildings.FORESTERS_GUILD) ? 25 : 0)\n + (userState.construction.isCompleted(Buildings.MINERS_GUILD) ? 50 : 0)\n + (userState.construction.isCompleted(Buildings.MECHANICIANS_GUILD) ? 50 : 0);\n\n const enchantmentModifiedAdditive = 0; // TODO: this\n // Inspirations = +100%\n const enchantmentModifierMultiplicative = 100; // TODO: this\n // Cursed Lands = 50\n\n const modifier = ((100 + terrainModifier + buildingModified + enchantmentModifiedAdditive) / 100.0)\n * (enchantmentModifierMultiplicative / 100)\n\n return modifier;\n}", "function knapSack(capacity, weights, values, n) {\n var i, w, a, b, kS = [];\n\n for (i = 0; i <= n; i++) { //initialize matrix used to find the solution\n kS[i] = [];\n }\n\n for (i = 0; i <= n; i++) {\n for (w = 0; w <= capacity; w++) {\n if (i === 0 || w === 0) { //ignore the first column and row of the matrix so that we can work only with indexes different from 0\n kS[i][w] = 0;\n } else if (weights[i-1] <= w) { //Item i can only be part of the solution if its weight is less than the constraint (capacity)\n a = values[i-1] + kS[i-1][w-weights[i-1]];\n b = kS[i-1][w];\n kS[i][w] = (a > b) ? a : b; //max(a,b), When we find that an item can be part of solution, we will choose the one with the maximum value\n console.log(a + ' can be part of the solution');\n } else{\n kS[i][w] = kS[i-1][w]; //if total weight > capacity, we will simply ignore its value and use the previous one\n }\n }\n console.log(kS[i].join());\n }\n //extra algorithm to find the items that are part of the solution\n findValues(n, capacity, kS, values, weights);\n return kS[n][capacity]; //solution found in the last cell of 2d table, which is found in the lower-right corner of the table.\n\n}", "function knapsack(capacity, size, value, n) {\r\n\tif (n == 0 || capacity == 0) {\r\n\t\treturn 0;\r\n\t}\r\n\tif (size[n-1] > capacity) {\r\n\t\treturn knapsack(capacity, size, value, n-1);\r\n\t}\r\n\telse {\r\n\treturn max(value[n-1] +\r\n\t\tknapsack(capacity-size[n-1], size, value, n-1),\r\n\t\tknapsack(capacity, size, value, n-1));\r\n\t}\r\n}", "function doseInML(weight, mgPerKg, mgPerML) {\n return (weight * mgPerKg) / parseFloat(mgPerML);\n}", "function weight_field(node) {\n return find_property(node, \"weight\");\n}", "function upgrade_cost (k)\n {\n return 500.0 * (1 + k/(15-k)) * Math.pow(k, 1.5) * (1/(15-k));\n }", "function randomWeight() {\n var start;\n var end;\n if (deck.cards.length === 1) {\n start = deck.cards[0].weight;\n } else {\n start = deck.cards[1].weight;\n }\n if (deck.cards.length >= 7) {\n end = deck.cards[6].weight;\n } else {\n end = deck.cards[deck.cards.length - 1].weight;\n }\n // + 1 adds milisecond to timestamp to ensure rotation when there are only two cards left\n return Math.round(Math.random() * (end - start)) + start + 1;\n }", "function knapsackProblem(items, capacity) {\n let memo = new Array(capacity + 1);\n for (let i = 0; i < memo.length; i++) {\n memo[i] = [0, []];\n }\n for (let j = 0; j < items.length; j++) {\n let currentItem = items[j];\n let currentValue = currentItem[0];\n let currentWeight = currentItem[1];\n\n for (let i = memo.length - 1; i >= currentWeight; i--) {\n let prevBest = memo[i - currentWeight];\n if (memo[i][0] < prevBest[0] + currentValue) {\n memo[i][0] = prevBest[0] + currentValue;\n memo[i][1] = [...prevBest[1], j];\n }\n }\n }\n return memo[memo.length - 1];\n}" ]
[ "0.71948147", "0.66494745", "0.65678364", "0.63743794", "0.6325384", "0.6319217", "0.62928843", "0.6084406", "0.60569614", "0.60402507", "0.6016911", "0.59957266", "0.5992119", "0.597225", "0.5970047", "0.596481", "0.5954523", "0.59522086", "0.59449285", "0.59439915", "0.5931863", "0.59261155", "0.5925851", "0.592469", "0.5922626", "0.5906421", "0.58546615", "0.5828586", "0.579117", "0.5772542", "0.5764494", "0.57416815", "0.57241416", "0.56726587", "0.56725377", "0.5667138", "0.56652516", "0.5660138", "0.5649403", "0.5595047", "0.5592889", "0.5587649", "0.5580957", "0.55746686", "0.5572355", "0.55519956", "0.5551237", "0.5526651", "0.55023766", "0.5500938", "0.5497379", "0.54895383", "0.54834354", "0.5478098", "0.5478018", "0.5475778", "0.5465508", "0.5444587", "0.5443498", "0.5435068", "0.5428541", "0.54204464", "0.54138374", "0.5410981", "0.5410368", "0.54095656", "0.54010975", "0.5400025", "0.5398541", "0.5390928", "0.53905845", "0.5388484", "0.5384062", "0.5381013", "0.5374663", "0.5367446", "0.5366626", "0.5362382", "0.53621393", "0.5353216", "0.5352292", "0.5335538", "0.53342634", "0.53332853", "0.53295296", "0.53264624", "0.5324309", "0.5303794", "0.52983046", "0.52957255", "0.5295129", "0.5289311", "0.52876824", "0.5280518", "0.52757317", "0.5273184", "0.5257811", "0.5256611", "0.52540916", "0.5252824" ]
0.69374865
1
Run command or app and WAIT until it finished. While waiting, this script cannot process new input and run others commands
async function runCommandHandler(command) { try { console.log(await runCommand(command)); } catch (e) { console.error(`Error: ${e.message}`); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function waitForCommandInput() {\n /**\n * Print menu & request input.\n */\n function getCommandInput() {\n prompt.get(['command'], function (err, input) {\n if (err) {\n console.log(err);\n return 1;\n }\n\n console.log();\n processCmd(input.command);\n });\n }\n\n /**\n * Process command.\n *\n * @param {string} command Command string\n */\n function processCmd(command) {\n var cmd = command.split(' ');\n\n switch (cmd[0]) {\n case 'check':\n var result = 'date : ' + currDate.getDate() + '/' + currDate.getMonth() + '/' + currDate.getFullYear() + '\\n';\n result += 'file path : ' + docFile + '\\n';\n result += 'index : ' + index;\n\n console.log(result);\n break;\n\n case 'clear':\n helper.clearScreen();\n break;\n\n case 'date':\n currDate.setFullYear(cmd[3], cmd[2], cmd[1])\n kompas.setDesiredDate(currDate.getDate(), currDate.getMonth(), currDate.getFullYear());\n console.log('date set.');\n break;\n\n case 'file':\n docFile = cmd[1];\n console.log('file set.');\n break;\n\n case 'index':\n index = cmd[1];\n console.log('article index set.');\n break;\n\n case 'h':\n printMenu();\n break;\n\n case 'page':\n kompas.setDesiredPage(cmd[1]);\n console.log('page set.');\n break;\n\n case 'scrap':\n console.log('start Scraping ..');\n startScrapper(cmd[1], function (data) {\n console.log('Scraping finished.');\n\n jsfile.writeFile(docFile, data, {spaces: 4}, function (err) {\n assert.equal(err, null);\n });\n });\n break;\n\n case 'exit':\n process.exit(0);\n }\n\n console.log();\n getCommandInput();\n }\n\n console.log('Type \\'h\\' to show full command list.');\n getCommandInput();\n}", "run () {\n\n this.readAndUpdate();\n this.start(this._state);\n this.doAction(\"PADDLE\", this._current_action);\n this.sendAction();\n\n while (true) {\n\n this.readAndUpdate();\n\n if (!this._next_command)\n return;\n\n if (this._promise_succeeded) {\n this._next_command.resolve(this._state);\n } else {\n this._next_command.reject(this._promise_failure_reason);\n }\n\n this.doAction(\"PADDLE\", this._current_action);\n this.sendAction();\n\n // reset current action\n this._current_action = [0, 0, false];\n\n // reset promise results\n this._promise_succeeded = undefined;\n this._promise_failure_reason = undefined;\n }\n }", "async run() { \n\n\twhile(true ) {\n\t \n\t switch (this.state.value.status) { \n\t case \"launched\" : \n\t\tthis.emit(\"Confirm shutdown\") \n\t\tthis.state.update(['status'], x=>\"confirming\")\n\t\tbreak \n\t\t\n\t case \"confirming\" : \n\t\tlet text = await this.get_input() \n\t\tif (text == \"yes\") {\n\t\t this.emit(\"Exiting Program\")\n\t\t setTimeout( (function() { this.feedback(\"shutdown\") }).bind(this) , 1000)\n\t\t setTimeout( function() { process.exit(1) } , 2500 )\n\t\t} else if (text == \"cancel\") { \n\t\t this.emit(\"Canceling program shutdown\") \n\t\t this.state.update(['status'] , ()=>\"aborting\")\n\t\t break\n\t\t} else {\n\t\t this.emit(\"Please say yes to shutdown, or cancel to abort\") \n\t\t}\n\t\t\n\t default: \n\t\tbreak //from the loop \n\t }\n\n\t}\n\t//input channel has been closed \n\tthis.finish({result : \"OK\" } )\n }", "async function runCommand(cmd) {\r\n switch (cmd.toLowerCase()) {\r\n \r\n case \"restart\": \r\n case \"reboot\": \r\n t_println(\"Rebooting. Please wait\");\r\n await t_write(\".....\", 0.5);\r\n t_terminal.innerHTML = terminalDefaultContent;\r\n boot();\r\n break;\r\n\r\n case \"shutdown\": \r\n t_println(\"Shutting down internal services\");\r\n await t_write(\"...\", 1);\r\n t_println(\"Goodbye!\");\r\n await sleep(1);\r\n t_terminal.innerHTML = \"\";\r\n break;\r\n\r\n case \"clear\": \r\n t_terminal.innerHTML = terminalDefaultContent;\r\n init();\r\n runCommand(await t_getln());\r\n break;\r\n\r\n case \"ls\": \r\n t_println(\"This is the return value of the ls command!\");\r\n runCommand(await t_getln());\r\n break;\r\n\r\n\r\n default: // Über JSON File falls kein 'Aktiver' Command (also wenn nur text zurück)\r\n t_println(\"Command not found: \" + cmd);\r\n runCommand(await t_getln()); //Ready for the next input\r\n break;\r\n }\r\n}", "function runSCADAProgram() {\n console.log('run');\n\n const spirt = spawn(processpath);\n\n spirt.on('exit', () => {\n stopReading();\n ifFirstStart=true;\n });\n}", "execute_program(){\n\t// execution loop\n\twhile(!this.step()){}\n}", "async submit() {\n\t\t\tlet value = stdin.value || stdpass.value;\n\n\t\t\t// Submit was called during a read, just handle returning the input\n\t\t\tif(typeof this.reader === 'function') {\n\t\t\t\tthis.submitInput(value);\n\n\t\t\t\tif(this.input.className === \"pass\") {\n\t\t\t\t\tthis.commitPrompt();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.commitPrompt(value);\n\t\t\t\t}\n\n\t\t\t\t// Clear stdin so the command can run\n\t\t\t\tthis.stdin.disabled = true;\n\t\t\t\tthis.stdin.value = \"\";\n\t\t\t\tthis.stdpass.value = \"\";\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.history.submit();\n\n\t\t\t// Clear stdin so the command can run\n\t\t\tthis.stdin.disabled = true;\n\t\t\tthis.stdin.value = \"\";\n\t\t\tthis.stdpass.value = \"\";\n\n\t\t\tthis.commitPrompt(value);\n\n\t\t\t// Actually execute the command (was deferred for stdout)\n\t\t\tif(typeof this.reader === 'function') {\n\t\t\t\tthis.submitInput();\n\t\t\t\tthis.reader = null;\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttry {\n\t\t\t\t\tlet interp = new InterpreterVisitor(this);\n\t\t\t\t\tlet res = await new ShellParser(value).parse().visit(interp);\n\n\t\t\t\t\tif(typeof res !== 'undefined' && res !== Symbol.for(\"void\")) {\n\t\t\t\t\t\tthis.log(res);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch(e) {\n\t\t\t\t\tif(e instanceof ShellError) {\n\t\t\t\t\t\tthis.error(e.message);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.error(e.stack);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Reenable stdin\n\t\t\tthis.stdin.disabled = false;\n\n\t\t\tlet c = this.current, n = tag(\n\t\t\t\t'div', {id: 'current'}\n\t\t\t);\n\t\t\tn.innerHTML = renderPrompt({user, cwd: path});\n\t\t\tc.parentNode.replaceChild(this.current = n, c);\n\t\t\tthis.prompt = n.firstChild;\n\n\t\t\t// Cleanup\n\t\t\tthis.realign();\n\t\t\tthis.stdin.focus();\n\t\t}", "async run() { \n\t//loop read from the input channel \n\twhile(true ) {\n\n\t this.feedback(\"continue\")\n\n\t let text = await this.get_input() \n\t if (text == undefined || text == \"finished\") { break }\n\t this.chunks.push(text) \n\t}\n\t//input channel has been closed \n\tthis.finish({payload : { result : this.chunks.join(this.args.joiner || \"\\n\")} }) \n }", "function wait(){}", "function exec() {\n lastExec = Date.now();\n callback.apply(self, args);\n }", "function exec() {\n lastExec = Date.now();\n callback.apply(self, args);\n }", "function exec() {\n lastExec = Date.now();\n callback.apply(self, args);\n }", "function exec() {\n lastExec = Date.now();\n callback.apply(self, args);\n }", "function exec() {\n lastExec = Date.now();\n callback.apply(self, args);\n }", "function exec() {\n lastExec = Date.now();\n callback.apply( self, args );\n }", "function exec() {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec() {\n lastExec = Date.now();\n callback.apply(self, arguments_);\n }", "function exec() {\n lastExec = Date.now();\n callback.apply(self, arguments_);\n }", "start(){\r\n process.stdin.resume();\r\n process.stdin.setEncoding('utf8');\r\n prompt();\r\n \r\n process.stdin.on('data', function(chunk) {\r\n let [success, res, more] = parseCommand(chunk.replace('\\n', '').replace('\\r', ''));\r\n if (!success){\r\n switch(res){\r\n case errcodes.NOCOMMAND :\r\n console.error(`CommandLine Error : nonexistant command (${more})`);\r\n break;\r\n case errcodes.NONAMESPACE :\r\n console.error(`CommandLine Error : nonexistant namespace (${more})`);\r\n break;\r\n } \r\n }\r\n logging = false;\r\n prompt();\r\n });\r\n logging = false;\r\n }", "function exec() {\n lastExec = Date.now();\n callback.apply(self, arguments_);\n }", "async function mainCommand() {\n const dialog = createDialog();\n\n const result = await dialog.showModal();\n if (result === \"reasonCanceled\") return;\n\n console.log(\"Exited with OK!\");\n\n return;\n}", "function exec() {\n\t lastExec = Date.now();\n\t callback.apply(self, args);\n\t }", "function runInteraction()\n{\n let delay = ''; //document.getElementById(\"delay\").value;\n delay =\n !isNaN(parseFloat(delay)) && isFinite(delay) ? \" \" + delay : \" 250\";\n let cmd =\n process.platform === \"win32\"\n ? \"python interact.py ./viewer/config.json 1000\"\n : \"python interact.py ./viewer/config.json 1000\";\n GC.interactor = execute(cmd + delay, function(output) {\n console.log(output);\n });\n}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec(command) {\n var oShell=wscript_shell.Exec(command);\n while (oShell.Status === 0) {\n WScript.sleep(100);\n }\n}", "function exec () {\n\t\t\t\tlastExec = Number(new Date());\n\t\t\t\tcallback.apply(self, args);\n\t\t\t}", "function exec () {\n\t\t\t\tlastExec = Number(new Date());\n\t\t\t\tcallback.apply(self, args);\n\t\t\t}", "async function waitUserInput(vm) {\n while (next === false) await timeout(50); // pause script but avoid browser to freeze ;)\n next = false; // reset var\n console.log('user input detected');\n if(vm.stored_input_text == 'break'){\n pushWinterText(vm, \"breakingg\")\n return false;\n } else {\n return true\n }\n}", "async function consoleCommands() {\n console.log(\"c to clear temp files\");\n console.log(\"r to start server\");\n var rl = readline.createInterface(process.stdin, process.stdout);\n var prefix = '>';\n rl.on('line', async function (line) {\n switch (line.trim()) {\n case 'c': //command to clean the temp file(serverRepos and other temp files of server)\n shell.exec(\"rm -r -f \" + exports.serverDirectory + \"/*\");\n shell.exec(\"rm -r -f ./server_0.9/.metadata\");\n shell.exec(\"rm -r -f ./server_0.9/jdt.ls-java-project\");\n exports.ReposInServer = [];\n console.log(\"done\");\n break;\n case 'r': //command to run the server\n t = await clientTest.startServer(exports.serverDirectory);\n fs.readdirSync(exports.serverDirectory).forEach(file => {\n exports.ReposInServer.push(file); //reading the repos already in the serverRepos directory\n });\n //this.close();//closing the prompt after starting the server\n break;\n default:\n console.log(\"wrong input\");\n }\n this.setPrompt(prefix);\n this.prompt();\n }).on('close', function () {\n });\n rl.setPrompt(prefix);\n rl.prompt();\n}", "enterWaitCommand(ctx) {\n\t}", "run() {\n\t\t\t// Pull latest data\n\t\t\tlet data = this.data();\n\t\t\ttry {\n\t\t\t\tif (data.commands.length) {\n\t\t\t\t\t// Set a holder for finished results\n\t\t\t\t\tlet finished = [];\n\t\t\t\t\t// Set recursive function for running one at a time.\n\t\t\t\t\tlet runner = () => {\n\t\t\t\t\t\t// Return promise\n\t\t\t\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\t\t\t\t// Is finished full?\n\t\t\t\t\t\t\tif (finished.length < data.commands.length) {\n\t\t\t\t\t\t\t\t// Time to do some command running\n\t\t\t\t\t\t\t\t// Run command using finished count as the index\n\t\t\t\t\t\t\t\tthis.runCommand(data.commands[finished.length])\n\t\t\t\t\t\t\t\t\t.then(res => {\n\t\t\t\t\t\t\t\t\t\t// Push to finished\n\t\t\t\t\t\t\t\t\t\tfinished.push(res);\n\t\t\t\t\t\t\t\t\t\t// Return another runner.\n\t\t\t\t\t\t\t\t\t\treturn runner();\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t.catch(e => {\n\t\t\t\t\t\t\t\t\t\t// Shit, error - still push it to finished so it gets counted.\n\t\t\t\t\t\t\t\t\t\tfinished.push(e.message);\n\t\t\t\t\t\t\t\t\t\t// Return rnner\n\t\t\t\t\t\t\t\t\t\treturn runner();\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Resolve it man!\n\t\t\t\t\t\t\t\tupdate(bs => {\n\t\t\t\t\t\t\t\t\tbs.commands = [];\n\t\t\t\t\t\t\t\t\tbs.finished = finished;\n\t\t\t\t\t\t\t\t\tStorage.local.put('commander', bs);\n\t\t\t\t\t\t\t\t\treturn bs;\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t// Toast!\n\t\t\t\t\t\t\t\tInteract.toast(\n\t\t\t\t\t\t\t\t\t`${finished.length} command${finished.length === 1 ? '' : 's'} executed`\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tresolve(finished);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t};\n\t\t\t\t\t// Start off the initial runner.\n\t\t\t\t\treturn runner();\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t}", "function exec() {\n\t lastExec = Date.now();\n\t callback.apply(self, arguments_);\n\t }", "async function execute() {\n let init_content;\n if (initfile !== null) {\n init_content = await load_init_file(initfile);\n } else {\n init_content = \"\";\n }\n\n let editor_code = await editor.getValue();\n let script = start_script + init_content + editor_code + end_script;\n let resp = await run_code(script);\n\n fillOutput(resp);\n displayOrHideOutputs(resp);\n\n }", "async function showPrompt() {\n await terminal.input(async function (res) {\n await commands(res);\n showPrompt();\n });\n\n return;\n}", "wait() {}", "function App()\r\n{\r\n\tconsole.log(\"===========================================\");\r\n\tconsole.log(\"\\t\\tWelcome to LIRI.\");\r\n\tconsole.log(\"===========================================\");\r\n\tinquirer.prompt(questions[0]).then(answer => {//promts the first question in our questions list object\r\n\t\tswitch(answer['MenuOption']) {//answer['MenuOption'] in order to get the users input result\r\n\t\t\tcase '1':\r\n\t\t\t\tinquirer.prompt(questions[1]).then(answer => {\r\n\t\t\t\t\tExecuteCommand('get-tweets', answer['TwitterUsername']);//runs the get latest tweets command\r\n\t\t\t\t});\r\n\t\t\t break;\r\n\t\t\tcase '2':\r\n\t\t\t\tinquirer.prompt(questions[2]).then(answer => {\r\n\t\t\t\t\tExecuteCommand('spotify-this-song', answer['SpotifySongSearch']);//runs the Spotify Song search command\r\n\t\t\t\t});\r\n\t\t\t break;\r\n\t\t\tcase '3':\r\n\t\t\t\tinquirer.prompt(questions[3]).then(answer => {\r\n\t\t\t\t ExecuteCommand('movie-this', answer['MovieName']);//runs the movie name search command\r\n\t\t\t\t});\r\n\t\t\t break;\r\n\t\t\tcase '4':\r\n\t\t\t\tExecuteCommand('do-what-it-says', null);//runs the command in the textfile \r\n\t\t\t break;\r\n\t\t\tcase '5':\r\n\t\t\t\tExecuteCommand('exit', null);//exits the application\r\n\t\t\t break;\r\n\t\t\tdefault:\r\n\t\t\t\tconsole.log(\"Command not recognized! Please try again.\");\r\n\t\t\t break;\r\n\t\t }\r\n\t})\r\n}", "async function runOnCommand() {\n //first two args are app path and node command. So we slice them.\n let args = process.argv.slice(2);\n // console.log(\"args.length >>>>>>>>>>>>\",args.length)\n //If args length equals 0, it means called in a function\n if (args.length == 0) {\n console.log('Internal Call For Verify OTP !!!')\n } else if (args.length == 5) {\n //Get otp function requires 5 parameters.\n let result = await verifyOtp(args[0], args[1], args[2], args[3], args[4]);\n console.log(result);\n } else {\n console.error('Args count must be 10. Debug, Base Url, User Type, Country Code and Mobile Number !!!');\n }\n}", "function exec() {\n last_exec = +new Date();\n callback.apply( that, args );\n }", "function exec() {\n last_exec = +new Date();\n callback.apply( that, args );\n }", "function exec() {\n last_exec = +new Date();\n callback.apply( that, args );\n }", "function exec() {\n last_exec = +new Date();\n callback.apply( that, args );\n }", "function start(){\n\n\tprocess.stdout.write('\\033c');\n\n\tinquirer.prompt([\n\t {\n\t \ttype: \"list\",\n \tmessage: \"Choose your path!\",\n \tchoices: [\"Take Quiz\", \"Add New Questions\", \"Create New Questions(blank slate)\"],\n \tname: \"ans\"\n\t \t\n\t }\n\t]).then(function(info){\n\t\tif(info.ans == \"Take Quiz\"){\n\t\t\ttestSkip = true;\n\t\t\ttester();\n\t\t}\n\t\telse if(info.ans == \"Add New Questions\"){\n\t\t\tappend = true;\n\t\t\tblankSlate();\t//but not really\n\t\t}\n\t\telse if(info.ans == \"Create New Questions(blank slate)\"){\n\t\t\tareYouSure();\n\t\t}\n\t});\n}", "start() {\r\n this.io.prompt();\r\n }", "function exec() {\n lastExec = Number(new Date());\n callback.apply(self, args);\n } // If `debounceMode` is true (at begin) this is used to clear the flag", "async waitForInterrupt() {\r\n while (ahk.hotkeysPending[0]) {\r\n await ahk.hotkeysPending[0]();\r\n ahk.hotkeysPending.shift();\r\n }\r\n }", "function loopIt() {\n menu(function(result) {\n if(result) {\n // Move to the bottom left hand corner\n term.moveTo(1, term.height-2);\n //term.blue(\"Please enter command below:\\n\");\n drawLine(); \n loopIt();\n } else {\n process.exit();\n }\n });\n}", "function start(){\n switch(lCmd){\n case 'my-tweets':\n Tweets();\n break;\n case 'spotify-this-song':\n SpotifyCall(inputs);\n break;\n case 'movie-this':\n Movie(inputs);\n break;\n case 'do-what-it-says':\n Do();\n break;\n default:\n console.log(\"my-tweets, spotify-this-song, movie-this and do-what-it-says are the only commands accepted. Check your input.\");\n break;\n \n }\n}", "function runCommands() {\n app\n .command('run <path>')\n .description('Run a bot manually')\n .option('-f --fork', 'Don\\'t re-queue bot after running.')\n .action(runActions);\n}", "async function main() {\n try {\n const page = 1; // TODO: Uncomment for GHA as source of truth\n const workflow = await getLatestWorkflow(page); // TODO: Uncomment for GHA as source of truth\n const success = validateWorkflowSuccess(workflow); // TODO: Uncomment for GHA as source of truth\n\n if (success === undefined) {\n console.log(`Check runs still pending. Sleeping for ${timeout} minutes`);\n await sleep(timeout * 60 * 1000);\n await main();\n return;\n }\n\n if (!success) {\n await getJobsFailed(workflow.id);\n process.exit(1);\n }\n } catch (e) {\n console.error(e);\n process.exit(1);\n }\n}", "function systemCommandResponseCallback(error, stdout, stderr)\n {\n var responseString =\n 'stdout: ' + pipeToString(stdout)\n + 'stderr: ' + pipeToString(stderr)\n + 'error: ' + error;\n console.log(\"command found \" + responseString);\n showForm(serverRequest, serverResponse, postedData)\n }", "function systemCommandResponseCallback(error, stdout, stderr)\n {\n var responseString =\n 'stdout: ' + pipeToString(stdout)\n + 'stderr: ' + pipeToString(stderr)\n + 'error: ' + error;\n console.log(\"command found \" + responseString);\n showForm(serverRequest, serverResponse, postedData)\n }", "function systemCommandResponseCallback(error, stdout, stderr)\n {\n var responseString =\n 'stdout: ' + pipeToString(stdout)\n + 'stderr: ' + pipeToString(stderr)\n + 'error: ' + error;\n console.log(\"command found \" + responseString);\n showForm(serverRequest, serverResponse, postedData)\n }", "function systemCommandResponseCallback(error, stdout, stderr)\n {\n var responseString =\n 'stdout: ' + pipeToString(stdout)\n + 'stderr: ' + pipeToString(stderr)\n + 'error: ' + error;\n console.log(\"command found \" + responseString);\n showForm(serverRequest, serverResponse, postedData)\n }", "function askForPrompt() {\n\tprompt.start();\n\n\tprompt.get({\"properties\":{\"name\":{\"description\":\"Enter a command\", \"required\": true}}}, function (err, result) { \n\t\tcommandFinder(result.name)\n\t})\n}", "run() {\r\n let runOption = 0;\r\n do {\r\n console.clear();\r\n HangmanUtils.displayIntroduction();\r\n runOption = input.questionInt(\">> \");\r\n switch (runOption) {\r\n case 1:\r\n console.clear();\r\n HangmanUtils.displayRules();\r\n this.runGame();\r\n break;\r\n case 2:\r\n this.runStatistics();\r\n break;\r\n case 3:\r\n console.log(\"Good Bye! :)\");\r\n break;\r\n default:\r\n console.log(\"\\nPlease enter 1, 2 or 3 only!\");\r\n input.question(\"\\nPress \\\"Enter\\\" to proceed...\");\r\n }\r\n }\r\n while (runOption !== 3);\r\n }", "async anything(inputs = {}) {\n this.cli.status('Running Anything')\n }", "function start() {\n var command = process.argv[2];\n\n if (command == \"exit\") {\n send(\"x\", \"\");\n }\n else if (command == \"force\") {\n send (\"!\", \"\");\n }\n else if (command == \"list\") {\n send(\"l\", \"\");\n }\n else if (command == \"kill\") {\n send(\"k\", getArguments());\n }\n else if (command == \"new\") {\n send(\"n\", getArguments());\n } else {\n console.log(INFO_MSG);\n }\n}", "async function main() {\n // create a new actionhero process\n const app = new actionhero_1.Process();\n // handle unix signals and uncaught exceptions & rejections\n app.registerProcessSignals(exitCode => {\n process.exit(exitCode);\n });\n // start the app!\n // you can pass custom configuration to the process as needed\n await app.start();\n}", "function commandFinder(cmd) {\n\tvar activeCommands = JSON.parse(fs.readFileSync('./cmds.json', 'utf8'));\n\tvar splitInput = cmd.trim().split(\" \")\n\tfor (var i = 0; i < activeCommands.commands.length; i++) {\n\t\tif (activeCommands.commands[i].name.toLowerCase() == splitInput[0].toLowerCase()) {\n\t\t\tif (activeCommands.commands[i].name.toLowerCase() != \"exit\") {\n\t\t\t\tclearScreen();\n\t\t\t\trunScript(activeCommands.commands[i].file, function (err) {\n \t\t\t\tif (err) throw err;\n \t\t\t\t//clearScreen();\n \t\t\t\tconsole.log(`\\n-----------\\nThe ${activeCommands.commands[i].name} command has finished running.`);\n \t\t\t\taskForPrompt();\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.log(\"\\nThe script has been terminated.\")\n\t\t\t\tprocess.exit()\n\t\t\t}\n\t\t}\n\t\tif (i + 1 == activeCommands.commands.length) {\n\t\t\tclearScreen()\n\t\t\tconsole.log(\"You didn't enter a valid command.\\nNeed help? Type in 'help' as your input.\\n\")\n\t\t\taskForPrompt()\n\t\t}\n\t}\n}", "function runProgram() {\n inquirer.prompt([\n {\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add To Inventory\", \"Exit\"],\n name: \"userChoice\"\n }\n ]).then(function (inquirerResponse) {\n userChoice = inquirerResponse.userChoice;\n switchChoices(userChoice);\n })\n}", "function nodeAppRun() {\n const dir = settings.get('directory');\n dirCheckHelper(dir).then(\n (result) => {\n log.info('[main]', 'directoryCheckHelper success');\n },\n (error) => {\n newNotification(appStr.dirCheckFailed);\n return;\n }\n );\n imageCheck().then(\n (result) => { //image exist run it\n log.info('[main]', 'autoUpdateCheck updateCheckDelay');\n setTimeout(autoUpdateCheck, updateCheckDelay);\n const dockerCmd = settings.get('docker_cmd');\n //Get the container status of bitmarkNode\n exec(\n dockerCmd + \" inspect -f '{{.State.Running}}' bitmarkNode\",\n (err, stdout, stderr) => {\n //If the container is not setup, create it\n if (err) {\n //Call container helper and wait for the promise to reload the page on success\n const net = settings.get('network');\n const dir = settings.get('directory');\n newNotification(appStr.createContainerStart)\n createContainerHelper(net, dir, isWin).then(\n (result) => {\n log.info('[main]', 'nodeAppRun Success', result);\n reloadMain('index');\n },\n (error) => {\n log.info('[main]', 'createContainerHelper Error', error);\n newNotification(appStr.containerFailStart);\n return; //terminate, don't have to start container\n }\n ); \n } else {\n //If the container is stopped, start it\n var str = stdout.toString().trim();\n if (str.includes('false')) {\n setActionRun(true);\n dockerStart().then(\n (result) => {\n setActionRun(false);\n log.info('[main]', 'bitmark-node start', result);\n reloadMain('index');\n },\n (error) => {\n setActionRun(false);\n log.error('[main]', error);\n newNotification(appStr.containerFailStart);\n reloadMain('index');\n }\n );\n }\n }\n }\n );\n },\n (error) => {// image does not exit run update immediately \n log.info('[main]', 'autoUpdateCheck immediately');\n setTimeout(autoUpdateCheck, 0);\n return;\n }\n );\n\n}", "function doCli() {\n rl.prompt();\n rl.on('line', function (line) {\n var words = line.trim().split(' '),\n cmd = words.shift(),\n str = words.join(' ');\n\n if (!cmd) {\n // repeat last command\n cmd = lastcmd;\n str = lastargs;\n }\n\n switch(cmd) {\n case 'c': connStatus(); break;\n case 'm': customMessage(str); break;\n case 's': setScenario(str); break;\n case 'n': nextEvent(); break;\n case 'r': restartScenario(); break;\n case 'q': quit(); break;\n case '?': showHelp(); break;\n default: console.log('Say what?! (? for help)'); break;\n }\n lastcmd = cmd;\n lastargs = str;\n rl.prompt();\n\n }).on('close', function () {\n quit();\n });\n}", "async run_cmd_queue() {\n for (;;) {\n if (this.cmd_queue.length === 0) {\n return;\n }\n const { command, resolve, reject } = this.cmd_queue[0];\n const reply = await this.process_cmd(command);\n if (reply.errorcode) {\n class JDWPCommandError extends Error {\n constructor(reply) {\n super(`JDWP command failed '${reply.command.name}'. Error ${reply.errorcode}`);\n this.command = reply.command;\n this.errorcode = reply.errorcode;\n }\n }\n reject(new JDWPCommandError(reply));\n } else {\n resolve(reply);\n }\n this.cmd_queue.shift();\n }\n }", "function run() {\n\nswitch (command) {\n\ncase 'my-tweets':\n\tgetTweets();\n break;\ncase 'spotify-this-song':\n\tgetSong(search);\n break;\ncase 'movie-this':\n\tgetFilm(search);\n break;\ncase 'do-what-it-says':\n\tgetRandom();\n break;\ncase 'HELP':\n\tconsole.log(\"Options: \\n my-tweets \\n spotify-this-song SONGNAME \\n movie-this MOVIENAME \\n do-what-it-says\")\ndefault:\n\tconsole.log(\"Enter a command, type 'node liri.js HELP' if need be\")\n break;\n}\n}", "function run(cb) {\n syncTries++;\n\n console.log('\\n Try: ' + syncTries);\n console.log('-------------');\n\n let kid = child_process.spawn(argv._[0], argv._.slice(1), {\n encoding: 'utf8'\n });\n\n kid.stdout.pipe(process.stdout);\n kid.stderr.pipe(process.stdout);\n\n kid.on('close', function(code) {\n return cb(code);\n });\n}", "async run() { \n\tthis.emit(\"Starting continuous timer\") \n\n\tvar timer = setInterval( (function(){this.emit(\"15 minutes have elapsed\")}).bind(this) , 1000*60*15)\n\n\t//loop read from the input channel\n\twhile(true ) {\n\t \n\t let text = await this.get_input() \n\t if (text == undefined || text == \"finished\") { break }\n\t \n\t}\n\t//input channel has been closed\n\tclearInterval(timer)\n\tthis.emit(\"Stopping timer\") \n\tthis.finish({result : \"OK\" } )\n }", "async stdin(data){\r\n if(data != \"\\r\"){\r\n this.cache = this.cache + data\r\n if(this.cache.includes(\"\\b\")){\r\n await process.stdout.clearLine()\r\n await process.stdout.cursorTo(0, process.stdout.rows)\r\n let temp = this.cache\r\n temp = temp.split(\"\")\r\n temp.splice(temp.length-2,2)\r\n this.cache = temp.join(\"\")\r\n process.stdout.write(this.prompt + this.cache)\r\n }\r\n this.cursor = this.rl.cursor\r\n return;\r\n }\r\n //Handle command\r\n switch(this.cache){\r\n case \"ping\":\r\n if(this.wait) return;\r\n this.log(\"Pong!\", null, false, true)\r\n break\r\n case \"stop\":\r\n if(this.wait) return;\r\n process.emit(\"SIGINT\")\r\n break;\r\n case \"restart\": \r\n if(this.wait) return;\r\n global.restart = true\r\n process.emit(\"SIGINT\")\r\n break;\r\n case \"status\":\r\n if(this.wait) return;\r\n if(global._ != undefined && global._.rconActive == true){\r\n global._.command.getStatistics().then(async data => {\r\n //this.log(require(\"util\").inspect(data, true, 5))\r\n this.log(\"\\nVersion: \" + data.build + \"\\nOwner: \" + data.ownerName + \"\\nUrl: \" + data.serverURL + \"\\nPassword protected: \" + data.hasServerPassword + \"\\nWhitelist: \" + data.isEnforcingWhitelist + \"\\nCreative: \" + data.creativeMode + \"\\nSavegame: \" + data.saveGameName + \"\\nFPS: \" + data.averageFPS + \"\\nIdle: \" + (data.playersInGame == 0) + \"\\nUnique players: \" + data.playersKnownToGame + \"\\n\")\r\n }).catch(async err => {\r\n this.log(err, \"Red\")\r\n })\r\n }else {\r\n this.log(\"Server terminal not connected\", \"Red\")\r\n }\r\n break;\r\n case \"save\":\r\n if(this.wait) return;\r\n if(global._ != undefined && global._.rconActive == true){\r\n let time = new Date().getTime()\r\n this.log(\"[INFO]: Saving game...\", \"Blue\", true)\r\n global._.command.save().then(async () => {\r\n this.log(\"Game saved (\" + ((new Date().getTime() - time) * 0.001) + \"s)\", \"Green\")\r\n }).catch(async err => {\r\n this.log(err, \"Red\")\r\n })\r\n }else {\r\n this.log(\"Server terminal not connected\", \"Red\")\r\n }\r\n break;\r\n case \"list\":\r\n if(this.wait) return;\r\n if(global._ != undefined && global._.rconActive == true){\r\n global._.command.getPlayers().then(async res => {\r\n let construct = []\r\n let count = 0\r\n res.playerInfo.forEach(async player => {\r\n if(player.inGame == true) construct.push(player.playerName + \"(\" + player.playerGuid + \")\")\r\n ++count\r\n if(count == res.playerInfo.length){\r\n this.log(construct.length == 0 ? \"Nobody is online\" : \"-\" + construct.join(\"\\n- \"))\r\n }\r\n })\r\n }).catch(async err => {\r\n this.log(err, \"Red\")\r\n })\r\n }else {\r\n this.log(\"Server terminal not connected\", \"Red\")\r\n }\r\n break;\r\n case \"mods\":\r\n if(this.wait) return;\r\n let construct = []\r\n global._.mods.forEach(async mod => {\r\n construct.push(mod.name + \"(\" + mod.version )\r\n })\r\n break;\r\n case \"help\": \r\n if(this.wait) return;\r\n let commands = [\r\n '\"help\" - Displays this message',\r\n '\"ping\" - Test the the AstroManager console',\r\n '\"stop\" - Stop the Astroneer Dedicated server',\r\n '\"status\" - Get the server status',\r\n '\"restart\" - Restart the server and AstroManager',\r\n '\"save\" - Save the game',\r\n '\"list\" - Get the list of players online',\r\n '\"kick <player guid / player name>\" - Kick a player',\r\n '\"kickall\" - Kick all players',\r\n '\"whitelist <on / off>\" - Toggle the whitelist on or off',\r\n '\"whitelist add <player guid / player name>\" - Whitelist a player',\r\n '\"whitelist remove <player guid / player name>\" - Remove a player from the whitelist',\r\n '\"saves\" - Get the current available savegames',\r\n '\"load <savename>\" - Load a savegame\"',\r\n '\"create <savename>\" - Create a new savegame',\r\n '\"op <player guid / player name>\" - Make a player admin',\r\n '\"ban <player guid / player name>\" - Ban a player',\r\n '\"mods\" - List the loaded mods'\r\n ]\r\n this.log(\"\\n [ AstroManager - Commands ]\\n \" + commands.join(\"\\n \"))\r\n break;\r\n case \"n\":\r\n this.events.emit(\"pick\", false)\r\n break\r\n case \"y\":\r\n this.events.emit(\"pick\", true)\r\n break\r\n default: \r\n if(this.wait) return;\r\n this.log(\"No such command, use 'help' for help.\", \"Red\", false, true)\r\n break\r\n }\r\n this.cache = \"\"\r\n this.cursor = 0\r\n }", "function C999_Common_SleepingPill_Run() {\n\tBuildInteraction(C999_Common_SleepingPill_CurrentStage);\n}", "async execute() {\n let command;\n let i = 0;\n do {\n command = this.commands[i];\n if (command instanceof Loop) {\n if (command.count > 0) {\n if (command.delay != 0) {\n await Typewriter.sleep(command.delay);\n }\n await command.execute();\n i = 0;\n } else {\n command.resetCount();\n i++;\n }\n } else {\n if (command.delay != 0) {\n await Typewriter.sleep(command.delay);\n }\n await command.execute();\n i++;\n }\n } while (i < this.commands.length);\n }", "function launcher() {\n\tif(apps.length > 0 && running < limit) {\n\t\tvar app = apps.shift()\n\n if(app !='') {\n\n \tutil.puts('Starting Process: ' + app.replace(root, ''))\n\n \trunning++\n \tinspect(app)\n }\n }\n else if(apps.length == 0 && running == 0)\n \tdone()\n}", "function run() {\n // exec rather than spawn to handle shell syntax within command\n child.exec(command, function (error, stdout, stderr) {\n\t\tscreen = stdout.toString();\n\t\tio.sockets.emit('screen', screen);\n\t\tif (stderr) {\n\t\t\tconsole.error(\"error: \" + stderr);\n\t\t}\n\t\tif (error !== null) {\n\t\t\tconsole.error(\"exec error: \" + error);\n\t\t}\n\t});\n}", "function run() {\n console.log(chalker.blue.bold(`SCRIPT STARTED : ---------------------------------------------------------------`));\n\n var params = {};\n\n async.waterfall([\n _enterSnapShotIds(params),\n _enterRemarks,\n _fetchInventories,\n _executeCorrection\n ], function (err, result) {\n if (err) {\n console.log(chalker.red.bold(`Error Occured , Terminating Script ------------------------------------------ `, err));\n process.exit(1);\n } else {\n console.log(chalker.green.bold(`Script Completed Successfully -----------------------------------------------`));\n process.exit();\n }\n });\n}", "function runLocalApp(port, options) {\n const { command } = options;\n /* istanbul ignore next */\n if (!command)\n return;\n const label = chalk.grey(options.label || 'app');\n return new Promise((resolve, reject) => {\n var _a, _b;\n try {\n const childProcess = shelljs_1.default.exec(command(port), {\n async: true,\n env: { ...process.env, PORT: port.toString(), FORCE_COLOR: 'true' },\n silent: true,\n }, code => {\n if (code > 0) {\n console.error(chalk.red('Layer0 encountered a fatal error while running your application. Exiting...'));\n reject();\n process.exit(code);\n }\n else {\n resolve();\n }\n });\n /* istanbul ignore next */\n (_a = childProcess.stderr) === null || _a === void 0 ? void 0 : _a.on('data', data => process.stderr.write(`${label} ${data}`));\n const ready = options.ready || [];\n const filterOutput = options.filterOutput || ((_line) => true);\n /* istanbul ignore next */\n (_b = childProcess.stdout) === null || _b === void 0 ? void 0 : _b.on('data', data => {\n let matched = false;\n ready.some((pattern, i) => {\n if (pattern.test(data)) {\n ready.splice(i, 1);\n matched = true;\n }\n });\n if (ready.length === 0) {\n resolve();\n }\n if (matched || !filterOutput(data)) {\n return; // hide the ready line so that the user doesn't see two URLs and get confused.\n }\n process.stdout.write(`${label} ${data}`);\n if (!data.endsWith('\\n')) {\n process.stdout.write('\\n');\n }\n });\n }\n catch (e) {\n reject(e);\n }\n });\n}", "async function userSendCmd (inpcmd) {\n const cmd = inpcmd.trim()\n terminalPrint('=> ' + cmd) // Extern\n blxErrMsg = 0\n if (cmd.startsWith('.')) await blxSysCmd(cmd.substr(1))\n else await blxDeviceCmd(cmd)\n await blxCheckIDs()\n if (blxErrMsg) terminalPrint(blxErrMsg)\n }", "function commandTrigger() {\n var line = promptText;\n if (typeof config.commandValidate == 'function') {\n var ret = config.commandValidate(line);\n if (ret == true || ret == false) {\n if (ret) {\n handleCommand();\n }\n } else {\n commandResult(ret,\"jquery-console-message-error\");\n }\n } else {\n handleCommand();\n }\n }", "static executeLifecycleCommandAsync(command, workingDirectory, initCwd, captureOutput = false) {\n let shellCommand = process.env.comspec || 'cmd';\n let commandFlags = '/d /s /c';\n let useShell = true;\n if (process.platform !== 'win32') {\n shellCommand = 'sh';\n commandFlags = '-c';\n useShell = false;\n }\n const environment = Utilities._createEnvironmentForRushCommand(initCwd);\n return child_process.spawn(shellCommand, [commandFlags, command], {\n cwd: workingDirectory,\n shell: useShell,\n env: environment,\n stdio: captureOutput ? ['pipe', 'pipe', 'pipe'] : [0, 1, 2]\n });\n }", "async function init() {\n\tlet ports = cli.readParameters()\n\tif(ports.portClient != undefined) wsClient.init(ports.portClient)\n\tif(ports.portServer != undefined) config.portServer = ports.portServer\n\twsServer.init(config.portServer)\n\n\t// You can stop it by typing 'exit' or ctrl + c\n\twhile(true) {\n\t\tlet answer = await cli.interactWithUser()\n\t\tprocessResponse(answer)\n\t}\n}", "async function run() {\n if (command.toUpperCase() === \"START\") {\n try {\n var data = await ec2client.send(new StartInstancesCommand(params));\n console.log(\"Success\", data.StartingInstances);\n } catch (err) {\n console.log(\"Error2\", err);\n }\n }\n else if (process.argv[2].toUpperCase() === \"STOP\") {\n try {\n const data = await ec2client.send(new StopInstancesCommand(params));\n console.log(\"Success\", data.StoppingInstances);\n } catch (err) {\n console.log(\"Error\", err)\n }\n }\n}", "function doRun() {\nif (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\nModule['calledRun'] = true;\nif (ABORT) return;\nensureInitRuntime();\npreMain();\nif (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\npostRun();\n}", "async function p() {\n localServerStart();\n consoleCommands();\n}", "function startAndWait (cmd, args, options) {\n return new Promise((resolve, reject) => {\n let buffer = ''\n\n const child = cp.spawn(cmd, args, options)\n function addToBuffer (data) {\n buffer += data\n }\n\n child.stdout.on('data', addToBuffer)\n child.stderr.on('data', addToBuffer)\n\n child.on('exit', function (status) {\n if (status !== 0) {\n return reject(new Error(buffer))\n }\n resolve(buffer)\n })\n })\n}", "run(){\n var a = this.action();\n while (a.isComplete()) {\n a.cleanUp();\n var oldState = this.state;\n this.preStateChange(a);\n this.stateTransition();\n this.enterState(oldState);\n if (oldState === this.state) {\n // if (this.state() != 'wait') self.debug('No state change from ' + this.name() + ':' + this.state());\n return;\n }\n a = this.action();\n }\n // this.debug('Run ' + a.string());\n a.run();\n }", "function init() {\n\n console.log(\"Start the process....\");\n\n inquirer.prompt(questions)\n .then( results => writeToFile(results) );\n}", "async function run()\n{\n\tif(!running)\n\t{\n\t\tfound = false;\n\t\tprint('algo:',select.value());\n\n\t\tclearBoard();\n\t\trunning = true;\n\n\t\tif(select.value() == 'dfs')\n\t\t{\n\t\t\tawait dfs(START);\n\t\t}\n\t\telse if(select.value() == 'bfs')\n\t\t{\n\t\t\tawait bfs();\n\t\t}\n\t\tSTART.setStart();\t//resetting start pos\n\t\trunning = false;\n\t\tfound = false;\t//resetting found; keep at bottom of run()\n\t}\n}" ]
[ "0.69205993", "0.62402123", "0.6059751", "0.5982935", "0.5947179", "0.59402996", "0.587957", "0.5789105", "0.5787899", "0.57580256", "0.57580256", "0.57580256", "0.57580256", "0.57580256", "0.5668054", "0.5659519", "0.56531173", "0.56531173", "0.5651149", "0.5650241", "0.5644245", "0.5624904", "0.5621609", "0.55815125", "0.55815125", "0.55815125", "0.55815125", "0.55815125", "0.55815125", "0.55815125", "0.55815125", "0.55815125", "0.55815125", "0.55815125", "0.55815125", "0.55815125", "0.55815125", "0.55815125", "0.55815125", "0.55815125", "0.55815125", "0.55701166", "0.5569483", "0.5569483", "0.55592847", "0.55416137", "0.553403", "0.55338174", "0.5511508", "0.55048364", "0.5502065", "0.5488128", "0.5475213", "0.5469425", "0.5462456", "0.5462456", "0.5462456", "0.5462456", "0.5460971", "0.5399307", "0.5390525", "0.53874904", "0.5379964", "0.53748375", "0.53689694", "0.53551924", "0.5344299", "0.5344299", "0.5344299", "0.5344299", "0.5321322", "0.5320981", "0.5320024", "0.5315787", "0.5310496", "0.53071433", "0.5305534", "0.52995455", "0.5291577", "0.5290639", "0.52837276", "0.5283602", "0.52835256", "0.52806586", "0.5277352", "0.527683", "0.52767867", "0.52725434", "0.5262652", "0.5258137", "0.525447", "0.5240196", "0.5236923", "0.52230424", "0.52207625", "0.5220351", "0.52198726", "0.52164567", "0.52140397", "0.520598", "0.52042073" ]
0.0
-1
Run app or command, but DON't wait until it finished. The app output will be in same console, so potentially can generate some mess
function runCommandWithoutWaitingHandler(command, args = []) { try { const childProcess = spawn(command, args); childProcess.stdout.on('data', data => { console.log(`stdout: ${data}`); }); childProcess.stderr.on('data', data => { console.error(`stderr: ${data}`); }); childProcess.on('close', code => { console.log(`child process (${command}) exited with code ${code}`); }); } catch (e) { console.error(`Error running: ${command} (args: ${args.join(', ')})`); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runLocalApp(port, options) {\n const { command } = options;\n /* istanbul ignore next */\n if (!command)\n return;\n const label = chalk.grey(options.label || 'app');\n return new Promise((resolve, reject) => {\n var _a, _b;\n try {\n const childProcess = shelljs_1.default.exec(command(port), {\n async: true,\n env: { ...process.env, PORT: port.toString(), FORCE_COLOR: 'true' },\n silent: true,\n }, code => {\n if (code > 0) {\n console.error(chalk.red('Layer0 encountered a fatal error while running your application. Exiting...'));\n reject();\n process.exit(code);\n }\n else {\n resolve();\n }\n });\n /* istanbul ignore next */\n (_a = childProcess.stderr) === null || _a === void 0 ? void 0 : _a.on('data', data => process.stderr.write(`${label} ${data}`));\n const ready = options.ready || [];\n const filterOutput = options.filterOutput || ((_line) => true);\n /* istanbul ignore next */\n (_b = childProcess.stdout) === null || _b === void 0 ? void 0 : _b.on('data', data => {\n let matched = false;\n ready.some((pattern, i) => {\n if (pattern.test(data)) {\n ready.splice(i, 1);\n matched = true;\n }\n });\n if (ready.length === 0) {\n resolve();\n }\n if (matched || !filterOutput(data)) {\n return; // hide the ready line so that the user doesn't see two URLs and get confused.\n }\n process.stdout.write(`${label} ${data}`);\n if (!data.endsWith('\\n')) {\n process.stdout.write('\\n');\n }\n });\n }\n catch (e) {\n reject(e);\n }\n });\n}", "function run(cb) {\n syncTries++;\n\n console.log('\\n Try: ' + syncTries);\n console.log('-------------');\n\n let kid = child_process.spawn(argv._[0], argv._.slice(1), {\n encoding: 'utf8'\n });\n\n kid.stdout.pipe(process.stdout);\n kid.stderr.pipe(process.stdout);\n\n kid.on('close', function(code) {\n return cb(code);\n });\n}", "function run() {\n // exec rather than spawn to handle shell syntax within command\n child.exec(command, function (error, stdout, stderr) {\n\t\tscreen = stdout.toString();\n\t\tio.sockets.emit('screen', screen);\n\t\tif (stderr) {\n\t\t\tconsole.error(\"error: \" + stderr);\n\t\t}\n\t\tif (error !== null) {\n\t\t\tconsole.error(\"exec error: \" + error);\n\t\t}\n\t});\n}", "function run(appName, command, callback) {\n commons.get(format('/%s/apps/%s/run/', deis.version, appName), callback);\n }", "function runProgram() {\n console.log(\"\\n~~~~~~~~~~~~~~~~WELCOME TO LIRI!~~~~~~~~~~~~~~~~~~~\")\n console.log(\"~~~~~~~~~~~~~~~TO START, TYPE IN~~~~~~~~~~~~~~\" + \"\\n1. node liri.js concert-this\" + \"\\n2. node liri.js spotify-this-song\" + \"\\n3. node liri.js movie-this, or \" + \"'\\n4. node liri.js do-what-it-says'\")\n\n}", "exec() {\n //this logs \"I'm ready!\" to the console\n console.log('I\\'m ready!');\n }", "function exec() {\n lastExec = Date.now();\n callback.apply(self, args);\n }", "function exec() {\n lastExec = Date.now();\n callback.apply(self, args);\n }", "function exec() {\n lastExec = Date.now();\n callback.apply(self, args);\n }", "function exec() {\n lastExec = Date.now();\n callback.apply(self, args);\n }", "function exec() {\n lastExec = Date.now();\n callback.apply(self, args);\n }", "function launcher() {\n\tif(apps.length > 0 && running < limit) {\n\t\tvar app = apps.shift()\n\n if(app !='') {\n\n \tutil.puts('Starting Process: ' + app.replace(root, ''))\n\n \trunning++\n \tinspect(app)\n }\n }\n else if(apps.length == 0 && running == 0)\n \tdone()\n}", "function main() {\n // Path\n var destinationPath = program.args.shift() || '.'\n\n // App name\n var appName = createAppName(path.resolve(destinationPath)) || 'hello-world'\n\n // Generate application\n emptyDirectory(destinationPath, function (empty) {\n if (empty || program.force) {\n createApplication(appName, destinationPath)\n } else {\n confirm('destination is not empty, continue? [y/N] ', function (ok) {\n if (ok) {\n process.stdin.destroy()\n createApplication(appName, destinationPath)\n } else {\n console.error('aborting')\n exit(1)\n }\n })\n }\n })\n}", "function endApp() {\n console.log(\n chalk.red(\n figlet.textSync(\"Goodbye!\", {\n font: \"Doom\",\n horizontalLayout: \"fitted\",\n verticalLayout: \"fitted\",\n width: 80,\n whitespaceBreak: true,\n })\n )\n );\n process.exit();\n}", "appExecute() {\n\n\t\tthis.appConfig();\n\t\tthis.includeRoutes(this.app);\n\n\t\tthis.http.listen(this.port, this.host, () => {\n\t\t\tconsole.log(`Listening on http://${this.host}:${this.port}`);\n\t\t});\n\t}", "function startApi() {\n // Bring in child_process https://nodejs.org/api/child_process.html\n var proc = require('child_process').spawn;\n\n // Create our process path based on system\n var apipath = (os.platform() == \"darwin\") ? path.join(__dirname, \"..//..//api//bin//dist//osx//Api\") : path.join(__dirname,\"..\\\\..\\\\api\\\\bin\\\\dist\\\\win\\\\api.exe\");\n\n // And call the process\n apiProcess = proc(apipath);\n\n // Log output of app to console.\n apiProcess.stdout.on('data', (data) => {\n console.log(`stdout: ${data}`);\n if (mainWindow == null) {\n createWindow();\n }\n })\n}", "function exec() {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function start () {\n var output\n var now = new Date()\n var elapsed = now - previousStart\n previousStart = now\n\n // If it's been a while since we restarted, call this a clean start.\n var isCleanStart = elapsed > okTime\n\n // Pass arguments to spawned processes.\n var args = process.argv.slice(3)\n args.unshift(appPath)\n\n child = spawn(process.execPath, args, {\n cwd: dir,\n env: process.env\n })\n\n var pipeToStdout = function () {\n child.stdout.pipe(process.stdout)\n child.stderr.pipe(process.stdout)\n }\n\n // When we've started cleanly, pipe child process output directly to stdout.\n if (isCleanStart) {\n pipeToStdout()\n\n // Reset the restart time to the pre-backoff starting value.\n restartTime = minRestartTime\n\n // After a fast failure, buffer the output in case we fail again.\n } else {\n output = '\\n'\n var append = function (chunk) {\n output += chunk\n }\n child.stdout.on('data', append)\n child.stderr.on('data', append)\n\n // When we've started ok, write output to stdout and start piping.\n var okTimer = setTimeout(function () {\n if (output) {\n process.stdout.write(output)\n pipeToStdout()\n child.stdout.removeListener('output', append)\n child.stderr.removeListener('output', append)\n }\n output = ''\n }, okTime)\n }\n\n // Set the child's stdin to accept objects.\n JSON.writeStream(child.stdin)\n\n // When a child process dies, restart it.\n child.on('close', function () {\n\n // Dereference the child.\n child = undefined\n\n // If we failed differently, log the new output.\n if (failureOutput && (munge(output) !== munge(failureOutput))) {\n write(output)\n\n // If we failed the same way, just show another red dot.\n } else {\n write('\\u001b[31m.\\u001b[39m')\n }\n failureOutput = output\n clearTimeout(okTimer)\n setTimeout(start, restartTime)\n restartTime = Math.max(restartTime * restartTimeBackoff, maxRestartTime)\n })\n }", "run() {\n console.log('running');\n }", "async function main() {\n // create a new actionhero process\n const app = new actionhero_1.Process();\n // handle unix signals and uncaught exceptions & rejections\n app.registerProcessSignals(exitCode => {\n process.exit(exitCode);\n });\n // start the app!\n // you can pass custom configuration to the process as needed\n await app.start();\n}", "function exec() {\n lastExec = Date.now();\n callback.apply( self, args );\n }", "async function main() {\n\tapp.listen(port, \"\", () => {\n\t\t//callback is executed once server is listening\n\t\tconsole.log(`server is listening at http://${port}...`)\n\t})\n}", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "async function main() {\n // print out configuration information\n logger.info(`${pkg.name || 'name'} - ${pkg.version || 'version'}`)\n logger.info(``, config)\n\n await app.listen(config.PORT)\n logger.info(`listening on port ${config.PORT}...`)\n}", "function exec() {\n\t lastExec = Date.now();\n\t callback.apply(self, args);\n\t }", "function exec() {\n lastExec = Date.now();\n callback.apply(self, arguments_);\n }", "function exec() {\n lastExec = Date.now();\n callback.apply(self, arguments_);\n }", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}", "function run () {\n socket.emit('run', {version: config.version, body: myCodeMirror.getValue()})\n $('#runButton').text('Compiling...').addClass('loading')\n\n if (runTimeout) {\n clearTimeout(runTimeout)\n }\n runTimeout = setTimeout(function () {\n $('#runButton').text('Run').removeClass('loading');\n }, 10000);\n}", "function runSCADAProgram() {\n console.log('run');\n\n const spirt = spawn(processpath);\n\n spirt.on('exit', () => {\n stopReading();\n ifFirstStart=true;\n });\n}", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "function exec() {\n lastExec = Date.now();\n callback.apply(self, arguments_);\n }", "output(data){\n\t\tconsole.log(`======] MINICAP STDOUT [======`, data.toString());\n\n\t\tthis.win.webContents.send('update-console', \"\\n\"+data.toString()+\"\\n\");\n\t\tthis.win.webContents.send('update-checkbox', 'minicap', true);\n\t\tthis.isRunning = true;\n\t}", "function exec () {\n\t\t\t\tlastExec = Number(new Date());\n\t\t\t\tcallback.apply(self, args);\n\t\t\t}", "function exec () {\n\t\t\t\tlastExec = Number(new Date());\n\t\t\t\tcallback.apply(self, args);\n\t\t\t}", "function doRun() {\n // run may have just been called through dependencies being fulfilled just in this very frame,\n // or while the async setStatus time below was happening\n if (calledRun) return;\n calledRun = true;\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n initRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (shouldRunNow) callMain(args);\n\n postRun();\n }", "function exec() {\n last_exec = +new Date();\n callback.apply( that, args );\n }", "function exec() {\n last_exec = +new Date();\n callback.apply( that, args );\n }", "function exec() {\n last_exec = +new Date();\n callback.apply( that, args );\n }", "function exec() {\n last_exec = +new Date();\n callback.apply( that, args );\n }", "async function main() {\n // Build the program.\n program\n .version(VERSION)\n .arguments(\"<source> [project]\")\n .description(\"bridge\", {\n source: \"source packages directory\",\n project: \"destination project directory\",\n })\n .option(\"-n, --dry-run\", \"perform a trial run with no changes made\")\n .action(runBridge);\n\n // Run the program.\n await program.parseAsync();\n}", "function runCommands() {\n app\n .command('run <path>')\n .description('Run a bot manually')\n .option('-f --fork', 'Don\\'t re-queue bot after running.')\n .action(runActions);\n}", "async function main() {\n let child = spawn(\"npm\", [\"publish\"]);\n\n child.on(\"stdout\", data => console.log(data.toString()));\n child.on(\"stderr\", data => console.error(data.toString()));\n\n let { code, stdout, stderr } = await child;\n\n console.log(code === 0 ? \"success\" : \"error\");\n}", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return; \n\n ensureInitRuntime();\n\n preMain();\n\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return; \n\n ensureInitRuntime();\n\n preMain();\n\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "function main () {\n return new Promise(async (resolve, reject) => {\n const resource = {\n title: 'cmdline title test',\n body: 'cmdline body test',\n }\n try {\n const actionInfo = await getActionInfo('microsling/somedoc', 'html');\n console.log(`actionInfo=${JSON.stringify(actionInfo, 2, null)}`);\n const rendered = await renderWithAction(resource, actionInfo);\n console.log(`rendered=${JSON.stringify(rendered, 2, null)}`);\n resolve(rendered);\n } catch(e) {\n reject(e);\n }\n });\n}", "async function main() {\n // create a new actionhero process\n const app = new index_1.Process();\n // handle unix signals and uncaught exceptions & rejections\n app.registerProcessSignals((exitCode) => {\n process.exit(exitCode);\n });\n // start the app!\n // you can pass custom configuration to the process as needed\n await app.start();\n}", "async function run() {\n const projectPath = path.resolve(__dirname, \"../../\");\n\n // Install sample data\n // Display message in a rectangle of stars 3 lines high with some newline\n // padding\n console.warn(\"\\n\\n\");\n console.warn(\"*******************************\");\n console.warn(\"* Installing sample data... *\");\n console.warn(\"*******************************\");\n console.warn(\"\\n\\n\");\n\n // Move working directory into the magento directory so we can make magento\n // commands easier\n if (shell.cd(path.resolve(projectPath, \".magento\")).code !== 0) {\n console.error(\"Error: Failed to change directory to .magento\");\n process.exit(1);\n }\n\n // Delete the magento installation git repo as nested repos is just confusing\n if (shell.rm(\"-rf\", path.resolve(projectPath, \".magento/.git\")).code !== 0) {\n console.error(\"Error: Failed to delete the magento installation git repo.\");\n process.exit(1);\n }\n\n if (shell.exec(\"bin/magento sampledata:deploy\").code !== 0) {\n console.error(\"Error: Failed to install sample data.\");\n process.exit(1);\n }\n\n if (shell.exec(\"bin/magento setup:upgrade\").code !== 0) {\n console.error(\"Error: Failed to install sample data.\");\n process.exit(1);\n }\n\n // Disable 2FA\n if (\n shell.exec(\"bin/magento module:disable Magento_TwoFactorAuth\").code !== 0\n ) {\n console.error(\"Error: Failed to disable 2FA.\");\n process.exit(1);\n }\n\n // Final cache flush\n if (shell.exec(\"bin/magento cache:flush\").code !== 0) {\n console.error(\"Error: Failed to flush cache.\");\n process.exit(1);\n }\n\n process.exit(0);\n}", "function exec() {\n\t lastExec = Date.now();\n\t callback.apply(self, arguments_);\n\t }", "function spawn(){\n var child = child_process.spawn('node', ['admin/app.js'].concat(args))\n child.stdout.on('data', function(data) {\n util.print(data);\n });\n child.stderr.on('data', function(data) {\n util.print(data);\n });\n child.on('exit', function (code) {\n // util.print('child process exited with code ' + code);\n util.puts('') \n spawn()\n }); \n // util.puts('Child ' + child.pid)\n}", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "function doRun() {\nif (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\nModule['calledRun'] = true;\nif (ABORT) return;\nensureInitRuntime();\npreMain();\nif (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\npostRun();\n}", "function doRun() {\r\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\r\n Module['calledRun'] = true;\r\n\r\n if (ABORT) return;\r\n\r\n ensureInitRuntime();\r\n\r\n preMain();\r\n\r\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\r\n\r\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\r\n\r\n postRun();\r\n }", "function runCommand(cmd, suppress, runtime) {\n shell.echo('\\nRunning command \"' + cmd + '\"\\n');\n var start = now();\n var run = shell.exec(cmd, {silent:suppress});\n var end = now();\n if (runtime) {\n shell.echo('\\nCommand \"' + cmd + '\" finished after ' + (end - start) / 1000 + ' seconds\\n')\n }\n if (run.code !== 0) {\n shell.echo('\\nError: Build failed at step \"' + cmd + '\" with ExitCode ' + run.code + '\\n');\n botio.message('Error: Build failed at step \"' + cmd + '\" with ExitCode ' + run.code);\n shell.exit(1);\n }\n}", "async exec (args, { Compose }) {\n // Code goes here\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n\n postRun();\n }", "function run() {\n console.log(chalker.blue.bold(`SCRIPT STARTED : ---------------------------------------------------------------`));\n\n var params = {};\n\n async.waterfall([\n _enterSnapShotIds(params),\n _enterRemarks,\n _fetchInventories,\n _executeCorrection\n ], function (err, result) {\n if (err) {\n console.log(chalker.red.bold(`Error Occured , Terminating Script ------------------------------------------ `, err));\n process.exit(1);\n } else {\n console.log(chalker.green.bold(`Script Completed Successfully -----------------------------------------------`));\n process.exit();\n }\n });\n}", "function main(){\n userInterface();\n bindings();\n console.log(stutter(\"I like to eat bananas for dinner. Yeah.\"));\n}", "appExecute() {\n\n this.appConfig();\n this.includeRoutes();\n\n this.http.listen(this.port, this.host, () => {\n console.log(`Listening on http://${this.host}:${this.port}`);\n });\n }", "function run () {\n logger.success('hello world!')\n}", "function execCallback(error, stdout, stderr) { \n console.log(stdout);\n}", "function run() {}", "function doRun() {\n // run may have just been called through dependencies being fulfilled just in this very frame,\n // or while the async setStatus time below was happening\n if (calledRun) return;\n calledRun = true;\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n initRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n postRun();\n }", "function run_app()\n {\n putAppVersionToFrontPage();\n methods.buildDocDef();\n methods.makeChartsOptions();\n //return; //skips sending charts to cloud-service\n methods.loadCharts( function() {\n var button = document.getElementById( 'generate-pdf' );\n if( fconf.setAnOpenButton ) {\n button.addEventListener( 'click', function() {\n ////solution works without timeout, but\n ////this timeout does not hurt\n setTimeout( createDoc, 1 );\n });\n button.style.opacity = \"1\";\n button.title = \"Click to generate document\";\n button.innerHTML = \"Generate Report\";\n pdfMake_is_in_busy_state = false;\n } else {\n pdfMake_is_in_busy_state = false;\n button.innerHTML = \"Data loaded\";\n button.title = \"Generating document ...\";\n createDoc();\n }\n })\n }", "function runOperation() {\n\tsetConfig();\n\tcreatePrints();\n\trunDialog.close();\n}", "async function main() {\r\n\r\n\t// const port = process.env.PORT || 3000;\r\n\t// await app.listen(port);\r\n\tawait app.listen(3000, () => console.log('RC server listening on port 3000!'))\r\n}", "function startApp() {\n connection.connect(function (err) {\n if (err) throw err;\n console.log('connected as id ' + connection.threadId);\n console.log('\\n');\n managerView();\n });\n}", "async function execute() {\n let init_content;\n if (initfile !== null) {\n init_content = await load_init_file(initfile);\n } else {\n init_content = \"\";\n }\n\n let editor_code = await editor.getValue();\n let script = start_script + init_content + editor_code + end_script;\n let resp = await run_code(script);\n\n fillOutput(resp);\n displayOrHideOutputs(resp);\n\n }", "function main() {\n new App().main();\n}", "function firstRun() {\n clear();\n console.log(\n chalk.blue('React SGH CLI \\n')\n );\n}", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n assert(!Module['_main'], 'compiled without a main, but one is present. if you added it from JS, use Module[\"onRuntimeInitialized\"]');\n\n postRun();\n }", "async function runOnCommand() {\n //first two args are app path and node command. So we slice them.\n let args = process.argv.slice(2);\n // console.log(\"args.length >>>>>>>>>>>>\",args.length)\n //If args length equals 0, it means called in a function\n if (args.length == 0) {\n console.log('Internal Call For Verify OTP !!!')\n } else if (args.length == 5) {\n //Get otp function requires 5 parameters.\n let result = await verifyOtp(args[0], args[1], args[2], args[3], args[4]);\n console.log(result);\n } else {\n console.error('Args count must be 10. Debug, Base Url, User Type, Country Code and Mobile Number !!!');\n }\n}", "async function main() {\n const program = new Command();\n program.parse(process.argv);\n await fs.mkdir(\"build\", { recursive: true });\n await fs.writeFile(\n \"build/config.json\",\n JSON.stringify(await getDeployConfig(), null, 2) + \"\\n\"\n );\n console.log(\"wrote build/config.json\");\n process.exit(0);\n}", "function runApp() {\n showCurrentGames();\n searchCountryMatches();\n selectSearchedTeam();\n listOfWorldCupTeams();\n}" ]
[ "0.6670146", "0.63676924", "0.6229795", "0.6204516", "0.6190291", "0.6175149", "0.6093462", "0.6093462", "0.6093462", "0.6093462", "0.6093462", "0.6068826", "0.60625434", "0.6052244", "0.60070455", "0.5995669", "0.5965964", "0.59624916", "0.5934666", "0.59250027", "0.59205884", "0.5916613", "0.5913357", "0.5913357", "0.5913357", "0.5913357", "0.5913357", "0.590042", "0.5897061", "0.5889803", "0.5889803", "0.58804184", "0.58804184", "0.58804184", "0.58804184", "0.58804184", "0.58804184", "0.58804184", "0.58804184", "0.58804184", "0.58804184", "0.58804184", "0.58804184", "0.58804184", "0.58804184", "0.58804184", "0.58804184", "0.58804184", "0.58804184", "0.58792835", "0.5849208", "0.5843334", "0.5843334", "0.5836803", "0.5814087", "0.5813523", "0.5813523", "0.57538444", "0.57441837", "0.57441837", "0.57441837", "0.57441837", "0.574157", "0.57410717", "0.572043", "0.57145625", "0.57145625", "0.571044", "0.5699626", "0.5698133", "0.56905615", "0.56820565", "0.5665477", "0.5665477", "0.5665477", "0.5665477", "0.5665477", "0.5665477", "0.5645249", "0.56381184", "0.5628781", "0.5623668", "0.562191", "0.5607773", "0.5604718", "0.5600817", "0.5599883", "0.5598426", "0.558577", "0.5580157", "0.55646104", "0.55611175", "0.5540275", "0.5535724", "0.5528906", "0.55192345", "0.55165565", "0.5510665", "0.55076474", "0.5490584", "0.5487816" ]
0.0
-1
Displays table of faculty users
function viewFaculty() { highlightCurrent('#viewFaculty'); $('#mytable').bootstrapTable('destroy'); $('#mytable').bootstrapTable({ url: baseURL + 'api/users/readFaculty.php', pagination: true, search: true, showButtonText: true, showSearchClearButton: true, buttonsClass: "ucf", columns: [{ field: 'id', title: 'ID', sortable: 'true' }, { field: 'firstName', title: 'First Name', sortable: 'true' }, { field: 'lastName', title: 'Last Name', sortable: 'true' }, { field: 'uploadDate', title: 'Date Added', sortable: 'true' }, { field: 'isAdmin', title: 'Faculty' }, { field: 'actionA', title: 'Delete', formatter: 'deleteFacultyFormatter', align: 'center' }] }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayUsers(users = []) {\n\n var userCount = users.length;\n\n for (var i = 0; i < userCount; i++) {\n\n var user = users[i];\n\n var userRow = createUserRow(user);\n\n if (user !== null) {\n tableBody.append(userRow);\n }\n }\n}", "function renderUsers(users) {\r\n\tvar body = document.getElementsByTagName('body')[0];\r\n\tvar table = document.createElement('table');\r\n\r\n\ttable.setAttribute('class', 'table table-striped table-hover');\r\n\ttable.setAttribute('id', 'usersTable');\r\n\r\n\tvar thead = document.createElement('thead');\r\n\r\n\tvar thFirstName = document.createElement('th');\r\n\tthFirstName.innerHTML = \"First Name\";\r\n\tthead.appendChild(thFirstName);\r\n\r\n\tvar thLastName = document.createElement('th');\r\n\tthLastName.innerHTML = \"Last name\";\r\n\tthead.appendChild(thLastName);\r\n\r\n\ttable.appendChild(thead);\r\n\r\n\tvar tbody = document.createElement('tbody');\r\n\ttable.appendChild(tbody);\r\n\r\n\tfor (var i = 0; i < users.length; i++) {\r\n\t\tvar user = users[i];\r\n\t\tvar tr = document.createElement('tr');\r\n\r\n\t\tvar tdFirstName = document.createElement('td');\r\n\t\ttdFirstName.innerHTML = user.firstName;\r\n\t\ttr.appendChild(tdFirstName);\r\n\r\n\t\tvar tdLastName = document.createElement('td');\r\n\t\ttdLastName.innerHTML = user.lastName;\r\n\t\ttr.appendChild(tdLastName);\r\n\r\n\t\ttbody.appendChild(tr);\r\n\r\n\t}\r\n\r\n\tbody.appendChild(table);\r\n}", "function renderUsers() {\n const tbody = document.querySelector('tbody');\n tbody.innerHTML = ''; //Clear whatever inner html is there.\n const props = Object.keys(model.props); // [firstName, lastName, dateOFBirth ]\n Object.values(model.users).forEach(user => {\n const tr = document.createElement('tr'); //TODO read up on create element in MDN\n props.forEach(prop => {\n const td = document.createElement('td');\n td.innerHTML = user[prop];\n tr.appendChild(td)\n });\n tbody.appendChild(tr);\n });\n}", "displayUsers() {\n let out = \"\";\n for (let i = 0; i < this.allUsers.length; i++) {\n const item = this.allUsers[i];\n out += '<tr id=\"user' + item.id + '\">';\n out += '<td>' + item.username + '</td>';\n out += '<td>' + item.api_key + '</td>';\n out += '</tr>';\n }\n $(\"#user_list\").find(\"tbody\").empty();\n $(\"#user_list\").find(\"tbody\").append(out);\n }", "function renderUsers(el, users){\n $.each(users, function(key, user){\n el.append(\n '<tr><td>' + (parseInt(key, 10) + 1) + '</td>' +\n '<td>' + user.first_name + '</td>' +\n '<td>' + user.last_name + '</td>' +\n '<td>' + user.username + '</td>' +\n '<td>' + user.position + '</td>' +\n '<td><span class=\"fa fa-info-circle\" id=\"' + user.url + '\" ></span></td>' +\n '</tr>'\n );\n });\n }", "function display() {\n\t\t\t\t\t\t$(\"#uListPos\").html(\"Number: \" + (i+1) + \"/\" + (userList.length));\n\t\t\t\t\t\t$(\"#uListName\").html(\"User: \" + userList[i][1]);\n\t\t\t\t\t\t$(\"#uListFact\").html(\"Fact:<br>\" + userList[i][2]);\n\t\t\t\t\t}", "function renderUsers(objUsers) {\r\n var table = document.getElementById(\"tblUsers\");\r\n\r\n while (table.rows.length > 1) {\r\n table.deleteRow(1)\r\n }\r\n for (var objUser in objUsers.data) {\r\n var row = table.insertRow(-1);\r\n row.id = \"user\"+objUsers.data[objUser].id;\r\n var cell1 = row.insertCell(0);\r\n var cell2 = row.insertCell(1);\r\n var cell3 = row.insertCell(2);\r\n var cell4 = row.insertCell(3);\r\n var cell5 = row.insertCell(4);\r\n cell1.innerHTML = objUsers.data[objUser].id;\r\n cell2.innerHTML = objUsers.data[objUser].email;\r\n cell3.innerHTML = objUsers.data[objUser].first_name;\r\n cell4.innerHTML = objUsers.data[objUser].last_name;\r\n cell5.innerHTML = \"<img src='\" + objUsers.data[objUser].avatar + \"' alt='avatar'>\";\r\n }\r\n}", "function userTable() { }", "function printUsers() {\n tableBody.innerHTML = '';\n // for(let i = 0; i < users.length; i++) {\n // const row = '<tr><td>'+ users[i].name +'</td><td>' + users[i].age + '</td><td>' + users[i].email + '</td><td>' + users[i].gender + '</td></tr>';\n // tableBody.innerHTML += row;\n // }\n //const usuarios = users.map(user => '<tr><td>'+ user.name +'</td><td>' + user.age + '</td><td>' + user.email + '</td><td>' + user.gender + '</td></tr>');\n users.forEach(user => {\n const row = `<tr>\n <td>${user.name}</td>\n <td>${user.age}</td>\n <td>${user.email}</td>\n <td>${user.gender}</td>\n </tr>`;\n tableBody.innerHTML += row; \n })\n}", "function loadUsersToPage() {\n const myUsers = getUsers();\n \n myUsers.then(response => {\n var tableHTML = \"<tr>\";\n for (var headers in response[0]) {\n tableHTML += \"<th>\" + headers + \"</th>\";\n }\n tableHTML += \"</tr>\";\n\n for (var eachItem in response) {\n tableHTML += \"<tr>\";\n var dataObj = response[eachItem];\n for (var eachValue in dataObj){\n tableHTML += \"<td>\" + dataObj[eachValue] + \"</td>\";\n }\n tableHTML += \"</tr>\";\n }\n usersTableElement.innerHTML = tableHTML;\n });\n \n}", "function displayUsers() {\n if (users && users.length) {\n var str = \"\";\n $(users).each(function () {\n str += this.name + \", \";\n });\n str = str.replace(/, $/, \"\");\n userList.text(str);\n userDisplay.show();\n }\n else {\n userDisplay.hide();\n }\n }", "function usersDisplayGenerator(){\n msg3 = \"<br/>\";\n if(theUsers != null){\n msg3 = msg3 + \"<b>Here is the display of the users</b><br/>\";\n msg3 = msg3 + \"<table><tr><th>Ord.No</th><th>Username</th><th>email</th></tr>\";\n var count = Object.keys(theUsers).length;\n for(x=0; x<count; x++){\n //console.log(\"Checking user:\" + theUsers[x].username);\n msg3 = msg3 + \"<tr><td>\" + x + \"</td><td>\" + theUsers[x].username + \"</td><td>\" \n + theUsers[x].email + \"</td></tr>\";\n }\n msg3 = msg3 + \"</table>\";\n } else {\n msg3 = msg3 + \"<h3>Remember!</h3><br/>\";\n msg3 = msg3 + \"Treating the users fairly is important!<br/>\";\n msg3 = msg3 + \"Click Refresh to see the users:<br/>\";\n }\n \n msg3 = msg3 + '|<a href=\"/adminpanel.html\">Refresh!</a>|<br/>';\n return msg3;\n}", "function showAllUsers() {\n userFacade.getUsers()\n .then(users => {\n const userRows = users.map(user => `\n <tr>\n <td>${user.id}</td>\n <td>${user.age}</td>\n <td>${user.name}</td>\n <td>${user.gender}</td>\n <td>${user.email}</td>\n </tr>\n `);\n const userRowsAsString = userRows.join(\"\");\n document.getElementById(\"allUserRows\").innerHTML = userRowsAsString;\n });\n}", "function renderUsers(users) {\n $tbody.empty();\n for(var u = 0; u < users.length; u++) {\n var user = users[u];\n $tbody.append(\n `<tr class=\"wbdv-template wbdv-user\">\n <td class=\"wbdv-username pt-4 pl-3\">${user.username}</td>\n <td class=\"pt-4 pl-3\">*****</td>\n <td class=\"wbdv-first-name pt-4 pl-3\">${user.firstName}</td>\n <td class=\"wbdv-last-name pt-4 pl-3\">${user.lastName}</td>\n <td class=\"wbdv-role pt-4 pl-3\">${user.role}</td>\n <td class=\"wbdv-actions\">\n <span class=\"text-nowrap float-right\">\n <button class=\"btn wbdv-remove fa-2x fa fa-times\" id=\"removeBtn-${u}\"></button>\n <button class=\"btn wbdv-edit fa-2x fa fa-pencil\" id=\"editBtn-${u}\"></button>\n </span>\n </td>\n </tr>`\n );\n }\n $removeBtn = $(\".wbdv-remove\");\n $removeBtn.click(deleteUser);\n $editBtn = $(\".wbdv-edit\");\n $editBtn.click(selectUser);\n }", "function printUsers() {\n for(let i = 0; i < users.length; i++) {\n const row = '<tr><td>'+users[i].name+'</td><td>' + users[i].email + '</td></tr>'\n tableBody.innerHTML += row;\n }\n}", "function showFaculty() {\n\t$.ajax({\n\t\turl \t: 'admin/show_faculty',\n\t\ttype \t: 'post',\n\t\tdataType: 'json',\n\t\tsuccess : function(data) {\n\t\t\tvar html = '';\n\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\thtml += '<tr>'+\n\t\t\t\t\t\t\t'<td>'+data[i].fac_ID+'</td>'+\n\t\t\t\t\t\t\t'<td>'+data[i].fac_fname+' '+data[i].fac_mname+' '+data[i].fac_lname+ '</td>'+\n\t\t\t\t\t\t\t'<td>'+data[i].phone_num+'</td>'+\n\t\t\t\t\t\t\t'<td>'+data[i].date_added+'</td>'+\n\t\t\t\t\t\t\t'<td><button class=\"btn btn-warning\" data=\"'+data[i].f_id+'\" id=editF><i class=\"fa fa-pencil\"></i> Edit</button></td>'+\n\t\t\t\t\t\t+'</tr>';\n\t\t\t}\n\t\t\t$('#faculty-tbl').html(html);\n\t\t\tvar dataTable = $('#table-faculty').DataTable();\n\t\t\t$('#table-faculty tbody').on('click', 'tr', function() {\n\t\t\t\tif ( $(this).hasClass('selected') ) {\n\t\t $(this).removeClass('selected');\n\t\t }\n\t\t else {\n\t\t dataTable.$('tr.selected').removeClass('selected');\n\t\t $(this).addClass('selected');\n\t\t }\n\t\t\t});\n\t\t},\n\t\terror \t: function() {\n\t\t\talert('error: showFaculty');\n\t\t}\n\t});\n}", "function printUsers() {\n const htmlDataUsers = htmlRowsUsers()\n const tableBody = getTablebody()\n tableBody.innerHTML = htmlDataUsers\n}", "function printOneUser(user) {\n searchInput.value = \"\";\n errorMsg.innerText = \"\";\n userTable.innerHTML += `<tr>\n <td>${user.fullName}</td>\n <td>${user.age}</td>\n <td>${user.isMarried ? `Yes, with ${user.spouse}` : `No`}</td>\n <td>${user.city}</td>\n <td>${user.country}</td>\n <td>${user.pets.join(\", \")}`;\n}", "function output_user_profile(res, login, userInfo, userInterests, userFriends, peopleWithSameInterests) {\n\tres.render('profile.jade',\n\t\t { title: \"Profile for User with login \" + login,\n\t\t\t userInfo: userInfo,\n\t\t\t userInterests: userInterests,\n\t\t\t userFriends: userFriends,\n\t\t\t peopleWithSameInterests : peopleWithSameInterests}\n\t );\n}", "renderUser() {\r\n\t\treturn (\r\n\t\t\t<div className=\"users\">\r\n\t\t\t{ this.state.isLoading ? \"\" : <div> <table width=\"100%\"> <tr> <td> <PageHeader align=\"left\" id=\"pageHeader\"> Hi {getLoggedInUserInfo(this.state.users).tx_user_name}! </PageHeader> </td> <td> <div align=\"right\" id=\"divRole\"> <img src=\"./users.png\" alt=\"\" /> {getLoggedInUserInfo(this.state.users).tx_role} </div> </td> </tr> </table> </div> }\r\n\t\t\t{!this.state.isLoading && this.renderUserLinks()}\r\n\t\t\t</div>\r\n\t\t);\r\n\t}", "function displayUFOSightings(ufoSightings)\n {\n // Get a reference to the table body\n var tbody = d3.select(\"tbody\");\n\n // Get a reference to the table heading to display the search result count\n var ufoSearchResult = d3.select(\"#ufo-count\");\n\n // Store the count of UFOs in the dataset\n var ufoCount = ufoSightings.length;\n\n // Display results in the table\n if (ufoCount === 0)\n {\n ufoSearchResult.text(\"Sorry, could not find any UFOs..try searching again!\");\n // Remove all rows so we can display all data from scratch based on user input \n d3.selectAll(\"td\").remove();\n }\n else\n {\n ufoSearchResult.text(\"Total UFO Sightings: \" + ufoCount);\n // Remove all rows so we can display all data from scratch based on user input \n d3.selectAll(\"td\").remove();\n\n ufoSightings.forEach((ufo) => \n {\n var row = tbody.append(\"tr\");\n Object.entries(ufo).forEach(([key, value]) => \n {\n var cell = row.append(\"td\");\n if (key == \"state\" || key == \"country\")\n {\n // Convert state and country abbreviations to upper case\n cell.text(value.toUpperCase());\n }\n else\n {\n cell.text(value);\n }\n });\n });\n }\n }", "function viewAllUsers() {\n var data = [],\n output,\n config;\n\n config = {\n columns: {\n }\n };\n data[0] = [\"User ID\".cyan, \"Full Name\".cyan, \"Username\".cyan, \"User Type\".cyan];\n let queryStr = \"users\";\n let columns = \"user_id, full_name, username, user_type\";\n\n myConnection.readFunction(columns, queryStr, function (res) {\n console.log(\"\\n Users\".magenta);\n for (let i = 0; i < res.length; i++) {\n data[i + 1] = [res[i].user_id.toString().yellow, res[i].full_name, res[i].username, res[i].user_type];\n }\n output = table.table(data, config);\n console.log(output);\n myConnection.goBack(\"Supervisor\", bamazonSupervisor.runBamazonSupervisor);\n });\n}", "function displayUser(users) {\n\tPromise.all(users.map(function(user) {\n\t\tconst userDisplay = document.createElement('div');\n\t\tuserDisplay.className= \"user\"\n\t\tuserDisplay.innerHTML = user.login;\n\t\tdocument.body.appendChild(userDisplay);\n\t}))\n}", "function renderUsers() {\n // clear the list for a fresh start look (innerHTML: use to modify/replace HTML elements)\n ulEl.innerHTML = \"\";\n\n // showing a new highscore\n for (var i = 0; i < users.length; i++) {\n // Create a new user object that pulls from the user array\n var user = users[i];\n\n // using text content to show user's initials and score\n var li = document.createElement(\"li\");\n li.textContent = user.userNum + \". \" + user.initials + \" - \" + user.score;\n\n // Append the element to the unordered list\n ulEl.appendChild(li);\n }\n}", "function showRegisteredStudents(){\n var students = getDataFromLocalStorage();\n var data = \"\";\n if (students.length == 0){\n data = \"<h3>No Students registered yet..</h3>\"\n } else{\n data += \"<table id='regstudents'><thead><tr>\";\n data += \"<th>#</th>\";\n data += \"<th>USN</th>\";\n data += \"<th>NAME</th>\";\n data += \"<th>EMAIL</th>\";\n data += \"<th>MOBILE</th>\";\n data += \"<th>COURSE</th>\";\n data += \"<th>CGPA</th>\";\n data += \"<th>DOB</th>\";\n data += \"</tr></thead>\";\n \n for (var i = 0; i < students.length; i++){\n var j = i +1;\n data += \"<tr>\";\n data += \"<td>\"+ j + \"</td>\";\n data += \"<td>\"+ students[i].usn + \"</td>\";\n data += \"<td>\"+ students[i].name + \"</td>\";\n data += \"<td>\"+ students[i].email+ \"</td>\";\n data += \"<td>\"+ students[i].mobile + \"</td>\";\n data += \"<td>\"+ students[i].course + \"</td>\";\n data += \"<td>\"+ students[i].cgpa + \"</td>\";\n data += \"<td>\"+ students[i].dob + \"</td>\";\n data += \"</tr>\"\n }\n data += \"</table\"\n \n }\n $(\"#content\").html(data);\n $(\"#regstudents\").dataTable({\n \"pageLength\" : 2\n });\n }", "function displayUsers(users) {\n users.forEach(function(user) {\n var $container = $('.container');\n var $tile = $('<div class=\"tile\"></div>');\n var name = user.name.first + ' ' + user.name.last;\n var $name = $('<p></p>');\n $name.text(name);\n\n var location = user.location.city + ', ' + user.location.state;\n var $location = $('<p></p>');\n $location.text(location);\n\n var $img = $('<img>');\n $img.attr('src', user.picture.large);\n\n $tile.append($img, $name, $location);\n $container.append($tile);\n });\n }", "function renderUserPage() {\n const userId = location.hash.split(\"users/\")[1];\n // get observations\n const observations = Model.get_user_observations(parseInt(userId));\n loadPage(\"user-details\", {\n user: Model.get_user(parseInt(userId)),\n observations: observations,\n });\n}", "function showUserPanel() {\n var usertype = \"\";\n var useridtype = \"\";\n var username = \"\";\n var userid = \"\";\n var functions;\n if (isSupervisor()) {\n usertype = \"LV-LeiterIn\";\n useridtype = \"uaccount-ID\";\n username = supervisordbInstance.getSupervisor(sessionStorage.address)[0];\n userid = supervisordbInstance.getSupervisor(sessionStorage.address)[1];\n\n functions = document.getElementById('supervisorfunctions');\n }\n else if (isStudent()) {\n usertype = \"StudentIn\";\n useridtype = \"MatrNr\";\n username = studentdbInstance.getStudent(sessionStorage.address)[0];\n userid = studentdbInstance.getStudent(sessionStorage.address)[1];\n\n functions = document.getElementById('studentfunctions');\n }\n document.getElementById('usertype').innerHTML = usertype;\n document.getElementById('useridtype').innerHTML = useridtype;\n document.getElementById('username').innerHTML = username;\n document.getElementById('userid').innerHTML = userid;\n\n if (functions != null) {\n functions.hidden = false;\n }\n}", "function fetchUsers() {\n userFacade.getUsers()\n .then(users => {\n const userRows = users.map(user => `\n <tr>\n <td>${user.id}</td>\n <td>${user.age}</td>\n <td>${user.name}</td>\n <td>${user.gender}</td>\n <td>${user.email}</td>\n </tr>`\n );\n const userRowsAsString = userRows.join(\"\");\n document.getElementById(\"allUserRows\").innerHTML = userRowsAsString;\n })\n}", "function outputUsers(users){\n userList.innerHTML = `\n ${users.map(user=>`<h6>${user.username}</h6>`).join('')}\n `;\n}", "render() {\n {this.props.user.username}\n return (\n <div>\n <h2>Admin Data Table</h2>\n <table>\n <tbody>\n <tr>\n <th>User Name</th>\n <th>Is Admin</th>\n <th>Is Active</th>\n <th>ID</th>\n </tr>\n {this.props.user.allUsers.map((user, i) => {\n return (\n <tr key={i}>\n <td>{user.username}</td>\n <td>{user.is_admin.toString()}</td>\n <td>{user.is_active.toString()}</td>\n <td>{user._id.toString()}</td>\n </tr>\n );\n })}\n </tbody>\n </table>\n </div>\n );\n }", "function printUsers(data) {\n $('#myTable').empty();\n $.each(data.results, function() {\n\n if(this.status == 'admin') {\n $('<tr>').attr('id', this.user_name).appendTo('#myTable');\n } else {\n $('<tr>').attr('id', this.user_name).attr('data-toggle', 'modal').attr('data-target', '#user_modal').appendTo('#myTable');\n }\n\n $('<td>').attr('class', 'text-center').html(this.user_name).appendTo('#'+this.user_name);\n $('<td>').attr('class', 'text-center').html(this.status).appendTo('#'+this.user_name);\n $('<td>').attr('class', 'text-center').html(this.last_updated).appendTo('#'+this.user_name);\n $('<td>').attr('class', 'text-center').html(this.record_created).appendTo('#'+this.user_name);\n $('<td>').attr('class', 'text-center').html(`<a onclick=\"del(this)\"><i class=\"fas fa-trash\" style=\"font-size: 20px\"></i></a>`).appendTo('#'+this.user_name);\n });\n}", "function renderUsers(users) {\n tbody.empty();\n for(var i=0; i<users.length; i++) {\n var user = users[i];\n var clone = template.clone();\n clone.attr('id', user.id);\n clone.find('.wbdv-delete').click(deleteUser);\n clone.find('.wbdv-edit').click(editUser);\n clone.find('.wbdv-username')\n .html(user.username);\n clone.find('.wbdv-first-name')\n .html(user.firstName);\n clone.find('.wbdv-last-name')\n .html(user.lastName);\n clone.find('.wbdv-role')\n .html(user.role);\n tbody.append(clone);\n }\n }", "function GetUser() {\n showUsers(dataUsers[currentPage]);\n}", "function renderTable() {\n const tbody = document.getElementById(\"bodyList\");\n if (tbody) {\n tbody.innerHTML = registerList.users\n .sort((a, b) => {\n return a.name < b.name ? -1 : 1;\n })\n .map((user) => {\n return `<tr>\n <td>${user.id}</td>\n <td>${user.name}</td>\n <td>${user.phone}</td>\n <td>${user.email}</td>\n <td>${user.city}</td>\n <td>\n <button onclick='showPage(\"register\", false, ${user.id})'>\n Editar\n </button>\n <button id=\"red\" onclick=\"askIfDelete(${user.id})\">Deletar</button>\n </td>\n\n </tr>`;\n })\n .join(\"\");\n }\n}", "function showTableOfUsers(result) {\n if(result.length>0) {\n var html = '<table class=\"primary\">';\n html += '<thead><tr>';\n html += '<th>Time</th>';\n html += '<th>First Name</th>';\n html += '<th>Last Name</th>';\n html += '<th>Email</th>';\n // html += '<th>Location</th>';\n html += '</tr></thead>';\n html += '<tbody>';\n for(var i in result) {\n var d = result[i].doc;\n if (d) {\n html += '<tr>';\n html += '<td>' + d.id + '</td>';\n html += '<td>' + d.nameFirst + '</td>';\n html += '<td>' + d.nameLast + '</td>';\n html += '<td>' + d.nameEmail + '</td>';\n // html += '<td>' + d.userLocation + '</td>';\n html += '</tr>';\n // html += '<tr>';\n var i;\n for (i=0; i<d.userLocation.length; i++){\n html += '<tr>' + '<th>Location</th>' + '</tr>';\n html += '<tr>' +'<td>' + d.userLocation[i] + '</td>' + '</tr>' ;\n }\n // html += '</tr>';\n }\n } \n html += '</tbody></table>';\n } else {\n html = \"nothing here\";\n }\n \n $(\"#divResults\").html(html);\n} //END showTableOfUsers();", "function displayProfile(times,temps){\n\tvar num_times = times.length;\n\t\n\tfor(i = 0 ; i < num_times ; i++){\n\t\tvar num_rows = profileTable.rows.length;\n\t\tvar row = profileTable.insertRow(num_rows);\n\t\t\n\t\tvar cell1 = row.insertCell(0);\n\t\tcell1.innerHTML = times[i];\n\t\t\n\t\tvar cell2 = row.insertCell(1);\n\t\tcell2.innerHTML = temps[i];\n\t}\n}", "function user_listing_pageshow() {\n try {\n // Grab some users and display them.\n views_datasource_get_view_result(\n 'drupalgap/views_datasource/drupalgap_users',\n {\n success: function(data) {\n // Extract the users into items, then drop them in the list.\n var items = [];\n for (var index in data.users) {\n if (!data.users.hasOwnProperty(index)) { continue; }\n var object = data.users[index];\n items.push(l(object.user.name, 'user/' + object.user.uid));\n }\n drupalgap_item_list_populate('#user_listing_items', items);\n }\n }\n );\n }\n catch (error) { console.log('user_listing_pageshow - ' + error); }\n}", "function popTable(){\n\tvar x = \"\";\n\tfor(i in currentProject.members){\n\t\tif(currentProject.members[i].name != undefined){\n\t\t\tx += \"<tr class='EditRow' onclick='EditUser()'>\" + \"<td onclick='passName(this.innerText)'>\" + currentProject.members[i].name + \"</td>\";\n\t\t\tfor (j in currentProject.members[i].role) {\n\t\t\t\tx += \"<td class='mrole'>\" + currentProject.members[i].role[j] + \"</td>\" + \"</tr>\";\n\t\t\t}\n\t\t}\n\t}\n\tdocument.getElementById(\"bod\").innerHTML = x;\n}", "function getAllUsers(){\n $.get(\"/getAllUsers\", function(users){\n let output =\n \"<table class='table table-striped table-bordered'>\" +\n \"<tr>\" +\n \"<th>Username</th>\" +\n \"</tr>\";\n\n for (const user of users){\n output +=\n \"<tr>\" +\n \"<td>\" + user.username + \"</td>\" +\n \"</tr>\";\n }\n output += \"</table>\";\n $(\"#allUsers\").empty().html(output);\n });\n }", "function outputUsers(users) {\n elim();\n let ul = document.createElement(\"ul\");\n ul.setAttribute(\"id\", \"users\");\n document.getElementById(\"list\").appendChild(ul);\n users.forEach(user=>{\n const li = document.createElement('li');\n li.className = 'list-group-item';\n li.innerText = user.username;\n ul.appendChild(li);\n });\n }", "function createUsersTable(users) {\n const table = document.createElement('table');\n for (let i = 0; i < users.length; i++) {\n const tr = document.createElement('tr');\n const tdName = document.createElement('td');\n tdName.innerText = users[i].name;\n const tdAge = document.createElement('td');\n tdAge.innerText = users[i].age;\n const tdEmail = document.createElement('td');\n tdEmail.innerText = users[i].email;\n const tdPhone = document.createElement('td');\n tdPhone.innerText = users[i].phone;\n tr.appendChild(tdName);\n tr.appendChild(tdAge);\n tr.appendChild(tdEmail);\n tr.appendChild(tdPhone);\n table.appendChild(tr);\n }\n return table;\n}", "function showUsers() {\n\t$.ajax({\n\t\ttype : \"GET\",\n\t\turl : \"user/goShowUsers\",\n\t\tcache : false,\n\t\tsuccess : function(data) {\n\t\t\t$(\"#showDynamicContent\").html(\"\");\n\t\t\t$(\"#dynamicContent\").html(data);\n\t\t\t$('#userLists').dataTable({\n\t\t\t\t\"bJQueryUI\" : true,\n\t\t\t\t\"sPaginationType\" : \"full_numbers\",\n\t\t\t\t\"iDisplayLength\" : 25,\n\t\t\t\t\"sScrollY\" : \"390px\",\n\t\t\t\t\"bFilter\" : true,\n\t\t\t\t\"bDestroy\" : true\n\t\t\t});\n\t\t}\n\t});\n}", "function renderUsers() {\n // Clear the list element so that its a clean slate every time\n ulEl.innerHTML = \"\";\n\n // Render a new li for each highscore\n for (var i = 0; i < users.length; i++) {\n // Create a new user object that pulls from the user array\n var user = users[i];\n\n // Set the text content of the list element to the user's information\n var li = document.createElement(\"li\");\n li.textContent = user.userNum + \". \" + user.initials + \" - \" + user.score;\n\n // Append the list element to the unordered list\n ulEl.appendChild(li);\n }\n}", "function displayUserResults() {\n state.userResults.forEach(function (item) {\n let htmlItem = $('.js-userResult.templ').clone();\n htmlItem.find('.js-name-title').append(`${item.firstName} ${item.lastName}`);\n htmlItem.find('.js-name').attr('uid', item._id);\n htmlItem.find('.js-name').attr('firstName', item.firstName);\n htmlItem.find('.js-username').append(`(${item.username})`);\n if (item.watchlist.length === 1) {\n htmlItem.find('.js-listCount').append(`${item.watchlist.length} item in their Watchlist.`);\n } else {\n htmlItem.find('.js-listCount').append(`${item.watchlist.length} items in their Watchlist.`);\n }\n htmlItem.removeClass('templ');\n $('.js-userResults-list').append(htmlItem);\n $('.js-userResults').removeClass('hidden');\n $('.js-userResults').show();\n });\n $('.js-noUsers').addClass('hidden');\n $('.js-watchlist').hide();\n $('.js-watchlist-results').html('');\n $('.results').hide();\n $('.js-results-container').html('');\n $('.js-returnButton').removeClass('hidden');\n $('.js-welcome').addClass('hidden');\n}", "function displayRoomUsers(userList) {\r\n $(\".users-list\").html(\r\n `${userList.map(\r\n (user) => `\r\n ${user.username}\r\n `\r\n )}`\r\n );\r\n}", "function ufoTable(ufoData) {\n // empty contents if any\n tbody.html('')\n // loop through\n ufoData.forEach((ufoSighting) => {\n //append rows day3 activity 2\n let newRow = tbody.append(\"tr\");\n //iterate through data.js values\n Object.entries(ufoSighting).forEach(([, value]) => {\n //append new cells for the values day3 activity 3\n let newCell = newRow.append(\"td\");\n newCell.text(value);\n });\n });\n}", "render() {\n return (\n <div>\n <h3>Logged Exercises</h3>\n <table className=\"table\">\n <thead className=\"thead-light\">\n <tr>\n <th>Username</th>\n <th>Description</th>\n <th>Duration</th>\n <th>Date</th>\n <th>Actions</th>\n </tr>\n </thead>\n <tbody>\n {this.exerciseList()}\n </tbody>\n </table>\n </div>\n );\n }", "function displayUser() {\r\n var output = \"\";\r\n $.ajax({\r\n type: \"GET\",\r\n url: \"../Model/fetchUser.php\",\r\n // data: \"data\",\r\n dataType: \"JSON\",\r\n success: function(response) {\r\n var x;\r\n if (response) {\r\n x = response;\r\n } else {\r\n x = \"\";\r\n }\r\n for (let i = 0; i < x.length; i++) {\r\n output += \"<tr><td>\" + (i + 1) + \"</td><td>\" + x[i].fname + \"</td><td>\" + x[i].lname + \"</td><td>\" + x[i].email + \"</td><td>\" + x[i].role + \"</td><td><button class='btn btn-warning btn-edit' data-userid=\" + x[i].userid + \"><i class='fas fa-edit'></i></button>&nbsp<button class='btn btn-danger btn-del' data-userid=\" + x[i].userid + \"><i class='fa fa-trash'></i></button></td></tr>\";\r\n }\r\n $(\"#userTbody\").append(output);\r\n }\r\n });\r\n\r\n }", "showUsers(userArray) {\n\t\tuserArray = userArray.slice(0, 10);\n\t\t//add @ sign to each entry\n\t\tuserArray = userArray.map((elem) => {\n\t\t\treturn {\n\t\t\t\t...elem,\n\t\t\t\tusername: elem.username.charAt(0) === '@' ? elem.username : `@${elem.username}`\n\t\t\t};\n\t\t});\n\t\tthis.screenWidth = this.sys.canvas.width;\n\t\tthis.screenHeight = this.sys.canvas.height;\n\n\t\t//calculate line height to fill every screen equally\n\t\tlet lineGraphics = this.add.graphics({\n\t\t\tlineStyle: {width: 2, color: 0x4e3663}\n\t\t});\n\t\tconst gap = (this.screenHeight - 170) / 10;\n\t\tfor (let i = 0; i < (userArray.length - 1); i++) {\n\t\t\tlineGraphics.lineBetween(30, 143 + (gap / 2) + (gap * i), this.screenWidth - 30, 143 + (gap / 2) + (gap * i));\n\t\t}\n\t\tfor (let i = 0; i < userArray.length; i++) {\n\t\t\tthis.add.text(20, 143 + (gap * i), userArray[i].username, Config.fonts.leaderboardUserName).setOrigin(0, 0.5);\n\t\t\tthis.add.text(this.screenWidth - 20, 143 + (gap * i), userArray[i].score, Config.fonts.leaderboardUserScore).setOrigin(1, 0.5);\n\t\t}\n\t}", "function updateUsersTableRow() {\n\tif (activeUser) {\n\n\t\tvar usersTableRow = findUsersTableRow(activeUser.userData.userID);\n\n\t\tif (usersTableRow !== null) {\n\t\t\tusersTableRow[0].cells[0].childNodes[0].innerText = activeUser.userData.lastName;\n\t\t\tusersTableRow[0].cells[1].childNodes[0].innerText = activeUser.userData.firstName;\n\t\t\tusersTableRow[0].cells[2].childNodes[0].innerText = calculateAge(activeUser.userData.birthDate);\n\t\t\tusersTableRow[0].cells[3].childNodes[0].innerText = activeUser.userData.balanceIdx;\n\t\t\tusersTableRow[0].cells[4].childNodes[0].innerText = activeUser.userData.activityIdx;\n\t\t}\n\t}\n}", "function addUsersToTable()\n{\n users.forEach( user => {\n let table_row = `\n <tr>\n <td>${user.id}</td>\n <td>${user.name}</td>\n <td>${user.username}</td>\n <td>${user.email}</td>\n <td><a class=\"waves-effect waves-light btn\" href=\"http://127.0.0.1:5500/post.html?user_id=${user.id}\">Details</a></td>\n </tr>\n `;\n\n tbody.innerHTML += table_row;\n });\n}", "function viewFunc(res) {\n if (res.userChoice === \"View all departments\") {\n // Returns all departments and IDs\n db.query(\"SELECT * FROM department\", (err, data) => {\n if (err) throw err;\n console.table(data);\n init();\n });\n } else if (res.userChoice === \"View all roles\") {\n // Returns all roles with department associated with and IDs\n db.query(\n \"SELECT roles.id, roles.title, roles.salary, department.department_name FROM roles, department WHERE department.id = roles.department_id ORDER BY roles.id ASC\",\n (err, data) => {\n if (err) throw err;\n console.table(data);\n init();\n }\n );\n } else if (res.userChoice === \"View all employees\") {\n // Returns employee fist and last name, role title, and department name and displays in a table\n db.query(\n \"SELECT employee.id, employee.first_name, employee.last_name, roles.title, department.department_name FROM employee, roles, department WHERE department.id = roles.department_id AND roles.id = employee.role_id ORDER BY employee.id ASC\",\n (err, data) => {\n if (err) throw err;\n console.table(data);\n init();\n }\n );\n } else if (res.userChoice === \"View all employees by manager\") {\n viewEmpByManager();\n } else if (res.userChoice === \"View all employees by department\") {\n viewEmpByDepartment();\n } else {\n init();\n }\n}", "function showCourses()\n{\n var selected = this.departments.indexOf($(\"#department\").val());\n \n if ((0 <= selected) && (selected < this.pages.length))\n {\n // Creates a div containing the department page;\n // this makes it easier for jQuery to look through the page\n var page = this.pages[selected];\n var wrapper = document.createElement(\"div\");\n $(wrapper).html(page);\n \n // Clear the table body\n var tableBody = $(\"#course-list-table > tbody\");\n tableBody.html(\"\");\n \n $(\"tr\", wrapper).each(function()\n {\n columnIndex = 0;\n\t\t\tcrn = 0;\n\t\t\tname = \"\";\n\t\t\tsection = 0;\n title = \"\";\n credits = 0;\n instructor = \"\";\n seats = \"\";\n days = \"\";\n time = \"\";\n room = \"\";\n dates = \"\";\n columnCount = $(\"td\", $(this)).length;\n \n $(\"td\", $(this)).each(function()\n {\n// alert($(this).text());\n // Lectures -- Before Registration\n if (columnCount == 12)\n {\n switch (columnIndex)\n {\n case 1:\n crn = $(this).text();\n break;\n case 2:\n name = $(this).text();\n break;\n case 3:\n section = $(this).text();\n break;\n case 4:\n title = $(this).text();\n break;\n case 5:\n credits = $(this).text();\n break;\n case 6:\n instructor = $(this).text();\n break;\n case 7:\n seats = $(this).text();\n break;\n case 8:\n days = $(this).text();\n break;\n case 9:\n time = $(this).text();\n break;\n case 10:\n room = $(this).text();\n break;\n case 11:\n dates = $(this).text();\n break;\n }\n }\n // Labs -- Before Registration\n else if (columnCount == 11)\n {\n switch (columnIndex)\n {\n case 7:\n days = $(this).text();\n break;\n case 8:\n time = $(this).text();\n break;\n case 9:\n room = $(this).text();\n break;\n case 10:\n dates = $(this).text();\n break;\n }\n }\n \n // Lectures -- After Registration Begins\n if (columnCount == 14)\n {\n switch (columnIndex)\n {\n case 1:\n crn = $(this).text();\n break;\n case 2:\n name = $(this).text();\n break;\n case 3:\n section = $(this).text();\n break;\n case 4:\n title = $(this).text();\n break;\n case 5:\n credits = $(this).text();\n break;\n case 6:\n instructor = $(this).text();\n break;\n case 7:\n seats = $(this).text();\n break;\n case 10:\n days = $(this).text();\n break;\n case 11:\n time = $(this).text();\n break;\n case 12:\n room = $(this).text();\n break;\n case 13:\n dates = $(this).text();\n break;\n }\n }\n // Labs -- After Registration Begins\n else if (columnCount == 13)\n {\n switch (columnIndex)\n {\n case 9:\n days = $(this).text();\n break;\n case 10:\n time = $(this).text();\n break;\n case 11:\n room = $(this).text();\n break;\n case 12:\n dates = $(this).text();\n break;\n }\n }\n\n columnIndex++;\n });\n \n // Create a row in the table for this course\n var row = document.createElement(\"tr\");\n \n // Lectures\n if (crn != 0)\n {\n $(row).append(\"<td>\" + crn + \"</td>\");\n $(row).append(\"<td>\" + name + \"</td>\");\n $(row).append(\"<td>\" + section + \"</td>\");\n $(row).append(\"<td>\" + ((title.indexOf(\"Restriction:\") == -1) ?\n (title) :\n (title.substring(0, title.indexOf(\"Restriction\")) +\n \"<br />\" + title.substring(title.indexOf(\"Restriction\"))))+ \"</td>\");\n $(row).append(\"<td>\" + credits + \"</td>\");\n $(row).append(\"<td>\" + instructor + \"</td>\");\n $(row).append(\"<td>\" + seats + \"</td>\");\n $(row).append(\"<td>\" + days + \"</td>\");\n $(row).append(\"<td>\" + time + \"</td>\");\n $(row).append(\"<td>\" + room + \"</td>\");\n $(row).append(\"<td>\" + dates + \"</td>\");\n $(tableBody).append(row);\n }\n // Labs\n else if ((crn == 0) && (days.length > 0))\n {\n $(row).append(\"<td></td>\");\n $(row).append(\"<td></td>\");\n $(row).append(\"<td></td>\");\n $(row).append(\"<td></td>\");\n $(row).append(\"<td></td>\");\n $(row).append(\"<td></td>\");\n $(row).append(\"<td></td>\");\n $(row).append(\"<td>\" + days + \"</td>\");\n $(row).append(\"<td>\" + time + \"</td>\");\n $(row).append(\"<td>\" + room + \"</td>\");\n $(row).append(\"<td>\" + dates + \"</td>\"); \n $(tableBody).append(row);\n }\n \n first = false;\n });\n }\n}", "function showUsers(infoUsers) {\n let output = '';\n infoUsers.forEach((user, index) => {\n output += `\n <tr id=${user.id}>\n <th scope=\"row\">${user.id}</th>\n <td>${user.employee_name}</td>\n <td>${user.employee_salary}</td>\n <td>${user.employee_age}</td>\n <td id = \"getId\" type=\"button\" class = \"\" onclick = onGet(${user.id})>Get</td>\n <td id = \"edit\" type=\"button\" class = \"\" onclick = onEdit(${user.id})>Edit</td>\n <td id = \"delete\" type=\"button\" class = \"btn-danger\" onclick = onDelete(${user.id})>Delete</td>\n </tr>\n `;\n });\n document.getElementById('users').innerHTML = output;\n}", "function show(data) {\r\n let tab = \r\n `<tr>\r\n <th>ID</th>\r\n <th>NAME</th>\r\n </tr>`;\r\n \r\n // Loop to access all rows \r\n for (let r of data) {\r\n tab += `<tr> \r\n <td>${r.id} </td>\r\n <td>${r.name}</td>\r\n \r\n</tr>`;\r\n }\r\n // Setting innerHTML as tab variable\r\n document.getElementById(\"employees\").innerHTML = tab;\r\n}", "function outputUsers(users) {\n userList.innerHTML = `<ul>\n ${users.map(user => `<li>${user.username}</li>`).join('')}\n </ul>`;\n}", "function renderUserListElement(user) {\n var table = document.getElementById('user_list');\n var row = table.insertRow(-1);\n\n var username = row.insertCell(0);\n var name = row.insertCell(1);\n username.innerHTML = user.username;\n name.innerHTML = user.name;\n\n row.addEventListener('click', function(e) {\n window.location.href = basePath + 'user/edit.html?user_id=' + user.user_id;\n });\n}", "function staffTableFxn(res){\n let snum = 1;\n let staffTable = `\n <h4>${res.sch[0].school_name}</h4>\n <table class='table table-bordered table-striped' >\n <thead class='oxblood'>\n <th>S/No.</th>\n <th>Name</th>\n <th>Staff ID</th>\n <th>Grade Level</th>\n <th>View Profile</th>\n <thead>\n <tbody>\n `;\n res.staff.forEach(st => staffTable += `\n <tr id='${st.StaffID}'>\n <td>${snum++}</td>\n <td>${st.Lastname+' '+st.Firstname+' '+st.Other_names}</td>\n <td class='text-center'>${st.StaffID}</td>\n <td class='text-center'>${st.grade_level}</td>\n <td class='text-center'>\n <button class='btn btn-outline-primary btn-sm staffProfileBtn' \n data-st='${st.StaffID}' data-record='${JSON.stringify(st)}'>\n View\n </button></td>\n </tr>\n `\n );\n staffTable += '</tbody></table>'\n return staffTable;\n}", "function renderScoreTable() {\n var currScoreList = UserScoreHelper.getScores();\n // Clear the table \n scoreTableEl.innerHTML = \"\";\n if (currScoreList.length > 0) {\n // Update table with user scores\n for (var index = 0; index < currScoreList.length; index++) {\n var row = createScoreTableRow();\n addColumnToRow(row, (index + 1), true);\n addColumnToRow(row, currScoreList[index].initials);\n addColumnToRow(row, currScoreList[index].score);\n }\n } else {\n // No user scores found - display message to user\n var row = createScoreTableRow();\n var column = addColumnToRow(row, \"No Scores Found\");\n column.setAttribute(\"colspan\", \"3\");\n column.setAttribute(\"class\", \"text-center\");\n }\n}", "function listUsers() {\n const Table = require('cli-table');\n const User = require('../models/user');\n const mongoose = require('../mongoose');\n\n User\n .find()\n .exec()\n .then((users) => {\n let table = new Table({\n head: [\n 'ID',\n 'Display Name',\n 'Profiles',\n 'Roles',\n 'State'\n ]\n });\n\n users.forEach((user) => {\n table.push([\n user.id,\n user.displayName,\n user.profiles.map((p) => p.provider).join(', '),\n user.roles.join(', '),\n user.disabled ? 'Disabled' : 'Enabled'\n ]);\n });\n\n console.log(table.toString());\n mongoose.disconnect();\n })\n .catch((err) => {\n console.error(err);\n mongoose.disconnect();\n });\n}", "function printUsers(qty){\n // Function which handle the edit forms url\n \n \n while ( \n document\n .getElementById('section')\n .firstChild) {\n document\n .getElementById('section').\n removeChild(\n document\n .getElementById('section')\n .firstChild);\n }\n for(i=1 ; i < qty ; i++){\n console.log(users[i])\n \n if(users[i].status!='Deleted'){\n document.getElementById('section').style.display = 'grid'\n \n auxUsers = `<div id=\"user-${i}\" class=\"card\"\">\n <header class=\"card-header\">\n <div class=\"media-content d-flex align-center\">\n <div class=\"info\">\n <p class=\"title is-4\">${users[i].name}</p>\n <p class=\"subtitle is-6\">${users[i].email}</p>\n <span class=\"tag is-warning mx-5\">${users[i].partnerShip}</span>\n </div>\n </div>\n <span class=\"mt-3 mx-2\">#${i}</span>\n \n </header>\n <div class=\"card-content\">\n <div class=\"content\">\n \n ${users[i].situation}\n </div>\n </div>\n </div>` + auxUsers }else if(i+1 == users.length && auxUsers == ''){\n\n document.getElementById('section').style.display = 'flex'\n document.getElementById('section').style.justifyContent = 'center'\n\n auxUsers = `<div class=\"notification is-warning is-light\">\n Nenhum cliente cadastrado!\n </div>`\n }\n \n }\n \n \n }", "function outputUsers(users) {\r\n userList.innerHTML = `\r\n ${users.map((user) => `<li>${user.username}</li>`).join(\"\")}\r\n `;\r\n}", "function outputUsers(users) {\n userList.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join(\"\")}\n `;\n}", "function displayTable()\r\n{\t\r\n\t// Package a JSON payload to deliver to the DisplayTable Endpoint with\r\n\t// the UserID in order to display their contacts.\r\n var jsonPayload = \r\n \t'{\"UserID\" : \"' + userId + '\"}';\r\n\tvar url = urlBase + '/DisplayTable.' + extension;\r\n\tvar xhr = new XMLHttpRequest();\r\n\t\r\n\txhr.open(\"POST\", url, false);\r\n\txhr.setRequestHeader(\"Content-type\", \"application/json; charset=UTF-8\");\r\n\t\r\n\t// Basic try and catch to ensure that any server code errors are \r\n\t// handled properly. \r\n\ttry\r\n\t{\r\n\t\txhr.onreadystatechange = function()\r\n\t\t{\r\n\t\t\tif (this.readyState == 4 && this.status == 200)\r\n\t\t\t\tconsole.log(\"Success in displayTable()\");\r\n\t\t};\r\n\t\txhr.send(jsonPayload);\r\n\t}\r\n\tcatch(err)\r\n\t{\r\n\t\tconsole.log(\"Failure in displayTable()\");\r\n\t}\r\n\r\n\tvar contactList = JSON.parse(xhr.responseText);\r\n\r\n\t// For each contact in the JSON array, the contact's\r\n\t// information will be added to the table.\r\n\tfor (var i in contactList)\r\n {\r\n \taddRow(contactList[i]);\r\n }\r\n}", "function getLeaderboard() {\r\n var leaderTable = document.getElementById(\"leaderTable\");\r\n for (i = 0; i < users.length; ++i) {\r\n var row = leaderTable.insertRow(0);\r\n \r\n var cell1 = row.insertCell(0);\r\n var cell2 = row.insertCell(1);\r\n\r\n cell1.innerHTML = users[i].username;\r\n cell2.innerHTML = users[i].points;\r\n }\r\n \r\n var row = leaderTable.insertRow(0)\r\n \r\n var header1 = row.insertCell(0);\r\n var header2 = row.insertCell(1);\r\n\r\n header1.innerHTML = \"Username\";\r\n header2.innerHTML = \"Points\";\r\n}", "function showUser(){\n\t$(\".profile-user-nickname\").html(userData.prezdivka);\n\t$(\".profile-user-name\").html(\"<p>\"+userData.jmeno+\" \"+userData.prijmeni+\"</p>\");\n\t$(\".profile-user-age-status\").html(userData.vek+checkStatus(userData.stav));\n\t$(\".profile-user-status\").html(userData.stav);\n\tif(userStatus){\n\t\t$(\".profile-user-bounty\").html(\"<p style='color: #938200;'>Bounty: \"+userData.vypsana_odmena+\" gold</p>\");\n\t}\n\telse{\n\t\t$(\".profile-user-bounty\").html(\"<p style='color: #938200;'>\" + 0 + \" gold</p>\");\n\t}\n}", "function allUserShow(){\n $.ajax({\n url: \"includes/user.php?status=all\",\n type: \"GET\",\n success: function(data){\n $('#user_table').empty();\n // alert(data);\n let users = JSON.parse(data);\n // console.log(users);\n let no = 1; \n\n for(user of users){\n console.log(user.name);\n $('#user_table').append(`<tr>\n <td>\n <img\n src=\"uploads/${user.photo}\"\n alt=\"List photo\"\n class=\"list__item2--image\"\n />\n </td>\n <td>${user.name}</td>\n <td>${user.email}</td>\n <td>${user.phone}</td>\n <td>${user.address}</td>\n <td>\n <a\n href=\"#popup\" id=\"preview_popup\"\n class=\"list__item2--button list__item2--button-view\"\n data-id=${user.id}\n >View</a\n >\n <a\n href=\"#user_edit_popup\"\n class=\"list__item2--button list__item2--button-edit\"\n id=\"edit\"\n data-id=${user.id}\n >Edit</a\n >\n <a\n href=\"#\"\n class=\"list__item2--button list__item2--button-delete\"\n id=\"delete\"\n data-id=${user.id}\n >Delete</a\n >\n </td>\n </tr>`);\n }\n\n \n }\n });\n }", "function crearContenidoTabla(members){\n\tvar table = '<thead class=\"thead\"><tr><th>Full name</th><th>Party</th><th>State</th><th>Seniority</th><th>Percentage of votes whith party</th></tr></thead>';\n\t\n\ttable += '<tbody>';\n\t\n\tmembers.forEach(function(member){\n\t\ttable += '<tr>';\n\t\tif(member.middle_name === null){\n\t\t\ttable += '<td ><a href =\"' +member.url+ '\">' + member.first_name+' '+member.last_name+'</td>';\n\t\t}else{\n\t\t\ttable +='<td><a href=\"' +member.url+ '\">'+member.first_name+' '+member.middle_name+' '+member.last_name+'</td>';\n\t\t}\n\ttable += '<td class=\"party\">'+member.party+'</td>';\n\ttable += '<td class=\"state\">'+member.state+'</td>';\n\ttable += '<td>'+member.seniority+'</td>';\n\ttable += '<td>% '+member.votes_with_party_pct+'</td>';\n\ttable += '</tr>';\n\t})\n\ttable += '</tbody>';\n\treturn table;\n}", "function viewEmployees() {\n connection.query(\n \"SELECT employee.id, first_name, last_name, roles.title, department.name AS department, roles.salary FROM employee INNER JOIN roles ON employee.role_id = roles.role_id INNER JOIN department ON roles.department_id = department.department_id\",\n (err, results) => {\n if (err) throw err;\n console.log(\"\\n\");\n console.table(results);\n console.log(\"===============================\");\n console.log(\"\\n \\n \\n \\n \\n \\n \\n\");\n }\n );\n // RETURN TO MAIN LIST\n runTracker();\n}", "function renderUser(id) {\n const userId = id || getSelectedUser()\n console.log('Rendering user')\n if (userId) {\n const user = client.user.get(userId)\n const userDataString = JSON.stringify(user, null, 4)\n document.getElementById('display').innerHTML = userDataString\n if (user != undefined && user != \"\") {\n const userDisplay = document.getElementById('display')\n let text = '<h5>User Info</h5>'\n userDisplay.innerHTML = ''\n Object.keys(user).forEach(\n key => (text += '<li><b>' + key + '</b>: <i>' + user[key] + '</i></li>')\n )\n\n userDisplay.innerHTML = '<ul>' + text + '</ul>';\n } else {\n log('User not found');\n }\n }\n }", "function displayData(allData){ \n tbody.text(\"\")\n allData.forEach(function(ufoSighting){\n newTr = tbody.append(\"tr\")\n Object.entries(ufoSighting).forEach(function([key, value]){\n newTd = newTr.append(\"td\").text(value)\t\n })\n})}", "render() {\n return (\n <div className=\"AdminTableDiv\">\n <h3>Admin Dashboard</h3>\n <Table className=\"AdminTable\" striped bordered condensed hover responsive>\n <thead>\n <tr>\n <th>Email:</th>\n <th>Roles:</th>\n </tr>\n </thead>\n {this.showUsersList()}\n </Table>\n\n <h3>Users Allowed Access Per Team</h3>\n <Table className=\"ViewableTeams\" striped bordered condensed hover responsive>\n <thead>\n <tr>\n <th>Team:</th>\n <th>Users With Access:</th>\n <th>Add User Access</th>\n <th>Remove User Access</th>\n </tr>\n </thead>\n {this.showTeamsList()}\n </Table>\n </div>\n )\n }", "function displayLeaderboard(results){\n var leaderboard = document.querySelector(\"#leaderboard\");\n console.log(results);\n var ranking = 1;\n for(var user in results[\"users\"]){\n \n var row = document.createElement('tr');\n var rank = document.createElement('th');\n rank.innerHTML = ranking++;\n rank.classList.add(\"rank\");\n rank.setAttribute(\"scope\",\"row\");\n \n var profile_img = document.createElement('td');\n profile_img.innerHTML = \"<img class = \\\"profile_picture\\\" src =\\\"images/noprofile.jpg\\\" alt = \\\"profile\\\"/>\";\n var username = document.createElement('td');\n username.innerHTML = user;\n var completed = document.createElement('td');\n console.log(results[\"users\"][user][\"completed\"]);\n \n completed.innerHTML = \"Finished \" + results[\"users\"][user][\"completed\"] + \" tasks!\";\n \n row.append(rank);\n row.append(profile_img);\n row.append(username);\n row.append(completed);\n leaderboard.append(row);\n \n }\n}", "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach(user=>{\n const li = document.createElement('li');\n li.innerText = user.username;\n userList.appendChild(li);\n });\n }", "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach(user=>{\n const li = document.createElement('li');\n li.innerText = user.username;\n userList.appendChild(li);\n });\n }", "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach(user=>{\n const li = document.createElement('li');\n li.innerText = user.username;\n userList.appendChild(li);\n });\n }", "function renderStaff(doc) {\n let data = doc.data();\n let tbodyRef = $(\"#displayStaffInfo\");\n let tbodyStaffDisplay = document.createElement(\"tbody\");\n let tr = document.createElement(\"tr\");\n let tdFirstName = document.createElement(\"td\");\n let tdLastName = document.createElement(\"td\");\n let tdPin = document.createElement(\"td\");\n\n // set id to tr\n tr.setAttribute(\"data-id\", doc.id);\n tbodyRef.append(tr);\n\n // set names and pin to td\n tdFirstName.innerHTML = doc.data().name.split(\" \")[0];\n tdLastName.innerHTML = doc.data().name.split(\" \")[1];\n tdPin.innerHTML = doc.data().pin;\n tr.append(tdFirstName);\n tr.append(tdLastName);\n tr.append(tdPin);\n}", "function viewEmployee() {\n\n var query =\n `SELECT e.id, e.first_name, e.last_name, r.title, d.name AS department, r.salary, CONCAT(m.first_name, ' ', m.last_name) AS manager\n FROM employee e\n LEFT JOIN roles r\n ON e.roles_id = r.id\n LEFT JOIN department d\n ON d.id = r.department_id\n LEFT JOIN employee m\n ON m.id = e.manager_id`\n \n connection.query(query, function (err, res) {\n if (err) throw err;\n \n console.table(res); \n init(); \n \n });\n }", "function populateTable(existingUsers) {\r\n\tif(existingUsers.length > 0) {\r\n\t\tdocument.getElementById(\"existingChangeRoleList\").style.display=\"block\";\r\n\t\tvar userList = document.getElementById(\"existingUsersTableId\");\r\n\t\tvar tableStr = \"<table width='94%' border='1' bordercolor='#78C0D3' id='myTable' align='center'><thead class='tab_header'><tr><th>SL. No.</th><th>Facilitator Email</th><th>User Group Name</th><th width='16%'>Status</th></tr></thead><tbody>\";\r\n\t\tvar counter = 1;\r\n\t\tfor (var index=0; index<existingUsers.length; index++) {\r\n\t\t\tvar trColor = \"\";\r\n\t\t\tif(index % 2 == 0) {\r\n\t\t\t\ttrColor = \"#D2EAF0\";\r\n\t\t\t} else {\r\n\t\t\t\ttrColor = \"#F1F1F1\";\r\n\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\ttableStr = tableStr + \"<tr class='user_list_row_width' bgcolor='\"+trColor+\"'><td align='center'>\"+counter+\".</td><td align='center'>\"+existingUsers[index].email+\"</td><td align='center'>\"+existingUsers[index].userGroup+\"</td>\";\r\n\t\t\ttableStr = tableStr + \"<td class='user_list_row_width' >\" +\r\n\t\t\t\t\t\"<table width='100%' border='0'>\" +\r\n\t\t\t\t\t\"<tr>\";\r\n\t\t\tif(existingUsers[index].softDelete == 0){\r\n\t\t\t\ttableStr = tableStr + \"<td align='center'>Active</td></td></tr></table></td></tr>\";\r\n\t\t\t} else {\r\n\t\t\t\ttableStr = tableStr + \"<td align='center'>Inactive</td></td></tr></table></td></tr>\";\r\n\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\tcounter = counter + 1;\r\n\t\t}\r\n\t\ttableStr = tableStr + \"</tbody></table>\";\r\n\t\tuserList.innerHTML = tableStr;\r\n\t\tnew SortableTable(document.getElementById('myTable'), 1);\r\n\t} else {\r\n\t\tdocument.getElementById(\"existingChangeRoleList\").style.display=\"none\";\r\n\t\tdocument.getElementById(\"existingUsersTableId\").innerHTML = \"<div align='center'><br /><br /><br /><img src='../img/no-record.png'><br /><div class='textStyleNoExist'>No Existing Facilitators</div></div>\";\r\n\t}\r\n}", "function outputUsers(users){\n userList.innerHTML=`\n ${users.map(user=>`<li>${user.username}</li>`).join('')}\n `\n}", "function displayEmployeesTable(employeesArray) {\n \t\n \tvar employeesTableBody = document.getElementById(\"employees-table-body\");\n \t//clear table body\n \temployeesTableBody.innerHTML=\"\";\n \t\n \t//Create table row and append to body\n \temployeesArray.forEach(function(employeeObject){\n\t var tr = document.createElement('tr');\n tr.appendChild( document.createElement('td') );\n tr.appendChild( document.createElement('td') );\n tr.appendChild( document.createElement('td') );\n tr.appendChild( document.createElement('td') );\n\n tr.cells[0].appendChild( document.createTextNode(employeeObject.id) )\n tr.cells[1].appendChild( document.createTextNode(employeeObject.firstName+\" \"+employeeObject.lastName) );\n tr.cells[2].appendChild( document.createTextNode(employeeObject.address)); \t\t\n tr.cells[3].appendChild( document.createTextNode(employeeObject.country.name)); \t\t\n employeesTableBody.appendChild(tr);\n \t});\n\n }", "function populateTable(existingUsers) {\r\n\t\r\n\tif(existingUsers.length > 0) {\r\n\t\tdocument.getElementById(\"existingDataListDiv\").style.display=\"block\";\r\n\t\tvar userList = document.getElementById(\"existingUsersTableId\");\r\n\t\tvar tableStr = \"<table width='94%' border='1' bordercolor='#78C0D3' id='myTable' align='center' class='tablesorter'><thead width='94%' class='tab_header'><tr><th width='6%'>#</th><th>Name (Last, First)</th><th>Email (User ID)</th><th>User Group Name</th><th>Expiration Date</th><th>Creator</th><th width='22%'>Action</th></tr></thead><tbody width='94%'>\";\r\n\t\tvar counter = 1;\r\n\t\tvar fName= \"\";\r\n\t\tvar lName = \"\";\r\n\t\tvar creator = \"\";\r\n\t\tfor (var index=0; index<existingUsers.length; index++) {\r\n\t\t\tvar trColor = \"\";\r\n\t\t\tif(index % 2 == 0) {\r\n\t\t\t\ttrColor = \"#D2EAF0\";\r\n\t\t\t} else {\r\n\t\t\t\ttrColor = \"#F1F1F1\";\r\n\t\t\t}\r\n\t\t\tvar expiryDate = \"\";\r\n\t\t\tvar userExpryDate = \"\";\r\n\t\t\t\r\n\t\t\tif(null != existingUsers[index].lastName) {\r\n\t\t\t\tlName = existingUsers[index].lastName;\r\n\t\t\t} else {\r\n\t\t\t\tlName = \"N/A\";\r\n\t\t\t}\r\n\t\t\tif(null != existingUsers[index].firstName) {\r\n\t\t\t\tfName = existingUsers[index].firstName;\r\n\t\t\t} else {\r\n\t\t\t\tfName = \"N/A\";\r\n\t\t\t}\r\n\t\t\tvar custId = existingUsers[index].customerId.substring(0, 2);\r\n\t\t\tvar adminId = existingUsers[index].jctUserDetailAdminId;\r\n\t\t\tif (existingUsers[index].roleId == 3) {\r\n\t\t\t\tif (adminId == 2) {\r\n\t\t\t\t\tcreator = \"Self\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcreator = \"Admin\";\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif(custId == 99) {\r\n\t\t\t\t\tcreator = \"Facilitator (\"+existingUsers[index].createdBy+\")\";\r\n\t\t\t\t} else if (custId == 98 && adminId == 2){\r\n\t\t\t\t\tcreator = \"Self\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcreator = \"Admin\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\tif (existingUsers[index].jctProfileId == 1) {\r\n\t\t\t\texpiryDate = new Date(existingUsers[index].jctAccountExpirationDate).toDateString();\r\n\t\t\t\tuserExpryDate = dateformat(new Date (expiryDate));\r\n\t\t\t}\r\n\t\t\texpiryDate = ( expiryDate == ('' || null || 0) ) ? 'N/A' : userExpryDate ;\t\t//\tfor facilitator -> N/A\r\n\t\t\t\r\n\t\t\ttableStr = tableStr + \"<tr class='user_list_row_width' bgcolor='\"+trColor+\"'><td align='center'>\"+counter+\".</td><td align='center'>\"+lName+\", \"+fName+\"</td><td align='center'>\"+existingUsers[index].email+\"</td><td align='center'>\"+existingUsers[index].userGroup+\"</td><td align='center'>\"+expiryDate+\"</td><td align='center'>\"+creator+\"</td>\";\r\n\t\t\ttableStr = tableStr + \"<td class='table_col_txt_style' >\" +\r\n\t\t\t\t\t\"<table width='100%' border='0'>\" +\r\n\t\t\t\t\t\"<tr>\";\r\n\t\t\t\r\n\t\t\t//If profile id is 3 then\r\n\t\t\tif (existingUsers[index].jctProfileId == 3) {\r\n\t\t\t\ttableStr = tableStr + \"<td align='center' width='50%'><a href='#' onclick='resetPassword(\\\"\"+existingUsers[index].email+\"\\\", \\\"\"+existingUsers[index].jctProfileId+\"\\\")'>Reset Password</a></td>\" +\r\n\t\t\t\t\t\t\t\t\"<td align='center' width='50%'><a href='#' onclick='deleteUser(\\\"\"+existingUsers[index].email+\"\\\", \\\"3\\\")'>Delete</a></td></td></tr></table></td></tr>\";\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\tif(parseInt(existingUsers[index].softDelete) == 0) {\r\n\t\t\t\t\ttableStr = tableStr + \"<td align='center' width='50%'><a href='#' onclick='updateStatus(\\\"\"+existingUsers[index].email+\"\\\", \\\"\"+existingUsers[index].softDelete+\"\\\")'> Deactivate</a></td>\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttableStr = tableStr + \"<td align='center' width='50%'><a class='inactivate_style' href='#' onclick='updateStatus(\\\"\"+existingUsers[index].email+\"\\\", \\\"\"+existingUsers[index].softDelete+\"\\\")'> Activate</a></td>\";\r\n\t\t\t\t}\r\n\t\t\t\tif (parseInt(existingUsers[index].activeInactiveStatus) == 1) {\r\n\t\t\t\t\ttableStr = tableStr + \"<td align='center' width='50%'><a href='#' onclick='resetPassword(\\\"\"+existingUsers[index].email+\"\\\", \\\"\"+existingUsers[index].jctProfileId+\"\\\")'>Reset Password</a></td></td><td align='center' width='50%'><a href='#' onclick='deleteUser(\\\"\"+existingUsers[index].email+\"\\\", \\\"1\\\")'>Delete</a></td></tr></table></td></tr>\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttableStr = tableStr + \"<td align='center' width='50%'><span class='non_clickable'>Reset Password</span></td></td><td align='center' width='50%'><a href='#' onclick='deleteUser(\\\"\"+existingUsers[index].email+\"\\\", \\\"1\\\")'>Delete</a></td></tr></table></td></tr>\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcounter = counter + 1;\r\n\t\t}\r\n\t\ttableStr = tableStr + \"</tbody></table>\";\r\n\t\tuserList.innerHTML = tableStr;\r\n\t\t//$(\"table\").tablesorter(); \r\n\t\t$(function(){\r\n\t\t\t $(\"table\").tablesorter({\r\n\t\t\t headers: {\r\n\t\t\t 0: { sorter: false } // disable first column\t\t\t \r\n\t\t\t }\r\n\t\t\t });\r\n\t\t\t});\r\n\t} else {\r\n\t\tdocument.getElementById(\"existingUsersTableId\").innerHTML = \"<div align='center'><br /><br /><br /><img src='../img/no-record.png'><br /><div class='textStyleNoExist'>No Existing Users.</div></div>\";\r\n\t\tdocument.getElementById(\"existingDataListDiv\").style.display=\"none\";\r\n\t}\r\n}", "function user_listing_pageshow() {\n try {\n // Grab some users and display them.\n drupalgap.views_datasource.call({\n 'path': 'drupalgap/views_datasource/drupalgap_users',\n 'success': function(data) {\n // Extract the users into items, then drop them in the list.\n var items = [];\n $.each(data.users, function(index, object) {\n items.push(l(object.user.name, 'user/' + object.user.uid));\n });\n drupalgap_item_list_populate('#user_listing_items', items);\n }\n });\n }\n catch (error) { console.log('user_listing_pageshow - ' + error); }\n}", "function printProfs(data) {\n $('#profTableBody').empty();\n $.each(data.results, function() {\n $('<tr>').attr('id', this.prof_id).appendTo('#profTableBody');\n $('<td>').attr('class', 'text-center align-middle').html(`<img src=\"../images/prof_images/${this.photo_id}.jpg\" style=\"vertical-align: middle;width: auto;height: auto;border-radius: 50%; max-width: 50px; max-height: 50px\">`).appendTo('#'+this.prof_id);\n $('<td>').attr('class', 'text-center align-middle').html(this.prof_id).appendTo('#'+this.prof_id);\n $('<td>').attr('class', 'text-center align-middle').html(this.prof_fname).appendTo('#'+this.prof_id);\n $('<td>').attr('class', 'text-center align-middle').html(this.prof_lname).appendTo('#'+this.prof_id);\n $('<td>').attr('class', 'text-center align-middle').html(this.last_updated).appendTo('#'+this.prof_id);\n $('<td>').attr('class', 'text-center align-middle').html(this.record_created).appendTo('#'+this.prof_id);\n $('<td>').attr('class', 'text-center align-middle').html(`<a onclick=\"delProf(this)\"><i class=\"fas fa-trash\" style=\"font-size: 20px\"></i></a>`).appendTo('#'+this.prof_id);\n });\n}", "function renderUsers(users) {\n users.forEach(function(user) {\n var container = document.createElement('div') // creates an empty div for each user\n // inserts an image for each user - img found in json file\n var img = document.createElement('img')\n img.style = \"float: left; margin-right: 12px;\"\n img.src = user.picture.medium\n container.appendChild(img)\n // inserts user title, name and last name\n var username = document.createElement('h3')\n username.textContent = user.name.title + \" \" + user.name.first + \" \" + user.name.last\n container.appendChild(username)\n // insert cell phone numbers\n var cell = document.createElement('a')\n cell.textContent = user.cell\n cell.href = \"tel:\" + user.cell\n container.appendChild(cell)\n // insert emails\n var email = document.createElement('a')\n email.textContent = user.email\n email.href = \"mailto:\" + user.email\n container.appendChild(email)\n // create a line below each div\n container.appendChild(document.createElement('hr'))\n\n usersEl.appendChild(container)\n })\n}", "function outputUsers(users) {\n userList.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join('')}\n `;\n}", "function usersShow(req, res){\n User.findById(req.params.id, function(err, user){\n if (err) return res.status(404).json({message: 'Something went wrong.'});\n res.render('profile', {user: user});\n });\n}", "render(){\n console.log(\"this props\",this.props.user);\n const {user} = this.props;\n const userTable = user.map((user, i)=>{\n return(\n <tr key={ i }>\n <td>\n {user.name}\n </td>\n <td>\n {user.age}\n </td>\n </tr>)\n })\n console.log(\"usertable\", userTable);\n return(\n <div>\n <h3>See Users</h3>\n <button onClick={this.props.fetchShit}>Fetch users</button>\n <br/>\n <table>\n <tbody>\n {userTable}\n </tbody>\n </table>\n </div>\n )\n }", "function viewEmployees() {\n connection.query(\"SELECT * FROM employee\", function(error, results) {\n if (error) throw error;\n\n // This shows the results in a nice table in the CLI\n console.table(results);\n\n // Goes back to the main menu.\n start();\n })\n}", "function displayUserData(flash) {\n if (user.displayName === null) {\n setTimeout(function() {\n $(\"#user-name\").text(user.displayName);\n }, 200);\n } else {\n $(\"#user-name\").text(user.displayName);\n }\n $(\"#user-rank\").text(flash.val().rank);\n $(\"#user-wins\").text(flash.val().wins);\n $(\"#user-losses\").text(flash.val().losses);\n $(\"#user-games-played\").text(flash.val().gamesPlayed);\n if (player === 1) {\n $(\"#player-name\").text(user.displayName);\n }\n if (player === 2) {\n $(\"#opponent-name\").text(user.displayName);\n }\n}", "static renderUsers(users) {\n if (users.length > 0) {\n return _.sortBy(users, u => u.name).map(user => {\n return <UserListItem key={user._id} user={user}/>;\n });\n } else {\n return <p>There are no users</p>;\n }\n }", "function outputUsers(users) {\n userList.innerHTML = `${users.map(user => `<li><i class=\"fa fa-user-circle\"></i>${user.username}</li>`).join('')}`\n}", "function printTables(membersArray, tbodyId, criteria1, criteria2) {\n let tbody = document.getElementById(tbodyId);\n for (let i = 0; i < membersArray.length; i++) {\n let row = tbody.insertRow(-1);\n let cell1 = row.insertCell(0);\n let element1 = document.createElement(\"td\");\n let firstName = membersArray[i].first_name;\n let middleName = membersArray[i].middle_name;\n let lastName = membersArray[i].last_name;\n let urlMember = membersArray[i].url;\n if (middleName == null) {\n var fullName = `<a href=\"${urlMember}\" target=\"_blank\">${firstName} ${lastName}</a>`;\n } else {\n var fullName = `<a href=\"${urlMember}\" target=\"_blank\">${firstName} ${lastName} ${middleName}</a>`;\n }\n element1.innerHTML = fullName;\n cell1.append(element1);\n\n let cell2 = row.insertCell(1);\n let element2 = document.createElement(\"td\");\n element2.innerHTML = membersArray[i][criteria1];\n cell2.append(element2);\n\n let cell3 = row.insertCell(2);\n let element3 = document.createElement(\"td\");\n element3.innerHTML = membersArray[i][criteria2];\n cell3.append(element3);\n\n }\n}", "function viewEmployee() {\n console.log(\"Viewing all employees\\n\");\n\n var results=connection.query\n (\"SELECT employee.id, employee.first_name, employee.last_name, role.title, department_id AS department, role.salary, employee.manager_id FROM employee, role where employee.role_id = role.id ;\",\n function(error,results)\n {\n\n if(error) throw error;\n\n \n console.table(results)\n console.log(\" All Employees \\n\");\n mainMenu();\n \n })\n\n }", "function viewAllEmployees(promptUser) {\n connection.query(`SELECT emp.id, emp.first_name, emp.last_name, role.title, department.name AS department, role.salary, concat(mng.first_name,' ',mng.last_name) as manager FROM employee emp LEFT JOIN role ON emp.role_id = role.id LEFT JOIN department ON role.department_id = department.id\n LEFT JOIN employee mng ON emp.manager_id = mng.id ORDER BY emp.id`, function (err, data) {\n if (err) throw err;\n console.table(\"\\n\",data);\n promptUser();\n })\n}", "function refreshUserAbsenceTable() {\n $.ajax({\n url: abp.appPath + 'AbsencesManager/GetUserAbsenceTable',\n type: 'GET',\n contentType: 'application/html',\n success: function (content) {\n _$userTable.html(content);\n },\n error: function (e) { }\n });\n }", "function display(heading,data){\n\tvar str=\"\";\n\tstr+='<table width=\"200\" border=\"1\">';\n\tstr+=\"<tr>\";\n\tfor(var col=0;col<heading.length;col++){\n\t\tstr+=\"<th>\"+heading[col]+\"</th>\";\n\t}\n\tstr+=\"</tr>\";\n\tfor(var year=1;year<data.length;year++){\n\t\tstr+=\"<tr>\";\n\t\tstr+=(\"<td>\"+year+\"</td>\");\n\t\tstr+=(\"<td>\"+retirement[year]+\"</td>\");\n\t\tstr+=\"</tr>\";\n\t}\n\tstr+=\"</table>\";\n\treturn str;\n}", "function loadUser(first_name, last_name, role_name) {\n\tif(role_name == \"Administrator\") {\n\t\tbuildHeader(first_name, last_name);\n\t\t$('#adminNav').show();\n\t\t$('#managerNav').show();\n\t\t$('#historyNav').show();\n\t\t$('#employeeNav').show();\n\t\t$('#accountNav').show();\n\t\tloadAdminView();\n }\n\telse if(role_name == \"Manager\") {\n\t\tbuildHeader(first_name, last_name);\n\t\t$('#adminNav').hide();\n\t\t$('#managerNav').show();\n\t\t$('#historyNav').show();\n\t\t$('#employeeNav').show();\n\t\t$('#accountNav').show();\n\t\tloadManagerView();\n\t}\n\telse if(role_name == \"Employee\") {\n\t\tbuildHeader(first_name, last_name);\n\t\t$('#adminNav').hide();\n\t\t$('#managerNav').hide();\n\t\t$('#historyNav').hide();\n\t\t$('#employeeNav').show();\n\t\t$('#accountNav').show();\n\t\tloadEmployeeView();\n }\n}", "function display_allUsers(e){\n\te.preventDefault();\n\n\tconst table = document.getElementById('displaytable')\n\tconst all = document.getElementById('all')\n\tif (table != null) {\n\t\tall.removeChild(table)\n\t}\n\n\tconst form = document.createElement(\"table\")\n\tform.id = \"displaytable\"\n\tform.className = \"table table-bordered\"\n\tform.innerHTML = \"<tbody> <tr> <td class='underline' width='25%'>UserID</td> <td class='underline'width='25%' >Name</td> <td class='underline' width='25%'>Status</td><td width='25%'></td></tr>\"\n\n\n\tconst url = '/users'\n\n\tfetch(url)\n\t.then((res) => {\n\t\tif (res.status === 200) {\n\t\t\treturn res.json()\n\n\t\t} else {\n\t\t\talert(\"Could not get students\")\n\t\t}\n\t})\n\t.then((json) => {\n\t\tjson.data.map((user) => {\n\t\t\tif(user.admin === false){\n\n\t\t\t\tif (user.blocked === false){\n\t\t\t\t\tconst status = \"unblock\"\n\t\t\t\t\tconst status_button = \"<td><button class='block'>block</button></td>\"\n\t\t\t\t\tform.innerHTML += \"<tr><td>\" + user.id + \"</td><td>\" + user.firstName + \" \" + user.lastName + \"</td><td>\" + status + \"</td><td><button class='block btn btn-large btn-primary'>block</button></td> </tr>\"\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tconst status = \"block\"\n\t\t\t\t\tconst status_button = \"<td><button class='unblock'>unblock</button></td>\"\n\t\t\t\t\t\t\t\t\tform.innerHTML += \"<tr><td>\" + user.id + \"</td><td>\" + user.firstName + \" \" + user.lastName + \"</td><td>\" + status + \"</td><td><button class='block btn btn-large btn-primary'>unblock</button></td> </tr>\"\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}).catch((error) => {\n\t\tconsole.log(error)\n\t})\n\n\tform.innerHTML += \"</tbody>\"\n\tall.appendChild(form)\n\tform.addEventListener(\"click\", block_user)\n}" ]
[ "0.6822647", "0.65625274", "0.64036196", "0.6329884", "0.6309466", "0.6295634", "0.6264153", "0.62542564", "0.62435865", "0.61530834", "0.61070764", "0.60975736", "0.60942715", "0.6061517", "0.60541964", "0.6011879", "0.6010335", "0.59755385", "0.5961298", "0.5943502", "0.59331155", "0.5926762", "0.5913877", "0.59067476", "0.58967894", "0.5866923", "0.58500564", "0.58443356", "0.5843451", "0.58325404", "0.5832336", "0.5790957", "0.5790226", "0.57618", "0.5752577", "0.5745145", "0.57105285", "0.56741613", "0.566446", "0.5654906", "0.56541026", "0.5635873", "0.5633652", "0.5613773", "0.5612507", "0.56091624", "0.5608877", "0.55975175", "0.55913687", "0.5585779", "0.5583927", "0.5573287", "0.55728155", "0.5568542", "0.5561645", "0.55570483", "0.5555555", "0.5554039", "0.55366266", "0.55365556", "0.55354893", "0.5525557", "0.5516849", "0.5513662", "0.5510318", "0.5508311", "0.5499698", "0.54963446", "0.54942787", "0.54909515", "0.54872453", "0.54764485", "0.54729724", "0.5464442", "0.5463756", "0.5463756", "0.5463756", "0.54629886", "0.5461992", "0.54570514", "0.5449531", "0.5449157", "0.54481643", "0.5442195", "0.54369986", "0.5436757", "0.54366344", "0.54323196", "0.5429059", "0.54257053", "0.5424094", "0.5423839", "0.54195476", "0.54150254", "0.54147685", "0.54100674", "0.54100585", "0.54093224", "0.54046804", "0.54029477" ]
0.62065786
9
Displays table of students who have not taken exam
function viewNotTakenExam() { highlightCurrent('#viewNotTakenExam'); $('#mytable').bootstrapTable('destroy'); $('#mytable').bootstrapTable({ url: baseURL + 'api/users/readNotTakenExam.php', pagination: true, search: true, showButtonText: true, showSearchClearButton: true, buttonsClass: "ucf", sortName: 'uploadDate', columns: [{ field: 'id', title: 'ID', sortable: 'true' }, { field: 'firstName', title: 'First Name', sortable: 'true' }, { field: 'lastName', title: 'Last Name', sortable: 'true' }, { field: 'uploadDate', title: 'Date Uploaded', sortable: 'true' }, { field: 'examID', title: 'Exam Assigned', formatter: 'examAssignedFormatter', sortable: 'true' }, { field: 'actionA', title: 'Delete', formatter: 'deleteUserFormatter', align: 'center' }] }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasOnlyStudents() {}", "function hideStudents() {\n for (let i = 0; i < students.length; i++) {\n students[i].style.display = 'none';\n }\n}", "function noResults() {\r\n // Get students ul and remove students if no match found\r\n const ul = document.querySelector('.student-list');\r\n ul.innerHTML = '';\r\n\r\n // Create no results message\r\n const text = `No Name Found`;\r\n const noNamesFound = `<li>${text}</li>`;\r\n\r\n // Get pagination ul and remove buttons if no match found\r\n const linkUL = document.querySelector('.link-list');\r\n linkUL.innerHTML = '';\r\n\r\n // Insert message to page\r\n ul.insertAdjacentHTML('beforeend', noNamesFound);\r\n}", "function hidePage() {\r\n for(let i=0; i< students.length; i++) {\r\n students[i].style.display = 'none';\r\n }\r\n}", "function showRegisteredStudents(){\n var students = getDataFromLocalStorage();\n var data = \"\";\n if (students.length == 0){\n data = \"<h3>No Students registered yet..</h3>\"\n } else{\n data += \"<table id='regstudents'><thead><tr>\";\n data += \"<th>#</th>\";\n data += \"<th>USN</th>\";\n data += \"<th>NAME</th>\";\n data += \"<th>EMAIL</th>\";\n data += \"<th>MOBILE</th>\";\n data += \"<th>COURSE</th>\";\n data += \"<th>CGPA</th>\";\n data += \"<th>DOB</th>\";\n data += \"</tr></thead>\";\n \n for (var i = 0; i < students.length; i++){\n var j = i +1;\n data += \"<tr>\";\n data += \"<td>\"+ j + \"</td>\";\n data += \"<td>\"+ students[i].usn + \"</td>\";\n data += \"<td>\"+ students[i].name + \"</td>\";\n data += \"<td>\"+ students[i].email+ \"</td>\";\n data += \"<td>\"+ students[i].mobile + \"</td>\";\n data += \"<td>\"+ students[i].course + \"</td>\";\n data += \"<td>\"+ students[i].cgpa + \"</td>\";\n data += \"<td>\"+ students[i].dob + \"</td>\";\n data += \"</tr>\"\n }\n data += \"</table\"\n \n }\n $(\"#content\").html(data);\n $(\"#regstudents\").dataTable({\n \"pageLength\" : 2\n });\n }", "function noResults() {\n var row = '<tr>' +\n '<td colspan=\"4\">' +\n '<p class=\"no-results\">No results!</p>' +\n '</td>' +\n '</tr>';\n $('#responder_results tbody').html(row);\n }", "addStudentToStudentsExams(exam){\n if(!this.checkIfStudentInExamList(exam.student_id)[0]){\n this.students_exams.push(exam);\n }\n }", "function hideAllStudents() {\n for(let i = 0; i < studentLI.length; i++) {\n studentLI[i].style.display = \"none\";\n }\n}", "function studentsFirstPage() {\n for (let i = 0; i < eachStudent.length; i++) {\n if ( i < studentsPerPage ) {\n eachStudent[i].style.display = '';\n } else {\n eachStudent[i].style.display = 'none';\n }\n }\n}", "function displayList(student) {\n // clear the list\n document.querySelector(\"#list tbody\").innerHTML = \"\";\n student.forEach(displayStudent);\n}", "function displayList(students) {\n document.querySelector(\"#all-students\").innerHTML = \"\";\n if (hasBeenHacked === true) {\n randomizeBloodType();\n students.forEach(displayStudent);\n console.log(\"hacked\");\n } else {\n students.forEach(displayStudent);\n console.log(\"not hacked yet\");\n }\n\n // Display current data for allStudents array (and expelledStudents array)\n document.querySelector(\".students-gryffindor\").textContent = \"Students in Gryffindor: \" + allStudents.filter((student) => student.house === \"Gryffindor\").length;\n document.querySelector(\".students-hufflepuff\").textContent = \"Students in Hufflepuff: \" + allStudents.filter((student) => student.house === \"Hufflepuff\").length;\n document.querySelector(\".students-ravenclaw\").textContent = \"Students in Ravenclaw: \" + allStudents.filter((student) => student.house === \"Ravenclaw\").length;\n document.querySelector(\".students-slytherin\").textContent = \"Students in Slytherin: \" + allStudents.filter((student) => student.house === \"Slytherin\").length;\n\n document.querySelector(\".students-total\").textContent = \"Students in total: \" + allStudents.length;\n document.querySelector(\".students-expelled\").textContent = \"Students expelled: \" + expelledStudents.length;\n}", "function loadExams(){\n $('#exam-content').load('load-exam_content.php');\n $('#info-message').html('');\n hideFirstTD();\n }", "function showStudents(pageNum) {\n\tconst stopNum = pageNum * 10;\n\tconst startNum = stopNum - 10;\n\tlet selectedList = [];\n\n\t//For debuging\n\t//console.log(startNum + \" - \" + stopNum);\n\t\n\t//Looping through all students first to check if they are deselected (if they are hide them), if not they are added to the selected list.\n\tfor (var i = 0; i < studentList.length; i++) {\n\t\tif ($(studentList[i]).hasClass('deselected') === false) {\n\t\t\tselectedList.push(studentList[i]);\n\t\t\t\n\t\t} else {\n\t\t\t$(studentList[i]).css(\"display\", \"none\");\n\n\t\t}\n\t}\n\n\t//the selected list is loop through to find the students for current page.\n\tfor (var i = 0; i < selectedList.length; i++) {\n\t\tif (i < stopNum && i >= startNum) {\n\t\t\t$(selectedList[i]).css(\"display\", \"\");\n\n\t\t}\telse {\n\t\t\t$(selectedList[i]).css(\"display\", \"none\");\n\n\t\t}\n\t}\n\t\n\n}", "showNoExercisesText()\n {\n var row = document.createElement(\"tr\");\n\n var col = document.createElement(\"td\");\n col.innerHTML = \"You haven't added any exercises yet. <a href='#'>Manage exercises</a>\";\n col.className = \"mdl-data-table__cell--non-numeric table-message\";\n col.setAttribute('colspan', 3);\n col.addEventListener('click', event => {\n if (event.target.nodeName === \"A\") {\n this.application.switchToExercises();\n }\n });\n\n row.appendChild(col);\n this.listEl.appendChild(row);\n }", "function renderIncompleteOnboardingTable(noCompliance, noOrientation) {\n $(\"#search-results\").empty();\n let missingOnboardingRequirementsHTML = `<br><h3>Missing onboarding requirements</h3><br>\n <table><thead><tr><th><strong>Missing Requirement</strong></th><th>Name</th>\n </thead><tbody><tr>`;\n\n noCompliance.forEach(function(data) {\n const tableRow = `<tr>\n <th><strong>Compliance training incomplete</strong></th>\n <th>${data.first_name} ${data.last_name}</th></tr>`;\n missingOnboardingRequirementsHTML += tableRow;\n });\n\n noOrientation.forEach(function(data) {\n const tableRow = `<tr>\n <th><strong>Orientation incomplete</strong></th>\n <th>${data.first_name} ${data.last_name}</th></tr>`;\n missingOnboardingRequirementsHTML += tableRow;\n });\n\n missingOnboardingRequirementsHTML += `</tbody></table>`;\n $(\"#search-results\").append(missingOnboardingRequirementsHTML);\n }", "function loadStudentExamData(name, code) {\n document.getElementById('examSpecific').style.display = \"none\";\n document.getElementById('student-exam-data').style.display = \"initial\";\n document.body.style.backgroundImage = \"none\";\n var answer = \"\";\n var finalId;\n\n //linear-gradient(135deg, rgb(245, 247, 250) 0%, rgb(195, 207, 226) 100%);\n\n var table = document.getElementsByClassName('table');\n for(var i = 0; i < table.length; i++) {\n table[i].style.display = \"none\";\n }\n\n firebase.database().ref(\"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem(\"className\") + \"/Students\").once('value', function(snapshot) {\n for(var info in snapshot.val()) {\n var data = snapshot.val()[info];\n var id = data.split(\";\")[0];\n var fullName = data.split(\";\")[1];\n\n if(name == fullName) {\n finalId = id;\n }\n }\n });\n\n firebase.database().ref(\"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem(\"className\") + \"/Exams/\" + code).once('value', function(snapshot) {\n var data = (snapshot.val().responses[name][Object.keys(snapshot.val().responses[name])[0]]);\n\n document.getElementById('resetStatus').onclick = function() {\n for(var takenKey in snapshot.val().taken) {\n var id = (snapshot.val().taken[takenKey]);\n\n if(id == finalId) {\n firebase.database().ref(\"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem(\"className\") + \"/Exams/\" + code + \"/taken/\").child(takenKey).remove()\n }\n }\n\n swal(\"Success!\", name + \"'s taken status has been reset. \" + name + \" should be able to retake exam now.\", 'success')\n }\n\n var studentPoints = data.totalScore / 100 * snapshot.val()[Object.keys(snapshot.val())[0]].examTotalPoints;\n document.getElementById('score-num').innerHTML = (studentPoints).toFixed(0) + \" / \" + snapshot.val()[Object.keys(snapshot.val())[0]].examTotalPoints;\n document.getElementById('score').innerHTML = data.totalScore + \"%\";\n\n var corrAnswer = \"\";\n sessionStorage.setItem(\"totalPointsExcludingFr\", 0);\n\n for(var i = 0; i < Object.keys(data.answers).length; i++) {\n\n if(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].type == \"tf\") {\n corrAnswer = snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].choices[0];\n }\n else if(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].type == \"mc\"){\n corrAnswer = snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].checked;\n }\n else if(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].type == \"fr\") {\n corrAnswer = \"\";\n }\n createGradedQuestion(\n // PARAM: studAnswer\n data.answers[i].split(\";\")[1],\n // PARAM: corrAnswer\n corrAnswer,\n // PARAM: numAnswerChoices\n Object.keys(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].choices).length,\n // PARAM: numPoints\n snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].points,\n // PARAM: questions\n snapshot.val()[Object.keys(snapshot.val())[0]].questions[i],\n // PARAM: studName\n name,\n // PARAM: examCurrentCode\n code,\n // PARAM: examTotalPoints\n snapshot.val()[Object.keys(snapshot.val())[0]].examTotalPoints\n );\n }\n });\n}", "function setAllNamesDisplayNone(){\n for(let i = 0; i < studentList.length; i++){\n studentList[i].style.display = 'none';\n }\n}", "function showStudentFromDatabase() {\n var ObjectStore = db.transaction(\"StudentTable\").objectStore(\"StudentTable\");\n var searchValue = document.getElementById(\"show_student_info\").value;\n\n var table = document.getElementById(\"tableShow\");\n\n ObjectStore.openCursor().onsuccess = function(event) {\n var cursor = event.target.result;\n\n if (cursor) {\n if (cursor.value.Roll !== searchValue) {\n cursor.continue();\n } else {\n var key = cursor.key;\n var value = cursor.value;\n\n var text = \"<table id='showTable' class='showTable'>\";\n text += \"<thead>\";\n text += \"<tr><th style='font-size:16px'>Roll</th>\";\n text += \"<th style='font-size:16px'>Name</th>\";\n text += \"<th style='font-size:16px'>Year</th>\";\n text += \"<th style='font-size:16px'>Semester</th>\";\n text += \"<th style='font-size:16px'>Department</th>\";\n text += \"</tr>\";\n text += \"</thead>\";\n text += \"<tbody>\";\n text += \"<tr><td style='font-size:16px'>\" + value.Roll + \"</td>\";\n text += \"<td style='font-size:16px'>\" + value.Name + \"</td>\";\n text += \"<td style='font-size:16px'>\" + value.Year + \"</td>\";\n text += \"<td style='font-size:16px'>\" + value.Semester + \"</td>\";\n text += \"<td style='font-size:16px'>\" + value.Department + \"</td>\";\n text += \"</tr>\";\n text += \"</tbody>\";\n text += \"</table>\";\n\n if (table.childNodes[0] === \"undefined\") {\n console.log(\"Undefined child\");\n } else {\n console.log(\"Child is present\");\n }\n\n document.getElementById(\"tableShow\").innerHTML = text;\n document.getElementById(\"tableShow\").style.display = \"block\";\n }\n } else {\n console.log(\"No more entries!\");\n text = \"<p class='noDataFound'>No match found for this roll number!</p>\";\n document.getElementById(\"tableShow\").innerHTML = text;\n document.getElementById(\"tableShow\").style.display = \"block\";\n }\n };\n}", "function mostrarExamen(){\n //Recoge la información del formulario\n var nQuestions = getValue('n_questions');\n var typeQuestions = getValue('type_question'); //0 Español-Ingles, 1 Inglés español, 2 aleatorio\n var bAyuda = getValue('with_help'); \n var nGroup = getValue('numberGroup'); \n\n // En caso de seleccionar todas las respuestas\n if (nQuestions == 0) {\n nQuestions = arrayVerb.length;\n }\n\n document.getElementById(\"resultadoFinal\").innerHTML='';\n document.getElementById(\"palabrasCorrectas\").innerHTML='';\n document.getElementById(\"examList\").innerHTML='';\n\n exam = new examen(nQuestions, typeQuestions, bAyuda, nGroup);\n\n addHeaderTable(\"examList\");\n document.getElementById(\"lblMaxGrupos\").innerHTML = \"Max. \" + exam.nTotalGrupo;\n document.getElementById(\"examList\").innerHTML += exam.showExam();\n document.getElementById(\"btnResult\").disabled = false;\n \n}", "function hideList (studentList) {\n for(let i = 0; i < studentList.length; i++)\n studentList[i].style.display = 'none';\n}", "function hideAll(){\n for (let i = 0; i < studentList.length; i ++){\n studentList[i].style.display = 'none';\n}\n}", "function showAll(courseId) {\n // Figure out how many columns we'll need.\n // const term = window.CST_OVERRIDES.terms.find( e => e.course_id === courseId);\n const term = findTermWithCourse(courseId);\n const assignmentCounts = term.students.map( e => e.assignment_overrides.length);\n const maxCols = assignmentCounts.reduce(function(a, b) {\n return Math.max(a, b);\n }, 0);\n\n // Add extra columns if needed.\n const termTable = document.getElementById('term_' + courseId);\n // const dataColumnCount = termTable.rows[1].cells.length - 1;\n const dataColumnCount = termTable.rows[1].cells.length - 2;\n if (maxCols > dataColumnCount) {\n termTable.rows[0].cells[0].colSpan = maxCols + 1;\n for (let i = 0; i < (maxCols - dataColumnCount); ++i) {\n for (let j = 1; j < termTable.rows.length; ++j) {\n termTable.rows[j].insertCell(0);\n }\n }\n }\n\n // Fill body of table with data cells\n for (let i = 1; i < termTable.rows.length; ++i) {\n \n // Observation assignments to display in this row\n let assignments = term.students[i - 1].assignment_overrides;\n \n for (let j = 0; j < maxCols; ++j) {\n // const newCell = termTable.rows[i].insertCell(j);\n\n // Clear any existing data in the cell\n const cell = termTable.rows[i].cells[j];\n let container = getDivChild(cell);\n if (container) {\n cell.removeChild(container);\n }\n\n // Check if this is a cell which should contain assignment data\n if (j < assignments.length) {\n const visibleAssignment = assignments[j];\n\n cell.appendChild(createObsDiv(term.course_id, visibleAssignment, true));\n // cell.appendChild(createObsDivShowAll(term.course_id, visibleAssignment));\n\n // Now that the cell is in place, see if we already have the\n // data to populate it.\n if (visibleAssignment.critiqueit_data) {\n populateAssignmentStatusDiv(term.course_id, visibleAssignment);\n } else {\n // Otherwise, populate it with an AJAX call\n getCritiqueItStatus(term.course_id, visibleAssignment, function() {} );\n }\n\n } // end populating cell containing assignment data\n } // end loop through columns\n } // end loop through rows \n\n hideButtonFromTeacherCandidate(termTable); // 12.21.2018 tps\n}", "function loadTable(students)\r\n{\r\n // Replacing \"true\" and \"false\" strings with \"yes\" and \"no\"\r\n for (var i = 0; i < students.length; i++)\r\n {\r\n students[i].isAdminClean = (students[i].isAdmin === \"1\" ? \"Yes\" : \"No\");\r\n }\r\n let headers = [\"First Name\", \"Last Name\", \"Email\", \"Admin?\"];\r\n let keys = [\"firstname\", \"lastname\", \"email\", \"isAdminClean\"];\r\n let table = makeTable(TABLE_CRUD, headers, keys, students);\r\n table.attr(\"id\", \"studentTable\");\r\n buildSearchAddBar();\r\n $(tableDiv).append(table);\r\n}", "function studentsShow (page) {\n let i = 1\t\n for (let=1; i<= studentsNumber; i +=1){\n \tstudentShow (i,page);\n \t$('ul.student-list').show();\t\n }\n}", "function noUsersFound() {\n numFound.style.display = \"none\";\n userList.style.display = \"none\";\n arrowContainer.style.display = \"none\";\n noResult.style.display = \"flex\";\n alert(`No ${inputString} users found. Please try again!`);\n}", "function studentShow(i,page) {\n\t// Does the student belong to the choosen page?\t\n \tif (studentsData[i-1].group === page) {\n\t// If yes show them\n\n\t\t//Creating a new list\n\t\tlet li = document.createElement('li');\n\t\tul.appendChild(li);\n\t\tli.className = \"student-item cf\";\n\n\t\t/*Defining and appending with the right content div blocks per \n\t\teach new student taht we want to show */\n\t\tlet divOrdinal1 = 2*studentsData[i-1].member-1;\n\t\tlet divOrdinal2 = 2*studentsData[i-1].member;\n\n\t\tlet divNumber1 = 'div'+divOrdinal1;\n\t\tlet divNumber2 = 'div'+divOrdinal2;\n\n\t\tlet div1 = document.createElement(divNumber1);\n\t\tlet div2 = document.createElement(divNumber2);\n\t\tli.appendChild(div1);\n\t\tdiv1.className = \"student-details\";\n\t\tli.appendChild(div2);\n\t\tdiv2.className = \"joined-details\";\n\n\t\t$(div1).append(\"<img class='avatar' src=\" + studentsData[i-1].photo + \">\");\n\t\t$(div1).append(\"<h3> #\" + studentsData[i-1].idnumber + \" \"+ studentsData[i-1].name + \"</h3>\");\t\n\t\t$(div1).append(\"<span class='email'>\" + studentsData[i-1].email + \"</span>\");\n\n\t\t$(div2).append(\"<span class='date'>\" + studentsData[i-1].enrollment + \"</span>\");\n\n\t\t//Erasing any student search that could have been shown previously\t\n\t\t$('divLook').empty();\n\t\t \t};\t\n}", "function getAllStudentsNotEnrolled(){\n\t\t\n\tvar getStudentsSettings={\n\t\t\t\"type\":\"GET\",\n\t\t\t\"async\": true,\n\t\t\t\"dataType\":\"json\",\n\t\t\t\"url\":\"api/student/enrollment?class=unenrolled\",\n\t\t\t\"headers\":{\n\t\t\t\t\"cache-control\":\"no-cache\"\n\t\t\t}\n\t\t};\n\t\t\n\t$.ajax(getStudentsSettings).success(function(response){\n\t\tconsole.log(JSON.stringify(response));\n\t\tif(response.status=='failed' || status=='failed'){\n\t\t\t\n\t\t\t$('.studentListnotEnrolled').html(\"\");\n\t\n\t\t\t$('.noUnenrolled').html(\"\");\n\t\t\tvar appendNotStu='<p class=\"alert alert-warning\">You have not added any students</p>';\n\t\t\t$('.noUnenrolled').append(appendNotStu);\n\t\t}\n\t\n\telse{\n\t\t$('.noUnenrolled').hide();\n\t\t$('.studentListnotEnrolled').html(\"\");\n\t\t//console.log(JSON.stringify(response));\n\t $.each(response, function(key, value){\n\t\t \n\t\t \t\n\t\t\tvar appendData='<tr>'+\n\t\t\t\t\t\t'<td>'+value.f_name+' '+value.l_name+'</td>'+\n\t\t\t\t\t\t'<td>'+value.username+'</td>'+\n\t\t\t\t\t\t'<td>'+value.dob+'</td>'+\n\t\t\t\t\t\t'<td><a data-sid=\"'+value.student_id+'\" class=\"btn btn-xs btn-light editStudent\" href=\"#\" data-target=\"#editStudent\" data-toggle=\"modal\">View</a></td>'+\n\t\t\t\t\t\t'<td><a data-sid=\"'+value.student_id+'\" class=\"btn btn-xs btn-light deleteStudent\" href=\"#\" data-target=\"#deleteStudent\" data-toggle=\"modal\"><i class=\"fa fa-times\"></i></a></td>'+\n\t\t\t\t\t\t'<td><input type=\"checkbox\" data-sid=\"'+value.f_name+' '+value.l_name+'\" value=\"'+value.student_id+'\" class=\"selectUnStudent\" /></td>'+\n\t\t\t\t\t'</tr>';\n\t\t\t$('.studentListnotEnrolled').append(appendData);\n\t\n\t\t\t\n\t\t});\n\t}\n\t\t\n\t\t\n\t\t//enroll student\n\t\t\t$('a.enrollBtn').click( function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\tvar student_id =$(this).attr(\"data-sid\");\n\t\t\t\tenrollStudent(student_id);\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t//mutiple enroll\n\t\t$('button.enrollMultiple').click( function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\t\n\n\t\t\n\t\n\t\t\t$('.notification').hide();\n\t\t\tmultienrollStudent();\n\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\n\t\t\t//delete student\n\t\t\t\t$('a.deleteStudent').click( function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\tvar student_id =$(this).attr(\"data-sid\");\n\t\t\t\tvar elementRemove=$(this).parent().parent();\n\t\t\t\tremoveStudent(student_id, elementRemove);\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\n\t\t\t//veiw individual student details\n\t\t\t$('a.editStudent').click( function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\tvar student_id =$(this).attr(\"data-sid\");\n\t\t\t\t\n\t\t\t\tveiwDetails(student_id);\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t$('#selectAllChildren').click( function(){\n\t\t\t\t\t\n\t\t\t\t\t $('input.selectUnStudent:checkbox').not(this).prop('checked', this.checked);\n\t\t\t\t});\n });\n\t\t\n\t\n\n}", "render() {\n return(\n <div className=\"padded-page\" id=\"adminPage\">\n <h1 style={{ margin: \"1.5rem\", fontSize: \"30px\" }}>Search For Courses</h1>\n <table className=\"table table-hover\">\n <thead className=\"thead-light\">\n <tr>\n <th>Join</th>\n <th>Course Name</th>\n <th>Course Number</th>\n <th>Semester</th>\n <th>Instructor</th>\n </tr>\n </thead>\n <tbody>\n {Object.keys(this.state.courses).length === 0 ? \n <tr>\n <td colSpan=\"5\" style={{fontStyle: \"italic\"}}>No courses found</td>\n </tr> : this.renderTable()\n }\n </tbody>\n </table>\n </div>\n );\n }", "function renderNoResultsError() {\n console.warn(\"BEAUTIFUL IB RESULTS: %s\", \"no results found\");\n\n //get the element within the template which will contain the subjects\n const subject_list = document.querySelector(\".subject-list\");\n //get the error template element\n const template = document.querySelector(\"#template_error\");\n\n //create a clone of the error\n let clone = template.content.cloneNode(true);\n\n //change the error message\n clone.querySelector(\".subject\").textContent = `Oh no, we couldn't find the results!`;\n\n //render the subject\n subject_list.append(clone);\n }", "function displayStudents(perPage, currentPage) {\n\tconst low = ((currentPage * perPage) - perPage)\n\tconst high = (currentPage * perPage)\n\n\tfor (let i = 0; i < numberOfStudents; i++) {\n\t\tif (i < low || i >= high) {\n\t\t\tstudentItems[i].style.display = 'none';\n\t\t}\n\t\tif (i >= low && i < high) {\n\t\t\tstudentItems[i].style.display = 'block';\n\t\t}\n\t}\n}", "function displayExamData(examName) {\n if(!examDataHasLoaded) {\n var cumAvg = 0;\n var classLength = 0;\n var highest = \"a:-1000\";\n var lowest = \"a:1000\";\n var quickest = \"a:1000\";\n var slowest = \"a:-1000\";\n var table;\n var populated = false;\n var standardDeviation = [];\n\n document.getElementById('welcome-div').style.display = \"none\";\n document.getElementById('wrapper').style.display = \"none\";\n document.getElementById('classSpecific').style.display = \"none\";\n document.getElementById('exam-wrapper').style.display = \"none\";\n document.getElementById('examSpecific').style.display = \"initial\";\n document.getElementById('sort-menu').style.display = \"initial\";\n document.getElementById('exam-name').innerHTML = examName;\n document.getElementById('this-exam').innerHTML = examName;\n document.body.style.backgroundImage = \"linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%)\";\n\n var i = document.createElement('i');\n i.className = \"glyphicon glyphicon-circle-arrow-up\";\n i.id = \"topPage\";\n\n i.onclick = function() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n };\n\n document.getElementById('main').appendChild(document.createElement('br'));\n document.getElementById('main').appendChild(i);\n\n var finalSelectedCode = \"\";\n var examCodeWithLetter = \"\";\n\n for (var key in exams) {\n // skip loop if the property is from prototype\n if (!arr.hasOwnProperty(key)) continue;\n var obj = exams[key];\n\n for (var prop in obj) {\n for(var initData in obj[prop]){\n if(obj[prop][initData].examCode != undefined && Object.keys(obj[prop]).length > 1) {\n var code = obj[prop][initData].examCode;\n\n sessionStorage.setItem('populatedExamCode', code);\n\n if(examName == obj[prop][initData].examTitle) {\n finalSelectedCode = code;\n examCodeWithLetter = prop;\n\n document.getElementById('edit-exam').innerHTML = examName;\n document.getElementById('edit-current-exam').style.display = \"initial\";\n\n document.getElementById('edit-current-exam').onclick = function() {\n document.getElementById('create-exam').style.display = \"initial\";\n document.getElementById('main').style.display = \"none\";\n document.body.style.background = \"white\";\n populateExam(finalSelectedCode, \"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem('createExamClass') + \"/Exams/\" + examCodeWithLetter)\n };\n\n document.getElementById('view-item-analysis').style.display = \"initial\";\n document.getElementById('view-item-analysis').onclick = function() {\n document.getElementById('main').style.display = \"none\";\n document.getElementById('item-analysis').style.display = \"inline-block\";\n document.body.style.backgroundImage = \"linear-gradient(to bottom, #6a85b6 0%, #bac8e0 100%)\";\n document.getElementById('item-analysis-name').innerHTML = examName;\n document.getElementById('current-exam').innerHTML = examName;\n populateItemAnalysis(finalSelectedCode, \"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem('createExamClass') + \"/Exams/\" + examCodeWithLetter)\n }\n }\n\n // skip loop if the property is from prototype\n if(!obj.hasOwnProperty(prop)) continue;\n\n var dbName = obj[prop][initData].examTitle;\n if(dbName == \"\") {\n dbName = obj[prop][initData].examCode.substring(1);\n }\n\n if(dbName == examName) {\n var random = document.createElement('div');\n var table = document.createElement('table');\n\n table.id = \"random\";\n table.className = \"table table-striped\";\n table.style.width = \"100vw\";\n\n var init = document.createElement('tr');\n init.style.color = \"darkgray\";\n\n var initName = document.createElement('td');\n initName.innerHTML = \"Name\";\n initName.style.paddingLeft = \"66px\";\n initName.id = \"name\";\n\n var initScore = document.createElement('td');\n initScore.innerHTML = \"Score (%)\"\n initScore.id = \"score\";\n\n var initPercentile = document.createElement('td');\n initPercentile.innerHTML = \"Percentile\";\n initPercentile.id = \"percentile\";\n\n var initTime = document.createElement('td');\n initTime.innerHTML = \"Time\";\n initTime.id = \"time\";\n\n init.appendChild(initName);\n init.appendChild(initScore);\n init.appendChild(initPercentile);\n init.appendChild(initTime);\n\n table.appendChild(init);\n }\n }\n else if(Object.keys(obj[prop]).length > 1 && !populated){\n populated = true;\n\n for(var response in obj[prop].responses){\n var data = obj[prop].responses[response][Object.keys(obj[prop].responses[response])[0]];\n\n standardDeviation.push(parseInt(data.score));\n examData.push(data.name + \":\" + data.score + \":\" + data.time);\n cumAvg += parseInt(data.score);\n classLength = Object.keys(obj[prop].responses).length;\n\n if(parseInt(data.score) > parseInt(highest.split(\":\")[1])) {\n highest = data.name + \":\" + parseInt(data.score);\n }\n\n if(parseInt(data.score) < parseInt(lowest.split(\":\")[1])) {\n lowest = data.name + \":\" + parseInt(data.score);\n }\n\n var tr = document.createElement('tr');\n tr.className = response;\n var examCode = prop;\n tr.onclick = function() { loadStudentExamData(this.className, examCode); }\n\n table.appendChild(document.createElement('br'));\n\n \t\t\tvar name = document.createElement('td');\n name.style.paddingLeft = \"66px\";\n name.id = \"name\";\n \t\t\tvar score = document.createElement('td');\n \t\t\tvar percentile = document.createElement('td');\n var time = document.createElement('td');\n\n \t\t\tname.innerHTML = data.name;\n name.id = \"name\";\n\n \t\t\tscore.innerHTML = data.score + \"%\";\n score.id = \"score\";\n\n time.innerHTML = data.time + \" Mins\";\n time.id = \"time\";\n\n \t\t\tpercentile.innerHTML = getPercentileOriginal(parseInt(data.score), obj[prop].responses, data.name) + \"th\";\n percentile.id = \"percentile\";\n\n \t\t\ttr.appendChild(name);\n \t\t\ttr.appendChild(score);\n \t\t\ttr.appendChild(percentile);\n tr.appendChild(time);\n \t\t\ttable.appendChild(tr);\n\n random.appendChild(table);\n document.getElementById('main').appendChild(random);\n }\n }\n }\n\n var feedback = document.createElement('div');\n feedback.style.marginBottom = \"40px\";\n feedback.appendChild(document.createElement('hr'));\n feedback.appendChild(document.createElement('br'));\n\n var feedbackHeader = document.createElement('h1');\n feedbackHeader.style.fontSize = \"15px\";\n feedbackHeader.style.textAlign = \"center\";\n feedbackHeader.innerHTML = \"Feedback On '\" + document.getElementById('exam-name').innerHTML + \"'\";\n feedbackHeader.style.textDecoration = \"underline\";\n feedback.appendChild(feedbackHeader)\n\n for(data in obj[prop].feedback) {\n var span = document.createElement('span');\n span.innerHTML = (obj[prop].feedback[data]);\n span.style.marginLeft = \"35px\";\n span.style.borderLeft = \"1px solid black\";\n span.style.paddingLeft = \"15px\";\n\n feedback.appendChild(span);\n feedback.appendChild(document.createElement('hr'));\n }\n\n document.getElementById('main').appendChild(feedback);\n }\n }\n\n var overallData = document.getElementById('overall-data');\n var ul = document.createElement('ul');\n ul.style.float = \"right\";\n ul.style.marginRight = \"15vw\";\n\n var avg = document.createElement('li');\n avg.innerHTML = \"Class Average: \" + (cumAvg / classLength).toFixed(1) + '%';\n avg.style.fontSize = \"20px\";\n\n var highestScorer = document.createElement('li');\n highestScorer.innerHTML = \"Highest Scorer: \" + highest.split(\":\")[0] + \" (\" + highest.split(\":\")[1] + \"%)\";\n highestScorer.style.fontSize = \"20px\";\n\n var lowestScorer = document.createElement('li');\n lowestScorer.innerHTML = \"Lowest Scorer: \" + lowest.split(\":\")[0] + \" (\" + lowest.split(\":\")[1] + \"%)\";\n lowestScorer.style.fontSize = \"20px\";\n\n var standardDev = document.createElement('li');\n\n // calculate SD\n mean = standardDeviation.reduce((a,b) => a+b)/standardDeviation.length;\n sd = Math.sqrt(standardDeviation.map(x => Math.pow(x-mean,2)).reduce((a,b) => a+b)/standardDeviation.length);\n\n standardDev.innerHTML = \"Standard Deviation (σ): \" + sd.toFixed(3);\n standardDev.style.fontSize = \"20px\";\n\n ul.appendChild(avg);\n ul.appendChild(highestScorer);\n overallData.appendChild(document.createElement('br'));\n ul.appendChild(lowestScorer);\n ul.appendChild(standardDev);\n\n overallData.appendChild(ul);\n\n }\n else {\n var possibleTables = document.getElementsByClassName('table');\n possibleTables[0].style.display = \"table\";\n\n document.getElementById('topPage').style.display = \"initial\";\n document.getElementById('examSpecific').style.display = \"inherit\";\n document.getElementById('classSpecific').style.display = \"none\";\n document.getElementById('exam-wrapper').style.display = \"none\";\n\n document.body.style.backgroundImage = \"linear-gradient(135deg, rgb(245, 247, 250) 0%, rgb(195, 207, 226) 100%);\";\n }\n examDataHasLoaded = true;\n}", "function showPage(pageStartIndex, pageEndIndex, studentArray, studentArrayLength) {\n errorMsgContainer.innerHTML = \"\";\n hideAllStudents();\n \n if(pageEndIndex <= studentArrayLength) {\n for(let i = pageStartIndex; i <= pageEndIndex; i++) {\n studentArray[i].style.display = \"\";\n }\n } else {\n for(let i = pageStartIndex; i < studentArrayLength; i++) {\n studentArray[i].style.display = \"\";\n }\n }\n}", "function a11yc_empty_table(){\n//console.time('a11yc_empty_table');\njQuery(function($){\n//\tconsole.log('function:'+'a11yc_empty_table');\n\tif(!a11yc_env.is_hide_passed_item) return;\n\n\t// hide disuse items\n\t$('.a11yc form').find('.a11yc_section_guideline, .a11yc_table_check').each(function(){\n\t\tvar $t = !$(this).is('table') ? $(this) : $(this).closest('.a11yc_section_criterion');\n\n\t\tif (!$(this).find('tr:not(.off)')[0]) // 見えているものがない場合\n\t\t{\n\t\t\t\t$t.hide();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(!$t.hasClass('a11yc_dn')) $t.show();\n\t\t}\n\t});\n});\n//\tconsole.timeEnd('a11yc_empty_table');\n}", "function display(){\n\n dom.name.innerHTML = students[studentNum].name;\n dom.address.innerHTML = students[studentNum].address.street + \" \" + students[studentNum].address.city;\n dom.grades.innerHTML = avg();\n\n //after show student1, go to student2\n studentNum++;\n\n if (studentNum == students.length){\n studentNum = 0;\n }\n\n }", "function nullTable() {\n let tbody = document.getElementsByTagName('tbody')[0];\n let tr = tbody.childNodes;\n\n let trHide = []\n\n for (i = 0; i < tr.length; i++) {\n if (tr[i].className === 'hide' || tr[i].getAttribute('type') === 'hide') {\n trHide.push(tr[i])\n }\n };\n\n if (trHide.length === membersInfo.length) {\n\n let tfootP = document.getElementById('null-table-text');\n tfootP.innerHTML = 'Sorry. There is no members that fit your filter criterien.'\n } else {\n let tfootP = document.getElementById('null-table-text');\n tfootP.innerHTML = ''\n };\n}", "function renderResponseEntriesForExercise(tx,results){\n console.log(\"Rendering response entries of all students for exercise \" + exerciseID + \" of lesson \"+ lessonID + \" of teacher \" + teacherID);\n if (results.rows.length == 0) {\n console.log(\"No row found for the query in responseandmark table\");\n $(\"#studentListForEx\").html(\"<p>この練習はだれも答えてないです。</p>\");\n } else {\n var s = \"<table id='studentAndScores'><tr>\";\n console.log(\"Number of responses from students = \" + results.rows.length);\n \n dbShellStudents = window.openDatabase(\"StudentProfile\",2,\"StudentProfile\",1000000);\n \n //open student database\n //get info from StudentProfile database for student_id\n dbShellStudents.transaction(setupTable,dberrorhandler,function(){\n console.log(\"Getting student entries for exercise.\");\n\n dbShellStudents.transaction(\n function(tx){\n// console.log(\"teacher = \" + item.teacher_id + \"student=\" + item.student_id + \"lesson\" + item.lesson_id + \"exercise\" + item.exercise_id + \"response=\" + item.response);\n dbShellStudents.transaction(function(tx){\n for(var i=0; i<results.rows.length; i++) {\n //getting student info\n var student_ID = results.rows.item(i).student_id;\n var responseURI = results.rows.item(i).response;\n var scoreMark;\n if(results.rows.item(i).scoreMark == null)\n scoreMark = -1;\n var studentImageURI;\n var studentName;\n \n var item = results.rows.item(i);\n console.log(\"i=\"+i+\"id=\" + student_ID); //+ \"name=\" + studentName);\n (function(student_ID,scoreMark){\n tx.executeSql(\"select id,name,image from students where id=?\",[student_ID],\n function(tx,res){\n //studentID is unique\n studentImageURI = res.rows.item(0).image;\n studentName = res.rows.item(0).name;\n //\n //show student image, student name and score mark\n s = s +\n \"<div id ='responseFromStudent?id=\" + i + \"'>\"+\n \"<li>\" +\n \"<img height='40' width='40' src=\\\"\" + studentImageURI + \"\\\" ><br>\" +\n \"<p>\";\n \n if(scoreMark != -1){\n s += \"<p> スコアー:\" + scoreMark + \"</p>\";\n }\n \n s +=\"<a href='#response?studentID=\" + student_ID + \"&studentName=\" + studentName +\"'> 学生名:\" + studentName + \"</a>\" +\n \"</p><br>\";\n\n s +=\"</li>\"+\"</div>\";\n\n },\n function(err){\n console.log(\"Student info get Error: \"+err.message + \"\\nCode=\"+err.code);\n alert(\"Student info get Error: \"+err.message + \"\\nCode=\"+err.code);\n }\n );\n\n })(student_ID,scoreMark);\n }//end for\n }\n ,dberrorhandler,\n function(){\n s +=\"</tr>\"+\"</table>\";\n console.log(s);\n console.log(\"Showing the list\");\n $(\"#studentListForEx\").html(s);\n $(\"#studentListForEx\").listview().listview(\"refresh\");\n }\n );\n },\n dberrorhandler\n );\n \n });\n }\n}", "function studentRequired(req, res, next) {\n if (!req.user) return res.status(401).json({ status: 'Please log in' });\n return ldb.one(\n 'SELECT isAdmin, isStudent '\n + 'FROM LearnSQL.UserData WHERE Username = $1',\n [req.user.username],\n )\n .then((user) => {\n if (!user.isadmin && !user.isstudent) {\n return res.status(401).json({ status: 'You are not authorized' });\n }\n return next();\n })\n .catch(() => res.status(500).json({ status: 'Something bad happened' }));\n}", "displayAllStudents() {\n\t\t$(\"#displayArea\").empty();\n\t\tvar studentDetails = Object.keys(this.data);\n\t\t//console.log(\"data\", studentDetails);\n\t\t\n\t\tfor(var key in this.data){\n\t\t\n\t\t\t$(\"#displayArea\").append(this.data[key].render());\n\t\t\t\t\n\t\t}\n\t\tthis.displayAverage();\n\n\t}", "function displayStudent(student) {\n //create clone\n const clone = document.querySelector(\"template#student\").content.cloneNode(true);\n\n //set clone data\n clone.querySelector(\"[data-field=firstname]\").textContent = student.firstName;\n clone.querySelector(\"[data-field=lastname]\").textContent = student.lastName;\n clone.querySelector(\"[data-field=middlename]\").textContent = student.middleName;\n clone.querySelector(\"[data-field=nickname]\").textContent = student.nickName;\n clone.querySelector(\"#profile\").src = \"./images/\" + student.photo;\n clone.querySelector(\"[data-field=house]\").textContent = student.house;\n\n //PREFECT\n if (student.prefect === true) {\n clone.querySelector(\"[data-field=prefect]\").classList.add(\"color\");\n document.querySelector(\".pop\").classList.add(\"color\");\n } else {\n clone.querySelector(\"[data-field=prefect]\").classList.remove(\"color\");\n }\n\n //CLICK PREFECT\n clone.querySelector(\"[data-field=prefect]\").onclick = () => {\n clickAddAsPrefect(student);\n };\n\n //INQ SQUAD\n if (student.inqS === true) {\n clone.querySelector(\"[data-field=inqs]\").classList.add(\"color\");\n } else {\n clone.querySelector(\"[data-field=inqs]\").classList.remove(\"color\");\n }\n\n //CLICK INQS\n clone.querySelector(\"[data-field=inqs]\").onclick = () => {\n clickAddAsInqS(student);\n };\n clone.querySelector(\"#profile\").onclick = () => {\n showStudentDetails(student);\n };\n\n //EXPELL CLICK\n clone.querySelector(\"[data-field=expell]\").onclick = () => {\n expell(student);\n };\n\n function clickAddAsPrefect(student) {\n if (student.prefect === true) {\n student.prefect = false;\n } else {\n prefectToggle(student);\n }\n //UPDATE LIST\n buildList();\n }\n\n function clickAddAsInqS(student) {\n if (student.inqS === true) {\n student.inqS = false;\n } else {\n inqSToggle(student);\n }\n //UPDATE LIST\n buildList();\n }\n //APPEND CLONE TO LIST\n document.querySelector(\".table-body\").appendChild(clone);\n}", "function ShowNotasStudentByMateriaAll(pTeacher, pMateria, pTableMat, pBtnclassByMateria, pGrdRespn) {\n let tableMateriaSel = document.querySelector(`#${pTableMat} tbody`);\n\n db.collection(\"materia\").where(\"materia\", \"==\", pMateria).where(\"profesor\", \"==\", pTeacher)\n .get()\n .then((querySnapshot) => {\n\n tableMateriaSel.innerHTML = \"\";\n querySnapshot.forEach((doc) => {\n // console.log(\"en foreach\", doc.data());\n\n if (pGrdRespn == \"Primer Año Bachillerato\" || pGrdRespn == \"Segundo Año Bachillerato\") {\n tableMateriaSel.innerHTML += cTheader.GetNotasFourPeriodos(doc, pBtnclassByMateria);\n } else {\n tableMateriaSel.innerHTML += cTheader.GetNotasThreePeriodos(doc, pBtnclassByMateria);\n }\n\n });\n\n const btnstoShowStudbytg = document.querySelectorAll(`.${pBtnclassByMateria}`);\n btnstoShowStudbytg.forEach((btn) => {\n btn.addEventListener(\"click\", async (e) => {\n let materia = e.target.dataset.materia;\n let nmTeacherse = e.target.dataset.nmteacher;\n let nmStudent = e.target.dataset.nmstudent;\n let idMatSe = e.target.dataset.idmatselected;\n // ShowAllStudentsByGradeTeacher(dtgrade);\n // titleGradSelected.innerHTML = dtgrade;\n document.getElementById('btnGuardarNotas').dataset.nmmateria = materia;\n document.getElementById('btnGuardarNotas').dataset.nmteacher = nmTeacherse;\n document.getElementById('btnGuardarNotas').dataset.nmstudent = nmStudent;\n document.getElementById('btnGuardarNotas').dataset.idmaterysel = idMatSe;\n console.log(\"clicke teacher=\", nmTeacherse, \"materia= \", materia, \" student= \", nmStudent, \"id selmat\", idMatSe);\n });\n });\n }).catch((error) => {\n console.log(error);\n });\n\n function GetColorNotaPasONo(trunCnot) {\n let valor = ``;\n if (trunCnot >= 5) {\n valor = `<span class=\"text-success\">${truncNota(trunCnot, 2)}</span>`;\n } else {\n valor = `<span class=\"text-warning\">${truncNota(trunCnot, 2)}</span>`;\n }\n return valor;\n }\n}", "practTableSearch(event) {\n\t event.preventDefault();\n\t var searchText = event.currentTarget.value;\n\t var filter = searchText.toUpperCase();\n\t var table = document.getElementById(\"ExamListTable\");\n\t var tr = table.getElementsByTagName(\"tr\");\n\t // Loop through all table rows, and hide those who don't match the search query\n\t if(tr){\n\t for (var i=0; i<tr.length; i++) {\n\t var td = tr[i].getElementsByTagName(\"td\")[1];\n\t if(td) {\n\t // console.log(td.innerHTML.indexOf(filter));\n\t if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {\n\n\t tr[i].style.display = \"\";\n\t } else {\n\t tr[i].style.display = \"none\";\n\t }\n\t }\n\t }\n\t }\n\n\t}", "function genTable(students, start, end){\n\t\n\t// helper arrays for date formatting (might be a good idea to use moment.js)\n\tconst aMonths = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\tconst months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n\tconst days = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n\n\tlet month = [start];\n\tlet day;\n\n\t// generates the date range\n\twhile(start.getTime() < end.getTime()){\n\t\tday = new Date(start);\n\t\tday.setDate(start.getDate()+1);\n\t\tif(day.getDay() != 0 && day.getDay() != 6){\n\t\t\tmonth.push(day);\n\t\t}\n\t\tstart = day;\n\t}\n\n\tlet attendence = [];\n\tlet header = [];\n\theader.push(new Cell(0, 0, \"\", \"Student Name:\", \"\"));\n\tfor(let i=0; i<month.length; i++){\n\t\tlet day = month[i];\n\t\t// header.push(\n\t\t// \tnew Cell(\n\t\t// \t\t0, \n\t\t// \t\ti+1, \n\t\t// \t\t\"\", \n\t\t// \t\t`<abbr title=\"${days[day.getDay()]} ${months[day.getMonth()]} ${day.getDate()}, ${day.getFullYear()}\">${aMonths[day.getMonth()]} ${day.getDate()}</abbr>`, \n\t\t// \t\t\"\"\n\t\t// \t)\n\t\t// );\n\t\theader.push(\n\t\t\tnew Cell(\n\t\t\t\t0, \n\t\t\t\ti+1, \n\t\t\t\t\"\", \n\t\t\t\t`${aMonths[day.getMonth()]} ${day.getDate()}</abbr>`, \n\t\t\t\t\"\"\n\t\t\t)\n\t\t);\n\t}\n\tattendence.push(header);\n\n\tfor(let i=0; i<students.length; i++){\n\t\tlet row = [];\n\t\trow.push(new Cell(i+1, 0, \"\", students[i], \"\"));\n\t\tfor(let j=0; j<month.length; j++){\n\t\t\trow.push(new Cell(i+1, j+1, \"\", \"\", \"\"));\n\t\t}\n\t\tattendence.push(row);\n\t}\n\n\treturn attendence;\n}", "function showAbsenceDetails(nr) {\nif (nr != undefined) {\nelementToCheck = nr;\t\n} else {\nelementToCheck = activeElement;\n}\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == elementToCheck);\n//console.log(activeDataSet);\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSet['ende'])+'</b>';\t\n} else {\ncontent += \" am <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b>\";\t\n}\nanzeige = \"\";\nif (activeDataSet['adminMeldung'] != 0) {\nanzeige = \"Eintrag Sekretariat am: <b>\" + formatDateDot(activeDataSet['adminMeldungDatum'])+'</b><br/>';\t\n}\nif (activeDataSet['lehrerMeldung'] != \"0\") {\n\tif (teacherUser ==1) {\n\taddInfo = activeDataSet['lehrerMeldung'] + \"<b> (\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+')</b><br/>';\t\n\t} else {\n\taddInfo = \"Eintrag Lehrkraft<b> (\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+')</b><br/>';\t\n\t}\n\tanzeige += addInfo;\t\n}\nif (activeDataSet['elternMeldung'] != \"0\") {\nanzeige += \"Eintrag Eltern am: <b>\" + formatDateDot(activeDataSet['elternMeldungDatum'])+'</b>';\t\n}\nif (activeDataSet['kommentar'] != \"\") {\nanzeige += \"<br/>Kommentar: <b>\" + activeDataSet['kommentar']+'</b>';\t\n}\nif (activeDataSet['entschuldigt'] != \"0000-00-00\") {\nanzeige += \"Entschuldigung am: <b>\" + formatDateDot(activeDataSet['entschuldigt'])+'</b>';\t\n}\ncontent += '<br/>' + anzeige;\n\nreturn content;\t\n}", "removeStudentFromStudentsExams(studentID){\n let check = this.checkIfStudentInExamList(studentID);\n if(check[0]){\n this.students_exams.splice(check[1], 1);\n }\n }", "function renderTable() {\n // addstudent();\n // this is the table\n var STDtable = document.getElementById(\"studentinfo\");\n // this is student table data\n var data1 = document.createElement(\"tr\");\n STDtable.appendChild(data1);\n var td = document.createElement('td');\n data1.appendChild(td);\n td.textContent = STD.studentName;\n var td2 = document.createElement('td');\n data1.appendChild(td2);\n td2.textContent = STD.studentId;\n var td3 = document.createElement('td');\n data1.appendChild(td3);\n td3.textContent = STD.gender;\n var td4 = document.createElement('td');\n data1.appendChild(td4);\n td4.textContent = STD.parentId;\n var total = 0;\n //this is the for loop to get each mark in math subject\n for (var j = 0; j < mathMark.length; j++) {\n var td5 = document.createElement('td');\n data1.appendChild(td5);\n td5.textContent = STD.mathMark[j];\n mathTotal += parseInt(STD.mathMark[j]);\n total = total + parseInt(mathMark[j]);\n }\n mathTotal = parseInt(grade1) + parseInt(grade2) + parseInt(grade3);\n\n\n //this is the for loop to get each mark in english subject\n for (var d = 0; d < englishMark.length; d++) {\n var td6 = document.createElement('td');\n data1.appendChild(td6);\n total = total + parseInt(englishMark[d]);\n td6.textContent = STD.englishMark[d];\n }\n englishTotal = parseInt(gradeE1) + parseInt(gradeE2) + parseInt(gradeE3);\n\n\n //this is the for loop to get each mark in science subject\n for (var k = 0; k < scienceMark.length; k++) {\n var td7 = document.createElement('td');\n data1.appendChild(td7);\n td7.textContent = STD.scienceMark[k];\n total = total + parseInt(scienceMark[k]);\n }\n scienceTotal = parseInt(gradeS1) + parseInt(gradeS2) + parseInt(gradeS3);\n\n\n\n var td8 = document.createElement(\"td\");\n data1.appendChild(td8);\n avg = ((mathTotal + englishTotal + scienceTotal)/3);\n td8.textContent = avg;\n // STDtable.deleteRow(-1);\n var td9 = document.createElement(\"td\");\n data1.appendChild(td9);\n td9.setAttribute(\"border-collapse\", \" collapse\");\n td9.textContent = feedBack;\n addStudent.reset();\n // this is to count the number of female students\n if (gender === 'Male') {\n maleTotal++;\n }\n else if (gender === 'Female') {\n femaleTotal++;\n }\n}", "function addstudent(event) {\n event.preventDefault();\n clicks++;\n if (clicks == 1 && !studentString) {\n makingHeader();\n }\n if (clicks >= 1) {\n stdname = event.target.stdname.value;\n studentId = event.target.stdID.value;\n gender = event.target.gender.value;\n parentId = event.target.prntID.value;\n var firtstSub = document.getElementById(\"math\");\n //first subject\n grade1 = event.target.firstExam.value;\n grade2 = event.target.secondExam.value;\n grade3 = event.target.thirdExam.value;\n mathMark = [];\n mathMark.push(grade1, grade2, grade3);\n mathTotal = parseInt(grade1) + parseInt(grade2) + parseInt(grade3);\n\n //second subjiect\n gradeE1 = event.target.FirstExamEnglish.value;\n gradeE2 = event.target.secondExamEnglish.value;\n gradeE3 = event.target.ThirdExamEnglish.value;\n englishMark = [];\n englishMark.push(gradeE1, gradeE2, gradeE3);\n englishTotal = parseInt(gradeE1) + parseInt(gradeE2) + parseInt(gradeE3);\n\n feedBack = event.target.feedback.value;\n //third subject\n gradeS1 = event.target.firstExamScience.value;\n gradeS2 = event.target.secondExamScience.value;\n gradeS3 = event.target.ThirdExamScience.value;\n scienceMark = [];\n scienceMark.push(gradeS1, gradeS2, gradeS3);\n scienceTotal = parseInt(gradeS1) + parseInt(gradeS2) + parseInt(gradeS3);\n avg = ((mathTotal + englishTotal + scienceTotal)/3);\n // avg.push(avg);\n }\n STD = new Student(stdname, studentId, gender, parentId, mathMark, englishMark, scienceMark, feedBack, mathTotal, scienceTotal, englishTotal, avg);\n renderTable();\n updateStudent();\n}", "function clearVisibleStudentArray() {\n visibleStudents = [];\n}", "mapUnreadStudents() {\n\n //var unreadStudents = [];\n //var user = this.state.students;\n //// filtering the this.state.students\n //for (let i = 0; i < user.length; i++) {\n // console.log(\"the user we want: \" , user);\n // if (!user[i].Reports == [0]) {\n // for (let r = 0; r < user[i].Reports.length; r++) {\n // if (user[i].Feedbacks !== [0] && user[i].Feedbacks.length != user[i].Reports.length) {\n // for (let f = 0; f < user[i].Feedbacks.length; f++) {\n // if (user[i].Reports[r].WeeklyReportFormId != user[i].Feedbacks[f].WeeklyReportId) {\n // unreadStudents.push(user[i]);\n // break;\n // }\n // }\n // break;\n // }\n // }\n // }\n //}\n\n const unreadStudents = this.state.students.reduce((newList, item) => {\n if(item.Reports.length > item.Feedbacks.length) newList.push(item)\n return newList;\n \n }, []);\n\n \n // building a list of cards of those student's whose daily reports hasn't been responded \n const studentMap = unreadStudents.map((student, i) => {\n let userInfo = [\n student.Name,\n student.Id,\n student.Location\n ]\n\n return (\n <div className=\"col-sm-4 col-12 page\" key={i}>\n <Link to={`/instructorWeeklyReportResult/${userInfo}`}>\n <div className=\"card\" style={{ height: \"auto\", padding: \"5px\" }}>\n <div className=\"card-block spaCourseBox text-center\">\n <h6>{student.Name}</h6>\n <p>{student.Location || \"not listed\"}</p>\n </div>\n </div>\n </Link>\n </div>\n );\n })\n return studentMap;\n }", "function showCourses()\n{\n var selected = this.departments.indexOf($(\"#department\").val());\n \n if ((0 <= selected) && (selected < this.pages.length))\n {\n // Creates a div containing the department page;\n // this makes it easier for jQuery to look through the page\n var page = this.pages[selected];\n var wrapper = document.createElement(\"div\");\n $(wrapper).html(page);\n \n // Clear the table body\n var tableBody = $(\"#course-list-table > tbody\");\n tableBody.html(\"\");\n \n $(\"tr\", wrapper).each(function()\n {\n columnIndex = 0;\n\t\t\tcrn = 0;\n\t\t\tname = \"\";\n\t\t\tsection = 0;\n title = \"\";\n credits = 0;\n instructor = \"\";\n seats = \"\";\n days = \"\";\n time = \"\";\n room = \"\";\n dates = \"\";\n columnCount = $(\"td\", $(this)).length;\n \n $(\"td\", $(this)).each(function()\n {\n// alert($(this).text());\n // Lectures -- Before Registration\n if (columnCount == 12)\n {\n switch (columnIndex)\n {\n case 1:\n crn = $(this).text();\n break;\n case 2:\n name = $(this).text();\n break;\n case 3:\n section = $(this).text();\n break;\n case 4:\n title = $(this).text();\n break;\n case 5:\n credits = $(this).text();\n break;\n case 6:\n instructor = $(this).text();\n break;\n case 7:\n seats = $(this).text();\n break;\n case 8:\n days = $(this).text();\n break;\n case 9:\n time = $(this).text();\n break;\n case 10:\n room = $(this).text();\n break;\n case 11:\n dates = $(this).text();\n break;\n }\n }\n // Labs -- Before Registration\n else if (columnCount == 11)\n {\n switch (columnIndex)\n {\n case 7:\n days = $(this).text();\n break;\n case 8:\n time = $(this).text();\n break;\n case 9:\n room = $(this).text();\n break;\n case 10:\n dates = $(this).text();\n break;\n }\n }\n \n // Lectures -- After Registration Begins\n if (columnCount == 14)\n {\n switch (columnIndex)\n {\n case 1:\n crn = $(this).text();\n break;\n case 2:\n name = $(this).text();\n break;\n case 3:\n section = $(this).text();\n break;\n case 4:\n title = $(this).text();\n break;\n case 5:\n credits = $(this).text();\n break;\n case 6:\n instructor = $(this).text();\n break;\n case 7:\n seats = $(this).text();\n break;\n case 10:\n days = $(this).text();\n break;\n case 11:\n time = $(this).text();\n break;\n case 12:\n room = $(this).text();\n break;\n case 13:\n dates = $(this).text();\n break;\n }\n }\n // Labs -- After Registration Begins\n else if (columnCount == 13)\n {\n switch (columnIndex)\n {\n case 9:\n days = $(this).text();\n break;\n case 10:\n time = $(this).text();\n break;\n case 11:\n room = $(this).text();\n break;\n case 12:\n dates = $(this).text();\n break;\n }\n }\n\n columnIndex++;\n });\n \n // Create a row in the table for this course\n var row = document.createElement(\"tr\");\n \n // Lectures\n if (crn != 0)\n {\n $(row).append(\"<td>\" + crn + \"</td>\");\n $(row).append(\"<td>\" + name + \"</td>\");\n $(row).append(\"<td>\" + section + \"</td>\");\n $(row).append(\"<td>\" + ((title.indexOf(\"Restriction:\") == -1) ?\n (title) :\n (title.substring(0, title.indexOf(\"Restriction\")) +\n \"<br />\" + title.substring(title.indexOf(\"Restriction\"))))+ \"</td>\");\n $(row).append(\"<td>\" + credits + \"</td>\");\n $(row).append(\"<td>\" + instructor + \"</td>\");\n $(row).append(\"<td>\" + seats + \"</td>\");\n $(row).append(\"<td>\" + days + \"</td>\");\n $(row).append(\"<td>\" + time + \"</td>\");\n $(row).append(\"<td>\" + room + \"</td>\");\n $(row).append(\"<td>\" + dates + \"</td>\");\n $(tableBody).append(row);\n }\n // Labs\n else if ((crn == 0) && (days.length > 0))\n {\n $(row).append(\"<td></td>\");\n $(row).append(\"<td></td>\");\n $(row).append(\"<td></td>\");\n $(row).append(\"<td></td>\");\n $(row).append(\"<td></td>\");\n $(row).append(\"<td></td>\");\n $(row).append(\"<td></td>\");\n $(row).append(\"<td>\" + days + \"</td>\");\n $(row).append(\"<td>\" + time + \"</td>\");\n $(row).append(\"<td>\" + room + \"</td>\");\n $(row).append(\"<td>\" + dates + \"</td>\"); \n $(tableBody).append(row);\n }\n \n first = false;\n });\n }\n}", "function showTable(list) {\n if (list.length > 2) {\n $('#tbSearch').removeAttr('hidden');\n listHandler(list);\n // Remove message of No Result\n noResult(0);\n } else {\n $('#tbSearch').prop('hidden', true);\n cleanRow();\n if ($('#searchQuestion')[0].value != '') {\n // Show message No Result when dont have some register\n noResult(1);\n }\n }\n}", "function showGrades(){\n var student = document.getElementById('show_students').value; \n var ajax = new XMLHttpRequest(); \n ajax.open(\"GET\", \"gradebook.php?load=no&student=\" + student, false);\n ajax.send(null);\n\n // creates a 2d array of grades\n var grades = ajax.responseText;\n grades = grades.split(', ');\n grades.pop();\n\n var table = \"<table style=\\\"margin: 0 auto;border: 2px dotted black\\\">\\n\";\n for(var i=0; i<grades.length; i++){\n var space = grades[i].split(' ');\n table += \"<tr>\\n\";\n table += \"<td>\" + space[0] + \"</td>\\n\";\n table += \"<td>\" + space[1] + \"</td>\\n\";\n table += \"</tr>\\n\";\n }\n document.getElementById('show_grades').innerHTML = table; \n}", "function displayUnsubmittedAssignments(current_course) {\r\n for(var i=0;i<course_list.length;i++){\r\n if(course_list[i] == current_course) {\r\n var assignment_list = course_assign_list[i];\r\n } \r\n }\r\n assignments_section.innerHTML = ``;\r\n var j = 0;\r\n for(var i=0;i<assignment_list.length;i++){ \r\n if(assignment_list[i].status == \"unsubmitted\"){\r\n function isOdd(num) { return num % 2;}\r\n if(isOdd(j) == 1){\r\n var styling = \" bg-light border \";\r\n }\r\n else {\r\n var styling = \" \";\r\n }\r\n j+=1;\r\n if(assignment_list[i].unread) {\r\n var bell = ' <img src=\"images/bell.png\" width=\"30\"> ';\r\n }\r\n else {\r\n var bell = ' '\r\n }\r\n assignments_section.innerHTML += `\r\n <div class=\"row assignment${i+1} pt-3 ${assignment_list[i].color} ${styling}}\">\r\n <div class=\"col-1\">${bell}</div>\r\n <div class=\"col-5\"><p>${assignment_list[i].assignment}</p></div>\r\n <div class=\"col-2\"><p>${assignment_list[i].due_date}</p></div>\r\n <div class=\"col-2\"><p>${assignment_list[i].grade}</p></div>\r\n <div class=\"col-2\">\r\n <img src=\"images/${assignment_list[i].status}.png\" class=\"icons\" width=\"24\" height=\"24\" alt=\"${assignment_list[i].status}!\">\r\n </div>\r\n </div>\r\n `;\r\n }\r\n }\r\n}", "toggleNoResults() {\n\t\tlet max_columns = this.column_name_array.length+1;\n\t\tif (this.total_items === 0) {\n\t\t\tgetComponentElementById(this,\"DataTableBody\").html('<tr id=\"#'+this.getUid()+'_DataTableLoading\"><td' +\n\t\t\t\t' colspan=\"'+max_columns+'\"' +\n\t\t\t\t' style=\"text-align: center;\">No results</td></tr>');\n\t\t\tgetComponentElementById(this,\"DataTableLoading\").show();\n\t\t}\n\t}", "function addAnswersToTable(nextRow, student) {\n let tdString = `<td>${student.name}</td>`\n for(let key in ANSWERS_SUM) {\n tdString += `<td>${student[key]}</td>`\n }\n nextRow.innerHTML += tdString\n}", "function createPage(pageNo, resultsPerPage) {\n let totalStudents = masterList.length;\n let firstStudentOnPage = (pageNo-1)*resultsPerPage;\n let lastStudentOnPage = pageNo*resultsPerPage - 1;\n\n for (let i = 0; i < totalStudents; i += 1) { // first hide all students\n masterList[i].style.display = 'none';\n }\n // then display students on their appopriate page\n if (lastStudentOnPage < totalStudents) {\n for (let i = firstStudentOnPage; i <= lastStudentOnPage; i++) {\n masterList[i].style.display = '';\n }\n }\n else {\n for (let i = firstStudentOnPage; i < totalStudents; i++) {\n masterList[i].style.display = '';\n }\n }\n\n}", "function showExcluded(){\n for(let user of ExclusionUser){\n if(ExclusionUser.length > 0){\n console.info(\"Excluded user: \", user);\n }\n else\n console.warn(\"No excluded people!\");\n }\n}", "function displayError() {\n errorMsgContainer.innerHTML = \"\";\n errorMsg.textContent = \"No results were found.\";\n errorMsgContainer.appendChild(errorMsg);\n studentUL.appendChild(errorMsgContainer);\n }", "function showAbsenceDetails(nr) {\nif (nr != undefined) {\nelementToCheck = nr;\t\n} else {\nelementToCheck = activeElement;\n}\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == elementToCheck);\n\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSet['ende'])+'</b>';\t\n} else {\ncontent += \" am <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b>\";\t\n}\nanzeige = \"\";\nif (activeDataSet['adminMeldung'] != 0) {\nanzeige = \"Eintrag Sekretariat am: <b>\" + formatDateDot(activeDataSet['adminMeldungDatum'])+'</b><br/>';\t\n}\nif (activeDataSet['beurlaubt'] == 0) {\n\tif (activeDataSet['lehrerMeldung'] != \"0\") {\n\tanzeige += \"Meldung Lehrer am: <b>\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+'</b><br/>';\t\n\t}\n\tif (activeDataSet['elternMeldung'] != \"0\") {\n\tanzeige += \"Eintrag Eltern am: <b>\" + formatDateDot(activeDataSet['elternMeldungDatum'])+'</b>';\t\n\t}\n\tif (activeDataSet['entschuldigt'] != \"0000-00-00\") {\n\tanzeige += \"Entschuldigung am: <b>\" + formatDateDot(activeDataSet['entschuldigt'])+'</b>';\t\n\t}\t\n}\nif (activeDataSet['kommentar'] != \"\") {\nanzeige += \"Kommentar: \" + activeDataSet['kommentar'];\t\n}\ncontent += '<br/>' + anzeige;\n\nreturn content;\t\n}", "function passingStudents (grades) {\n let studentGrades = finalLetterGrades(grades)\n return Object.keys(studentGrades).filter(function (student) {\n return studentGrades[student] !== 'F'\n })\n}", "function showRoles() {\n //sql consult select\n connection.query(`SELECT role.title AS job_title,role.id,department.name AS department_name,role.salary FROM role LEFT JOIN department ON role.department_id=department.id`,\n (err, res) => {\n \n if (err) throw err;\n \n if (res.length > 0) {\n console.log('\\n')\n console.log(' ** Roles **')\n console.log('\\n')\n console.table(res);\n }\n //calls the menu to display the question again\n menu();\n });\n }", "function showPage(studentsList,pageNumber){\n hideStudents(studentsList,pageNumber);\n}", "showNoExercisesForTodayText()\n {\n var row = document.createElement(\"tr\");\n\n var col = document.createElement(\"td\");\n col.innerHTML = \"There are no exercises left to do today. <a href='#'>Check schedule</a>.\";\n col.className = \"mdl-data-table__cell--non-numeric table-message\";\n col.setAttribute('colspan', 3);\n col.addEventListener('click', event => {\n if (event.target.nodeName === \"A\") {\n this.application.switchToSchedule();\n }\n });\n\n row.appendChild(col);\n this.listEl.appendChild(row);\n }", "function showScoreTable(id) {\n $('#clrButton').css('display', 'block');\n $('#detailtable').bootstrapTable('destroy'); \n $('#detailtable').bootstrapTable({\n url: baseURL + 'api/results/readByKey.php?key=' + id,\n Striped: true,\n tableSm: true,\n columns: [{\n field : 'id',\n title: 'ID',\n }, {\n field: 'examID',\n title: 'Exam ID'\n }, {\n field: 'questionID',\n title: 'Question ID'\n }, {\n field: 'answered',\n title: 'Answered'\n }, {\n field: 'correctAnswer',\n title: 'Correct Answer'\n }, {\n field: 'seconds',\n title: 'Time (s)'\n }]\n });\n let messageTxt = \"<p><strong>Note: </strong>Answered 'z' means student did not answer that question. \"\n document.getElementById(\"message\").innerHTML = messageTxt;\n $('#message').css('display', 'block');\n}", "async viewQuestionsTable(req, res) {\n const db = await Database()\n const pass = req.body.password\n const adminPassword = await db.get('SELECT * FROM admin')\n if (adminPassword.adminPassword == pass) {\n const questions = await db.all('SELECT * FROM questions')\n res.render('table', { dataTable: questions, tableType: 'questions' })\n } else {\n adminLogged = false\n res.render('parts/passincorrect', { roomId: '/admin' })\n }\n }", "function getAndDisplayStudents() {\n getStudents(displayStudents);\n}", "function showPage(pageNum, studentList) {\r\n\t\t$(li).hide();\r\n\t\tfor (i = 0; i < studentList; i++) {\r\n\t\t\tif ((i >= (pageNum * showPerPage) - showPerPage) && i < (pageNum * showPerPage)) {\r\n\t\t\t\t$(li[i]).show();\r\n\t}}}", "function examtimetable(){\n\n var request= new XMLHttpRequest();\n\n var formData = new FormData();\n\n // retreiving data from html page\n formData.append(\"studentNumber\", sessionStorage.getItem('username'));\n\n //sending post data to external api\n request.open(\"POST\",\"http://127.0.0.1:8000/api/viewExamTimetable\");\n\n // logic for handling received data\n request.onload=function(){\n var data=JSON.parse(request.responseText);\n console.log(data); \n\n //populating table with user data received from database\n for (var i=0;i<data.length;i++) {\n //console.log(i);\n document.getElementById(parseInt(i+1)+ \"x\" + parseInt(1)).innerHTML =data[i]['date'] ;\n document.getElementById(parseInt(i+1)+ \"x\" + parseInt(2)).innerHTML =data[i]['module'] ;\n document.getElementById(parseInt(i+1)+ \"x\" + parseInt(3)).innerHTML =data[i]['venue'] ;\n document.getElementById(parseInt(i+1)+ \"x\" + parseInt(4)).innerHTML =data[i]['period'] ;\n localStorage.setItem(\"exam-\" + parseInt(i+1)+ \"x\" + parseInt(3), String(data[i]['venue']));\n\n\n }\n\n //disabling table elements which have no data so they are not clickable\n for (var i=1; i<6; i++ ){\n for (var j=1; j<5; j++){\n if (!document.getElementById(String(i) +\"x\"+ String(j)).innerHTML){\n document.getElementById(String(i) +\"x\"+ String(j)).onclick=null;\n }\n }\n } \n\n }\n\n\n request.send(formData); \n\n}", "function printTableLeastEngaged() {\n let OrderedMembers = members.sort((a, b) => (a.missed_votes_pct > b.missed_votes_pct) ? 1 : ((b.missed_votes_pct > a.missed_votes_pct) ? -1 : 0));\n for (let i = 0; i < OrderedMembers.length * 0.1; i++) {\n let fila2 = document.createElement(\"tr\");\n let celda2 = document.createElement(\"td\");\n let celda3 = document.createElement(\"td\");\n let celda4 = document.createElement(\"td\");\n celda2.innerHTML = OrderedMembers[i].first_name;\n celda3.innerHTML = OrderedMembers[i].missed_votes;\n celda4.innerHTML = OrderedMembers[i].missed_votes_pct;\n fila2.append(celda2, celda3, celda4);\n presis.append(fila2);\n\n }\n}", "function userTableShowOthers() {\n\tvar tbl = document.getElementById('user-stats-table');\n\tvar row = tbl.rows[0];\n\tvar end = row.cells.length-1;\n\tvar idlast = row.cells[end].id;\n\tif (idlast == \"show_others\") return true;\n\treturn false;\n}", "function renderScoreTable() {\n var currScoreList = UserScoreHelper.getScores();\n // Clear the table \n scoreTableEl.innerHTML = \"\";\n if (currScoreList.length > 0) {\n // Update table with user scores\n for (var index = 0; index < currScoreList.length; index++) {\n var row = createScoreTableRow();\n addColumnToRow(row, (index + 1), true);\n addColumnToRow(row, currScoreList[index].initials);\n addColumnToRow(row, currScoreList[index].score);\n }\n } else {\n // No user scores found - display message to user\n var row = createScoreTableRow();\n var column = addColumnToRow(row, \"No Scores Found\");\n column.setAttribute(\"colspan\", \"3\");\n column.setAttribute(\"class\", \"text-center\");\n }\n}", "render() {\n return (\n <div>\n <h3>Logged Exercises</h3>\n <table className=\"table\">\n <thead className=\"thead-light\">\n <tr>\n <th>Username</th>\n <th>Description</th>\n <th>Duration</th>\n <th>Date</th>\n <th>Actions</th>\n </tr>\n </thead>\n <tbody>\n {this.exerciseList()}\n </tbody>\n </table>\n </div>\n );\n }", "function searchStudents() {\n\t\tclearClass();\n\t\t$('.no-student').hide();\n\t\t$('.student-item').hide();\n\t\tcounter = 0;\n\t\tcount = 1;\n\t\tvar input = $('input').val();\n\t\tinput = input.toLowerCase();\n\t\tif(input.length === 0){\n\t\t\tloadFirstPage();\n\t\t\t\n\t\t}else{\n\t\t\tfor(i = 1; i <=studentItemLength; i++){\n\t\t\t\t\n\t\t\t\tvar name = $('.student-item:nth-child('+ i + ') h3').html();\n\t\t\t\tname = name.toLowerCase();\n\t\t\t\tvar email = $('.student-item:nth-child('+ i + ') .email').html();\n\t\t\t\temail = email.toLowerCase();\n\t\t\t\tvar nameOutput = name.indexOf(input);\n\t\t\t\tvar emailOutput = email.indexOf(input);\n\t\t\t\tif((nameOutput !== -1) || (emailOutput !== -1)){\n\t\t\t\t\tvar item = $('.student-item:nth-child(' + i + ')');\n\t\t\t\t\tcreateClass(item);\n\t\t\t\t\tcounter ++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(counter === 0){\n\t\t\t\t$('.no-student').show();\n\t\t\t}\n\t\t\tnavBar(counter);\n\t\t\tshowStudents(1);\n\t\t\tclickingPageNumber();\n\t\t\t\n\t\t}\n\t\n}", "function allStudentsInfoCallBack(students) {\n\n //successful generation of students\n if (students != null && typeof(students.Error)=='undefined') {\n \n message('#allStudentNo', students.length, 'brown');\n\n //students exist in the database\n if (students.length > 0) {\n message('#spanAllStudents', '', 'black'); //reset to default text color\n \n var output = '<table id=\"allTable\" class=\"table table-striped table-responsive text-center\">';\n output += '<thead> <tr> <th class=\"text-center\">S/N</th> <th class=\"text-center largeFont\">Students\\' Information</th> </tr> </thead> <tbody>';\n \n for (var i = 0; i < students.length; i++) {\n output += '<tr> <td class=\"largeFont\">' + (i + 1) + '</td>';\n output += '<td> <table class=\"table\"> <tbody>';\n output += '<tr class=\"success\"> <td> <em>Name</em></td> <td>' + students[i].LastName + ',&nbsp;' +\n students[i].FirstName + '&nbsp;' + students[i].MiddleName + '</td></tr>';\n output += '<tr class=\"info\"> <td> <em>Matriculation Number</em></td> <td>' + students[i].MatricNo + '</td> </tr>';\n output += '<tr> <td><em>Student Unique ID</em></td> <td>' + students[i]._id + '</td> </tr>';\n output += '<tr> <td> <em>Faculty</em></td> <td>' + students[i].Faculty + '</td> </tr>';\n output += '<tr> <td><em>Department</em></td> <td>' + students[i].Department + '</td> </tr>';\n output += '<tr> <td> <em>Level</em></td> <td>' + students[i].Level + '</td> </tr>';\n output += '<tr> <td> <em>Date of Birth</em></td><td>' + formatDate(students[i].DateOfBirth) + '</td></tr>';\n output += '<tr> <td> <em>Mobile Number</em></td> <td>' + students[i].PhoneNo + '</td> </tr>';\n output += '<tr> <td> <em>Email Address</em></td><td> ' + students[i].Email + '</td></tr>';\n output += '<tr> <td> <em>Date Registered</em></td><td>' + formatDate(students[i].DateReg) + '</td></tr>';\n output += '</tbody> </table> <br/></td> </tr>';\n }\n output += '</tbody></table>';\n \n $('#spanAllStudents').html(output);\n }\n //no student in the database\n else {\n message('#spanAllStudents', 'No Registered Student Available', 'brown');\n $('#spanAllStudents').addClass('fontMsg'); \n }\n }\n\n //exceptional situation from ajax call or from server\n else {\n $('#spanAllStudents').addClass('fontMsg');\n if (students == null) {\n message('#spanAllStudents', ajaxErrMsg, 'red');\n }\n else {\n message('#spanAllStudents', students.Error, 'red');\n } \n }\n}", "function view_table(secid,section)\n{ \n\t$(\"#section_label\").html(section);\n\thidetable('.mark_sheet_table');\n\tshowtable('.student_mark_table');\n\t$.fn.dataTableExt.sErrMode = 'throw';\n\twindow.mark = $('#student_mark_table').dataTable({\n\t\tajax: \"mark/mark_table/\"+clsid+\"/\"+secid,\n\t\tlanguage: {\n\t\t\t\"lengthMenu\": \"_MENU_ Records Per Page\",\n\t\t\t\"zeroRecords\": \"No Mark Sheet Found\",\n\t\t\t\"info\": \"Showing page _PAGE_ of _PAGES_\",\n\t\t\t\"infoEmpty\": \"No records available\",\n\t\t\t\"infoFiltered\": \" -- Filtered from _MAX_ total records\"\n\t\t},\n\t\tdestroy: true,\n\t\tdom: 'Bfrtip',\n\t\tbuttons: [\n\t\t'pdfHtml5',\n\t\t'excelHtml5',\n\t\t'print'\n\t\t],\n\t});\n}", "function showPage(page, studentList) {\n for (let i = 0; i < studentList.length; i += 1) {\n studentList[i].style.display = \"none\";\n }\n for (let i = 0; i < studentList.length; i += 1) {\n if (i >= (page - 1) * 10 && i <= (page * 10) - 1) {\n studentList[i].style.display = \"block\";\n }\n }\n}", "function loadStudent(data) {\n\t\t$(\".js-next-student\").attr(\"data-id\", data[\"id\"]);\n\t\t$(\".js-previous-student\").attr(\"data-id\", data[\"id\"]);\n\t\tvar $student_name = $(\".studentName\").html('');\n\t\t$student_name.append(\"<h3>\" + data.first_name + \" \" + data.last_name + \"</h3>\");\n\t\t\n\t\tvar $classrooms = $(\".studentClassrooms\").html(''); \n\t\tdata['classrooms'].forEach(function(classroom) {\n\t\t\tsubject = classroom.subject\n\t\t\t$classrooms.append(`<tr><td>${subject}`);\n\t\t});\n\t}", "function getStudent() {\n studentString = localStorage.getItem(\"studentinfo\");\n if (studentString ) {\n Student.all = JSON.parse(studentString);\n makingHeader();\n ///---------------------------------------------------------------------------------------\n for (var b = 0; b < Student.all.length; b++) {\n var STDtable = document.getElementById(\"studentinfo\");\n // this is student table data\n var data1 = document.createElement(\"tr\");\n STDtable.appendChild(data1);\n var td = document.createElement('td');\n data1.appendChild(td);\n td.textContent = Student.all[b].studentName;\n var td2 = document.createElement('td');\n data1.appendChild(td2);\n td2.textContent = Student.all[b].studentId;\n var td3 = document.createElement('td');\n data1.appendChild(td3);\n td3.textContent = Student.all[b].gender;\n var td4 = document.createElement('td');\n data1.appendChild(td4);\n td4.textContent = Student.all[b].parentId;\n \n\n\n for (var i = 0; i < 3; i++) {\n\n var td5 = document.createElement('td');\n data1.appendChild(td5);\n td5.textContent = Student.all[b].mathMark[i];\n total = total + parseInt(mathMark[i]);\n mathTotal += parseInt(Student.all[b].mathMark[i])\n\n }\n\n for (var i = 0; i < 3; i++) {\n var td7 = document.createElement('td');\n data1.appendChild(td7);\n td7.textContent = Student.all[b].englishMark[i];\n total = total + parseInt(englishMark[i]);\n englishTotal += parseInt(Student.all[b].englishMark[i]);\n\n }\n\n for (var i = 0; i < 3; i++) {\n var td6 = document.createElement('td');\n data1.appendChild(td6);\n td6.textContent = Student.all[b].scienceMark[i]\n total = total + parseInt(scienceMark[i]);\n scienceTotal += parseInt(Student.all[b].scienceMark[i]);\n }\n\n var td8 = document.createElement(\"td\");\n td8.textContent = Student.all[b].avg;\n data1.appendChild(td8);\n \n\n var td9 = document.createElement(\"td\");\n data1.appendChild(td9);\n td9.setAttribute(\"border-collapse\", \" collapse\");\n td9.textContent = Student.all[b].feedBack;\n\n\n\n }\n\n // STDtable.deleteRow(-1);\n\n\n //----------------------------------------------------------------------------------------- \n }\n}", "function viewStudent(id, name, guardian, occupation, phone, dob, rel, address)\n{\n\t$('#stID').html(id);\n\t$('#stName').html(name);\n\t$('#dob').html(dob);\n\t$('#religion').html(rel);\n\t$('#address').html(address);\n\t$('#gName').html(guardian);\n\t$('#occupation').html(occupation);\n\t$('#phone').html(phone);\n}", "noResultsOnTable() {\n this.membersList.length ? this.noResults = false : this.noResults = true;\n }", "function wrongAnswersRender(score, givenAnswers, correctAnswers, questions) {\r\n if (score === allQuestions.length) return;\r\n const waca = document.querySelector(\".wrong-and-correct-answers\");\r\n waca.classList.remove(\"hidden\");\r\n\r\n givenAnswers.forEach((answer, i) => {\r\n if (answer !== correctAnswers[i]) {\r\n waca.insertAdjacentHTML(\r\n \"beforeend\",\r\n `\r\n <div class=\"waca-question\">\r\n <div class=\"question-number question-number--results\">\r\n Question ${[i + 1]}/15\r\n </div>\r\n\r\n <p class=\"waca-question-text\">${questions[i]}</p>\r\n\r\n <span class=\"answer-label\">Your answer</span>\r\n\r\n <p class=\"waca-answer wrong-answer\">\r\n ${givenAnswers[i]}\r\n <svg class=\"wrong-answer-icon\">\r\n <use xlink:href=\"images/sprite.svg#icon-remove_circle\"></use>\r\n </svg>\r\n </p>\r\n\r\n <span class=\"answer-label\">Correct answer</span>\r\n\r\n <p class=\"waca-answer wrong-answer\">\r\n ${correctAnswers[i]}\r\n <svg class=\"correct-answer-icon\">\r\n <use xlink:href=\"images/sprite.svg#icon-check_circle\"></use>\r\n </svg>\r\n </p>\r\n </div>\r\n `\r\n );\r\n }\r\n });\r\n}", "function showPage(list, page) {\n // if the list is empty, show \"RESULTS NOT FOUND\"\n if (list.length === 0) {\n const p = document.createElement('p');\n const br = document.createElement('br');\n p.textContent = 'RESULTS NOT FOUND';\n const pageDiv = document.querySelector('.page');\n pageDiv.appendChild(br);\n pageDiv.appendChild(p);\n }\n let lastStud = (page * itemsPerPage) - 1;\n let firstStud = (page * itemsPerPage) - 10;\n // loop through all students to only show 10 students depending on page #\n for (i = 0; i < list.length; i++) {\n if (i >= firstStud && i <= lastStud) {\n list[i].style.display = \"\";\n } else {\n list[i].style.display = \"none\";\n }\n }\n}", "function teacherSchd(name, activity, grade,helper){\n\tvar table = document.getElementById(\"teachSchedule\");\n\tvar teachers=['Jennifer Winkler','Leane Sikes','Jackie Holowinski','Jean Rorro',\n\t'Carolyn Cooney','Kim McCloskey','Robert Crescitelli', 'Audrey Mutch',\n\t'Laura Cibbattoni', 'Rebecca Gloede'];\n\tvar formattedActivity=\"\";\n\tswitch(activity) {\n\t\tcase 'free':\n\t\tformattedActivity = 'Free Time';\n\t\tbreak;\n\t\tcase 'outdoor':\n\t\tformattedActivity = ' Outdoor Activity';\n\t\tbreak;\n\t\tcase 'talent':\n\t\tformattedActivity = 'Talent Show';\n\t\tbreak;\n\t\tcase 'crafts':\n\t\tformattedActivity = 'Arts & Crafts';\n\t\tbreak;\n\t\tcase 'group':\n\t\tformattedActivity = 'Group Activity';\n\t\tbreak;\n\t\tcase 'hallway':\n\t\tformattedActivity = 'Hallway Activity';\n\t\tbreak;\n\t\tcase 'kidTeach':\n\t\tformattedActivity = 'Kids Teaching Kids';\n\t\tbreak;\n\t\tdefault:\n\t\tformattedActivity = activity;\n\t\tbreak;\n\t}\n\n\tif(helper === 1){\n\t\t//setup the headers\n\t\tvar header = table.insertRow(-1);\n\t\tfor(teacher in teachers){\n\t\t\tvar head1 = header.insertCell();\n\t\t\thead1.innerHTML = teachers[teacher];\n\t\t}\n\n\t\t//setup table - assume each teacher has no more than 60 students.\n\t\tfor(var r = 0; r < 60; r++){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var t =0; t<10; t++){\n\t\t\t\tvar cell= row.insertCell();\n\t\t\t\tcell.innerHTML =\"\";\n\t\t\t}\n\t\t}\n\t}\n\t//add students to teachers table\n\tswitch(grade) {\n\t\tcase '1w':\n\t\ttable.rows[window.w1].cells[0].innerHTML = name + \": \" + formattedActivity;\n\t\twindow.w1++;\n\t\tbreak;\n\t\tcase '1s':\n\t\twindow.s1++;\n\t\tif(table.rows[window.s1].cells[1].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.s1].cells[1].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.s1].cells[1].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '2h':\n\t\twindow.h2++;\n\t\tif(table.rows[window.h2].cells[2].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.h2].cells[2].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.h2].cells[2].innerHTML = name + \": \" + formattedActivity;\n\n\t\tbreak;\n\t\tcase '2r':\n\t\twindow.r2++;\n\t\tif(table.rows[window.r2].cells[3].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.r2].cells[3].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.r2].cells[3].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '3c':\n\t\twindow.c3++;\n\t\tif(table.rows[window.c3].cells[4].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.c3].cells[4].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.c3].cells[4].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '3m':\n\t\twindow.m3++;\n\t\tif(table.rows[window.m3].cells[5].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.m3].cells[5].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.m3].cells[5].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '4c':\n\t\twindow.c4++;\n\t\tif(table.rows[window.c4].cells[6].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.c4].cells[6].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.c4].cells[6].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '4m':\n\t\twindow.m4++;\n\t\tif(table.rows[window.m4].cells[7].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.m4].cells[7].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.m4].cells[7].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '5c':\n\t\twindow.c5++;\n\t\tif(table.rows[window.c5].cells[8].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.c5].cells[8].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.c5].cells[8].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '5g':\n\t\twindow.g5++;\n\t\tif(table.rows[window.g5].cells[9].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.g5].cells[9].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.g5].cells[9].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\n\t\tdefault:\n\t\talert(\"Error: grade not found: \" + grade);\n\t}\n}", "function showPage (pageNumber, studentList) {\n hideList(studentList);\n for(let i = 1; i <= studentList.length; i++) {\n const li = studentList[i - 1];\n if(i >= getLowerRange(pageNumber) &&\n i <= getUpperRange(pageNumber))\n li.style.display = '';\n }\n}", "function showResults() {\n // variables\n var table, tBody, row, cellDomain, cellRank, cellExplain, i;\n // change the div on display\n document.getElementById('questions').style.display = 'none';\n document.getElementById('rubric').style.display = 'block';\n\n // get the table\n table = document.getElementById('table');\n // create the <tbody>\n tBody = document.createElement(\"tbody\");\n\n // create the cells\n for (i = 0; i < DOMAINS.length; i++) {\n // the row\n row = document.createElement(\"tr\");\n // domain cell\n cellDomain = document.createElement(\"td\");\n cellDomain.appendChild(document.createTextNode(DOMAINS[i]));\n row.appendChild(cellDomain);\n // rank cell\n cellRank = document.createElement(\"td\");\n cellRank.className = \"rank\";\n cellRank.appendChild(document.createTextNode((score[i] + 1) + \"/\" + (QUESTIONS[i].length + 1)));\n row.appendChild(cellRank);\n // explanation cell\n var cellExplain = document.createElement(\"td\");\n if (flagTerminateDomain && score[i] == 2) {\n // \"Skill Communication\" special text\n cellExplain.appendChild(document.createTextNode(STATEMENT_SKILLED_COM_ALT));\n } else {\n // usual text\n cellExplain.appendChild(document.createTextNode(STATEMENTS[i][score[i]]));\n }\n row.appendChild(cellExplain);\n // add the row to the table\n tBody.appendChild(row);\n }\n table.appendChild(tBody);\n}", "function noneInitializations(profile) {\n for (var i = 0; i < profile.length; i++) {\n if (profile[i])\n profile[i].style.display = \"none\"\n }\n} //end of noneInitializations", "render(alunos){\r\n this.tableBody.innerHTML = \"\";\r\n alunos.forEach( aluno =>{\r\n const htmlBody = document.createElement(\"tr\");\r\n let htmlMedias = `<td>${aluno.nome}</td>`;\r\n \r\n let encontrado = false;\r\n\r\n this.materias.forEach( materia =>{\r\n if(materia in aluno.notas){\r\n encontrado = true;\r\n }\r\n })\r\n\r\n if(encontrado){//se tiver faltando uma nota ele pede uma nota n o singulurar\r\n this.materias.forEach( materia =>{\r\n htmlMedias+= `<td>\r\n ${aluno.media[materia] !==undefined ?\r\n aluno.media[materia] :\r\n `<a href =\"edit.html?id=${aluno._id}\">Incluir nota</a>`\r\n }\r\n </td>`\r\n })\r\n //se tiverem faltando as notas todas vai incluir notas\r\n }else{\r\n htmlMedias+= `<td colspan =\"${this.materias.length}\">\r\n <a href=\"edit.html?id=${aluno._id}\">Incluir Notas</a></td>`\r\n }\r\n \r\n \r\n htmlBody.innerHTML = htmlMedias;\r\n this.tableBody.appendChild(htmlBody);\r\n })\r\n \r\n }", "function getTopStudents(){\n\n var iCounter = 0;\n var iCounterInner = 0;\n var sTableBody=\"\";\n var sResult=\"\";\n\n var oTopStudents = oSubject1;\n\n oTopStudents.sort(function (a,b){\n return b.Percentage-a.Percentage;\n });\n\n for(iCounter = 0; iCounter < 5; iCounter++){\n if(oSubject1){\n sTableBody = sTableBody + \"<tr>\";\n for(iCounterInner = 0; iCounterInner < sHeaderList.length; iCounterInner++){\n if(sHeaderList[iCounterInner] !== \"\"){\n var sSubject = oSubject1[iCounter][sHeaderList[iCounterInner].replace(\" \",\"\")];\n if(sSubject){\n sResult = sSubject; \n }\n else{\n sResult = \"NA\";\n }\n sTableBody = sTableBody + \"<td>\" + sResult + \"</td>\";\n }\n }\n sTableBody = sTableBody + \"</tr>\";\n }\n}\nreturn sTableBody;\n }", "function ShowStudentTabel(object)\n{\n var richting = object.innerHTML;\n var tabel;\n\n richting = richting.trim();\n\n\tswitch(richting)\n\t{\n\t\tcase \"BaKo\":\n\t\t tabel = document.getElementsByClassName(\"studentlist\")[0];\n\t\t \n\t\t\tif(tabel.style.display == \"none\")\n\t\t\t{\n\t\t\t\ttabel.style.display = \"block\";\n\t\t\t\tobject.className = \"richtingmin\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttabel.style.display = \"none\";\n\t\t\t\tobject.className = \"richting\";\n\t\t\t}\n\t\tbreak;\n\t\tcase \"BaLo\":\n\t\t\ttabel = document.getElementsByClassName(\"studentlist\")[1];\n\t\t\tif(tabel.style.display == \"none\")\n\t\t\t{\n\t\t\t\ttabel.style.display = \"block\";\n\t\t\t\tobject.className = \"richtingmin\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttabel.style.display = \"none\";\n\t\t\t\tobject.className = \"richting\";\n\t\t\t}\n\t\tbreak;\n\t\tcase \"BaSo\":\n\t\t\ttabel = document.getElementsByClassName(\"studentlist\")[2];\n\t\t\tif(tabel.style.display == \"none\")\n\t\t\t{\n\t\t\t\ttabel.style.display = \"block\";\n\t\t\t\tobject.className = \"richtingmin\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttabel.style.display = \"none\";\n\t\t\t\tobject.className = \"richting\";\n\t\t\t}\n\t\tbreak;\n\t}\n}", "function affichageSysteme()\n\t{\n\t var i = null;\n\t var j = null;\n\t \n\t document.write('<br /><table>');\n\t \n\t for(i = 0; i < this.matrice_systeme.length; i++)\n\t {\n document.write('<tr>');\n\t for(j = 0; j <= this.matrice_systeme[i].length; j++)\n\t {\n\t document.write('<td>');\n\t if(j == this.matrice_systeme[i].length)\n\t {\n\t document.write(' = '+this.second_membre[i]);\n\t }\n\t else\n\t {\n\t if(this.matrice_systeme[i][j] != 0)\n\t\t{\n\t document.write(this.matrice_systeme[i][j] +'<span style=\"color:blue\">a'+ j +'</span>');\n\t\t \n\t\t if(j != this.matrice_systeme[i].length - 1)\n\t\t document.write(' + ');\n\t\t}\n }\n\t document.write('</td>');\n\t }\n\t document.write('</tr>');\n\t } \n\t document.write('</table>');\n\t}", "function apendlist(NoExpelledStuds) {\n document.querySelector(\".listhere\").innerHTML = \"\";\n NoExpelledStuds.forEach(e => {\n const template = document.querySelector(\".studentlist-template\").content;\n const clone = template.cloneNode(true);\n const sname = clone.querySelector(\".studentdetails\");\n const firstname = e.firstName;\n const middleName = e.middleName;\n const lastname = e.lastName;\n sname.innerHTML = firstname + `&nbsp` + middleName + `&nbsp` + lastname;\n clone.querySelector(\".studentdetails\").setAttribute(\"data-id\", e.id);\n document.querySelector(\".listhere\").appendChild(clone);\n });\n clickonStud();\n document.querySelector(\".filter\").click();\n clickonData(\"General\", studentArray);\n clickonFilter();\n}", "function displayUsers(users = []) {\n\n var userCount = users.length;\n\n for (var i = 0; i < userCount; i++) {\n\n var user = users[i];\n\n var userRow = createUserRow(user);\n\n if (user !== null) {\n tableBody.append(userRow);\n }\n }\n}", "function noUniResults() {\n if (!$(\"#uni-results\").children().length > 0) {\n $(\"#uni-results\").append(\"No results found\");\n count = 0;\n }\n }", "function getResponseEntriesForStudent(){\n console.log(\"Getting all exercise response entries for \\\n teacher \" + teacherID +\", lesson \" + lessonID +\" and student \" + studentID);\n dbShellResponsesForStudent.transaction(function(tx){\n tx.executeSql(\"select row_id,teacher_id,student_id,lesson_id,exercise_id,response,scoremark,comment\\\n from responseandmark where teacher_id=? and student_id=? order by lesson_id,exercise_id\",[teacherID,studentID]\n ,renderResponseEntriesForStudent,dberrorhandlerForResponseForStudent);\n },dberrorhandlerForResponseForStudent);\n}", "function isDisplayTableEmpty(){\n\t\tvar table = document.getElementById(\"displayTable\");\n\t\tvar rows = table.getElementsByTagName(\"tr\");\n\t\tif (rows.length > 1) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function displayStudent2(alu){\n\n//var alu = JSON.parse('[{ \"Name\":\"John\", \"Age\":31,\"Gender\":\"Male\",\"Courses\":[{ \"season\":\"Winter\", \"name\":\"CIT-160\", \"finalGrade\":\"A\" },{ \"season\":\"Winter\", \"name\":\"WDD-100\", \"finalGrade\":\"A\" },{ \"season\":\"Fall\", \"name\":\"CIT-230\", \"finalGrade\":\"-A\" },{ \"season\":\"Winter\", \"name\":\"CIT-261\", \"finalGrade\":\"Nothing yet\"}]},{ \"Name\":\"Alfredo\", \"Age\":34,\"Gender\":\"Male\",\"Courses\":[{ \"season\":\"Winter\", \"name\":\"CIT-160\", \"finalGrade\":\"B\" },{ \"season\":\"Winter\", \"name\":\"WDD-100\", \"finalGrade\":\"B\" },{ \"season\":\"Fall\", \"name\":\"CIT-230\", \"finalGrade\":\"B\" },{ \"season\":\"Winter\", \"name\":\"CIT-261\", \"finalGrade\":\"B\"}]}]');\n\n\n\n //read each object inside of Array.\n var y;\n var txt = \"\";\n var txt2 = \"\";\n var txt3 = \"\";\n var stu = \"\";\n\n\n //var stu = \"Name: \"+alu.Name+\" - Age:\"+alu.Age+\" - Gender: \"+alu.Gender;\n for (i=0; i < alu.length;i++){\n for(y in alu[i].Courses){\n //var al = alu[i];\n var stu = \"Name: \"+alu[i].Name+\" - Age:\"+alu[i].Age+\" - Gender: \"+alu[i].Gender+\"<br>\";\n\n\n txt2 += \"Season: \"+alu[i].Courses[y].season+\" - Course: \"+alu[i].Courses[y].name + \" - Final Grade: \"+alu[i].Courses[y].finalGrade+\"<br> \";\n\n //this allows to add the name of the student only one time. \n var cant = (alu[i].Courses.length - 1); \n\n if(y == cant){\n txt3 += \"<strong>\"+stu+\"</strong>\"+\"<br>\"+txt2;\n txt3=txt3+\"<br>\";\n document.getElementById(\"listStu2\").innerHTML = \"<br><br>\"+txt3+\"<br><br>\";\n txt2 = \"\";\n }\n }\n\n }\n\n}", "function quickSearchResults_NoResultsDisplay() {\n $(\"#QuickSearchResultsListContainer_helm\").toggleClass(\"displayNone\", true);\n $(\"#QuickSearchNoResultsWrapper_helm\").toggleClass(\"displayNone\", false);\n }", "function getStudents () {\n\n }", "function doesNotHaveTableContext( qId ) {\n\t//TODO: Should depend on the user's selection in the UI\n\treturn !hasTableContext( qId );\n}", "function highlightFailedCourses(){\n var data = $('#grade-table-javascript').bootstrapTable('getData');\n for(var i in data){\n var table_row = data[i];\n if(table_row.grade[0] === \"F\"){\n $(\"#grade-table-javascript tr[data-index='\"+ i +\"']\").addClass(\"failed-course\");\n }\n }\n }", "function showStudents(pageNumber){\n\t$('.student-item').hide();\n\t$('.page' + pageNumber).fadeIn(1000);\t\n}" ]
[ "0.6052018", "0.5766289", "0.5701835", "0.5616322", "0.56024605", "0.5593164", "0.5545896", "0.5538471", "0.55125475", "0.54600674", "0.5454386", "0.54072183", "0.5399993", "0.537125", "0.5368964", "0.5312058", "0.5309269", "0.53086215", "0.52958196", "0.5293138", "0.5289294", "0.5266002", "0.52386546", "0.5233858", "0.52077025", "0.51992595", "0.5188624", "0.5157951", "0.5157396", "0.51565975", "0.5149606", "0.510555", "0.5103859", "0.510116", "0.5096238", "0.5095193", "0.5080587", "0.5076666", "0.50685287", "0.50678164", "0.5055328", "0.5048272", "0.5041427", "0.502672", "0.502599", "0.5021634", "0.5014206", "0.50069255", "0.5003723", "0.50004154", "0.49844977", "0.4976593", "0.49567416", "0.49496078", "0.49360284", "0.49355733", "0.49347663", "0.4917328", "0.4903326", "0.48974842", "0.4895237", "0.4884872", "0.48782676", "0.48669666", "0.48592478", "0.48563877", "0.48536345", "0.48400006", "0.48397458", "0.48364922", "0.4834682", "0.48346692", "0.48342174", "0.4826645", "0.4814798", "0.4814258", "0.4804593", "0.47983804", "0.4795904", "0.4792743", "0.47838774", "0.4782442", "0.47799495", "0.47759366", "0.47741607", "0.4771385", "0.47668383", "0.4766053", "0.47588617", "0.47512046", "0.4744706", "0.47438422", "0.47436485", "0.4741973", "0.47387326", "0.4737321", "0.47369403", "0.47341496", "0.47301736", "0.4721795" ]
0.5105755
31
Used when displaying students who have taken exam to show links for answer and time logs
function deleteUserFormatter(value, row, index) { return [ '<a href="javascript:void(0)" onclick="deleteUser(\'' + row.id + '\');" title="Delete User">', '<i class="fa fa-trash fa-2x ucf-colors-selected"></i>', '</a> ' ].join('') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showAbsenceDetails(nr) {\nif (nr != undefined) {\nelementToCheck = nr;\t\n} else {\nelementToCheck = activeElement;\n}\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == elementToCheck);\n//console.log(activeDataSet);\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSet['ende'])+'</b>';\t\n} else {\ncontent += \" am <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b>\";\t\n}\nanzeige = \"\";\nif (activeDataSet['adminMeldung'] != 0) {\nanzeige = \"Eintrag Sekretariat am: <b>\" + formatDateDot(activeDataSet['adminMeldungDatum'])+'</b><br/>';\t\n}\nif (activeDataSet['lehrerMeldung'] != \"0\") {\n\tif (teacherUser ==1) {\n\taddInfo = activeDataSet['lehrerMeldung'] + \"<b> (\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+')</b><br/>';\t\n\t} else {\n\taddInfo = \"Eintrag Lehrkraft<b> (\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+')</b><br/>';\t\n\t}\n\tanzeige += addInfo;\t\n}\nif (activeDataSet['elternMeldung'] != \"0\") {\nanzeige += \"Eintrag Eltern am: <b>\" + formatDateDot(activeDataSet['elternMeldungDatum'])+'</b>';\t\n}\nif (activeDataSet['kommentar'] != \"\") {\nanzeige += \"<br/>Kommentar: <b>\" + activeDataSet['kommentar']+'</b>';\t\n}\nif (activeDataSet['entschuldigt'] != \"0000-00-00\") {\nanzeige += \"Entschuldigung am: <b>\" + formatDateDot(activeDataSet['entschuldigt'])+'</b>';\t\n}\ncontent += '<br/>' + anzeige;\n\nreturn content;\t\n}", "function printAns(answer) {\n const TITLE = document.querySelector('#title');\n TITLE.textContent = 'You got: '+RESULTS_MAP[answer].title;\n const RESULT = document.querySelector('#test_result');\n RESULT.textContent = RESULTS_MAP[answer].contents;\n}", "function display(question, target) {\n\tvar d = new Date(question.timestamp);\n\t$(target).append(\"<div class='question click_option' onclick='redirect(\"+question.question_id+\");'>\" +\n\t\t\t\"<p class='qtitle'>\"+question.question_title+\"</p><span class='qauthor'><a href='user_profile.php?id=\"+\n\t\t\tquestion.auth+\"'>\"+question.screenName+\"</a></span><span class='qexcerpt'><pre>\"+excerpt(question.q)+\"</pre></span>\"+\n\t\t\t\"<span class='qstats'>\"+d.toLocaleDateString()+\" | \"+replies(question.replies)+\n\t\t\t\"<span class='tags'>\"+tagLinks(question.tags)+\"</span></span></div>\");\n}", "function renderExamResultDetails(type) {\n console.log('renderExamResultDetails() has been used.');\n \n hideElements(['challenge', 'progress', 'timer']);\n \n showElement('.result');\n\n\n var summary = validateExamAnswers();\n var className;\n var list = questions.answered;\n \n var html = '';\n\n html += '<div class=\"row\">';\n html += ' <div class=\"col mb-3\">';\n html += ' <div class=\"list-group mb-3\">';\n list.forEach(function(item, i) {\n className = item == 'correct' ? 'success' : 'danger';\n if (!type || type == 'common') {\n html += '<a href=\"#\" onclick=\"javascript:backToChallenge('+(i-1)+', \\'result\\', \\'common\\');\" class=\"list-group-item list-group-item-action list-group-item-'+className+'\">'+replaceBBCode(questions.used[i-1].name)+'</a>';\n } else {\n if (type == item) {\n html += '<a href=\"#\" onclick=\"javascript:backToChallenge('+(i-1)+', \\'result\\', \\''+item+'\\');\" class=\"list-group-item list-group-item-action list-group-item-'+className+'\">'+replaceBBCode(questions.used[i-1].name)+'</a>';\n }\n }\n });\n if (type == 'correct' || type == 'wrong') {\n var answered = type == 'correct' ? 'correctly' : 'incorrectly';\n var message = 'Questions answered ' + answered + ' not found.';\n if (summary[type].length == 0) {\n html += '<div class=\"alert alert-warning mb-2\" role=\"alert\">' + message + '</div>';\n }\n }\n html += ' </div>';\n\n html += ' <div class=\"col text-center mb-3\">';\n html += ' <button id=\"exam-results\" onclick=\"javascript:renderExamResult();\" class=\"btn btn-secondary\">' + getMessage('back_to_result', 'Back to exam result') + '</button>';\n html += ' </div>';\n html += '</div>';\n\n html += '</div>';\n\n \n // renderElement('.result', result + '<p class=\"advice\">' + advice + '</p>' + html);\n renderElement('.result', html);\n\n state = 'exam_result_rendered';\n}", "function directUserFromViewInfo() {\n if (nextStep == \"Departments\") {\n viewDepartments();\n }\n if (nextStep == \"Roles\") {\n viewRoles();\n }\n if (nextStep == \"Employees\") {\n viewEmployees();\n }\n if (nextStep == \"All Information\") {\n viewAll();\n } \n }", "function report_ToAnswer_emails() { report_emails( TO_ANSWER_LABEL_NAME, TA_REPORT_LABEL_NAME ); }", "function printExam(event) {\n console.log('printExam() has been used.');\n if ($('#print-button').hasClass('disabled')) {\n return;\n }\n\n console.log('Print event has been triggered.');\n initChallenge(properties['print_questions.skip_ignore_']);\n // generate first questions\n // generateQuestion(questions.used[challenge]);\n hideElement('#exams');\n showElement('.challenge');\n var html = '';\n for (var q in questions.all) {\n html += printQuestion(questions.all[q], parseInt(q));\n }\n\n renderElement('.challenge', html);\n\n // hideElement('#start');\n // hideElement('#print');\n // hideElement('#show-options');\n disableAction('start');\n disableAction('print');\n\n state = 'exam_printed';\n}", "function showQuestions(passQuestion) {\n questionEl.innerText = passQuestion.question;\n answerBtn1.innerText = passQuestion.answers[0].text;\n answerBtn2.innerText = passQuestion.answers[1].text;\n answerBtn3.innerText = passQuestion.answers[2].text;\n answerBtn4.innerText = passQuestion.answers[3].text;\n}", "function showAbsenceDetails(nr) {\nif (nr != undefined) {\nelementToCheck = nr;\t\n} else {\nelementToCheck = activeElement;\n}\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == elementToCheck);\n\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSet['ende'])+'</b>';\t\n} else {\ncontent += \" am <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b>\";\t\n}\nanzeige = \"\";\nif (activeDataSet['adminMeldung'] != 0) {\nanzeige = \"Eintrag Sekretariat am: <b>\" + formatDateDot(activeDataSet['adminMeldungDatum'])+'</b><br/>';\t\n}\nif (activeDataSet['beurlaubt'] == 0) {\n\tif (activeDataSet['lehrerMeldung'] != \"0\") {\n\tanzeige += \"Meldung Lehrer am: <b>\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+'</b><br/>';\t\n\t}\n\tif (activeDataSet['elternMeldung'] != \"0\") {\n\tanzeige += \"Eintrag Eltern am: <b>\" + formatDateDot(activeDataSet['elternMeldungDatum'])+'</b>';\t\n\t}\n\tif (activeDataSet['entschuldigt'] != \"0000-00-00\") {\n\tanzeige += \"Entschuldigung am: <b>\" + formatDateDot(activeDataSet['entschuldigt'])+'</b>';\t\n\t}\t\n}\nif (activeDataSet['kommentar'] != \"\") {\nanzeige += \"Kommentar: \" + activeDataSet['kommentar'];\t\n}\ncontent += '<br/>' + anzeige;\n\nreturn content;\t\n}", "function makeAnswerPage(index, userAns) {\n\tclearTimeout(sessionTime);\n\tclearInterval(intervalID);\n\tif (userAns == questions[index].correct) {\n\t\tnumCorrect++;\n\t\tansCorrect = true;\n\t}\n\telse {\n\t\tnumWrong++;\n\t\tansCorrect = false;\n\t}\n\tpartialClear();\n\tvar correctness = $(\"<h2>\");\n\tvar ansHeading = $(\"<h3>\");\n\tvar expDisplay = $(\"<p>\");\n\tvar answer = $(\"<p>\");\n\tvar c = questions[index].correct;\n\tif (userAns == null) {\n\t\tcorrectness.text(\"TIME'S UP!!!\");\n\t\t$(\"#questDiv\").append(correctness);\n\t\tansHeading.text(\"The correct answer is: \");\n\t\t$(\"#questDiv\").append(ansHeading);\n\t\tanswer.text(questions[index].answers[c]);\n\t\t$(\"#questDiv\").append(answer);\n\t}\n\telse if (ansCorrect == true) {\n\t\t\tcorrectness.text(\"CORRECT!!!\");\n\t\t\t$(\"#questDiv\").append(correctness);\n\t\t}\n\telse {\n\t\taudioEx.play();\n\t\tcorrectness.text(\"WRONG!!!\");\n\t\t$(\"#questDiv\").append(correctness);\n\t\tansHeading.text(\"The correct answer is: \");\n\t\t$(\"#questDiv\").append(ansHeading);\n\t\tanswer.text(questions[index].answers[c]);\n\t\t$(\"#questDiv\").append(answer);\n\t}\n\tvar image = $('<img id=\"answerImg\" src=\"' + questions[index].img + '\">');\n\t$(\"#questDiv\").append(image);\n\n\tif (ansCorrect == false || userAns == null) {\n\t\texpDisplay.text(questions[index].explain);\n\t\t$(\"#questDiv\").append(expDisplay);\n\t}\n\tquestionNum++;\n\tsessionTime = setTimeout(function() {makeQuestionPage(questionNum);}, 1000 * 10);\n}", "function show_answers() {\n $(\".answers\").show(500);\n $(\".result-info\").show(500);\n }", "function goHomeFromExams() {\n document.getElementById('classSpecific').style.display = \"none\";\n document.getElementById('welcome-div').style.display = \"block\";\n document.getElementById('wrapper').style.display = \"grid\";\n document.getElementById('doesNotExist').style.display = \"none\";\n document.getElementById('no-exams').style.display = \"none\";\n document.getElementById('exam-wrapper').style.display = \"none\";\n\n document.body.style.backgroundImage = \"none\"\n\n var examDataHasLoaded = false;\n}", "function populateQuizAnswer(link, answerText) {\n const divId = `crs_${courseId}_quz_${quizId}_stu_${studentId}`;\n const div = document.getElementById(divId);\n if (div) {\n if (link) {\n div.innerHTML = `<A HREF=\"${link}\" TARGET=\"_blank\">${answerText}</A>`;\n } else {\n div.innerText = answerText;\n }\n }\n }", "function showQuestions() {\n if (quizBank.length == questionCounter) {\n endQuiz();\n } else {\n questionDisplay.innerText = quizBank[questionCounter].question;\n showAnswers();\n }\n}", "function showAbsenceDetails_old() {\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == activeElement);\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSet['ende']);\t\n} else {\ncontent += \" am <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b>\";\t\n}\nanzeige = \"\";\nif (activeDataSet['adminMeldung'] != 0) {\nanzeige = \"Eintrag Sekretariat am: \" + formatDateDot(activeDataSet['adminMeldungDatum'])+'<br/>';\t\n}\nif (activeDataSet['lehrerMeldung'] != \"0\") {\nanzeige += \"Meldung Lehrer am: \" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+'<br/>';\t\n}\nif (activeDataSet['elternMeldung'] != \"0\") {\nanzeige += \"Eintrag Eltern am: \" + formatDateDot(activeDataSet['elternMeldungDatum']);\t\n}\nif (activeDataSet['kommentar'] != \"0\") {\nanzeige += \"Kommentar: \" + formatDateDot(activeDataSet['kommentar']);\t\n}\ncontent += '<br/>' + anzeige;\n\nreturn content;\t\n}", "function showResultPage() {\n if (console.log('test completed')) {\n\n //log \"time/score\" to High Scores page//\n\n //Automatically open High Scores HTML//\n\n }\n}", "function displayAnswer(answers) {\n var rows = [];\n answers.forEach(answer => {\n var my_answer = \"postedBy: \" + answer.user_id + \"<br><p>\" + answer.answer_body + \"</p><br>\"\n + \"<span id='actions_\" + answer.answer_id + \"'></span><br/><hr/>\";\n rows.push(my_answer);\n\n });\n rows.push(\"<span id='textarea_display'></span>\");\n document.getElementById('answers').innerHTML = rows.join('');\n showAnswerActions(answers);\n}", "function submitPage(){\n $scope.beginExamClicked = true;\n var testFinishTime=new Date();\n var totalAttempted= 0,totalCorrect=0;\n var questionStatsList=[];\n var questionStats={};\n for(var j=0; j<$rootScope.questions.length;j++){\n \tquestionStats={};\n \tquestionStats.examId=$rootScope.currentExam.examSetId;\n \tquestionStats.userId=$scope.userId;\n \tquestionStats.examDate=getDateTime();\n \tquestionStats.attemptNo=$rootScope.currentExam.currentAttempt;\n\n \tquestionStats.moduleName=getModuleName(j);\n \tquestionStats.questionId=\"question_\"+j;\n \tquestionStats.isCorrect='N';\n \tquestionStats.userAnswer=$rootScope.questions[j].user_selected_option;\n \tquestionStats.correctAnswer=$rootScope.questions[j].correct_option;\n \tquestionStats.score=0;\n \tquestionStats.timeTaken=\"00:00:00\";\n\n if($rootScope.questions[j].user_selected_option!='-1'){\n totalAttempted++;\n if($rootScope.questions[j].user_selected_option==$rootScope.questions[j].correct_option){\n totalCorrect++;\n questionStats.isCorrect='Y';\n questionStats.score=$rootScope.currentExam.correctMarks;\n }else{\n \tif($rootScope.currentExam.isNegativeMarks){\n \t\tquestionStats.score=$rootScope.currentExam.negativeMarks;\n \t}\n }\n questionStats.timeTaken=$rootScope.questions[j].timeTaken;\n }\n\n questionStatsList.push(questionStats);\n }\n $rootScope.currentExam.total_questions_attempted=totalAttempted;\n $rootScope.currentExam.total_questions_correct=totalCorrect;\n\n if($rootScope.currentExam.is_negative_marks_applicable){\n \t$rootScope.currentExam.score_obtained=totalCorrect*$rootScope.currentExam.correct_marks-(totalAttempted-totalCorrect)*$rootScope.currentExam.negativeMarks;\n \t}else{\n \t\t$rootScope.currentExam.score_obtained=totalCorrect*$rootScope.currentExam.correctMarks;\n \t}\n $rootScope.currentExam.total_time_taken=findTimeDifference(testStartTime,testFinishTime);\n\n //update modal & save in DB\n saveExamStats(questionStatsList);\n }", "function displayGrade(event) {\n console.log(questionIndex);\n var correctAnswer = questionArray[questionIndex].correct;\n console.log(correctAnswer);\n if (event.target.textContent === correctAnswer) {\n console.log(\"correct\");\n navigate();\n } else {\n // Adjust timer by -10 seconds\n secondsLeft -= 10;\n navigate();\n }\n}", "function answerTimeOut() {\n\n\t// If there's another question, display it.\n\tif (index < questionsArray.length - 1) {\n\t\tindex++;\n\t\tquestionID = questionsArray[index];\n\t\tgoToNextQuestion();\n\n\t// If there's no more questions, show results.\n\t} else {\n\t\tshowTriviaResults();\n\t}\n}", "getMCQAnswerString() {\n console.log('here in server/db helper');\n var allAnswers = '';\n for (let student in this.students) {\n if ('answer here', this.students[student].MCQAnswer) {\n console.log(this.students[student].MCQAnswer);\n allAnswers = allAnswers.concat(this.students[student].MCQAnswer);\n }\n }\n return allAnswers;\n }", "addStudentToStudentsExams(exam){\n if(!this.checkIfStudentInExamList(exam.student_id)[0]){\n this.students_exams.push(exam);\n }\n }", "function showResult(){\n let titles = [\"Master\",\"Champion\",\"Average\",\"Bad\"]; \n let nrOfCorrects = document.getElementById(\"nrOfCorrectAnswers\");\n let showTitle = document.getElementById(\"title\");\n let username = document.getElementById(\"username\");\n nrOfCorrects.innerHTML = \"You scored \" + \"<span>\" + quiz.correctAnswers + \"</span>\" + \" of\" + \" <span>\" + quiz.maxScore + \"</span>\" + \" points right!\";\n username.innerHTML = quiz.username;\n if(quiz.correctAnswers == quiz.maxScore){\n showTitle.innerHTML = titles[0];\n }\n else if(quiz.correctAnswers > 3){\n showTitle.innerHTML = titles[1];\n }\n else if(quiz.correctAnswers >= 2){\n showTitle.innerHTML = titles[2];\n }\n else if(quiz.correctAnswers < 2){\n showTitle.innerHTML = titles[3];\n }\n}", "function answersQuestionPrint() {\n questionChooser();\n answerChooser(currentQuestion);\n }", "function showAnswer(clicked){\n\n // if answer is correct\n if (clicked.attr(\"id\") === questionArr[questionIndex].answer[0]) {\n\n correctA++;\n\n // display\n $(\"#question-panel\").html(\"CORRRRRECT! The answer is... \" + \"<em>\" + questionArr[questionIndex].answer[1] + \"</em>\");\n clicked.addClass(\"correct\");\n console.log(\"Plankton voice: CORRRREECT!\");\n\n }\n\n // if answer is false\n else {\n\n incorrectA++;\n\n // display\n $(\"#question-panel\").html(\"Tartar sauce! The correct answer was... \" + \"<em>\" + questionArr[questionIndex].answer[1] + \"</em>\");\n clicked.addClass(\"incorrect\");\n $(\"#\" + questionArr[questionIndex].answer[0]).addClass(\"correct\");\n console.log(\"Dwight Schrute voice: FALSE!\");\n\n }\n\n // delay on next question so you have time to read answer\n setTimeout(function() {\n\n questionIndex++;\n renderQuestion();\n console.log(\"Answer displayed\", questionIndex);\n\n }, 3500);\n\n }", "function showResults(answer) {\n if (answer === questions[questionIndex].answer) {\n resultsEl.textContent = \"Correct!\";\n count++;\n } else {\n resultsEl.textContent = \"Incorrect!\";\n time = time - 5;\n timerEl.textContent = time;\n }\n setTimeout(nextQuestion, 1000);\n}", "function answer_student(id) {\n var parser = document.createElement('a');\n parser.href = window.location.href;\n var ta = parser.pathname.split('/')[2];\n socket.emit('remove_student_answer', {net_id: id.id, ta:ta});\n socket.emit('answer_student', {\"net_id\":id.id, \"ta\": ta});\n\n}", "function displayQuestions() {\n //gets the current question from global variable currentQuestion\n // display a question\n currentQuestion++;\n $(\".questions\").text(triviaQuestions[currentQuestion].questions);\n }", "function displayAdvice()\n {\n // Calculate error rate (in percent)\n var error = Math.round(my.current.errorRate)\n\n var repeatSubunit = error > 0\n\n // Update remark and advice\n var anchorElement = document.createElement('a')\n if (repeatSubunit) {\n Util.addChildren(my.html.remark, 'Reduce error')\n my.html.remark.title = 'Your error rate should not ' +\n 'exceed 0%.'\n\n Util.addChildren(anchorElement, 'Try again')\n anchorElement.href = '#restart'\n anchorElement.title = 'Please practice this lesson again.'\n } else {\n Util.addChildren(my.html.remark, 'Well done!')\n my.html.remark.title = 'You have satisfactorily ' +\n 'completed this lesson.'\n\n Util.addChildren(anchorElement, 'Next lesson')\n anchorElement.href = '#next'\n anchorElement.title = 'Please proceed with the next lesson.'\n }\n\n // Do not display 'Next lesson' advice if the user is at the\n // last subunit; display advice otherwise\n if (repeatSubunit || !currentSubunitIsTheLastSubunit()) {\n my.html.advice.appendChild(anchorElement)\n anchorElement.focus()\n }\n }", "function showQuestion() {\n if (questionCount === questionsObj.length) {\n stop();\n }\n else {\n $(\"#question\").html(questionsObj[questionCount].question);\n $(\"#answer1\").html(questionsObj[questionCount].choices[0]);\n $(\"#answer2\").html(questionsObj[questionCount].choices[1]);\n $(\"#answer3\").html(questionsObj[questionCount].choices[2]);\n $(\"#answer4\").html(questionsObj[questionCount].choices[3]);\n questionTime = 5;\n }\n }", "function showAnswerDefault () {\n\n incorrectA++;\n\n // display\n $(\"#question-panel\").html(\"Fish paste! The correct answer was... \" + \"<em>\" + questionArr[questionIndex].answer[1] + \"</em>\");\n $(\"#\" + questionArr[questionIndex].answer[0]).addClass(\"correct\");\n console.log(\"Dwight Schrute voice: NO ANSWER GIVEN!\");\n\n // delay on next question so you have time to read answer\n setTimeout(function() {\n\n questionIndex++;\n renderQuestion();\n\n }, 3500);\n\n }", "function showAnswers(container, answers) {\n container.empty();\n var i = 1;\n answers.forEach(function (a) {\n // FIXME: also deal with < > &\n text = a.text.replace(/\"/g, \"&#34;\");\n container.append('<li id=i class=\"answer\"><a href=\"#answer-description\">' + text + '<span class=\"ui-li-count\">' + (a.confidence * 100).toFixed(1) + '%</span></a></li>'\n\n /*'<tr><td class=\"i\">' + i + '.</td>'\n + '<td class=\"text\" title=\"' + text + '\">' + text + '</td>'\n + '<td class=\"scorebar\">' + /*score_bar(a.confidence)+*//*'</td>'\n + '<td class=\"score\">' + (a.confidence * 100).toFixed(1) + '%</td></tr>'*/);\n $(\"#answers\").listview().listview(\"refresh\");\n getAnswerDescription(i, answers);\n i++;\n });\n}", "function renderReviewResult() {\n console.log('renderExamResult() has been used.');\n\n hideElements(['challenge']);\n \n showElement('.result');\n\n var column = Math.ceil(questions.used.length / 3);\n \n var html = '';\n var answered = questions.exam.filter(el => el != undefined).length;\n var missing = questions.used.length - answered;\n var marked = questions.marked.filter(el => el == true).length;\n var onclick, ignored;\n\n html += '<div class=\"container\">';\n html += '<div>' + getMessage('answered_in_total', 'Answered in total') + ': <strong>'+answered+'</strong></div>';\n html += '<div>' + getMessage('missing_answers', 'Missing answers') + ' : <strong>'+missing+'</strong></div>';\n html += '<div>' + getMessage('marked_for_review', 'Marked for review') + ': <strong>'+marked+'</strong></div>';\n html += '<div class=\"row\">';\n for (var q in questions.used) {\n q = parseInt(q);\n if (q % column == 0) {\n html += '<div class=\"col-sm-4\">';\n }\n var answers = [];\n for (var ans in questions.exam[q+1]) {\n if (questions.exam[q+1][ans] == true) {\n answers.push(letters[ans].toUpperCase());\n }\n }\n var markedForReview = questions.marked[q] ? '*' : '';\n onclick = 'onclick=\"javascript:backToChallenge(this.getAttribute(\\'data-id\\'));\"';\n ignored = (questions.used[q].params.status && questions.used[q].params.status == 'ignored') ? '<span class=\"badge badge-danger\">'+getMessage('ignored', 'Ignored')+'</span>' : '';\n\n html += '';\n html += '<div>';\n html += ' <a id=\"r'+q+'\" href=\"#\" data-id=\"'+q+'\" '+onclick+' class=\"review-question\">'+(q+1)+'. '+answers.join(', ')+' '+markedForReview + ignored + '</a>';\n html += '</div>';\n if ((q+1) % column == 0) {\n html += '</div>';\n }\n }\n html += '</div>';\n html += '</ul>';\n\n // html += '<button id=\"additional-review\" onclick=\"javascript:backToChallenge(challenge);\" class=\"btn btn-secondary\">back to challenge</button>';\n\n renderElement('.result', html);\n}", "function ansSelection(event){\n event.preventDefault();\n \n if(event.target.matches(\"li\")){\n userId = event.target.id;\n var userAns = arrQues[k].options[userId];\n if(typeof userId !== \"undefined\"){\n resultDisplay.textContent = \"\";\n \n if(userAns === arrQues[k].a){ \n resultDisplay.textContent = \"Hurray Correct!!\"\n resultDisplay.setAttribute(\"style\", \"background-color:green; margin: 8px; width:150px; font-size: 20px;\");\n \n score = score+10; \n }else{ \n resultDisplay.textContent = \"Oops Wrong!!\"\n resultDisplay.setAttribute(\"style\", \"background-color:red; margin: 8px; width:150px; font-size: 20px;\"); totalSeconds = totalSeconds - 10;\n \n }\n k++;\n \n }\n \n // StartQuiz is being called to display successive questions\n startQuiz();\n if(liCount === arrQues.length){\n showResults();\n }\n liCount++;\n \n } \n}", "function getSingleReportDisplay(standupReport) {\n var report = \"*\" + standupReport.userName + \"* did their standup at \" + standupReport.datetime + \"\\n\";\n report += \"_What did you work on yesterday:_ `\" + standupReport.yesterdayQuestion + \"`\\n\";\n report += \"_What are you working on today:_ `\" + standupReport.todayQuestion + \"`\\n\";\n report += \"_Any obstacles:_ `\" + standupReport.obstacleQuestion + \"`\\n\\n\";\n return report;\n}", "displayUserView() {\n const questionnaire = this.props.questionnaire\n\n return(\n <div className=\"questionnaire-row\">\n <Link to={`/questionnaires/${questionnaire.id}`}\n onClick={ () => { this.props.fetchQuestionnaire(questionnaire.id) }}\n >\n <h3>\n { questionnaire.attributes.name }\n </h3>\n </Link>\n </div>\n )\n }", "function showAnswers(){\t\n\t\tvar rightAnswers = 0;\n\t\tvar wrongAnswers = 0;\n\t\tvar userInput1 = $('#a1 input:checked').val();\n\t\tvar userInput2 = $('#a2 input:checked').val();\n\t\tvar userInput3 = $('#a3 input:checked').val();\n\t\tvar userInput4 = $('#a4 input:checked').val();\n\t\tvar userInput5 = $('#a5 input:checked').val();\n\t\tif (userInput1 === 'quail'){\n\t\t\trightAnswers++;\n\t\t}\n\t\telse {\n\t\t\twrongAnswers++;\n\t\t}\n\t\tif (userInput2 === 'frog') {\n\t\t\trightAnswers++;\n\t\t}\n\t\telse {\n\t\t\twrongAnswers++;\n\t\t}\n\t\tif (userInput3 === 'bear') {\n\t\t\trightAnswers++;\n\t\t}\n\t\telse {\n\t\t\twrongAnswers++;\n\t\t}\n\t\tif (userInput4 === 'avacado') {\n\t\t\trightAnswers++;\n\t\t}\n\t\telse {\n\t\t\twrongAnswers++;\n\t\t}\n\t\tif (userInput5 === 'artichoke') {\n\t\t\trightAnswers++;\n\t\t}\n\t\telse {\n\t\t\twrongAnswers++;\n\t\t}\n\t\tconsole.log('Input1:' + userInput1);\n\t\tconsole.log('Input2: ' + userInput2);\n\t\tconsole.log('Input3: ' + userInput3);\n\t\tconsole.log('Input4: ' + userInput4);\n\t\tconsole.log('Input5: ' + userInput5);\n\t\tconsole.log('Right Answers: ' + rightAnswers);\n\t\tconsole.log('Wrong Answers: ' + wrongAnswers);\n\t\t$('#time').remove();\n\t\t$('#submitButton').remove();\n\t\t$('#formQuestions').remove();\n\t\t$('#questions').html('<div id=\"results\">Results</div>');\n\t\t$('#questions').html(\"<div>\" + 'Right Answers: ' + rightAnswers + \"</div>\");\n\t\t$('#questions').append(\"<div>\" + 'Wrong or Empty Answers: ' + wrongAnswers + \"</div>\");\n\n\t}", "function ask(question) {\n console.log(this.teacher, question);\n}", "function nextQuestion(){\n previousQuestion = document.querySelector(\".\" + sectionArray[nextSectionIndex]);\n previousQuestion.style.display = \"none\";\n\n nextQuestionIndex++;\n nextSectionIndex++;\n \n // When the user gets to the last question, final score section will display. Otherwise, displays another question from the list in object\n if(nextQuestionIndex === lastQuestionIndex) {\n finalScoreMessage();\n } else {\n questionList();\n } \n}", "function show(index){\n //simple function to show the quiz according to the choice of user\n Quizfact.getbyid(index); //Get the data by category of quiz\n\n\n}", "renderReadableQs() {\n const {\n questions,\n answers,\n } = this.props;\n\n if (answers.length) {\n return (\n <div>\n { this.renderSubviewHeaders(QUESTIONS_SUB_HEADER, ANSWERS_SUB_HEADER) }\n { questions.map((q, i) => (\n <li key={ q.id }>\n <div className=\"qa-section\">\n <div className=\"subview-content question\">\n { q.content }\n </div>\n </div>\n <div className=\"qa-section\">\n { answers.find(a => a.questionId === q.id.toString()).content }\n </div>\n </li>\n )) }\n </div>\n );\n }\n return this.getNoContentMessage(NOT_COMPLETED_REVIEW_HEADER);\n }", "function studentShow(i,page) {\n\t// Does the student belong to the choosen page?\t\n \tif (studentsData[i-1].group === page) {\n\t// If yes show them\n\n\t\t//Creating a new list\n\t\tlet li = document.createElement('li');\n\t\tul.appendChild(li);\n\t\tli.className = \"student-item cf\";\n\n\t\t/*Defining and appending with the right content div blocks per \n\t\teach new student taht we want to show */\n\t\tlet divOrdinal1 = 2*studentsData[i-1].member-1;\n\t\tlet divOrdinal2 = 2*studentsData[i-1].member;\n\n\t\tlet divNumber1 = 'div'+divOrdinal1;\n\t\tlet divNumber2 = 'div'+divOrdinal2;\n\n\t\tlet div1 = document.createElement(divNumber1);\n\t\tlet div2 = document.createElement(divNumber2);\n\t\tli.appendChild(div1);\n\t\tdiv1.className = \"student-details\";\n\t\tli.appendChild(div2);\n\t\tdiv2.className = \"joined-details\";\n\n\t\t$(div1).append(\"<img class='avatar' src=\" + studentsData[i-1].photo + \">\");\n\t\t$(div1).append(\"<h3> #\" + studentsData[i-1].idnumber + \" \"+ studentsData[i-1].name + \"</h3>\");\t\n\t\t$(div1).append(\"<span class='email'>\" + studentsData[i-1].email + \"</span>\");\n\n\t\t$(div2).append(\"<span class='date'>\" + studentsData[i-1].enrollment + \"</span>\");\n\n\t\t//Erasing any student search that could have been shown previously\t\n\t\t$('divLook').empty();\n\t\t \t};\t\n}", "function showTriviaResults() {\n\tshowSection(resultsPage);\n\t$(\"#correct-answers\").html(correctAnswers);\n\t$(\"#incorrect-answers\").html(incorrectAnswers);\n\t$(\"#unanswered\").html(unanswered);\n}", "function displayQuestion() {\n\t\t\tstartTime30();\t\n\t\t\t$(\"#question\").html(eachone[count].question);\n\t\t\t$(\"#option1\").html(eachone[count].option1.answer);\n\t\t\t$(\"#option2\").html(eachone[count].option2.answer);\n\t\t\t$(\"#option3\").html(eachone[count].option3.answer);\n\t\t\t$(\"#option4\").html(eachone[count].option4.answer);\n\t\t\t$(\"#okButton\").html(\"\");\n\t\t}", "function showQuestion() {\n\n questionSpot.textContent = questions[questionIndex].question;\n showAnswers(); \n \n \n}", "function answerTimeOut() {\n\n\n\n // If there's another question, display it.\n\n if (index < questionsArray.length - 1) {\n\n index++;\n\n questionID = questionsArray[index];\n\n goToNextQuestion();\n\n\n\n // If there's no more questions, show results.\n\n } else {\n\n showTriviaResults();\n\n }\n\n}", "function DisplayResult(){\n\tanswers = answers.filter(function(e){return e});\n\t$(\"#content\").html('');\n\t$(\"#content\").append(\"<div class='page-header'><h1>\"+Language[\"Analysis\"]+\"</h1></div>\");\n\t$(\"#content\").append(\"<ul id='answerpanel'></ul>\");\n\tvar noAnswersGiven = 0;\n\tfor (var i = 0; i < answers.length;i++){\n\t\tvar text = \"\";\n\t\tif (answers[i].SelectedAnswer == null){\n\t\t\ttext =\"<b>\"+Language[\"NoAnswer\"]+\"</b>\";\n\t\t\tnoAnswersGiven++;\n\t\t}else\n\t\t\ttext = answers[i].SelectedAnswer.Text;\n\t\t$(\"#answerpanel\").append(\"<li>\"+answers[i].Question+\": \" + text+ \"</li>\");\n\t}\t\n\t\n\tif (noAnswersGiven == answers.length){\n\t\t$(\"#content\").append(\"<div class=\\\"alert alert-danger\\\" role=\\\"alert\\\">\"+Language[\"NoAnswersWarning\"]+\"</div\");\n\t}\n\t$(\"#content\").append(\"<a id =\\\"backToLastQuestion\\\" class='btn btn-primary btn-lg' role='button'>Zurück</a>\");\n\t$(\"#backToLastQuestion\").click(function(){\n\t\t$(\"#answerpanel\").fadeOut(function(){\n\t\t\t\t$(\"#answerpanel\").remove();\n\t\t\t\t$(\"#content\").append(\"<div id='answerpanel'></div>\"); \t\t\t\t\n\t\t\t\tLoadQuestion(--lastAnsweredQuestion.Id);\t\n \t\t});\n\t});\n\tif (noAnswersGiven != answers.length)\n\t$(\"#content\").append(\"<a id='showDistros' class='btn btn-success btn-lg' role='button'>\"+Language[\"ShowResults\"]+\"</a>\");\n\t$(\"#showDistros\").click(function(){\n\t\tLoadDistributionByAnswer();\n\t});\n}", "function nextQandA() {\n\t\tCURRENT_QNUM += 1;\n\t\tvar curQuestion = nextQuestion();\n\t\tvar curAnswers = nextAnswers();\n\t\t\n\t\t// If no questions are left, display results. Else, display next Q&A.\n \t\tif (CURRENT_HP == 0) {\n\t\t\tshowResults(\"Game Over\");\n\t\t\tshowImage(\"img/pogo-revive.png\");\n\t\t\t// hide nav\n\t\t\t$('.navbar-toggle').animate({\n\t\t\t\tbottom: \"-100vh\"\n\t\t\t}, 800, \"swing\", function() {\n\t\t\t});\n\t\t\t$('.collapse').collapse('hide');\n\t\t} else if (curQuestion == \"\") {\n\t\t\tshowResults(\"Results\");\n\t\t\t\n\t\t\t// Medals\n\t\t\tvar medalImage = getMedal();\n\t\t\tshowImage(medalImage);\n\t\t\t\n\t\t} else {\n\t\t\t// Enable navbar toggle\n\t\t\t$('.navbar-toggle').attr(\"data-toggle\", \"collapse\");\n\t\t\t\n\t\t\t// Reallow click event for answers\n\t\t\tFLAG_ACTION = false;\n\t\t\t\n\t\t\tshowQuestion(curQuestion);\n\t\t\tshowAnswers(curAnswers);\n\t\t\tshowImage(\"\");\n\t\t} \n\t}", "function topicsSummaryMultiplePapers()\n {\n\t var points=[\"You did a splendid Job I can't believe you scored Fullest Percentage, But don't let this you to get into relax mode.\",\n\t\t\t\"Excellent Job! You Performed Well in the Examination but don't be relaxed\",\n\t\t\t\"You scored a very good score, But Why did you miss the remaining look at them once\",\n\t\t\t\"You have Scored Good Score but you missed others look at them\",\n\t\t\t\"Ok, But it's not up to your level must Consider this don't leave it\",\n\t\t\t\"I believe You Have the ability to score fullest, May be I think your hardWork is not as expected. So Work hard Buddy\",\n\t\t\t\"Hey! the score is not as expected. What happend to you. I know this is not your score. But Why is this happend? Take it seriously\",\n\t\t\t\"It's too low. Anything wrong? I can't expect this kind of score. You Have to put more efforts and hardwork. Hope you won't repeat this.\",\n\t\t\t\"Bad Score! Your HardWork is required.\",\n\t\t\t\"Worst Score! More and More HardWork is required\",\n\t\t\t\"No Comment! Please Think about Your progress\"];\n\t\tvar studyAdvice;\n\t\tvar st=\"<div class='row'>\";\n\t\tvar marks=0;\n\t\tvar marksPercent;\n\t \n\t\tvar d=[];\n\t\t var data=[];\n\t\t \n\t\t for(i=0;i<userAllPapersAnswers.length;i++)\n\t\t\t {\n\t\t\t \n\t\t\t for(j=0;j<userAllPapersAnswers[i].optionsList.length;j++)\n\t\t\t\t {\n\t\t\t\t d.push(userAllPapersAnswers[i].optionsList[j]);\n\t\t\t\t\t data.push(questionsAllPapersData[i].questionsList[j]);\n\t\t\t\t }\n\t\t\t\t\n\t\t\t\t\n\t\t\t }\n\t\t \n\t\t console.log(d);\n\t\t console.log(data);\n\t\t \n\t\t var answeredCount=0;\n\t\t var topicsToFocus=[];\n\t\t var tDuplicate=0;\n\t\t for(var i=0;i<d.length;i++)\n\t\t\t {\n\t\t\t \n\t\t\t tDuplicate=0;\n\t\t\t if(d[i]!=\"NA\")\n\t\t\t \tansweredCount++;\n\t\t\t if(d[i]!=data[i].qkey)\n\t\t\t \t{\n\t\t\t \t for(j=0;j<topicsToFocus.length;j++)\n\t\t\t \t\t {\n\t\t\t \t\t if(data[i].topic==topicsToFocus[j])\n\t\t\t \t\t\t tDuplicate=1; \n\t\t\t \t\t }\n\t\t\t \t if(tDuplicate==0)\n\t\t\t \ttopicsToFocus.push(data[i].topic);\n\t\t\t \t\n\t\t\t \t}\n\t\t\t else{\n\t\t\t \tmarks++;\n\t\t\t }\n\t\t\t }\n\t\t marksPercent=parseInt((marks*100)/data.length);\n\t\t \n\t\t if(marksPercent>=100)\n\t\t\t studyAdvice=points[0];\n\t\t else if(marksPercent>=95)\n\t\t\t studyAdvice=points[1];\n\t\t else if(marksPercent>=90)\n\t\t\t studyAdvice=points[2];\n\t\t else if(marksPercent>=80)\n\t\t\t studyAdvice=points[3];\n\t\t else if(marksPercent>=70)\n\t\t\t studyAdvice=points[4];\n\t\t else if(marksPercent>=60)\n\t\t\t studyAdvice=points[5];\n\t\t else if(marksPercent>=45)\n\t\t\t studyAdvice=points[6];\n\t\t else if(marksPercent>=35)\n\t\t\t studyAdvice=points[7];\n\t\t else if(marksPercent>=20)\n\t\t\t studyAdvice=points[8];\n\t\t else if(marksPercent>=10)\n\t\t\t studyAdvice=points[9];\n\t\t else\n\t\t\t studyAdvice=points[10];\n\t\t \n\t\t \n\t\t var diffTopics=[];\n\t\t var diffTopicsQCount=[];\n\t\t tDuplicate=0;\n\t\t \n\t\t for(i=0;i<data.length;i++)\n\t\t\t {\n\t\t\t tDuplicate=0;\n\t\t\t for(j=0;j<diffTopics.length;j++)\n\t\t\t \t{\n\t\t\t \t if(data[i].topic==diffTopics[j])\n\t\t\t \t\t {\n\t\t\t \t\t tDuplicate=1;\n\t\t\t \t\t \n\t\t\t \t\t }\n\t\t\t \t}\n\t\t\t if(tDuplicate==0)\n\t\t\t \tdiffTopics.push(data[i].topic); \t\n\t\t\t }\n\t\t \n\t\t \n\t\t //Topic wise statistics\n\t\t var qCount=0;\n\t\t var wrongQCount=0;\n\t\t var wrongQuestion;\n\t\t var wrongQuestions=[];\n\t\t var multopics=[];\n\t\t for(i=0;i<diffTopics.length;i++)\n\t\t\t {\n\t\t\t \n\t\t\t wrongQCount=0;\n\t\t\t qCount=0;\n\t\t\t wrongQuestions=[];\n\t\t\t for(j=0;j<data.length;j++)\n\t\t\t \t {\n\t\t\t \t if(diffTopics[i]==data[j].topic)\n\t\t\t \t \t{\n\t\t\t \t \tqCount++;\n\t\t\t \t \t if(d[j]!=data[j].qkey)\n\t\t\t \t \t\t {\n\t\t\t \t \t\t wrongQCount++;\n\t\t\t \t \t\t wrongQuestions.push(new WrongQuestion(data[j].question,data[j].qkey,d[j],data[j].optionA,data[j].optionB,data[j].optionC,data[j].optionD,data[j].optionE));\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 multopics.push(new Topic(diffTopics[i],qCount,wrongQCount,wrongQuestions));\n\t\t\t }\n\t\t \n\t\tst=st+\"<div class='col-md-7'>\" +\n\t\t\t\t\"<p><span style='font-weight:600;font-size:12px;'>Total Number of Questions :</span> <span style='color:#00a69c'>\"+data.length+\"</span></p>\" +\n\t\t\t\t\"<p><span style='font-weight:600;font-size:12px;'>Total Number of Questions answered : </span> <span style='color:#00a69c'>\"+answeredCount+\"</span></p>\" +\n\t\t\t\t\"<p><span style='font-weight:600;font-size:12px;'>Total Number of Questions Correctly Answered : </span> <span style='color:#00a69c'>\"+marks+\"</span></p>\" +\n\t\t\t\t\"</div>\";\n\t\t\tif(marksPercent<=35)\n\t\t\t{\n\t\t\t\tst=st+\"<div class='col-md-5'><br><p style='marging-top:1%;'><span style='font-weight:600;font-size:12px;'>Your total score : </span><span class='redClass clrsClass'>\"+marksPercent+\"%</span></p>\"+\n\t\t\t\t\"</div></div>\";\n\t\t\t}\n\t\t\telse if(marksPercent>35 && marksPercent<=75)\n\t\t\t{\n\t\t\t\tst=st+\"<div class='col-md-5'><br><p style='marging-top:1%;'><span style='font-weight:600;font-size:12px;'>Your total score : </span><span class='clrAvg clrsClass'>\"+marksPercent+\"%</span></p>\"+\n\t\t\t\t\"</div></div>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tst=st+\"<div class='col-md-5'><br><p style='marging-top:1%;'><span style='font-weight:600;font-size:12px;'>Your total score : </span><span class='greenClass clrsClass'>\"+marksPercent+\"%</span></p>\"+\n\t\t\t\t\"</div></div>\";\n\t\t\t}\n\t\t\t\t\n\t\t\tst=st+\"<div class='row' style='border:1px solid #4e4e4e;border-radius:5px;'><div class='col-md-12'>\";\n\t\t\n\t\tif(answeredCount!=data.length)\n\t\tst=st+\"<span style='color:#4e4e4e;font-weight:600;'>Note : </span><span style='color:red'> It's not fare that you did not even attempt all Questions. The Exam Doesn't even have any Negative Marking</span>\"+\"<br>\";\n\t/*\n\t\tst=st+\"Different Topics Covered In this Question Paper\"+\"<br>\";\n\t\t\n\t\tfor(i=0;i<diffTopics.length;i++)\n\t\t{\n\t\t\tst=st+\"<span style='margin:3px;border-radius:20%;padding:5px;color:black;background-color:#DDD6D4'>\"+diffTopics[i]+\"</span>\";\n\t\t}\n\t\tst=st+\"<br>\";\n\t\t*/\n\t\t\n\t\tst=st+\"<canvas id='topicsBarGraph'></canvas>\" +\n\t\t\t\t\"</div></div>\" +\n\t\t\t\t\"<br><div class='row' style='height:450px;'><div class='col-md-8' style='height:450px;overflow:scroll;'>\";\n\t\t\n\t\t/*st=st+\"<p style='padding-top:1%;font-size:16px;text-align:center;font-weight:600px;color:#ff6666;'>Topics You have to Focus More\"+\"</p>\";\n\t\tfor(i=0;i<topicsToFocus.length;i++)\n\t\t{\n\t\t\tst=st+\"<p style='padding:5px;font-size:12px;text-align:center;width:90% !important;color:black;background-color:#DDD6D4'>\"+topicsToFocus[i]+\"</p>\";\n\t\t}\n\t\t\n\t\tst=st+\"</div>\" +\n\t\t\t\t\"<div class='col-md-8' style='overflow:scroll;height:440px;'>\";*/\n\t\t\n\t\tvar labelsData=[];\n\t\tvar percentData=[];\n\t\tvar colors=[];\n\t\tst=st+\"<p style='padding-top:1%;font-size:16px;text-align:center;font-weight:600;color:#ff6666;'>Look in Detail\"+\"</p>\";\n\t\tfor(i=0;i<multopics.length;i++)\n\t\t\t{\n\t\t\tst=st+\"<p style='font-weight:600;font-size:12px'>Topic: <span style='color:#ff6666'>\"+multopics[i].topic+\"</span> Score Percent : <span style='font-weight:500;color:#00a69c;'>\"+parseInt((multopics[i].qCount-multopics[i].wrongQCount)*100/multopics[i].qCount)+\"%</span></p>\";\n\t\t\t st=st+\"<p style='font-weight:600;font-size:12px'>Totoal Questions from Topic : <span style='font-weight:600;color:#000;'>\"+multopics[i].qCount+\"</span></p>\";\n\t\t\tif(multopics[i].wrongQCount!=0)\n\t\t\t\t{\n\t\t\t \n\t\t\t st=st+\"<p style='font-size:12px'>You did not Score for <span style='font-weight:600;color:#ff6666;'>\"+multopics[i].wrongQCount+\"</span> Questions</p>\";\n\t\t\t st=st+\"<p style='font-weight:600;font-size:12px'>Want To See Questions You missed scoring : <button class='btn btn-default' style='color:#ff6666;border:1px solid #ff6666;border-radius:5px;font-size:10px;font-weight:600;' onclick='displayD(\\\"wrongQuestions\"+i+\"\\\")'>Click Here</button></p><hr>\";\n\t\t\t st=st+\"<span id='wrongQuestions\"+i+\"' style='display:none'>\";\n\t\t\t for(j=0;j<multopics[i].wrongQuestions.length;j++)\n\t\t\t\t {\n\t\t\t\t st=st+\"<p><span style='color:red;font-size:12px;'>Question No: </span><span style='color:#00a69c'>\"+(j+1)+\"</span></p>\" +\n\t\t\t\t \t\t\"<p style='font-weight:600;font-size:12px;'> \"+multopics[i].wrongQuestions[j].question+\"</p>\";\n\t\t\t\t st=st+\"<p>A) \"+multopics[i].wrongQuestions[j].optionA+\"<span style='margin-left:10px;'>B) \"+multopics[i].wrongQuestions[j].optionB+\"</span><span style='margin-left:10px;'>C) \"+multopics[i].wrongQuestions[j].optionC+\"</span><span style='margin-left:10px;'>D) \"+multopics[i].wrongQuestions[j].optionD+\"</span><span style='margin-left:10px;'>E) \"+multopics[i].wrongQuestions[j].optionE+\"</span></p>\";\n\t\t\t\t st=st+\"<p>Key : <span style='font-weight:600;'>\"+multopics[i].wrongQuestions[j].qkey+\"</span><span style='margin-left:2%'> Your Answer: </span><span style='font-weight:600;'>\"+multopics[i].wrongQuestions[j].yourAnswer+\"</span></p><hr><br>\";\n\t\t\t\t \n\t\t\t\t st=st+\"<p>Google Help:<br> <a href='https://www.google.co.in/search?q=\"+multopics[i].wrongQuestions[j].question+\"' target='_blank'>Ask <i style='color:green' class='fa fa-google' aria-hidden='true'></i></a></p>\";\n\t\t\t\t }\n\t\t\t st=st+\"</span>\";\n\t\t\t}\n\t\t\t else{\n\t\t\t\t st=st+\"<p style='font-size:12px'>Good You have Answered All Questions</p>\";\n\t\t\t }\n\t\t\t labelsData.push(multopics[i].topic);\n\t\t\n\t\t\t percentData.push(parseInt((multopics[i].qCount-multopics[i].wrongQCount)*100/multopics[i].qCount));\n\t\t\t \n\t\t\t if(parseInt((multopics[i].qCount-multopics[i].wrongQCount)*100/multopics[i].qCount)>75)\n\t\t\t\t colors.push(\"green\");\n\t\t\t else if(parseInt((multopics[i].qCount-multopics[i].wrongQCount)*100/multopics[i].qCount)>45)\n\t\t\t colors.push(\"yellow\");\n\t\t\t else\n\t\t\t\t colors.push(\"red\");\n\t\t\t}\n\t\tst=st+\"</div><div class='col-md-4'>\";\n\t\t\n\t\tst=st+\"<p style='text-align:center;color:#00a69c;font-weight:600;font-size:16px;'>Study Advicer's Advice</p>\"+studyAdvice+\"<br>\";\n\t\t\t\t\n\t\tst=st+\"</div></div>\";\n\t\t\n\t\t$(\"#resultStats\").html(st);\n\t\tdisplayBarGraph('topicsBarGraph',percentData,'Topic Wise Analysis',labelsData,colors);\n\t\t\n\t \n\t\t\n\t\t\n\t \n\t $(\"#ajaxPageLoader\").hide();\n }", "function printQA() {\n var currentQA = getRandomQA();\n var message = '<h3 class=\"question\">Q: ' + currentQA.question + \"</h3>\";\n message += '<p class=\"answer\">A: ' + currentQA.answer + \"</p><footer>\";\n if (currentQA.readmore) {\n message += '<p><a class=\"readmore\" href=\"' + currentQA.readmore + '\">Read More...</a></p>';\n }\n if (currentQA.tags) {\n \tmessage += '<span class=\"tags small\">tags: ' + currentQA.tags + '</span>';\n }\n message += \"</footer>\";\n\n document.getElementById(\"qa-box\").innerHTML = message;\n}", "function showAnswers(question, answers) {\n\tanswers.slideDown() // Slide the answer panel down\n}", "function displayQuestion () {\r\n //displays score after user answers final question\r\n if (questionIndex === finalQuestion){\r\n return displayScore();\r\n} \r\n var currentQuestion = myQuestions[questionIndex];\r\n question.innerHTML = \"<p>\" + currentQuestion.question + \"</p>\";\r\n answerA.innerHTML = myQuestions[questionIndex].answers.a;\r\n answerB.innerHTML = myQuestions[questionIndex].answers.b;\r\n answerC.innerHTML = myQuestions[questionIndex].answers.c;\r\n answerD.innerHTML = myQuestions[questionIndex].answers.d;\r\n }", "function getResponseEntriesForStudent(){\n console.log(\"Getting all exercise response entries for \\\n teacher \" + teacherID +\", lesson \" + lessonID +\" and student \" + studentID);\n dbShellResponsesForStudent.transaction(function(tx){\n tx.executeSql(\"select row_id,teacher_id,student_id,lesson_id,exercise_id,response,scoremark,comment\\\n from responseandmark where teacher_id=? and student_id=? order by lesson_id,exercise_id\",[teacherID,studentID]\n ,renderResponseEntriesForStudent,dberrorhandlerForResponseForStudent);\n },dberrorhandlerForResponseForStudent);\n}", "function showFAQUrl() {\n\tremoveMessageFromDivId();\n\tremoveSuccessOrFailureStrip();\n\tbookmarks.sethash('#moreinfo', showFooterPopup, messages['schedule_card_faq']);\t\n\treturn false;\n}", "function showAnswers(curAnswers) {\n\t\tvar numAnswers = curAnswers.length;\n\t\t\n\t\t// Hide the list of previous answers\n\t\t$( \".answer\" ).children('p').each(function( i ) {\n\t\t\t$(this).animate({\n\t\t\t\topacity: \"0\"\n\t\t\t}, 400, function() {\n\t\t\t\t$(this).text(\" \");\n\t\t\t});\n\t\t});\n\t\t\n\t\tsetTimeout(function() {\n\t\t\t$(\".answer\").animate({\n\t\t\t\twidth: \"16em\"\n\t\t\t\t}, 400, function() {\n\t\t\t});\n\t\t\t\n\t\t\t// Shuffle the list of current answers in array.\n\t\t\tshuffle(curAnswers); //.sort(function() { return 0.5 - Math.random() });\n\t\t\t\n\t\t\t// Update and then display the current answers\n\t\t\t$( \".answer\" ).promise().done(function() {\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tfor (var i = 0; i < numAnswers; i++) {\n\t\t\t\t\t\tvar parent = \"#a\" + (i + 1);\n\t\t\t\t\t\tvar textElement = \"#a\" + (i + 1) + \" p\";\n\t\t\t\t\t\t$(textElement).text(curAnswers[i].answer);\n\t\t\t\t\t\t$(textElement).animate({\n\t\t\t\t\t\t\topacity: \"1\"\n\t\t\t\t\t\t\t}, 400, function() {\n\t\t\t\t\t\t});\n\t\t\t\t\t\t$(parent).attr(\"title\",curAnswers[i].answer);\n\t\t\t\t\t}\n\t\t\t\t}, 300);\n\t\t\t\t\n\t\t\t\t$( \".answer\" ).each(function( i ) {\n\t\t\t\t\t$(this).animate({\n\t\t\t\t\t\twidth: '100%'\n\t\t\t\t\t\t}, 400, function() {\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t}, 500);\n\t}", "function showResults(exercisePassed ) {\n self.exercise.blockUIElements();\n\n self.dom.buttons.done.hide()\n self.dom.buttons.tryAgain.show();\n self.dom.buttons.showCorrectAnswer.hide();\n\n self.data.exercisePassed = exercisePassed;\n\n renderResultBlock();\n\n if (self.config.showDetails) {\n self.dom.buttons.details.show();\n } else {\n self.dom.buttons.details.hide();\n }\n }", "function showSolutions() {\n $(document).ready(function() {\n $('.solution-link').show();\n $('.next-question').hide();\n $('.topic-solution-link').show();\n $('.topic-next-question').hide();\n\n $('.toggle-hide-video').hide();\n\n $('.toggle-video').on('click', function(event){\n event.preventDefault();\n var linkText = $(this).text();\n if (linkText === 'Show Video') {\n $(this).prev().css(\"display\",\"\");\n $(this).text('');\n $(this).append(\"<i class='fa fa-arrow-up' aria-hidden='true'></i> Hide Video\");\n $(\".toggle-hide-video\").show();\n } else {\n $(this).prev().css(\"display\",\"none\");\n $(this).text('Show Video');\n $(\".toggle-hide-video\").hide();\n }\n });\n\n $('.toggle-hide-video').on('click', function(event){\n event.preventDefault();\n $(this).next().css(\"display\",\"none\");\n $(this).next().next().text('Show Video');\n $(\".toggle-hide-video\").hide();\n });\n\n $('.chapter-collapsable').next().hide();\n $('.lesson-div').hide();\n\n $(\".topic-headings\").css(\"margin\",\"10px auto\");\n $(\".lesson-headings\").css(\"margin\",\"6px auto\");\n $(\".topic-questions-headings\").css(\"margin\",\"6px auto\");\n\n var collapsable = function(event){\n event.preventDefault();\n if ($(this).next().is(':visible')){\n $(this).next().hide();\n } else {\n $(this).next().show();\n }\n };\n\n $('.chapter-collapsable').on('click', collapsable);\n\n $('.lesson-collapsable').on('click', collapsable);\n\n var submitSolution = function(event){\n event.preventDefault();\n var identifier = event.target.id.split(\"-\");\n var topicId = identifier[0];\n var lessonId = identifier[1];\n var lessonExp = $(\"#lesson-\" + lessonId + \"-exp\");\n var topicExp = $(\"#topic-\" + topicId + \"-exp\");\n var topicNextLevelExp = $(\"#topic-\" + topicId + \"-next-level-exp\");\n var topicNextLevel = $(\"#topic-\" + topicId + \"-next-level\");\n var endTopicExp = $(\"#end-topic-\" + topicId + \"-exp\");\n var endTopicNextLevelExp = $(\"#end-topic-\" + topicId + \"-next-level-exp\");\n var endTopicNextLevel = $(\"#end-topic-\" + topicId + \"-next-level\");\n var submitSolutionForm = $(this).parent();\n var postAddress = submitSolutionForm.attr('action');\n\n var answersArray = [];\n var i = 1;\n\n while (i < 20) {\n var answerLabelClass = '.answer-label-' + i;\n var studentAnswerClass = '.student-answer-' + i;\n var answerLabel = $(this).siblings(\".answer-answers\").children(answerLabelClass).attr(\"for\");\n if (!answerLabel) { break; }\n var exactLabel = answerLabel.replace(\"answers_\", \"\");\n var studentAnswer = $(this).siblings(\".answer-answers\").children(studentAnswerClass).val();\n if (studentAnswer === \"\") { return; }\n answersArray.push([exactLabel,studentAnswer]);\n i++;\n }\n\n var choice = submitSolutionForm.find('input:checked[name=\"choice\"]').val();\n\n if (typeof choice === 'undefined' && answersArray.length === 0)\n {\n return;\n }\n\n var question_id = submitSolutionForm.find('input[name=\"question_id\"]').val();\n var lesson_id = submitSolutionForm.find('input[name=\"lesson_id\"]').val();\n var topic_id = submitSolutionForm.find('input[name=\"topic_id\"]').val();\n var authenticity_token = submitSolutionForm.find('input[name=\"authenticity_token\"]').val();\n var solutionTitle = $(this).siblings(\".solution-title\");\n var solutionText = $(this).siblings(\".solution-text\");\n var correctDiv = $(this).siblings(\"#correct\");\n\n $(this).hide();\n $(this).siblings('.topic-next-question').show();\n $(this).siblings('.next-question').show();\n\n var params = {\n 'choice': choice,\n 'js_answers': answersArray,\n 'question_id': question_id,\n 'lesson_id': lesson_id,\n 'topic_id': topic_id,\n 'authenticity_token': authenticity_token }\n\n $.post(postAddress, params, function(response){\n solutionTitle.text(\"Solution\");\n solutionText.text(response.question_solution);\n if (response.solution_image_url){\n solutionText.append(\n \"<img class='solution-image' src='\" + response.solution_image_url + \"' alt='medium'>\"\n );\n }\n correctDiv.text(response.message);\n if (typeof lesson_id === 'undefined'){\n endTopicExp.text(response.topic_exp);\n endTopicNextLevelExp.text(response.topic_next_level_exp);\n endTopicNextLevel.text(response.topic_next_level);\n } else {\n lessonExp.text(response.lesson_exp);\n }\n topicExp.text(response.topic_exp);\n topicNextLevelExp.text(response.topic_next_level_exp);\n topicNextLevel.text(response.topic_next_level);\n\n if (response.choice) {\n correctDiv.css(\"color\", \"green\");\n } else {\n if (response.correctness > 0) {\n correctDiv.css(\"color\", \"orange\");\n } else {\n correctDiv.css(\"color\", \"red\");\n };\n };\n\n MathJax.Hub.Typeset();\n });\n };\n\n\n var topicNextQuestion = function(event){\n event.preventDefault();\n var nextQuestionLink = $(this);\n var nextQuestionDiv = $(this).parent().parent();\n var nextQuestionForm = $(this).parent();\n var answerChoices = $(this).siblings('.answer-choices');\n var answerAnswers = $(this).siblings('.answer-answers');\n\n $.get(this.href, function(response){\n if (response.question === \"\") {\n nextQuestionDiv.empty();\n nextQuestionDiv.append(\"<div class='request-more-questions'>Well done! You have attempted all the questions available for this lesson, contact us to ask for more!</div>\")\n } else {\n\n nextQuestionForm.siblings('.question-header').children('.question-exp').text(response.question.experience);\n\n if (typeof response.topic_bonus_exp === 'undefined'){\n nextQuestionForm.siblings('.question-header').children('.streak-mtp').text(response.lesson_bonus_exp);\n } else {\n nextQuestionForm.siblings('.question-header').children('.streak-mtp').text(response.topic_bonus_exp);\n };\n\n nextQuestionForm.siblings('.question-text').text(response.question.question_text);\n nextQuestionForm.children('.form-question-id').val(response.question.id);\n\n if (response.question_image_urls){\n questionImage = nextQuestionForm.siblings('.question-image');\n questionImage.html(\"\")\n response.question_image_urls.forEach(function(image_url){\n questionImage.append(\n \"<img class='question-image' src='\" + image_url + \"' alt='medium'>\"\n )\n })\n }\n\n nextQuestionForm.children('.solution-title').text('');\n nextQuestionForm.children('.solution-text').text('');\n nextQuestionForm.children('.question-result').text('');\n\n answerChoices.empty();\n\n var choices = response.choices;\n var choices_urls = response.choices_urls;\n for (var i = 0, len = choices.length; i < len; i++) {\n answerChoices.append(\"<input class='question-choice' type='radio' id='choice-\"\n + choices[i].id +\"' \" + \"name='choice' value=\" + choices[i].id\n + \">\" + '<span style=\"padding-left:10px;\">' + choices[i].content + '</span>');\n if (choices_urls) {\n answerChoices.append(\n \"<img class='choice-image' src='\" + choices_urls[i] + \"' alt='medium'>\"\n );\n }\n answerChoices.append(\"<br>\");\n }\n\n answerAnswers.empty();\n\n var answers = response.answers;\n for (var j = 0, len = answers.length; j < len; j++) {\n answerAnswers.append(\n '<label class=\"answer-label-' + (j+1) + ' answer-label-style\" for=\"answers_'\n + answers[j].label + '\">' + answers[j].label + '</label>'\n + '<input class=\"student-answer-' + (j+1) + '\" type=\"text\" name=\"answers['\n + answers[j].label + ']\" id=\"answers_' + answers[j].label + '\" />'\n + '<span class=\"answer-hint\">' + answers[j].hint + '</span><br>'\n );\n }\n\n nextQuestionLink.hide();\n nextQuestionForm.children('.topic-solution-link').show();\n nextQuestionForm.children('.solution-link').show();\n MathJax.Hub.Typeset();\n }\n });\n };\n\n $('.solution-link').on('click',submitSolution);\n $('.next-question').on('click', topicNextQuestion);\n\n });\n MathJax.Hub.Typeset();\n}", "function reviewExam(index)\n{\n console.log(\"This functionality isn't implemented yet!\");\n}", "function showNeedHelpUrl() {\n\tremoveMessageFromDivId();\n\tremoveSuccessOrFailureStrip();\n\tbookmarks.sethash('#moreinfo',showFooterPopup, messages['gettingStartedUrl']);\n\treturn false;\n}", "function showQuestionDetailsEvent(paragraphName, questionID) {\n if (!featureEnabled) return;\n logger().logQuestionRequest(simpaticoEservice, paragraphName, questionID);\n }", "function helpMeInstructor(err) {\n console.info(\n `\n Did you hit CORRECT the endpoint?\n Did you send the CORRECT data?\n Did you make the CORRECT kind of request [GET/POST/PATCH/DELETE]?\n Check the Kwitter docs 👉🏿 https://kwitter-api.herokuapp.com/docs/#/\n Check the Axios docs 👉🏿 https://github.com/axios/axios\n TODO: troll students\n `,\n err\n );\n}", "function showTriviaResults() {\n\n showSection(resultsPage);\n\n $(\"#correct-answers\").html(correctAnswers);\n\n $(\"#incorrect-answers\").html(incorrectAnswers);\n\n $(\"#unanswered\").html(unanswered);\n\n}", "function displayQuestion() {\n $(\".questions\").text(currentQuestionData.question);\n $(\".answer-1\").text(currentQuestionData.otherAnswers[0]);\n $(\".answer-2\").text(currentQuestionData.otherAnswers[1]);\n $(\".answer-3\").text(currentQuestionData.otherAnswers[2]);\n $(\".answer-4\").text(currentQuestionData.otherAnswers[3]);\n }", "function loadExams(){\n $('#exam-content').load('load-exam_content.php');\n $('#info-message').html('');\n hideFirstTD();\n }", "function showRemediation() {\n\n // gather objectives\n if (_objectives) {\n\n var gatheredRemedationPages = [];\n\n _objectives.forEach( function(objective) {\n if (objective.pass !== true) {\n if (objective.remediationq) {\n gatheredRemedationPages = gatheredRemedationPages.concat(objective.remediationq)\n }\n }\n });\n\n // if remediation pages found trigger remediation\n if (gatheredRemedationPages.length > 0) {\n setTimeout(function() {\n RemediationActions.create(gatheredRemedationPages);\n }, 0.1);\n }\n }\n}", "showQuestionDetailsForAnswer(questionId, title, questionBody, username) {\n document.getElementById('question-title').textContent = title;\n document.getElementById('username').textContent = username;\n document.getElementById('questiontext-holder').textContent = questionBody;\n }", "function studentsShow (page) {\n let i = 1\t\n for (let=1; i<= studentsNumber; i +=1){\n \tstudentShow (i,page);\n \t$('ul.student-list').show();\t\n }\n}", "function seeResults() {\n store.quizStarted = false;\n store.questionNumber ++;\n}", "function startQuiz(answer) {\n hideWelcome();\n questionDisplay(answer);\n timer();\n}", "function results() {\n selectedAnswers = $(displayTest.find(\"input:checked\"));\n //if user is correct\n if (\n selectedAnswers[0].value === testSetup[currentQuestion - 1].questionAnswer\n ) {\n //add to correct score and display on element\n correct++;\n $(\"#correct\").text(\"Answers right: \" + correct);\n } else {\n //if user is wrong then add to wrong score and display on element\n wrong++;\n $(\"#incorrect\").text(\"Wrong answers: \" + wrong);\n }\n //check to see if the user has reached the end of the test\n if (currentQuestion === 10) {\n //toggle finalize modal at end of test to display score\n $(\"#modalMatch\").modal(\"toggle\");\n $(\"#testScore\").text(\n \"End of test! You scored a \" + (parseFloat(correct) / 10) * 100 + \"%\"\n );\n //show postTest element\n $(\"#postTest\").show();\n $(\"#submitTest\").hide();\n }\n }", "function showQuestion() {\n // quiz questions along with possible answers\n questionEl.innerHTML = questions[currentQuesIndex].question;\n answerA.innerHTML = questions[currentQuesIndex].choiceA;\n answerB.innerHTML = questions[currentQuesIndex].choiceB;\n answerC.innerHTML = questions[currentQuesIndex].choiceC;\n\n}", "function listenResultsClick() {\n\tconst resultsLink = document.getElementById('display-results');\n\tresultsLink.addEventListener('click', () => {\n\t\t// send page view to Analytics\n\t\tgtag('config', 'UA-170700693-2', {\n\t\t\tpage_title: 'resultat-detall',\n\t\t\tpage_path: '/resultat-detall',\n\t\t});\n\t\t// send Analytics event\n\t\tgtag('event', 'display-results', {\n\t\t\tevent_category: state.age,\n\t\t\tevent_label: `score: ${state.score}`,\n\t\t});\n\t\t// clean HTML\n\t\tcontent.innerHTML = '';\n\t\t// create Results title\n\t\tconst resultsTitle = document.createElement('h1');\n\t\tresultsTitle.textContent = 'Resultats';\n\t\tcontent.appendChild(resultsTitle);\n\t\t// create list of answers\n\t\tconst answers = document.createElement('ul');\n\t\tstate.collectedAnswers.map((item) => {\n\t\t\tconst uniqueAnswer = document.createElement('li');\n\t\t\tuniqueAnswer.id = 'answer-item';\n\t\t\tuniqueAnswer.innerHTML = `${\n\t\t\t\titem.correct\n\t\t\t\t\t? '<i class=\"fas fa-check-circle answer-summary\" id=\"correct-answer\"></i>'\n\t\t\t\t\t: '<i class=\"fas fa-times-circle answer-summary\" id=\"wrong-answer\"></i>'\n\t\t\t}<p>Pregunta: ${item.question} | Resposta: ${item.answer}</p>`;\n\t\t\t// uniqueAnswer.textContent = `Pregunta: ${item.question} | Resposta: ${\n\t\t\t// \titem.answer\n\t\t\t// } | ${item.correct ? 'Correcte' : 'Equivocada'}`;\n\t\t\tanswers.appendChild(uniqueAnswer);\n\t\t});\n\t\tcontent.appendChild(answers);\n\n\t\t// CTA button\n\t\tconst ctaButton = document.createElement('button');\n\t\tctaButton.id = 'tryAgain';\n\t\tctaButton.textContent = `Torna-ho a provar`;\n\t\tcontent.appendChild(ctaButton);\n\t\t// social media buttons\n\t\tdisplaySocialMediaButtons(content);\n\t});\n}", "function showScore () {\n\t$(\".questions\").hide();\n\t$(\".result\").show();\n\tshowScore();\n}", "function showQuestion(questionNumber) {\n \n currentQuestion = questionNumber;\n var questionDetails = questionAnswersOptions[questionNumber-1];;\n var question = questionDetails.question;\n var options = questionDetails.options;\n \n $(\"#questionTxt\").html(question);\n $(\"#questionCounter\").html(showQuestionCounter(questionNumber));\n var optionsHtml = \"\";\n $('#optionsContainer').html(optionsHtml);\n \n for ( var i = 0; i < options.length; i++ ) {\n // Use of AND operator\n if ( answerByStudent[questionNumber] && answerByStudent[questionNumber] === (i+1) ) {\n optionsHtml += '<input type=\"radio\" name=\"option\" checked onclick=\"calculateMarks('+(i+1)+');\"><label id=\"opt'+(i+1)+'\">' + options[i] + '</label><br>';\n } else {\n optionsHtml += '<input type=\"radio\" name=\"option\" onclick=\"calculateMarks('+(i+1)+');\"><label id=\"opt'+(i+1)+'\">' + options[i] + '</label><br>';\n }\n }\n $('#optionsContainer').html(optionsHtml);\n if(questionNumber === questionAnswersOptions.length){\n $(\"#nextBtn\").hide()\n }else{\n $(\"#nextBtn\").show()\n }\n}", "function showQuestions(question, options, answerIndex){\n\t//sets question\n\t$(\".question-title\").html(question);\n\n\t//sets question image\n\tvar questionImageSrc = questions[nextQuestionIndex].questionImage;\n\t$(\".question-image\").attr(\"src\", questionImageSrc);\n\n\t//sets question options\n\t$(\".question-answers\").empty();\n\tfor(var i = 0; i < options.length; i++){\n\t\tvar correctAnswer = false;\n\t\tif(i == answerIndex){\n\t\t\tcorrectAnswer = true;\n\t\t}\n\t\t$(\".question-answers\").append('<li class=\"option-list\" data-correct-answer=\"' + correctAnswer + '\">' + options[i] + '</li>');\n\t}\n}", "_goToResults() {\n const formattedTime = formatTime(this._model.time);\n getStats(this._model.correctQuestions, this._model.time, formattedTime)\n .then((resultStats) => {\n result.stats = resultStats;\n Application.showStats();\n })\n .catch((res) => {\n result.stats.time = formattedTime;\n Application.showStats();\n });\n setStats({time: this._model.time, answers: this._model.correctQuestions});\n this._stopFn();\n document.body.removeEventListener('timer-tick', this._tick);\n }", "function showResults(){\n\n\t// gather answer containers from our quiz\n\tconst answerContainers = quizContainer.querySelectorAll('.answers');\n \n\t// keep track of user's answers\n\tlet numCorrect = 0;\n \n\t// for each question...\n\tmyQuestions.forEach( (currentQuestion, questionNumber) => {\n \n\t // find selected answer\n\t const answerContainer = answerContainers[questionNumber];\n\t const selector = `input[name=question${questionNumber}]:checked`;\n\t const userAnswer = (answerContainer.querySelector(selector) || {}).value;\n \n\t // if answer is correct\n\t if(userAnswer === currentQuestion.correctAnswer){\n\t\t// add to the number of correct answers\n\t\tnumCorrect++;\n \n\t\t//color the answers green\n\t\tanswerContainers[questionNumber].style.color = 'blue';\n\t }\n\t // if answer is wrong or blank\n\t else{\n\t\t// color the answers red\n\t answerContainers[questionNumber].style.color = 'red';\n\t }\n\t});\n \n\t// show number of correct answers out of total\n\tresultsContainer.innerHTML = `Your score is : ${numCorrect} out of ${myQuestions.length}`;\n }", "function quesIdentifiesStudent(ques) \n { \n if (ques.indexOf('first') != -1)\n {\n return true;\n }\n else if (ques.indexOf('last') != -1)\n {\n return true;\n }\n else if (ques.indexOf('name') != -1)\n {\n return true;\n }\n \n else if (ques == 'id')\n {\n return true;\n }\n \n var id_index = ques.indexOf('id');\n if (id_index != -1)\n {\n if (id_index > 0)\n {\n if (ques[id_index-1] == ' ')\n {\n // e.g. \"student id\"\n return true;\n }\n }\n } \n else if (ques.indexOf('id:') != -1)\n {\n // e.g. student id:\n return true;\n }\n else if (ques.indexOf('identity') != -1)\n {\n return true;\n }\n else if (ques.indexOf('identifier') != -1)\n {\n return true;\n }\n else if (ques.indexOf('class') != -1)\n {\n return true;\n }\n else if (ques.indexOf('section') != -1)\n {\n return true;\n }\n else if (ques.indexOf('period') != -1)\n {\n return true;\n }\n else if (ques.indexOf('room') != -1)\n {\n return true;\n }\n else if (ques.indexOf('student') != -1)\n {\n return true;\n }\n else if (ques.indexOf('teacher') != -1)\n {\n return true;\n }\n else if (ques.indexOf('email') != -1)\n {\n return true;\n }\n else if (ques.indexOf('e-mail') != -1)\n {\n return true;\n }\n \n // spanish\n else if (ques.indexOf('correo') != -1)\n {\n return true;\n }\n \n return false;\n }", "function showQuestions() {\n $(questionText).text(quizObject[index].question);\n $(optionA).text(quizObject[index].answerA);\n $(optionB).text(quizObject[index].answerB);\n $(optionC).text(quizObject[index].answerC);\n $(optionD).text(quizObject[index].answerD);\n }", "function showAnswer()\n {\n let displayAnswer;\n saveAnswer=(QuizObj[index].answer); // retrieve answer from object in array \n // console.log(`index is Ans :${index}`);\n // console.log(`saveAnswer is ${saveAnswer+1}`);\n // console.log(`retrieve answer from object ${QuizObj[0].possible1}`)\n \n displayAnswer=\"possible\"+saveAnswer;\n\n \n console.log(`answer is : ${QuizObj[index][displayAnswer]}`); //bad expression\n //console.log(\"answer2222 is \"+QuizObj[0][1]);\n \n //clear div tag answers\n $(\".answersContainer\").empty();\n $(\".answersContainer\").html(`<h3 class=\"validation\"> ${check} </h3> <img src=\"${QuizObj[index].visual}\" class=\"result .img-rounded img-responsive\">`);\n $(\".answersContainer\").append(`<h2 class=\"answer\">answer is ${QuizObj[index][displayAnswer]} </h2>`);\n\n index++; // Next question\n if(index>15) // Stop counter if reach end of Quizz (quizzobj[0].length-1)\n {\n clearInterval(intervalId);\n clockrunning=false;\n showResults(); \n return endQuizz;\n }\n setTimeout(time5sec,3000); // set timeOut to 3 sec before next question \n }", "function quizUser() // TODO Implement actual timer\n{\n if (questionNum > 5)\n {\n endQuiz(timer.toFixed(2));\n return;\n }\n\n // Get question and populate relevent text in quizzer\n let question = quiz[questionNum-1];\n txt_question.innerHTML = question.q;\n btn_answer1.innerHTML = question.o[0];\n btn_answer2.innerHTML = question.o[1];\n btn_answer3.innerHTML = question.o[2];\n btn_answer4.innerHTML = question.o[3];\n}", "function updateInstructorInfo(nameMap, text, foundLocal) {\n\n\tvar tdIndexInstructor = nameMap.tdIndexInstructor;\n\tvar lname = nameMap.lname;\n\tvar name = nameMap.name;\n\n\tif(text.indexOf('No results were found') > -1) {\n\t\tfor(var tdIndex=0, tc = nameMap.td.length; tdIndex < tc; tdIndex++) {\n\t\t\tnameMap\n\t\t\t.td[tdIndex]\n\t\t\t.attr('title','No record found in the directory')\n\t\t}\n\t\tif(localStorage.getItem('sched.param(debug)') !== '0') {\n\t\t\tconsole.log('Employee directory has no record for \\'' + lname + '\\'');\n\t\t}\n\t}\n\telse {\n\t\tfor(var tdIndex=0, tc = nameMap.td.length; tdIndex < tc; tdIndex++) {\n\t\t\tnameMap\n\t\t\t.td[tdIndex]\n\t\t\t.addClass('td-tooltip')\n\t\t\t.empty();\n\t\t}\n\t\tvar tipContent =\n\t\t\t$('<div>')\n\t\t\t.addClass('name-tooltip')\n\t\t\t.append(text)\n\t\t\t.append(\n\t\t\t\t$('<span>')\n\t\t\t\t.html(\n\t\t\t\t\t'<br><br>See all employees having last name starting with \\'' +\n\t\t\t\t\t'<a href=\"https://gsw.edu/searchDirectory/employee/search.php?name=' + lname + '\" ' +\n\t\t\t\t\t'target=\"_blank\">' + lname + '</a>\\''\n\t\t\t\t)\n\t\t\t);\n\t\tvar a = $('<a>')\n\t\t\t.attr('href','')\n\t\t\t.click(function(){\n\t\t\t\t/*\n\t\t\t\tif($('#container').hasClass('blur')) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\tvar clickElement = $(this);\n\t\t\t\t//-- Create tooltip container if does not exist\n\t\t\t\tif($('div.tooltip-container').length === 0) {\n\t\t\t\t\t$('#topOfThePage')\n\t\t\t\t\t.after(\n\t\t\t\t\t\t$('<div>')\n\t\t\t\t\t\t.addClass('tooltip-container')\n\t\t\t\t\t\t.addClass('no-print')\n\t\t\t\t\t\t.click(function(){\n\t\t\t\t\t\t\t$(this).remove();\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tvar toolTipContainer =\n\t\t\t\t\t$('div.tooltip-container')\n\t\t\t\t\t.html(tipContent)\n\t\t\t\t\t.css({\n\t\t\t\t\t\t'position' : 'absolute'\n\t\t\t\t\t})\n\t\t\t\tif(isMobile()) {\n\t\t\t\t\ttoolTipContainer\n\t\t\t\t\t.css({\n\t\t\t\t\t\t'left' : ($(window).width() - toolTipContainer.width())/2,\n\t\t\t\t\t\t'top' : ($(window).height() - toolTipContainer.height())/2 + $(window).scrollTop()\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttoolTipContainer\n\t\t\t\t\t.css({\n\t\t\t\t\t\t'top' : clickElement.offset().top - toolTipContainer.height(),\n\t\t\t\t\t\t'left' : clickElement.offset().left - toolTipContainer.width()\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t})\n\t\t\t.text(name)\n\t\t\t.appendTo(nameMap.td);\n\t}\n}", "function whatIsQuestion() {\n\n if(anonymousvotingAddr.state() > 0) {\n var q = anonymousvotingAddr.question();\n document.getElementById('title').innerHTML = q;\n }\n}", "function display(questionIndex) {\n quizContainer.innerHTML = \" \";\n ulCreate.innerHTML = \" \";\n //To display questions\n for (var i = 0; i < myQuestions.length; i++) {\n var userQuestion = myQuestions[questionIndex].question;\n var userChoices = myQuestions[questionIndex].answers;\n quizContainer.textContent = userQuestion;\n quizContainer.setAttribute(\"style\", \"width:100%;\")\n }\n // To dispalay the relatives answers\n userChoices.forEach(function (answerList) {\n var listAnswer = document.createElement(\"li\");\n listAnswer.setAttribute(\"id\", \"listAnswer\")\n listAnswer.textContent = answerList;\n quizContainer.appendChild(ulCreate);\n ulCreate.appendChild(listAnswer);\n listAnswer.addEventListener(\"click\", (compare));\n\n });\n}", "function whatIsTheAns(){\n $('#currentQ').empty();\n $('.myChoice').empty();\n $('.question').empty();\n\n // The correct answer is pulled out from the object myQuestions and stored in var theAnswerText\n var theAnswerText = myQuestions[currentQ].answerArray[myQuestions[currentQ].correctAnswer];\n var theAnswerNum = myQuestions[currentQ].correctAnswer;\n //link img if you wish 144\n\n if((userAns === theAnswerNum) && (isAnswered === true)){\n correctAns++;\n $('#prompt').html(prompt.whenCorrect);\n } else if ((userAns !== theAnswerNum) && (isAnswered === true)){\n wrongAns++;\n $('#prompt').html(prompt.whenIncorrect);\n $('#fixedAns').html('The correct answer was: ' + theAnswerText);\n } else {\n noAns++;\n $('#prompt').html(prompt.whenNoTimeLeft);\n $('#fixedAns').html('The correct answer was: ' + theAnswerText);\n isAnswered = true;\n }\n\n if (currentQ === (myQuestions.length-1)){\n setTimeout(results, 1000);\n } else {\n currentQ++;\n setTimeout(displayQuestion, 1000);\n }\n\n}", "function showQuestion(){\n\ttimeRemaining = 30\n\ttimer = setInterval(timerFunction, 1000);\n\tif (index > 0) {\n\t\t$(\"#previous\").removeClass(\"initialHide\");\n\t}\n\tif (index == 4) {\n\t\t$(\"#next\").text(\"Get my Results\");\n\t}\n\n// Set the timer and the text for the questions\n\t$(\"#timer\").text(timeRemaining);\n\t\t$(\"#hint\").text(\"\");\n\t\t$(\"#question,#answers,#next\").removeClass('initialHide');\n\t\t$(\"#question-text\").text(currentQuestion.question);\n\t\t$(\"#question-sentence\").text(currentQuestion.sentence);\n\t\t$(\"#answer-one\").text(currentQuestion.answers.a);\n\t\t$(\"#answer-two\").text(currentQuestion.answers.b);\n\t\t$(\"#answer-three\").text(currentQuestion.answers.c);\n\t\t$(\"#answer-four\").text(currentQuestion.answers.d);\n\n\t\t$('p.answer-border').click(function(){\n\t\t\tanswerChoice = $(this).html();\n\t\t\tcheckAnswer();\n\t\t})\n}", "function results() {\n $(\"#questions\").hide();\n $(\"#options\").hide();\n $(\"#time-left\").hide();\n $(\"#results\").show();\n $(\"#correct\").html(\"Correct Answers:\" + correctAnswersCount);\n $(\"#incorrect\").html(\"Wrong Answers:\" + incorrectAnswersCount);\n\n\n}", "function viewRoles() {\r\n var query = 'SELECT * FROM role';\r\n connection.query(\"SELECT employee.first_name, employee.last_name, role.title AS Title FROM employee JOIN role ON employee.role_id = role.id;\", \r\n function(err, res) {\r\n if (err) throw err\r\n console.table(res)\r\n questions();\r\n })\r\n}", "function loadStudentExamData(name, code) {\n document.getElementById('examSpecific').style.display = \"none\";\n document.getElementById('student-exam-data').style.display = \"initial\";\n document.body.style.backgroundImage = \"none\";\n var answer = \"\";\n var finalId;\n\n //linear-gradient(135deg, rgb(245, 247, 250) 0%, rgb(195, 207, 226) 100%);\n\n var table = document.getElementsByClassName('table');\n for(var i = 0; i < table.length; i++) {\n table[i].style.display = \"none\";\n }\n\n firebase.database().ref(\"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem(\"className\") + \"/Students\").once('value', function(snapshot) {\n for(var info in snapshot.val()) {\n var data = snapshot.val()[info];\n var id = data.split(\";\")[0];\n var fullName = data.split(\";\")[1];\n\n if(name == fullName) {\n finalId = id;\n }\n }\n });\n\n firebase.database().ref(\"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem(\"className\") + \"/Exams/\" + code).once('value', function(snapshot) {\n var data = (snapshot.val().responses[name][Object.keys(snapshot.val().responses[name])[0]]);\n\n document.getElementById('resetStatus').onclick = function() {\n for(var takenKey in snapshot.val().taken) {\n var id = (snapshot.val().taken[takenKey]);\n\n if(id == finalId) {\n firebase.database().ref(\"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem(\"className\") + \"/Exams/\" + code + \"/taken/\").child(takenKey).remove()\n }\n }\n\n swal(\"Success!\", name + \"'s taken status has been reset. \" + name + \" should be able to retake exam now.\", 'success')\n }\n\n var studentPoints = data.totalScore / 100 * snapshot.val()[Object.keys(snapshot.val())[0]].examTotalPoints;\n document.getElementById('score-num').innerHTML = (studentPoints).toFixed(0) + \" / \" + snapshot.val()[Object.keys(snapshot.val())[0]].examTotalPoints;\n document.getElementById('score').innerHTML = data.totalScore + \"%\";\n\n var corrAnswer = \"\";\n sessionStorage.setItem(\"totalPointsExcludingFr\", 0);\n\n for(var i = 0; i < Object.keys(data.answers).length; i++) {\n\n if(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].type == \"tf\") {\n corrAnswer = snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].choices[0];\n }\n else if(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].type == \"mc\"){\n corrAnswer = snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].checked;\n }\n else if(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].type == \"fr\") {\n corrAnswer = \"\";\n }\n createGradedQuestion(\n // PARAM: studAnswer\n data.answers[i].split(\";\")[1],\n // PARAM: corrAnswer\n corrAnswer,\n // PARAM: numAnswerChoices\n Object.keys(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].choices).length,\n // PARAM: numPoints\n snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].points,\n // PARAM: questions\n snapshot.val()[Object.keys(snapshot.val())[0]].questions[i],\n // PARAM: studName\n name,\n // PARAM: examCurrentCode\n code,\n // PARAM: examTotalPoints\n snapshot.val()[Object.keys(snapshot.val())[0]].examTotalPoints\n );\n }\n });\n}", "function showEvidenceQuestionsByMethod(mp_method) {\r\n if (mp_method == \"Case Report\") { \r\n\t$(\"#caseReport\").css(\"display\",\"block\");\r\n } else if (mp_method == \"Clinical study\") {\r\n\t$(\"#clinicalTrial\").css(\"display\",\"block\");\t\t\r\n } else if (mp_method == \"Metabolic Experiment\") {\r\n\t$(\"#metabolic\").css(\"display\",\"block\");\t\t\r\n } else if (mp_method == \"Transport Experiment\") {\r\n\t$(\"#transport\").css(\"display\",\"block\");\t\t\t\r\n } else {\r\n\tconsole.log(\"[ERROR] evidence type undefined: \" + mp_method);\r\n }\r\n}", "function getQuizPage() {\n \n}", "function displayQuestion() {\n hideResults();\n $(\"#answer\").hide();\n $(\"#time\").show();\n showDiv();\n $(\"#question\").html(question[questionCount]);\n $(\"#choice1\").html(firstChoice[questionCount]);\n $(\"#choice2\").html(secondChoice[questionCount]);\n $(\"#choice3\").html(thirdChoice[questionCount]);\n $(\"#choice4\").html(fourthChoice[questionCount]);\n }", "function show_subject_tab(){\n\t$(\"subject_tab\").show();\n\t\n\t$(\"subject_list\").show();\n\t$(\"subject_detail\").hide();\n\t$(\"subject_new\").hide();\n\t\n\t$(\"homeroom_tab\").hide();\n\t$(\"library_tab\").hide();\n\t$(\"exam_tab\").hide();\n\t$(\"homework_tab\").hide();\n\t$(\"student_tab\").hide();\n\t\n\ttab_on(1);\n}", "function getExerciseEntriesFromLessons(){\n console.log(\"Getting Exercise Entries for lesson Page \" + lessonID);\n dbShellLessons.transaction(function(tx){ // put teacher_id also\n tx.executeSql(\"select lessonRow_id,teacher_id,lesson_id,exercise_id,exercise_title,exercise_detail,\\\n exercise_voice,exercise_image from lessons where lesson_id=? group by exercise_id\",[lessonID]\n ,renderEntriesForExerciseInLessonPage,dberrorhandlerForLessons);\n },dberrorhandlerForLessons);\n}", "function HistoryAnswer(question,useAnswer,correct){\n this.question=question;\n this.useAnswer=useAnswer;\n this.correct=correct;\n resultHistory.push(this)\n }", "function showAnswer() {\n $(\"#questions\").empty();\n $(\".answers\").empty();\n\n var gif = $(\"<img class = 'answer-images'>\").attr(\"src\", questions[click - 1].Image);\n $(\".answers\").append(gif);\n var explanationDiv = $(\"<div>\");\n var answer = $(\"<h3 class = 'answer-explanations'>\").html(\"<b>Correct Answer: </b>\" + questions[click - 1].Correct);\n var explanation = $(\"<h3 class = 'answer-explanations'>\").text(questions[click - 1].explanation);\n explanationDiv.append(answer, explanation)\n $(\".answers\").append(explanationDiv);\n\n // temporarily utilize flexbox for explanation display\n $(\".answers\").css(\"display\", \"flex\");\n\n // ternary to reduce font-size of long explanations\n $(\".answer-explanations\").css(\"font-size\", questions[click - 1].explanation.length > 300 ? \"0.8em\" : \"1.0em\");\n\n var nextQuestionButton = $(\"<button>\").addClass(\"btn game-button next-question\").text(\"Skip\");\n $(\".answers\").append(nextQuestionButton);\n\n\n showAnswerTimer = setTimeout(function () {\n $(\".answers\").css(\"display\", \"block\");\n if (click < questions.length) {\n nextQuestion();\n }\n else if (click === questions.length) {\n displayScore();\n }\n }, questions[click - 1].explanation.length > 300 ? 10000 : 6000);\n }", "function showQuestion() {\n if (trackQuestion == questions.length) {\n scorePage();\n } else {\n questionElement.textContent = questions[trackQuestion].question;\n btn1.textContent = questions[trackQuestion].answers[0];\n btn2.textContent = questions[trackQuestion].answers[1];\n btn3.textContent = questions[trackQuestion].answers[2];\n btn4.textContent = questions[trackQuestion].answers[3];\n trackQuestion++;\n console.log(trackQuestion);\n }\n}", "function displayQus(dataText) {\n var ansArr = document.querySelectorAll('.ans')\n id = 0\n if (ansArr) {\n ansArr.forEach(e => e.remove())\n }\n var qusText = document.querySelector('.ques-container h4')\n document.querySelector('.conclusion-container').style.display = \"block\"\n document.querySelector('.check').style.opacity = \"0\"\n document.querySelector('.check .explain').innerText = dataText[id].explain\n qusText.innerText = dataText[id].qus\n displayAns(dataText, id)\n}", "function showUsersGroups(answer) {\n var array = getUsersGroups(answer);\n console.log(answer + ' is found in the following groups: ');\n array.forEach(function (group) {\n console.log(group.group_name);\n });\n helpers.menuCallback();\n}", "function mostrarExamen(){\n //Recoge la información del formulario\n var nQuestions = getValue('n_questions');\n var typeQuestions = getValue('type_question'); //0 Español-Ingles, 1 Inglés español, 2 aleatorio\n var bAyuda = getValue('with_help'); \n var nGroup = getValue('numberGroup'); \n\n // En caso de seleccionar todas las respuestas\n if (nQuestions == 0) {\n nQuestions = arrayVerb.length;\n }\n\n document.getElementById(\"resultadoFinal\").innerHTML='';\n document.getElementById(\"palabrasCorrectas\").innerHTML='';\n document.getElementById(\"examList\").innerHTML='';\n\n exam = new examen(nQuestions, typeQuestions, bAyuda, nGroup);\n\n addHeaderTable(\"examList\");\n document.getElementById(\"lblMaxGrupos\").innerHTML = \"Max. \" + exam.nTotalGrupo;\n document.getElementById(\"examList\").innerHTML += exam.showExam();\n document.getElementById(\"btnResult\").disabled = false;\n \n}", "function displayQuestions(){\n\n\t//Start timer.\n\tintervalId = setInterval(displayTime, 1000);\n\n\t//If the time is over\n\t//timer = setTimeout(timeOut, 1000 * parseInt(sec));\n\n\tvar quiz = \"\";\n\tfor(var i=0; i<quizList.length; i++){\n\n\t\tvar multipleChoice = \"\";\n\n\t\t//Get mutiple choice for each question, set it's values according to the choices and set same name for each question to group them together.\n\t\tfor(var j=0; j<quizList[i].choices.length; j++){\n\t\t\tmultipleChoice += \"<br><input name=\" + quizList[i].name + \" type='radio' value=\" + quizList[i].choices[j] + \">&emsp;\" + quizList[i].choices[j]; \n\t\t}\n\n\t\t//Append all questions along with its choices\n\t\tquiz += \"<span class='question'>\" + quizList[i].question + \"</span>\" + multipleChoice + \"<hr>\";\n\t}\n\n\t//Append all question and its choices in the form and display it on screen\n\t$(\".quiz-form\").append(quiz);\n\t$('.form').show();\n\t$('.map-image').hide();\t\n\t$('#start').hide();\n}" ]
[ "0.56121784", "0.55771226", "0.5531409", "0.5525864", "0.54792386", "0.5478827", "0.54045963", "0.5393816", "0.53929514", "0.53826094", "0.53681827", "0.5339943", "0.5332711", "0.532865", "0.52932", "0.527741", "0.5274747", "0.52560097", "0.5255776", "0.5249104", "0.5248587", "0.5241801", "0.5233985", "0.52227396", "0.5222505", "0.5208418", "0.5207337", "0.520699", "0.52022135", "0.52003384", "0.51970416", "0.5191401", "0.5186414", "0.5185183", "0.5182087", "0.5168168", "0.515002", "0.51486033", "0.5146326", "0.51460093", "0.5142306", "0.51399595", "0.513484", "0.51305985", "0.5129312", "0.5123586", "0.5123072", "0.51203036", "0.51202", "0.51179755", "0.5117932", "0.5115121", "0.51054436", "0.5102351", "0.5091172", "0.5087396", "0.5082724", "0.50825816", "0.5077912", "0.5076721", "0.5071853", "0.5070012", "0.50591516", "0.50563693", "0.5048273", "0.5044843", "0.5036514", "0.5036365", "0.50336987", "0.50223154", "0.5019803", "0.50194514", "0.5018297", "0.5016309", "0.5009633", "0.5005931", "0.500578", "0.50026107", "0.4997638", "0.49973786", "0.49941197", "0.49918228", "0.49914804", "0.49888393", "0.49858823", "0.49801433", "0.49797964", "0.49784738", "0.49765363", "0.49752536", "0.49749503", "0.49692127", "0.4966568", "0.49662837", "0.49656886", "0.49652994", "0.4964515", "0.4961482", "0.4960773", "0.496044", "0.49598944" ]
0.0
-1
Displays table of students who have taken exam and gotten score
function viewTakenExam() { highlightCurrent('#viewTakenExam'); $('#mytable').bootstrapTable('destroy'); $('#mytable').bootstrapTable({ url: baseURL + 'api/users/readTakenExam.php', pagination: true, search: true, showButtonText: true, showSearchClearButton: true, buttonsClass: "ucf", showColumns: true, sortName: 'examDate', sortOrder: 'desc', columns: [{ field: 'id', title: 'ID', sortable: 'true' }, { field: 'firstName', title: 'First Name', sortable: 'true' }, { field: 'lastName', title: 'Last Name', sortable: 'true', }, { field: 'uploadDate', title: 'Date Uploaded', sortable: 'true' }, { field: 'examID', title: 'Exam Taken', sortable: 'true' }, { field: 'examDate', title: 'Exam Date', sortable: 'true' }, { field: 'examTimeLimit', title: 'Time Limit' }, { field: 'examStartTime', title: 'Exam Started' }, { field: 'examEndTime', title: 'Exam Ended' }, { field: 'examScore', title: 'Score', sortable: 'true' }, { field: 'actionA', title: 'Details', formatter: 'viewScoreFormatter', align: 'center' }] }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderScoreTable() {\n var currScoreList = UserScoreHelper.getScores();\n // Clear the table \n scoreTableEl.innerHTML = \"\";\n if (currScoreList.length > 0) {\n // Update table with user scores\n for (var index = 0; index < currScoreList.length; index++) {\n var row = createScoreTableRow();\n addColumnToRow(row, (index + 1), true);\n addColumnToRow(row, currScoreList[index].initials);\n addColumnToRow(row, currScoreList[index].score);\n }\n } else {\n // No user scores found - display message to user\n var row = createScoreTableRow();\n var column = addColumnToRow(row, \"No Scores Found\");\n column.setAttribute(\"colspan\", \"3\");\n column.setAttribute(\"class\", \"text-center\");\n }\n}", "function displayScore() {\n var score = $('<p>',{id: 'question'});\n \n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n\n var numIncorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].wrongAnswer) {\n numIncorrect++;\n }\n }\n \n score.append('Correct Answers:' + numCorrect);\n score.append('Incorrect Answers:' + numInorrect);\n \n \n }", "function display(){\n\n dom.name.innerHTML = students[studentNum].name;\n dom.address.innerHTML = students[studentNum].address.street + \" \" + students[studentNum].address.city;\n dom.grades.innerHTML = avg();\n\n //after show student1, go to student2\n studentNum++;\n\n if (studentNum == students.length){\n studentNum = 0;\n }\n\n }", "function showScore () {\n\t$(\".questions\").hide();\n\t$(\".result\").show();\n\tshowScore();\n}", "function renderResponseEntriesForExercise(tx,results){\n console.log(\"Rendering response entries of all students for exercise \" + exerciseID + \" of lesson \"+ lessonID + \" of teacher \" + teacherID);\n if (results.rows.length == 0) {\n console.log(\"No row found for the query in responseandmark table\");\n $(\"#studentListForEx\").html(\"<p>この練習はだれも答えてないです。</p>\");\n } else {\n var s = \"<table id='studentAndScores'><tr>\";\n console.log(\"Number of responses from students = \" + results.rows.length);\n \n dbShellStudents = window.openDatabase(\"StudentProfile\",2,\"StudentProfile\",1000000);\n \n //open student database\n //get info from StudentProfile database for student_id\n dbShellStudents.transaction(setupTable,dberrorhandler,function(){\n console.log(\"Getting student entries for exercise.\");\n\n dbShellStudents.transaction(\n function(tx){\n// console.log(\"teacher = \" + item.teacher_id + \"student=\" + item.student_id + \"lesson\" + item.lesson_id + \"exercise\" + item.exercise_id + \"response=\" + item.response);\n dbShellStudents.transaction(function(tx){\n for(var i=0; i<results.rows.length; i++) {\n //getting student info\n var student_ID = results.rows.item(i).student_id;\n var responseURI = results.rows.item(i).response;\n var scoreMark;\n if(results.rows.item(i).scoreMark == null)\n scoreMark = -1;\n var studentImageURI;\n var studentName;\n \n var item = results.rows.item(i);\n console.log(\"i=\"+i+\"id=\" + student_ID); //+ \"name=\" + studentName);\n (function(student_ID,scoreMark){\n tx.executeSql(\"select id,name,image from students where id=?\",[student_ID],\n function(tx,res){\n //studentID is unique\n studentImageURI = res.rows.item(0).image;\n studentName = res.rows.item(0).name;\n //\n //show student image, student name and score mark\n s = s +\n \"<div id ='responseFromStudent?id=\" + i + \"'>\"+\n \"<li>\" +\n \"<img height='40' width='40' src=\\\"\" + studentImageURI + \"\\\" ><br>\" +\n \"<p>\";\n \n if(scoreMark != -1){\n s += \"<p> スコアー:\" + scoreMark + \"</p>\";\n }\n \n s +=\"<a href='#response?studentID=\" + student_ID + \"&studentName=\" + studentName +\"'> 学生名:\" + studentName + \"</a>\" +\n \"</p><br>\";\n\n s +=\"</li>\"+\"</div>\";\n\n },\n function(err){\n console.log(\"Student info get Error: \"+err.message + \"\\nCode=\"+err.code);\n alert(\"Student info get Error: \"+err.message + \"\\nCode=\"+err.code);\n }\n );\n\n })(student_ID,scoreMark);\n }//end for\n }\n ,dberrorhandler,\n function(){\n s +=\"</tr>\"+\"</table>\";\n console.log(s);\n console.log(\"Showing the list\");\n $(\"#studentListForEx\").html(s);\n $(\"#studentListForEx\").listview().listview(\"refresh\");\n }\n );\n },\n dberrorhandler\n );\n \n });\n }\n}", "function showScores() {\n console.log(chalk.whiteBright.bold(\" YAY!\"),`${chalk.magentaBright.bold(userName)}`, chalk.whiteBright.bold(\"You have Scored:\"), `${chalk.green.bold(score)}`, '\\n');\n\n console.log(chalk.yellowBright.bold.inverse(\" Check out these HIGH SCORES: \"));\n\n for (let i in highScores) {\n console.log(highScores[i].name, \" : \", highScores[i].score)\n }\n}", "function showResults() {\n // variables\n var table, tBody, row, cellDomain, cellRank, cellExplain, i;\n // change the div on display\n document.getElementById('questions').style.display = 'none';\n document.getElementById('rubric').style.display = 'block';\n\n // get the table\n table = document.getElementById('table');\n // create the <tbody>\n tBody = document.createElement(\"tbody\");\n\n // create the cells\n for (i = 0; i < DOMAINS.length; i++) {\n // the row\n row = document.createElement(\"tr\");\n // domain cell\n cellDomain = document.createElement(\"td\");\n cellDomain.appendChild(document.createTextNode(DOMAINS[i]));\n row.appendChild(cellDomain);\n // rank cell\n cellRank = document.createElement(\"td\");\n cellRank.className = \"rank\";\n cellRank.appendChild(document.createTextNode((score[i] + 1) + \"/\" + (QUESTIONS[i].length + 1)));\n row.appendChild(cellRank);\n // explanation cell\n var cellExplain = document.createElement(\"td\");\n if (flagTerminateDomain && score[i] == 2) {\n // \"Skill Communication\" special text\n cellExplain.appendChild(document.createTextNode(STATEMENT_SKILLED_COM_ALT));\n } else {\n // usual text\n cellExplain.appendChild(document.createTextNode(STATEMENTS[i][score[i]]));\n }\n row.appendChild(cellExplain);\n // add the row to the table\n tBody.appendChild(row);\n }\n table.appendChild(tBody);\n}", "function displayScore() {\n \tstop();\n \tvar score = $('<p>',{id: 'question'});\n\n \tvar numCorrect = 0;\n \tfor (var i = 0; i < selections.length; i++) {\n \t\tif (selections[i] === questions[i].correctAnswer) {\n \t\t\tnumCorrect++;\n \t\t}\n \t}\n\n \tscore.append('You scored: ' + numCorrect + ' out of ' +\n \t\tquestions.length + ' questions.');\n \treturn score;\n }", "function displayExamData(examName) {\n if(!examDataHasLoaded) {\n var cumAvg = 0;\n var classLength = 0;\n var highest = \"a:-1000\";\n var lowest = \"a:1000\";\n var quickest = \"a:1000\";\n var slowest = \"a:-1000\";\n var table;\n var populated = false;\n var standardDeviation = [];\n\n document.getElementById('welcome-div').style.display = \"none\";\n document.getElementById('wrapper').style.display = \"none\";\n document.getElementById('classSpecific').style.display = \"none\";\n document.getElementById('exam-wrapper').style.display = \"none\";\n document.getElementById('examSpecific').style.display = \"initial\";\n document.getElementById('sort-menu').style.display = \"initial\";\n document.getElementById('exam-name').innerHTML = examName;\n document.getElementById('this-exam').innerHTML = examName;\n document.body.style.backgroundImage = \"linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%)\";\n\n var i = document.createElement('i');\n i.className = \"glyphicon glyphicon-circle-arrow-up\";\n i.id = \"topPage\";\n\n i.onclick = function() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n };\n\n document.getElementById('main').appendChild(document.createElement('br'));\n document.getElementById('main').appendChild(i);\n\n var finalSelectedCode = \"\";\n var examCodeWithLetter = \"\";\n\n for (var key in exams) {\n // skip loop if the property is from prototype\n if (!arr.hasOwnProperty(key)) continue;\n var obj = exams[key];\n\n for (var prop in obj) {\n for(var initData in obj[prop]){\n if(obj[prop][initData].examCode != undefined && Object.keys(obj[prop]).length > 1) {\n var code = obj[prop][initData].examCode;\n\n sessionStorage.setItem('populatedExamCode', code);\n\n if(examName == obj[prop][initData].examTitle) {\n finalSelectedCode = code;\n examCodeWithLetter = prop;\n\n document.getElementById('edit-exam').innerHTML = examName;\n document.getElementById('edit-current-exam').style.display = \"initial\";\n\n document.getElementById('edit-current-exam').onclick = function() {\n document.getElementById('create-exam').style.display = \"initial\";\n document.getElementById('main').style.display = \"none\";\n document.body.style.background = \"white\";\n populateExam(finalSelectedCode, \"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem('createExamClass') + \"/Exams/\" + examCodeWithLetter)\n };\n\n document.getElementById('view-item-analysis').style.display = \"initial\";\n document.getElementById('view-item-analysis').onclick = function() {\n document.getElementById('main').style.display = \"none\";\n document.getElementById('item-analysis').style.display = \"inline-block\";\n document.body.style.backgroundImage = \"linear-gradient(to bottom, #6a85b6 0%, #bac8e0 100%)\";\n document.getElementById('item-analysis-name').innerHTML = examName;\n document.getElementById('current-exam').innerHTML = examName;\n populateItemAnalysis(finalSelectedCode, \"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem('createExamClass') + \"/Exams/\" + examCodeWithLetter)\n }\n }\n\n // skip loop if the property is from prototype\n if(!obj.hasOwnProperty(prop)) continue;\n\n var dbName = obj[prop][initData].examTitle;\n if(dbName == \"\") {\n dbName = obj[prop][initData].examCode.substring(1);\n }\n\n if(dbName == examName) {\n var random = document.createElement('div');\n var table = document.createElement('table');\n\n table.id = \"random\";\n table.className = \"table table-striped\";\n table.style.width = \"100vw\";\n\n var init = document.createElement('tr');\n init.style.color = \"darkgray\";\n\n var initName = document.createElement('td');\n initName.innerHTML = \"Name\";\n initName.style.paddingLeft = \"66px\";\n initName.id = \"name\";\n\n var initScore = document.createElement('td');\n initScore.innerHTML = \"Score (%)\"\n initScore.id = \"score\";\n\n var initPercentile = document.createElement('td');\n initPercentile.innerHTML = \"Percentile\";\n initPercentile.id = \"percentile\";\n\n var initTime = document.createElement('td');\n initTime.innerHTML = \"Time\";\n initTime.id = \"time\";\n\n init.appendChild(initName);\n init.appendChild(initScore);\n init.appendChild(initPercentile);\n init.appendChild(initTime);\n\n table.appendChild(init);\n }\n }\n else if(Object.keys(obj[prop]).length > 1 && !populated){\n populated = true;\n\n for(var response in obj[prop].responses){\n var data = obj[prop].responses[response][Object.keys(obj[prop].responses[response])[0]];\n\n standardDeviation.push(parseInt(data.score));\n examData.push(data.name + \":\" + data.score + \":\" + data.time);\n cumAvg += parseInt(data.score);\n classLength = Object.keys(obj[prop].responses).length;\n\n if(parseInt(data.score) > parseInt(highest.split(\":\")[1])) {\n highest = data.name + \":\" + parseInt(data.score);\n }\n\n if(parseInt(data.score) < parseInt(lowest.split(\":\")[1])) {\n lowest = data.name + \":\" + parseInt(data.score);\n }\n\n var tr = document.createElement('tr');\n tr.className = response;\n var examCode = prop;\n tr.onclick = function() { loadStudentExamData(this.className, examCode); }\n\n table.appendChild(document.createElement('br'));\n\n \t\t\tvar name = document.createElement('td');\n name.style.paddingLeft = \"66px\";\n name.id = \"name\";\n \t\t\tvar score = document.createElement('td');\n \t\t\tvar percentile = document.createElement('td');\n var time = document.createElement('td');\n\n \t\t\tname.innerHTML = data.name;\n name.id = \"name\";\n\n \t\t\tscore.innerHTML = data.score + \"%\";\n score.id = \"score\";\n\n time.innerHTML = data.time + \" Mins\";\n time.id = \"time\";\n\n \t\t\tpercentile.innerHTML = getPercentileOriginal(parseInt(data.score), obj[prop].responses, data.name) + \"th\";\n percentile.id = \"percentile\";\n\n \t\t\ttr.appendChild(name);\n \t\t\ttr.appendChild(score);\n \t\t\ttr.appendChild(percentile);\n tr.appendChild(time);\n \t\t\ttable.appendChild(tr);\n\n random.appendChild(table);\n document.getElementById('main').appendChild(random);\n }\n }\n }\n\n var feedback = document.createElement('div');\n feedback.style.marginBottom = \"40px\";\n feedback.appendChild(document.createElement('hr'));\n feedback.appendChild(document.createElement('br'));\n\n var feedbackHeader = document.createElement('h1');\n feedbackHeader.style.fontSize = \"15px\";\n feedbackHeader.style.textAlign = \"center\";\n feedbackHeader.innerHTML = \"Feedback On '\" + document.getElementById('exam-name').innerHTML + \"'\";\n feedbackHeader.style.textDecoration = \"underline\";\n feedback.appendChild(feedbackHeader)\n\n for(data in obj[prop].feedback) {\n var span = document.createElement('span');\n span.innerHTML = (obj[prop].feedback[data]);\n span.style.marginLeft = \"35px\";\n span.style.borderLeft = \"1px solid black\";\n span.style.paddingLeft = \"15px\";\n\n feedback.appendChild(span);\n feedback.appendChild(document.createElement('hr'));\n }\n\n document.getElementById('main').appendChild(feedback);\n }\n }\n\n var overallData = document.getElementById('overall-data');\n var ul = document.createElement('ul');\n ul.style.float = \"right\";\n ul.style.marginRight = \"15vw\";\n\n var avg = document.createElement('li');\n avg.innerHTML = \"Class Average: \" + (cumAvg / classLength).toFixed(1) + '%';\n avg.style.fontSize = \"20px\";\n\n var highestScorer = document.createElement('li');\n highestScorer.innerHTML = \"Highest Scorer: \" + highest.split(\":\")[0] + \" (\" + highest.split(\":\")[1] + \"%)\";\n highestScorer.style.fontSize = \"20px\";\n\n var lowestScorer = document.createElement('li');\n lowestScorer.innerHTML = \"Lowest Scorer: \" + lowest.split(\":\")[0] + \" (\" + lowest.split(\":\")[1] + \"%)\";\n lowestScorer.style.fontSize = \"20px\";\n\n var standardDev = document.createElement('li');\n\n // calculate SD\n mean = standardDeviation.reduce((a,b) => a+b)/standardDeviation.length;\n sd = Math.sqrt(standardDeviation.map(x => Math.pow(x-mean,2)).reduce((a,b) => a+b)/standardDeviation.length);\n\n standardDev.innerHTML = \"Standard Deviation (σ): \" + sd.toFixed(3);\n standardDev.style.fontSize = \"20px\";\n\n ul.appendChild(avg);\n ul.appendChild(highestScorer);\n overallData.appendChild(document.createElement('br'));\n ul.appendChild(lowestScorer);\n ul.appendChild(standardDev);\n\n overallData.appendChild(ul);\n\n }\n else {\n var possibleTables = document.getElementsByClassName('table');\n possibleTables[0].style.display = \"table\";\n\n document.getElementById('topPage').style.display = \"initial\";\n document.getElementById('examSpecific').style.display = \"inherit\";\n document.getElementById('classSpecific').style.display = \"none\";\n document.getElementById('exam-wrapper').style.display = \"none\";\n\n document.body.style.backgroundImage = \"linear-gradient(135deg, rgb(245, 247, 250) 0%, rgb(195, 207, 226) 100%);\";\n }\n examDataHasLoaded = true;\n}", "function displayScore() {\n var score = $('<p>', {id: 'question'}),\n numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (JSON.stringify(selections[i]) === JSON.stringify(questions[i].correctAnswer)) {\n numCorrect++;\n }\n }\n\n score.append('You have correctly answered ' + numCorrect + ' out of ' +\n questions.length + ' questions!!!');\n return score;\n }", "function displayScore() {\n var score = $('<p>',{id: 'question'});\n \n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].awsA) {\n numCorrect += 0;\n }\n else if (selections[i] === questions[i].awsB) {\n numCorrect++;\n }\n else if (selections[i] === questions[i].awsC) {\n numCorrect += 2;\n }\n else {\n numCorrect += 3;\n }\n }\n \n if (numCorrect >5) {\n score.append('You scored ' + numCorrect + ' out of ' +\n questions.length * 3 + '. Exercising several hours before bed is the best time to exercise because it allows our brains to return to baseline activity and eventually allow us to feel sleepy. Because brains are increasingly active during exercise, you should not exercise right before bed or you might risk feeling restless. You’re doing great by giving your brain enough time before bed to calm down! If you don’t exercise, it is still recommended that you start exercising consistently because it correlates with benefits on your sleep quality and memory consolidation - just keep in mind not to exercise too close to bedtime! ');\n return score;\n } else {\n score.append('You scored ' + numCorrect + ' out of ' +\n questions.length * 3 + '. Exercising too close to your bedtime can affect your sleepiness levels and impede on your ability to fall asleep quickly. Because our brains are increasingly active during exercise, they will need an adequate amount of time to return to base level and eventually allow us to feel sleepy. Exercising is good, but do not do it too close to bedtime or else you will not be able to sleep!');\n return score;\n }\n }", "function renderTable() {\n // addstudent();\n // this is the table\n var STDtable = document.getElementById(\"studentinfo\");\n // this is student table data\n var data1 = document.createElement(\"tr\");\n STDtable.appendChild(data1);\n var td = document.createElement('td');\n data1.appendChild(td);\n td.textContent = STD.studentName;\n var td2 = document.createElement('td');\n data1.appendChild(td2);\n td2.textContent = STD.studentId;\n var td3 = document.createElement('td');\n data1.appendChild(td3);\n td3.textContent = STD.gender;\n var td4 = document.createElement('td');\n data1.appendChild(td4);\n td4.textContent = STD.parentId;\n var total = 0;\n //this is the for loop to get each mark in math subject\n for (var j = 0; j < mathMark.length; j++) {\n var td5 = document.createElement('td');\n data1.appendChild(td5);\n td5.textContent = STD.mathMark[j];\n mathTotal += parseInt(STD.mathMark[j]);\n total = total + parseInt(mathMark[j]);\n }\n mathTotal = parseInt(grade1) + parseInt(grade2) + parseInt(grade3);\n\n\n //this is the for loop to get each mark in english subject\n for (var d = 0; d < englishMark.length; d++) {\n var td6 = document.createElement('td');\n data1.appendChild(td6);\n total = total + parseInt(englishMark[d]);\n td6.textContent = STD.englishMark[d];\n }\n englishTotal = parseInt(gradeE1) + parseInt(gradeE2) + parseInt(gradeE3);\n\n\n //this is the for loop to get each mark in science subject\n for (var k = 0; k < scienceMark.length; k++) {\n var td7 = document.createElement('td');\n data1.appendChild(td7);\n td7.textContent = STD.scienceMark[k];\n total = total + parseInt(scienceMark[k]);\n }\n scienceTotal = parseInt(gradeS1) + parseInt(gradeS2) + parseInt(gradeS3);\n\n\n\n var td8 = document.createElement(\"td\");\n data1.appendChild(td8);\n avg = ((mathTotal + englishTotal + scienceTotal)/3);\n td8.textContent = avg;\n // STDtable.deleteRow(-1);\n var td9 = document.createElement(\"td\");\n data1.appendChild(td9);\n td9.setAttribute(\"border-collapse\", \" collapse\");\n td9.textContent = feedBack;\n addStudent.reset();\n // this is to count the number of female students\n if (gender === 'Male') {\n maleTotal++;\n }\n else if (gender === 'Female') {\n femaleTotal++;\n }\n}", "function scoredisplay(){\r\n scorepage.style.display = \"block\";\r\n quiz.style.display = \"none\";\r\n timer.style.display = \"none\";\r\n let scorePercent = Math.round(100 * score/questions.length);\r\n scorealert.innerHTML = \"<h2>\" + \"Your score is\" + \" \" + scorePercent + \"%\" + \"</h2>\";\r\n record();\r\n }", "showScoreTable(){\n console.log(\"\\n********* \"+this.mode+\" - tour \"+this.tour+\" *********\");\n console.table(this.players, [\"name\",\"max\"]);\n }", "function addAnswersToTable(nextRow, student) {\n let tdString = `<td>${student.name}</td>`\n for(let key in ANSWERS_SUM) {\n tdString += `<td>${student[key]}</td>`\n }\n nextRow.innerHTML += tdString\n}", "function showGrades(){\n var student = document.getElementById('show_students').value; \n var ajax = new XMLHttpRequest(); \n ajax.open(\"GET\", \"gradebook.php?load=no&student=\" + student, false);\n ajax.send(null);\n\n // creates a 2d array of grades\n var grades = ajax.responseText;\n grades = grades.split(', ');\n grades.pop();\n\n var table = \"<table style=\\\"margin: 0 auto;border: 2px dotted black\\\">\\n\";\n for(var i=0; i<grades.length; i++){\n var space = grades[i].split(' ');\n table += \"<tr>\\n\";\n table += \"<td>\" + space[0] + \"</td>\\n\";\n table += \"<td>\" + space[1] + \"</td>\\n\";\n table += \"</tr>\\n\";\n }\n document.getElementById('show_grades').innerHTML = table; \n}", "function displayScores() {\n score0El.innerText = score0;\n score1El.innerText = score1;\n }", "function displayHighscores() {\n $(\"#high-scores\").append(\"<h3>Scores so far</h3><br>\");\n $(\"#high-scores\").append(\n \"<table id='score-table'><tr><th>Name...</th><th>Score...</th><th>Time Left<th><tr></table>\"\n );\n for (i in highscores) {\n $(\"#score-table\").append(\"<tr id='table\" + i + \"-row'></tr>\");\n for (x in highscores[i]) {\n $(\"#table\" + i + \"-row\").append(\"<td>\" + highscores[i][x] + \"</td>\");\n }\n }\n}", "function displayItems() {\r\n \r\n scoreTable\r\n .read() // Read the results\r\n .then(addHighestScoreHandler, handleError);\r\n }", "function displayScore() {\n var score = $('<p>',{id: 'question'});\n \n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n \n score.append('You got ' + numCorrect + ' of ' +\n questions.length + ' correct');\n return score;\n }", "function displayScore() {\r\n var score = $('<p>', {\r\n id: 'question'\r\n });\r\n var numCorrect = 0;\r\n for (var i = 0; i < selections.length; i++) {\r\n if (selections[i] === questions[i].correctAnswer) {\r\n numCorrect++;\r\n }\r\n }\r\n score.append('You got ' + numCorrect + ' out of ' +\r\n questions.length + '.');\r\n return score;\r\n }", "function viewHighScores() {\n clearCurrentQuestion();\n clearAnswerMsg();\n stopTimer();\n clearInterval(interval);\n clearTimeout(timeOut);\n hideNameInput();\n resetQuestionIndex();\n showStart();\n hideFinalScore()\n resetAllTextContent();\n forEachKey(); \n\n questionText.textContent = \"High Scores\";\n}", "function displayScore() {\n var score = $('<p>',{id: 'question'});\n \n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] == questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n \n score.append('You got ' + numCorrect + ' questions out of ' +\n questions.length + ' right.');\n return score;\n }", "function showScore() {\n\t$('#user').text(localStorage.username); \n\tif (localStorage.score != null) {\n\t\tvar getScore = JSON.parse(localStorage.score);\n\t\tgetScore.sort(function(a,b) {return b-a});\n\t\tfor (i = 0; i < getScore.length; i++) {\n\t\t\t$('<p>').text(i + 1 + '. Correct answers: ' + getScore[i] + ' / 10').appendTo($('#showScore'));\n\t\t}\n\t} else {\n\t\t$('<p>').text('You have no score yet.').appendTo($('#myScore'));\n\t}\n\t$('#questionBox').hide();\n\t$('#facit').hide();\n\t$('#myScore').show();\n\t$('#showScore').show();\n}", "function displayScore() {\r\n var score = $('<p>',{id: 'question'}); \r\n var numCorrect = 0;\r\n for (var i = 0; i < selections.length; i++) {\r\n if (selections[i] === questions[i].correctAnswer) {\r\n numCorrect++;\r\n }\r\n }\r\n \r\n score.append('You got ' + numCorrect + ' questions out of ' +\r\n questions.length + ' right!!!');\r\n return score;\r\n }", "function displayScore() {\r\n var score = $('<p>',{id: 'question'});\r\n \r\n var numCorrect = 0;\r\n for (var i = 0; i < selections.length; i++) {\r\n if (selections[i] === questions[i].correctAnswer) {\r\n numCorrect++;\r\n }\r\n }\r\n \r\n score.append('You got ' + numCorrect + ' questions out of ' +\r\n questions.length + ' right!!!');\r\n return score;\r\n }", "function displayScore() {\n\tvar score = document.createElement('p');\n\tscore.id = 'question';\n\t\n\tvar numCorrect = 0;\n\tfor (var i = 0; i < selections.length; i++) {\n\t\tif (selections[i] === Quiz[i].correctAnswer) {\n\t\tnumCorrect++;\n\t\t}\n\t}\n\t\n\tscore.innerHTML = 'You got ' + numCorrect + ' questions out of ' +\n\t\t\t\t Quiz.length + ' right!!!';\n\n\treturn score;\n\t}", "displayAllStudents() {\n\t\t$(\"#displayArea\").empty();\n\t\tvar studentDetails = Object.keys(this.data);\n\t\t//console.log(\"data\", studentDetails);\n\t\t\n\t\tfor(var key in this.data){\n\t\t\n\t\t\t$(\"#displayArea\").append(this.data[key].render());\n\t\t\t\t\n\t\t}\n\t\tthis.displayAverage();\n\n\t}", "function displayScore() {\r\n var score = $('<p>',{id: 'question'});\r\n \r\n var numCorrect = 0;\r\n for (var i = 0; i < selections.length; i++) {\r\n if (selections[i] === questions[i].correctAnswer) {\r\n numCorrect++;\r\n }\r\n }\r\n \r\n var result = numCorrect*100/questions.length;\r\n\tresult = Math.round(result);\r\n\tscore.append('You scored ' + result + ' % ');\r\n\t\t\t \r\n return score;\r\n }", "function showScoreTable(id) {\n $('#clrButton').css('display', 'block');\n $('#detailtable').bootstrapTable('destroy'); \n $('#detailtable').bootstrapTable({\n url: baseURL + 'api/results/readByKey.php?key=' + id,\n Striped: true,\n tableSm: true,\n columns: [{\n field : 'id',\n title: 'ID',\n }, {\n field: 'examID',\n title: 'Exam ID'\n }, {\n field: 'questionID',\n title: 'Question ID'\n }, {\n field: 'answered',\n title: 'Answered'\n }, {\n field: 'correctAnswer',\n title: 'Correct Answer'\n }, {\n field: 'seconds',\n title: 'Time (s)'\n }]\n });\n let messageTxt = \"<p><strong>Note: </strong>Answered 'z' means student did not answer that question. \"\n document.getElementById(\"message\").innerHTML = messageTxt;\n $('#message').css('display', 'block');\n}", "function loadStudentExamData(name, code) {\n document.getElementById('examSpecific').style.display = \"none\";\n document.getElementById('student-exam-data').style.display = \"initial\";\n document.body.style.backgroundImage = \"none\";\n var answer = \"\";\n var finalId;\n\n //linear-gradient(135deg, rgb(245, 247, 250) 0%, rgb(195, 207, 226) 100%);\n\n var table = document.getElementsByClassName('table');\n for(var i = 0; i < table.length; i++) {\n table[i].style.display = \"none\";\n }\n\n firebase.database().ref(\"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem(\"className\") + \"/Students\").once('value', function(snapshot) {\n for(var info in snapshot.val()) {\n var data = snapshot.val()[info];\n var id = data.split(\";\")[0];\n var fullName = data.split(\";\")[1];\n\n if(name == fullName) {\n finalId = id;\n }\n }\n });\n\n firebase.database().ref(\"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem(\"className\") + \"/Exams/\" + code).once('value', function(snapshot) {\n var data = (snapshot.val().responses[name][Object.keys(snapshot.val().responses[name])[0]]);\n\n document.getElementById('resetStatus').onclick = function() {\n for(var takenKey in snapshot.val().taken) {\n var id = (snapshot.val().taken[takenKey]);\n\n if(id == finalId) {\n firebase.database().ref(\"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem(\"className\") + \"/Exams/\" + code + \"/taken/\").child(takenKey).remove()\n }\n }\n\n swal(\"Success!\", name + \"'s taken status has been reset. \" + name + \" should be able to retake exam now.\", 'success')\n }\n\n var studentPoints = data.totalScore / 100 * snapshot.val()[Object.keys(snapshot.val())[0]].examTotalPoints;\n document.getElementById('score-num').innerHTML = (studentPoints).toFixed(0) + \" / \" + snapshot.val()[Object.keys(snapshot.val())[0]].examTotalPoints;\n document.getElementById('score').innerHTML = data.totalScore + \"%\";\n\n var corrAnswer = \"\";\n sessionStorage.setItem(\"totalPointsExcludingFr\", 0);\n\n for(var i = 0; i < Object.keys(data.answers).length; i++) {\n\n if(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].type == \"tf\") {\n corrAnswer = snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].choices[0];\n }\n else if(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].type == \"mc\"){\n corrAnswer = snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].checked;\n }\n else if(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].type == \"fr\") {\n corrAnswer = \"\";\n }\n createGradedQuestion(\n // PARAM: studAnswer\n data.answers[i].split(\";\")[1],\n // PARAM: corrAnswer\n corrAnswer,\n // PARAM: numAnswerChoices\n Object.keys(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].choices).length,\n // PARAM: numPoints\n snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].points,\n // PARAM: questions\n snapshot.val()[Object.keys(snapshot.val())[0]].questions[i],\n // PARAM: studName\n name,\n // PARAM: examCurrentCode\n code,\n // PARAM: examTotalPoints\n snapshot.val()[Object.keys(snapshot.val())[0]].examTotalPoints\n );\n }\n });\n}", "function displayScore() {\r\n var score = $('<p>',{id: 'question'});\r\n \r\n var numCorrect = 0;\r\n for (var i = 0; i < selections.length; i++) {\r\n if (selections[i] === questions[i].correctAnswer) {\r\n numCorrect++;\r\n }\r\n }\r\n \r\n score.append('Congratulations! You answered correct to ' + numCorrect + ' questions out of ' +\r\n questions.length) + \" !\";\r\n return score;\r\n }", "function getStatistics(){\n fetch('http://localhost:3000/users/'+userId+'?query=attempted')\n .then(res => {\n if(res.ok){\n console.log('SUCCESS')\n return res.json()\n }else{\n console.log('FAILED')\n }\n })\n .then(data => {\n let table = document.getElementById(\"table\")\n for(let i = 0 ; i < data.length; i++){\n let row = table.insertRow(i+1)\n let cell0 = row.insertCell(0)\n cell0.innerText = data[i].quizName+\"\"\n let cell1 = row.insertCell(1)\n cell1.innerText = (data[i].completion === true) ? \"Completed\" : \"Incompleted\"\n let cell2 = row.insertCell(2)\n cell2.innerText = data[i].score+\"\"\n }\n })\n}", "function showResult(){\n let titles = [\"Master\",\"Champion\",\"Average\",\"Bad\"]; \n let nrOfCorrects = document.getElementById(\"nrOfCorrectAnswers\");\n let showTitle = document.getElementById(\"title\");\n let username = document.getElementById(\"username\");\n nrOfCorrects.innerHTML = \"You scored \" + \"<span>\" + quiz.correctAnswers + \"</span>\" + \" of\" + \" <span>\" + quiz.maxScore + \"</span>\" + \" points right!\";\n username.innerHTML = quiz.username;\n if(quiz.correctAnswers == quiz.maxScore){\n showTitle.innerHTML = titles[0];\n }\n else if(quiz.correctAnswers > 3){\n showTitle.innerHTML = titles[1];\n }\n else if(quiz.correctAnswers >= 2){\n showTitle.innerHTML = titles[2];\n }\n else if(quiz.correctAnswers < 2){\n showTitle.innerHTML = titles[3];\n }\n}", "function displayScores(group) {\n // avgs row for the table\n var avgs = '<tr id=\"avgs\">';\n // extra cell\n avgs += '<td></td>';\n avgs += '<td class=\"name special\">Average</td>';\n // add cell for each avgs score\n _.each(group.avgScores, function(score) {\n avgs += '<td class=\"tar special\">'+ score +'</td>';\n })\n // averaging the score totals\n avgs += '<td class=\"tar special\">' + avgTotals(group, 'totalScore') + '</td>';\n // averaging the max totals\n avgs += '<td class=\"tar special\">' + avgTotals(group, 'maxScore') + '</td>';\n // close out the table row\n avgs += '</tr>';\n // append avgs row to table\n $('#table').append(avgs);\n}", "function highScoresPage() {\n $(\"#finished\").hide();\n $(\"#scores\").show();\n $(\"#correctInput\").hide();\n $(\"#wrongInput\").hide();\n\n \n }", "function addstudent(event) {\n event.preventDefault();\n clicks++;\n if (clicks == 1 && !studentString) {\n makingHeader();\n }\n if (clicks >= 1) {\n stdname = event.target.stdname.value;\n studentId = event.target.stdID.value;\n gender = event.target.gender.value;\n parentId = event.target.prntID.value;\n var firtstSub = document.getElementById(\"math\");\n //first subject\n grade1 = event.target.firstExam.value;\n grade2 = event.target.secondExam.value;\n grade3 = event.target.thirdExam.value;\n mathMark = [];\n mathMark.push(grade1, grade2, grade3);\n mathTotal = parseInt(grade1) + parseInt(grade2) + parseInt(grade3);\n\n //second subjiect\n gradeE1 = event.target.FirstExamEnglish.value;\n gradeE2 = event.target.secondExamEnglish.value;\n gradeE3 = event.target.ThirdExamEnglish.value;\n englishMark = [];\n englishMark.push(gradeE1, gradeE2, gradeE3);\n englishTotal = parseInt(gradeE1) + parseInt(gradeE2) + parseInt(gradeE3);\n\n feedBack = event.target.feedback.value;\n //third subject\n gradeS1 = event.target.firstExamScience.value;\n gradeS2 = event.target.secondExamScience.value;\n gradeS3 = event.target.ThirdExamScience.value;\n scienceMark = [];\n scienceMark.push(gradeS1, gradeS2, gradeS3);\n scienceTotal = parseInt(gradeS1) + parseInt(gradeS2) + parseInt(gradeS3);\n avg = ((mathTotal + englishTotal + scienceTotal)/3);\n // avg.push(avg);\n }\n STD = new Student(stdname, studentId, gender, parentId, mathMark, englishMark, scienceMark, feedBack, mathTotal, scienceTotal, englishTotal, avg);\n renderTable();\n updateStudent();\n}", "function getAndDisplayStudents() {\n getStudents(displayStudents);\n}", "function displayScore() {\n var score = $('<h3>', {\n id: 'question'\n });\n\n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] == questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n // Sending Results\n send_quizz_results(selections, quiz_id);\n // Calculate score and display relevant message\n var percentage = numCorrect / questions.length;\n if (percentage >= 0.9) {\n score.append('Bravo! Vous avez obtenu ' + numCorrect + ' bonnes réponses sur ' +\n questions.length);\n } else if (percentage >= 0.7) {\n score.append('Bon travail! Vous avez obtenu ' + numCorrect + ' bonnes réponses sur ' +\n questions.length);\n } else if (percentage >= 0.5) {\n score.append('Vous avez obtenu ' + numCorrect + ' bonnes réponses sur ' +\n questions.length);\n } else {\n score.append('Vous avez obtenu seulement ' + numCorrect + ' bonnes réponses sur ' +\n questions.length + '. Voulez-vous réessayer?');\n }\n \n return score;\n \n }", "function viewScoreFormatter(value, row, index) {\n return [\n '<a href=\"javascript:void(0)\" onclick=\"showScoreTable(\\'' + row.id + '\\');\" title=\"Answer Details\">',\n '<i class=\"fa fa-check-square fa-2x ucf-colors-selected\"></i>',\n '</a> ',\n '<a href=\"javascript:void(0)\" onclick=\"showTimeTable(\\'' + row.id + '\\');\" title=\"Time Audit\">',\n '<i class=\"fa fa-clock fa-2x ucf-colors-selected\"></i>',\n '</a>'\n ].join('')\n}", "function results() {\n selectedAnswers = $(displayTest.find(\"input:checked\"));\n //if user is correct\n if (\n selectedAnswers[0].value === testSetup[currentQuestion - 1].questionAnswer\n ) {\n //add to correct score and display on element\n correct++;\n $(\"#correct\").text(\"Answers right: \" + correct);\n } else {\n //if user is wrong then add to wrong score and display on element\n wrong++;\n $(\"#incorrect\").text(\"Wrong answers: \" + wrong);\n }\n //check to see if the user has reached the end of the test\n if (currentQuestion === 10) {\n //toggle finalize modal at end of test to display score\n $(\"#modalMatch\").modal(\"toggle\");\n $(\"#testScore\").text(\n \"End of test! You scored a \" + (parseFloat(correct) / 10) * 100 + \"%\"\n );\n //show postTest element\n $(\"#postTest\").show();\n $(\"#submitTest\").hide();\n }\n }", "function getStudent() {\n studentString = localStorage.getItem(\"studentinfo\");\n if (studentString ) {\n Student.all = JSON.parse(studentString);\n makingHeader();\n ///---------------------------------------------------------------------------------------\n for (var b = 0; b < Student.all.length; b++) {\n var STDtable = document.getElementById(\"studentinfo\");\n // this is student table data\n var data1 = document.createElement(\"tr\");\n STDtable.appendChild(data1);\n var td = document.createElement('td');\n data1.appendChild(td);\n td.textContent = Student.all[b].studentName;\n var td2 = document.createElement('td');\n data1.appendChild(td2);\n td2.textContent = Student.all[b].studentId;\n var td3 = document.createElement('td');\n data1.appendChild(td3);\n td3.textContent = Student.all[b].gender;\n var td4 = document.createElement('td');\n data1.appendChild(td4);\n td4.textContent = Student.all[b].parentId;\n \n\n\n for (var i = 0; i < 3; i++) {\n\n var td5 = document.createElement('td');\n data1.appendChild(td5);\n td5.textContent = Student.all[b].mathMark[i];\n total = total + parseInt(mathMark[i]);\n mathTotal += parseInt(Student.all[b].mathMark[i])\n\n }\n\n for (var i = 0; i < 3; i++) {\n var td7 = document.createElement('td');\n data1.appendChild(td7);\n td7.textContent = Student.all[b].englishMark[i];\n total = total + parseInt(englishMark[i]);\n englishTotal += parseInt(Student.all[b].englishMark[i]);\n\n }\n\n for (var i = 0; i < 3; i++) {\n var td6 = document.createElement('td');\n data1.appendChild(td6);\n td6.textContent = Student.all[b].scienceMark[i]\n total = total + parseInt(scienceMark[i]);\n scienceTotal += parseInt(Student.all[b].scienceMark[i]);\n }\n\n var td8 = document.createElement(\"td\");\n td8.textContent = Student.all[b].avg;\n data1.appendChild(td8);\n \n\n var td9 = document.createElement(\"td\");\n data1.appendChild(td9);\n td9.setAttribute(\"border-collapse\", \" collapse\");\n td9.textContent = Student.all[b].feedBack;\n\n\n\n }\n\n // STDtable.deleteRow(-1);\n\n\n //----------------------------------------------------------------------------------------- \n }\n}", "function viewStudent(id, name, guardian, occupation, phone, dob, rel, address)\n{\n\t$('#stID').html(id);\n\t$('#stName').html(name);\n\t$('#dob').html(dob);\n\t$('#religion').html(rel);\n\t$('#address').html(address);\n\t$('#gName').html(guardian);\n\t$('#occupation').html(occupation);\n\t$('#phone').html(phone);\n}", "function showStudentFromDatabase() {\n var ObjectStore = db.transaction(\"StudentTable\").objectStore(\"StudentTable\");\n var searchValue = document.getElementById(\"show_student_info\").value;\n\n var table = document.getElementById(\"tableShow\");\n\n ObjectStore.openCursor().onsuccess = function(event) {\n var cursor = event.target.result;\n\n if (cursor) {\n if (cursor.value.Roll !== searchValue) {\n cursor.continue();\n } else {\n var key = cursor.key;\n var value = cursor.value;\n\n var text = \"<table id='showTable' class='showTable'>\";\n text += \"<thead>\";\n text += \"<tr><th style='font-size:16px'>Roll</th>\";\n text += \"<th style='font-size:16px'>Name</th>\";\n text += \"<th style='font-size:16px'>Year</th>\";\n text += \"<th style='font-size:16px'>Semester</th>\";\n text += \"<th style='font-size:16px'>Department</th>\";\n text += \"</tr>\";\n text += \"</thead>\";\n text += \"<tbody>\";\n text += \"<tr><td style='font-size:16px'>\" + value.Roll + \"</td>\";\n text += \"<td style='font-size:16px'>\" + value.Name + \"</td>\";\n text += \"<td style='font-size:16px'>\" + value.Year + \"</td>\";\n text += \"<td style='font-size:16px'>\" + value.Semester + \"</td>\";\n text += \"<td style='font-size:16px'>\" + value.Department + \"</td>\";\n text += \"</tr>\";\n text += \"</tbody>\";\n text += \"</table>\";\n\n if (table.childNodes[0] === \"undefined\") {\n console.log(\"Undefined child\");\n } else {\n console.log(\"Child is present\");\n }\n\n document.getElementById(\"tableShow\").innerHTML = text;\n document.getElementById(\"tableShow\").style.display = \"block\";\n }\n } else {\n console.log(\"No more entries!\");\n text = \"<p class='noDataFound'>No match found for this roll number!</p>\";\n document.getElementById(\"tableShow\").innerHTML = text;\n document.getElementById(\"tableShow\").style.display = \"block\";\n }\n };\n}", "function showHighScoreContent() {\n if (highscoreData.highscores == undefined) {\n p5HTMLElements.push(createP('No Highscores to view here'));\n p5HTMLElements[p5HTMLElements.length - 1].position(view.options.x2 / 2 + 50, view.options.y + 100);\n return;\n }\n highscoreData.highscores.reverse();\n var tableContent = '<tr><th>Name</th><th>Score</th></tr>';\n for (var i = 0; i < highscoreData.highscores.length; i++) {\n tableContent += '<tr><td>' + highscoreData.highscores[i].name + '</td><td>' + highscoreData.highscores[i].score + '</td></tr>';\n }\n highscoreData.highscores.reverse();\n p5HTMLElements.push(createElement('table', tableContent));\n var highscoresTable = p5HTMLElements[p5HTMLElements.length - 1];\n highscoresTable.position(view.options.x + 10, view.options.y + 50);\n highscoresTable.size(view.options.x2 - 20, highscoresTable.size().height);\n}", "function passExam(name, score) {\n let passUni = 71;\n let passColl = 51;\n if (score >= passUni) {\n console.log(name + ' has enrolled in University with ' + score + ' points');\n } else if (score >= passColl) {\n console.log(name + ' has enrolled in College with ' + score + ' points');\n } else {\n console.log(name + ' has failed');\n }\n}", "function showScore() {\n $(\"#questions div\").hide();\n $(\"#questions button\").hide();\n $(\"#total-correct\").append(\"Total Correct: \" + correct);\n $(\"#total-incorrect\").append(\"Total Incorrect: \" + incorrect);\n $(\"#total-unanswered\").append(\"Total Unanswered: \" + unanswered);\n}", "function showAll(courseId) {\n // Figure out how many columns we'll need.\n // const term = window.CST_OVERRIDES.terms.find( e => e.course_id === courseId);\n const term = findTermWithCourse(courseId);\n const assignmentCounts = term.students.map( e => e.assignment_overrides.length);\n const maxCols = assignmentCounts.reduce(function(a, b) {\n return Math.max(a, b);\n }, 0);\n\n // Add extra columns if needed.\n const termTable = document.getElementById('term_' + courseId);\n // const dataColumnCount = termTable.rows[1].cells.length - 1;\n const dataColumnCount = termTable.rows[1].cells.length - 2;\n if (maxCols > dataColumnCount) {\n termTable.rows[0].cells[0].colSpan = maxCols + 1;\n for (let i = 0; i < (maxCols - dataColumnCount); ++i) {\n for (let j = 1; j < termTable.rows.length; ++j) {\n termTable.rows[j].insertCell(0);\n }\n }\n }\n\n // Fill body of table with data cells\n for (let i = 1; i < termTable.rows.length; ++i) {\n \n // Observation assignments to display in this row\n let assignments = term.students[i - 1].assignment_overrides;\n \n for (let j = 0; j < maxCols; ++j) {\n // const newCell = termTable.rows[i].insertCell(j);\n\n // Clear any existing data in the cell\n const cell = termTable.rows[i].cells[j];\n let container = getDivChild(cell);\n if (container) {\n cell.removeChild(container);\n }\n\n // Check if this is a cell which should contain assignment data\n if (j < assignments.length) {\n const visibleAssignment = assignments[j];\n\n cell.appendChild(createObsDiv(term.course_id, visibleAssignment, true));\n // cell.appendChild(createObsDivShowAll(term.course_id, visibleAssignment));\n\n // Now that the cell is in place, see if we already have the\n // data to populate it.\n if (visibleAssignment.critiqueit_data) {\n populateAssignmentStatusDiv(term.course_id, visibleAssignment);\n } else {\n // Otherwise, populate it with an AJAX call\n getCritiqueItStatus(term.course_id, visibleAssignment, function() {} );\n }\n\n } // end populating cell containing assignment data\n } // end loop through columns\n } // end loop through rows \n\n hideButtonFromTeacherCandidate(termTable); // 12.21.2018 tps\n}", "function displayscore(){\n \t$('#playerscore').html('Correct Answer: ' + correctanswer + \n \t\t '<br>Wrong Answer: ' + wronganswer +\n '<br>Unanswer: ' + unanswered);\n }", "function showMeanEngScoreGrid() {\n var htmlList = \"\";\n var ctrl = \"satMeanGridEng\";\n\n //Build a HTML table on the fly dynamically and initialize it as a jQuery data table\n htmlList += \"<table width= 100% style= 'margin-top:12px:width:100%' class='row-border table-striped table-hover' id = 'table-\" + ctrl + \"'>\";\n htmlList += \"<thead>\";\n htmlList += \"<tr>\";\n htmlList += \"<th class = 'dt-head-center'>School</th>\";\n htmlList += \"<th class = 'dt-head-center'>Year</th>\";\n htmlList += \"<th class = 'dt-head-center'>Average Score</th>\";\n htmlList += \"</tr>\";\n htmlList += \"</thead>\";\n htmlList += \"<tbody>\";\n\n var satObject;\n var currentYear = \"\";\n var nextYear = \"\";\n var currentSchool = \"\";\n var nextSchool = \"\";\n\n var average = 0.0;\n\n if (filteredSatArray.length > 0) {\n satObject = filteredSatArray[0];\n currentYear = satObject.Year;\n currentSchool = satObject.School;\n }\n\n scoresArray = [];\n\n for (var i = 0; i < filteredSatArray.length; i++) {\n satObject = filteredSatArray[i];\n\n nextYear = satObject.Year;\n nextSchool = satObject.School; scoresArray\n\n if (currentSchool == nextSchool) {\n\n if (currentYear == nextYear) {\n\n scoresArray.push(satObject.Reading_and_Writing_Total_Score);\n\n } else {\n average = math.mean(scoresArray);\n average = math.round(average, 0);\n\n htmlList += \"<tr>\";\n htmlList += \"<td>\" + currentSchool + \"</td>\";\n htmlList += \"<td style='text-align:right'>\" + currentYear + \"</td>\";\n htmlList += \"<td style='text-align:right'>\" + average + \"</td>\";\n htmlList += \"</tr>\";\n\n currentYear = nextYear;\n scoresArray = [];\n scoresArray.push(satObject.Reading_and_Writing_Total_Score);\n }\n\n }\n else {\n average = math.mean(scoresArray);\n average = math.round(average, 0);\n\n htmlList += \"<tr>\";\n htmlList += \"<td>\" + currentSchool + \"</td>\";\n htmlList += \"<td style='text-align:right'>\" + currentYear + \"</td>\";\n htmlList += \"<td style='text-align:right'>\" + average + \"</td>\";\n htmlList += \"</tr>\";\n\n currentYear = nextYear;\n currentSchool = nextSchool;\n scoresArray = [];\n scoresArray.push(satObject.Reading_and_Writing_Total_Score);\n }\n\n }\n\n average = math.mean(scoresArray);\n average = math.round(average, 0);\n\n htmlList += \"<tr>\";\n htmlList += \"<td>\" + nextSchool + \"</td>\";\n htmlList += \"<td style='text-align:right'>\" + nextYear + \"</td>\";\n htmlList += \"<td style='text-align:right'>\" + average + \"</td>\";\n\n htmlList += \"</tr>\";\n\n htmlList += \"</tbody>\";\n htmlList += \"</table>\";\n\n //Write back to the page\n $(\"#\" + ctrl).html(htmlList);\n var table = $(\"#table-\" + ctrl).DataTable(\n {\n paging: true,\n ordering: true,\n info: true,\n displayLength: 10,\n order: [[0, 'asc'], [1, 'asc']],\n responsive: true\n });\n}", "function showMeanMathScoreGrid() {\n var htmlList = \"\";\n var ctrl = \"satMeanGridMath\";\n\n //Build a HTML table on the fly dynamically and initialize it as a jQuery data table\n htmlList += \"<table width= 100% style= 'margin-top:12px:width:100%' class='row-border table-striped table-hover' id = 'table-\" + ctrl + \"'>\";\n htmlList += \"<thead>\";\n htmlList += \"<tr>\";\n htmlList += \"<th class = 'dt-head-center'>School</th>\";\n htmlList += \"<th class = 'dt-head-center'>Year</th>\";\n htmlList += \"<th class = 'dt-head-center'>Average Score</th>\";\n htmlList += \"</tr>\";\n htmlList += \"</thead>\";\n htmlList += \"<tbody>\";\n\n var satObject;\n var currentYear = \"\";\n var nextYear = \"\";\n var currentSchool = \"\";\n var nextSchool = \"\";\n\n var average = 0.0;\n\n if (filteredSatArray.length > 0) {\n satObject = filteredSatArray[0];\n currentYear = satObject.Year;\n currentSchool = satObject.School;\n }\n\n scoresArray = [];\n\n for (var i = 0; i < filteredSatArray.length; i++) {\n satObject = filteredSatArray[i];\n\n nextYear = satObject.Year;\n nextSchool = satObject.School; scoresArray\n\n if (currentSchool == nextSchool) {\n\n if (currentYear == nextYear) {\n\n scoresArray.push(satObject.Math_Total_Score);\n\n } else {\n average = math.mean(scoresArray);\n average = math.round(average, 0);\n\n htmlList += \"<tr>\";\n htmlList += \"<td>\" + currentSchool + \"</td>\";\n htmlList += \"<td style='text-align:right'>\" + currentYear + \"</td>\";\n htmlList += \"<td style='text-align:right'>\" + average + \"</td>\";\n htmlList += \"</tr>\";\n\n currentYear = nextYear;\n scoresArray = [];\n scoresArray.push(satObject.Math_Total_Score);\n }\n\n }\n else {\n average = math.mean(scoresArray);\n average = math.round(average, 0);\n\n htmlList += \"<tr>\";\n htmlList += \"<td>\" + currentSchool + \"</td>\";\n htmlList += \"<td style='text-align:right'>\" + currentYear + \"</td>\";\n htmlList += \"<td style='text-align:right'>\" + average + \"</td>\";\n htmlList += \"</tr>\";\n\n currentYear = nextYear;\n currentSchool = nextSchool;\n scoresArray = [];\n scoresArray.push(satObject.Math_Total_Score);\n }\n\n }\n\n average = math.mean(scoresArray);\n average = math.round(average, 0);\n\n htmlList += \"<tr>\";\n htmlList += \"<td>\" + nextSchool + \"</td>\";\n htmlList += \"<td style='text-align:right'>\" + nextYear + \"</td>\";\n htmlList += \"<td style='text-align:right'>\" + average + \"</td>\";\n\n htmlList += \"</tr>\";\n\n htmlList += \"</tbody>\";\n htmlList += \"</table>\";\n\n //Write back to the page\n $(\"#\" + ctrl).html(htmlList);\n var table = $(\"#table-\" + ctrl).DataTable(\n {\n paging: true,\n ordering: true,\n info: true,\n displayLength: 10,\n order: [[0, 'asc'], [1, 'asc']],\n responsive: true\n });\n}", "grade(Student, subject){\n return `${Student.name} receives a perfect score on ${subject}`;\n }", "function printScoreboard(sb){\n var table = document.getElementById(\"scoreboard_table\");\n while (table.childNodes.length > 0) {\n table.removeChild(table.childNodes[0]);\n }\n \n var headers = [\"Inst\", \"Dest\", \"Src\", \"Trgt\", \"Issue\",\n \"Exec\", \"WB\", \"Commit\"];\n var row = document.createElement(\"tr\");\n for (var h in headers){\n var header = document.createElement(\"th\");\n header.innerHTML=headers[h];\n row.appendChild(header);\n }\n table.appendChild(row);\n for (var inst = 0; inst < sb.length; inst++){\n row = document.createElement(\"tr\");\n headers.forEach(function(header){\n var col = document.createElement(\"td\");\n if (sb[inst][header.toLowerCase()] !== null)\n col.innerHTML=sb[inst][header.toLowerCase()];\n else\n col.innerHTML='N/A';\n row.appendChild(col);\n });\n table.appendChild(row);\n }\n}", "function renderExamResult() {\n console.log('renderExamResult() has been used.');\n \n hideElements(['challenge', 'progress', 'timer']);\n \n showElement('.result');\n\n\n var summary = validateExamAnswers();\n var score = summary.score;\n var title;\n var subtitle;\n var image;\n\n var html = '';\n\n subtitle = getMessage('result_score', 'Your score is ${score}.', ['<strong>'+score+'%</strong>']) + ' ';\n\n if (score == 100) {\n title = getMessage('result_perfect', 'Perfect');\n subtitle += getMessage('result_perfect_details', 'Will you repeat this?');\n image = 'passed';\n }\n if (score >= 80 && score < 100) {\n title = getMessage('result_great', 'Great');\n subtitle += getMessage('result_great_details', 'You would pass exam.');\n image = 'passed';\n }\n if (score >= 50 && score < 80) {\n title = getMessage('result_not_good', 'Not good');\n subtitle += getMessage('result_not_good_details', 'You can do it better.');\n image = 'failed';\n }\n if (score < 50) {\n title = getMessage('result_poor', 'Poor');\n subtitle += getMessage('result_poor_details', 'You have to do it better.');\n image = 'failed';\n }\n if (score == 0) {\n title = getMessage('result_terrible', 'Terrible');\n subtitle += getMessage('result_terrible_details', 'Start to learn wise.');\n image = 'epic-fail';\n }\n\n html += '<div class=\"row\">';\n html += '<div class=\"col mb-3\">';\n html += '<div class=\"card text-center result-box\">';\n // html += '<div class=\"card text-center col-sm-6 col-md-6 col-lg-8 col-xl-12\">';\n html += ' <div class=\"card-header\">';\n // html += allExams[exam].exam.toUpperCase() + ' exam result';\n html += getMessage('exam_result_header', '${name} exam result', [allExams[exam].description]);\n // html += ' Service Mapping exam result';\n html += ' </div>';\n html += ' <a href=\"#\" onclick=\"javascript:renderExamResultDetails();\">';\n html += ' <div class=\"card-body\">';\n html += ' <div class=\"col-sm-6 result-image '+image+'\"></div>';\n html += ' <h1 class=\"card-title\">'+title+'</h1>';\n html += ' <p class=\"card-text\">'+subtitle.replace('%d%', '<strong>'+score+'%</strong>')+'</p>';\n // html += '<a href=\"#\" class=\"btn btn-primary\">Go somewhere</a>';\n html += ' </div>';\n html += ' </a>';\n html += '</div>';\n html += '</div>';\n html += '</div>';\n\n html += '<div class=\"row row-cols-1 row-cols-md-2\">';\n html += ' <div class=\"col mb-3 col-sm-6 col-md-6\">';\n html += ' <div class=\"card h-100 text-center text-success border-success result-box\">';\n html += ' <a href=\"#\" onclick=\"javascript:renderExamResultDetails(\\'correct\\');\">';\n html += ' <div class=\"card-body\">';\n html += ' <h1 class=\"card-title\">'+summary.correct.length+'</h1>';\n html += ' <p class=\"card-text\">' + getMessage('exam_result_correct', 'Questions answered correctly.') + '</p>';\n html += ' </div>';\n html += ' </a>';\n html += ' </div>';\n html += ' </div>';\n html += ' <div class=\"col mb-3 col-sm-6 col-md-6\">';\n html += ' <div class=\"card h-100 text-center text-danger border-danger result-box\">';\n html += ' <a href=\"#\" onclick=\"javascript:renderExamResultDetails(\\'wrong\\');\">';\n html += ' <div class=\"card-body\">';\n html += ' <h1 class=\"card-title\">'+summary.wrong.length+'</h1>';\n html += ' <p class=\"card-text\">' + getMessage('exam_result_incorrect', 'Questions with incorrect or missing answer.') + '</p>';\n html += ' </div>';\n html += ' </a>';\n html += ' </div>';\n html += ' </div>';\n html += '</div>';\n\n // html += '<div class=\"row\">';\n // html += ' <div class=\"col text-center mt-3 mb-3\">';\n // html += '<button id=\"repeat-exam\" onclick=\"javascript:repeatExam();\" class=\"btn btn-secondary\">Repeat same questions</button>';\n // html += '<button id=\"retry-exam\" onclick=\"javascript:retryExam();\" class=\"btn btn-primary\">Retry new questions</button>';\n // html += ' </div>';\n // html += '</div>';\n\n html += '<div class=\"row row-cols-1 row-cols-md-2\">';\n html += ' <div class=\"col text-center mb-3 col-sm-6 col-md-6\">';\n html += ' <button id=\"retry-exam\" onclick=\"javascript:retryExam();\" class=\"btn btn-primary\">' + getMessage('retry_exam', 'Retry new questions') + '</button>';\n html += ' </div>';\n html += ' <div class=\"col text-center mb-3 col-sm-6 col-md-6\">';\n html += ' <button id=\"repeat-exam\" onclick=\"javascript:repeatExam();\" class=\"btn btn-secondary\">' + getMessage('repeat_exam', 'Repeat same questions') + '</button>';\n html += ' </div>';\n html += '</div>';\n \n\n // renderElement('.result', result + '<p class=\"advice\">' + advice + '</p>' + html);\n renderElement('.result', html);\n\n state = 'exam_result_rendered';\n}", "function displayscores() {\n\tlet timeto = endTime;\n\tif(!timeto)\n\t\ttimeto = Date.now();\n\tlet formattime = formatTime(timeto-startTime);\n\tlet t = statstext.replace(\"$score\",(score/100 | 0)).replace(\"$level\",\"\" + diffToLevel()).replace(\"$health\",health).replace(\"$kills\",kills).replace(\"$time\",formattime).replace(\"$difficulty\",difficultyGame);\n\tif(difficultyGame == \"easy\") {\n\t\tt = t.replace(\"Health\",\"Amount of Damage received\");\n\t}\n\ttext(t,0,0);\n}", "function displayScore(){\n console.log(\"Your final score is: \",score)\n console.log(\"High Scorer's: \")\n for(var i=0;i<highScore.length;i++){\n console.log(highScore[i].name,\":\",highScore[i].score)\n }\n //if user score is equal or greater than high scorer congrats user\n if(score >= highScore[0].score || score >= highScore[1].score){\n console.log(chalk.bgGrey(\"Congrats! You made it to the high score chart.\\nSend screenshot of your score.\"))\n }\n}", "function drawScores(gameState) {\n document.querySelectorAll(\"tr.score\").forEach(e => e.remove());\n gameState.scores.forEach(([name, score]) => {\n const tableRow = document.createElement(\"tr\");\n tableRow.innerHTML = `<td>${name}<td>${score}`;\n tableRow.className = \"score\";\n tableBody.appendChild(tableRow);\n });\n }", "function printScoreboard(sb){\n var table = document.getElementById(\"scoreboard_table\");\n while (table.childNodes.length > 0) {\n table.removeChild(table.childNodes[0]);\n }\n \n var headers = [\"Inst\", \"Dest\", \"Src\", \"Trgt\", \"Issue\",\n \"Read\", \"Exec\", \"WB\"];\n var row = document.createElement(\"tr\");\n for (var h in headers){\n var header = document.createElement(\"th\");\n header.innerHTML=headers[h];\n row.appendChild(header);\n }\n table.appendChild(row);\n for (var inst = 0; inst < sb.length; inst++){\n row = document.createElement(\"tr\");\n for (var element in headers){\n var col = document.createElement(\"td\");\n if (sb[inst][headers[element].toLowerCase()] !== null)\n col.innerHTML=sb[inst][headers[element].toLowerCase()];\n else\n col.innerHTML='N/A';\n row.appendChild(col);\n }\n table.appendChild(row);\n }\n}", "function teacherSchd(name, activity, grade,helper){\n\tvar table = document.getElementById(\"teachSchedule\");\n\tvar teachers=['Jennifer Winkler','Leane Sikes','Jackie Holowinski','Jean Rorro',\n\t'Carolyn Cooney','Kim McCloskey','Robert Crescitelli', 'Audrey Mutch',\n\t'Laura Cibbattoni', 'Rebecca Gloede'];\n\tvar formattedActivity=\"\";\n\tswitch(activity) {\n\t\tcase 'free':\n\t\tformattedActivity = 'Free Time';\n\t\tbreak;\n\t\tcase 'outdoor':\n\t\tformattedActivity = ' Outdoor Activity';\n\t\tbreak;\n\t\tcase 'talent':\n\t\tformattedActivity = 'Talent Show';\n\t\tbreak;\n\t\tcase 'crafts':\n\t\tformattedActivity = 'Arts & Crafts';\n\t\tbreak;\n\t\tcase 'group':\n\t\tformattedActivity = 'Group Activity';\n\t\tbreak;\n\t\tcase 'hallway':\n\t\tformattedActivity = 'Hallway Activity';\n\t\tbreak;\n\t\tcase 'kidTeach':\n\t\tformattedActivity = 'Kids Teaching Kids';\n\t\tbreak;\n\t\tdefault:\n\t\tformattedActivity = activity;\n\t\tbreak;\n\t}\n\n\tif(helper === 1){\n\t\t//setup the headers\n\t\tvar header = table.insertRow(-1);\n\t\tfor(teacher in teachers){\n\t\t\tvar head1 = header.insertCell();\n\t\t\thead1.innerHTML = teachers[teacher];\n\t\t}\n\n\t\t//setup table - assume each teacher has no more than 60 students.\n\t\tfor(var r = 0; r < 60; r++){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var t =0; t<10; t++){\n\t\t\t\tvar cell= row.insertCell();\n\t\t\t\tcell.innerHTML =\"\";\n\t\t\t}\n\t\t}\n\t}\n\t//add students to teachers table\n\tswitch(grade) {\n\t\tcase '1w':\n\t\ttable.rows[window.w1].cells[0].innerHTML = name + \": \" + formattedActivity;\n\t\twindow.w1++;\n\t\tbreak;\n\t\tcase '1s':\n\t\twindow.s1++;\n\t\tif(table.rows[window.s1].cells[1].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.s1].cells[1].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.s1].cells[1].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '2h':\n\t\twindow.h2++;\n\t\tif(table.rows[window.h2].cells[2].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.h2].cells[2].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.h2].cells[2].innerHTML = name + \": \" + formattedActivity;\n\n\t\tbreak;\n\t\tcase '2r':\n\t\twindow.r2++;\n\t\tif(table.rows[window.r2].cells[3].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.r2].cells[3].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.r2].cells[3].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '3c':\n\t\twindow.c3++;\n\t\tif(table.rows[window.c3].cells[4].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.c3].cells[4].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.c3].cells[4].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '3m':\n\t\twindow.m3++;\n\t\tif(table.rows[window.m3].cells[5].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.m3].cells[5].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.m3].cells[5].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '4c':\n\t\twindow.c4++;\n\t\tif(table.rows[window.c4].cells[6].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.c4].cells[6].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.c4].cells[6].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '4m':\n\t\twindow.m4++;\n\t\tif(table.rows[window.m4].cells[7].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.m4].cells[7].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.m4].cells[7].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '5c':\n\t\twindow.c5++;\n\t\tif(table.rows[window.c5].cells[8].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.c5].cells[8].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.c5].cells[8].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '5g':\n\t\twindow.g5++;\n\t\tif(table.rows[window.g5].cells[9].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.g5].cells[9].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.g5].cells[9].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\n\t\tdefault:\n\t\talert(\"Error: grade not found: \" + grade);\n\t}\n}", "function showRegisteredStudents(){\n var students = getDataFromLocalStorage();\n var data = \"\";\n if (students.length == 0){\n data = \"<h3>No Students registered yet..</h3>\"\n } else{\n data += \"<table id='regstudents'><thead><tr>\";\n data += \"<th>#</th>\";\n data += \"<th>USN</th>\";\n data += \"<th>NAME</th>\";\n data += \"<th>EMAIL</th>\";\n data += \"<th>MOBILE</th>\";\n data += \"<th>COURSE</th>\";\n data += \"<th>CGPA</th>\";\n data += \"<th>DOB</th>\";\n data += \"</tr></thead>\";\n \n for (var i = 0; i < students.length; i++){\n var j = i +1;\n data += \"<tr>\";\n data += \"<td>\"+ j + \"</td>\";\n data += \"<td>\"+ students[i].usn + \"</td>\";\n data += \"<td>\"+ students[i].name + \"</td>\";\n data += \"<td>\"+ students[i].email+ \"</td>\";\n data += \"<td>\"+ students[i].mobile + \"</td>\";\n data += \"<td>\"+ students[i].course + \"</td>\";\n data += \"<td>\"+ students[i].cgpa + \"</td>\";\n data += \"<td>\"+ students[i].dob + \"</td>\";\n data += \"</tr>\"\n }\n data += \"</table\"\n \n }\n $(\"#content\").html(data);\n $(\"#regstudents\").dataTable({\n \"pageLength\" : 2\n });\n }", "function displayHighscores() {\n if (localStorage.getItem(\"scores\") === null) {\n scoresArr = [];\n } else {\n scoresArr = JSON.parse(localStorage.getItem(\"scores\"));\n }\n scoresArr\n .sort((a, b) => b.score - a.score)\n .forEach((scores) => {\n let tableRow = document.createElement(\"tr\");\n let tableRank = document.createElement(\"td\");\n let tableInitials = document.createElement(\"td\");\n let tableScore = document.createElement(\"td\");\n\n highscores.append(tableRow);\n // Adding a one to index first so top rank does not show as 0\n tableRank.textContent = 1 + scoresArr.indexOf(scores);\n tableInitials.textContent = scores.initials;\n tableScore.textContent = scores.score;\n tableRow.append(tableRank, tableInitials, tableScore);\n });\n}", "function showResults(){\n\n\t// gather answer containers from our quiz\n\tconst answerContainers = quizContainer.querySelectorAll('.answers');\n \n\t// keep track of user's answers\n\tlet numCorrect = 0;\n \n\t// for each question...\n\tmyQuestions.forEach( (currentQuestion, questionNumber) => {\n \n\t // find selected answer\n\t const answerContainer = answerContainers[questionNumber];\n\t const selector = `input[name=question${questionNumber}]:checked`;\n\t const userAnswer = (answerContainer.querySelector(selector) || {}).value;\n \n\t // if answer is correct\n\t if(userAnswer === currentQuestion.correctAnswer){\n\t\t// add to the number of correct answers\n\t\tnumCorrect++;\n \n\t\t//color the answers green\n\t\tanswerContainers[questionNumber].style.color = 'blue';\n\t }\n\t // if answer is wrong or blank\n\t else{\n\t\t// color the answers red\n\t answerContainers[questionNumber].style.color = 'red';\n\t }\n\t});\n \n\t// show number of correct answers out of total\n\tresultsContainer.innerHTML = `Your score is : ${numCorrect} out of ${myQuestions.length}`;\n }", "function displayScore() {\n\n audio.pause();\n\n var score = $('<p>',{id: 'question'});\n\n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n\n if (numCorrect == questions.length) {\n score.append('Goodjob Genuis.com, you got all of em. ');\n // Display the corresponding gif\n var gif_src = '<img src=\"../resources/gif/denzel.gif\">';\n gifHolder.append(gif_src);\n }else {\n score.append('You got ' + numCorrect + ' questions out of ' +\n questions.length + ' right!!!');\n\n // Display the corresponding gif\n var gif_src = '<img src=\"../resources/gif/numbers.gif\">';\n gifHolder.append(gif_src);\n }\n return score;\n }", "function displayScore(){\n $(\"#memory-score\").html(score);\n $(\"#correct-pairs\").html(pairsCorrect);\n}", "function displayScore() {\n clearTimeout(t);\n $('#time').hide();\n StopFunctionTwo();\n StopFunction();\n var score = $('<p>',{id: 'question'});\n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n \n score.append('You got ' + numCorrect + ' out of ' + questions.length + ' questions right!!!');\n return score;\n \n}", "function getResponseEntriesForStudent(){\n console.log(\"Getting all exercise response entries for \\\n teacher \" + teacherID +\", lesson \" + lessonID +\" and student \" + studentID);\n dbShellResponsesForStudent.transaction(function(tx){\n tx.executeSql(\"select row_id,teacher_id,student_id,lesson_id,exercise_id,response,scoremark,comment\\\n from responseandmark where teacher_id=? and student_id=? order by lesson_id,exercise_id\",[teacherID,studentID]\n ,renderResponseEntriesForStudent,dberrorhandlerForResponseForStudent);\n },dberrorhandlerForResponseForStudent);\n}", "function renderScores(parent) {\n // Generate essential table structure\n let frame = $('<table class=\"table\"></table').appendTo(parent);\n let header = $('<thead></thead').appendTo(frame);\n let headRow = $('<tr></tr>').appendTo(header);\n let numCol = $('<th scope=\"col\">#</th>').appendTo(headRow);\n let nameCol = $('<th scope=\"col\">Name</th>').appendTo(headRow);\n let scoreCol = $('<th scope=\"col\">Score</th>').appendTo(headRow);\n let tableBody = $('<tbody></tbody').appendTo(frame)\n\n // parses objects of scoreBoard array\n scoreBoard.sort((a, b) => (a.score < b.score) ? 1 : -1);\n let initsArr = scoreBoard.map(user => user.initials);\n let scoresArr = scoreBoard.map(user => user.score);\n console.log(scoreBoard)\n scoreBoard.forEach((player) => {\n const placeRow = $('<tr></tr>').appendTo(tableBody)\n let placeRank = $('<th scope=\"row\"></th>').text(initsArr.indexOf(player.initials) + 1);\n let placeInit = $('<td></td>').text(player.initials);\n let placeScore = $('<td></td>').text(player.score);\n placeRank.appendTo(placeRow);\n placeInit.appendTo(placeRow);\n placeScore.appendTo(placeRow);\n ;\n })\n \n const highScores = scoreBoard.filter(user => user.score >= 50);\n}", "function displayResults() {\n finalScore.innerHTML += `<h3>Your score is ${score}</h3>`;\n const sentences = {\n 0: \"Wax on, wax off NOOB\",\n 1: \"Wax on, wax off NOOB\",\n 2: \"Wax on, wax off NOOB\",\n 3: \"Almost there, Baby-IronHacker!\",\n 4: \"Almost there, Baby-IronHacker!\",\n 5: \"Welcome Home WebDev ! \",\n 6: \"Welcome Home WebDev ! \",\n 7: \" YEAH, Welcome to you Ironhacker!\",\n 8: \" YEAH, Welcome to you IronHacker!\",\n 9: \" Congratulations ! Biggest IRONHACKER Ever ! \",\n 10: \"Congratulations ! Biggest IRONHACKER Ever !\"\n };\n scoreSentences.innerHTML += `<p>${sentences[score]}</p>`;\n}", "function displayStudent(student) {\n //create clone\n const clone = document.querySelector(\"template#student\").content.cloneNode(true);\n\n //set clone data\n clone.querySelector(\"[data-field=firstname]\").textContent = student.firstName;\n clone.querySelector(\"[data-field=lastname]\").textContent = student.lastName;\n clone.querySelector(\"[data-field=middlename]\").textContent = student.middleName;\n clone.querySelector(\"[data-field=nickname]\").textContent = student.nickName;\n clone.querySelector(\"#profile\").src = \"./images/\" + student.photo;\n clone.querySelector(\"[data-field=house]\").textContent = student.house;\n\n //PREFECT\n if (student.prefect === true) {\n clone.querySelector(\"[data-field=prefect]\").classList.add(\"color\");\n document.querySelector(\".pop\").classList.add(\"color\");\n } else {\n clone.querySelector(\"[data-field=prefect]\").classList.remove(\"color\");\n }\n\n //CLICK PREFECT\n clone.querySelector(\"[data-field=prefect]\").onclick = () => {\n clickAddAsPrefect(student);\n };\n\n //INQ SQUAD\n if (student.inqS === true) {\n clone.querySelector(\"[data-field=inqs]\").classList.add(\"color\");\n } else {\n clone.querySelector(\"[data-field=inqs]\").classList.remove(\"color\");\n }\n\n //CLICK INQS\n clone.querySelector(\"[data-field=inqs]\").onclick = () => {\n clickAddAsInqS(student);\n };\n clone.querySelector(\"#profile\").onclick = () => {\n showStudentDetails(student);\n };\n\n //EXPELL CLICK\n clone.querySelector(\"[data-field=expell]\").onclick = () => {\n expell(student);\n };\n\n function clickAddAsPrefect(student) {\n if (student.prefect === true) {\n student.prefect = false;\n } else {\n prefectToggle(student);\n }\n //UPDATE LIST\n buildList();\n }\n\n function clickAddAsInqS(student) {\n if (student.inqS === true) {\n student.inqS = false;\n } else {\n inqSToggle(student);\n }\n //UPDATE LIST\n buildList();\n }\n //APPEND CLONE TO LIST\n document.querySelector(\".table-body\").appendChild(clone);\n}", "function genTable(students, start, end){\n\t\n\t// helper arrays for date formatting (might be a good idea to use moment.js)\n\tconst aMonths = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\tconst months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n\tconst days = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n\n\tlet month = [start];\n\tlet day;\n\n\t// generates the date range\n\twhile(start.getTime() < end.getTime()){\n\t\tday = new Date(start);\n\t\tday.setDate(start.getDate()+1);\n\t\tif(day.getDay() != 0 && day.getDay() != 6){\n\t\t\tmonth.push(day);\n\t\t}\n\t\tstart = day;\n\t}\n\n\tlet attendence = [];\n\tlet header = [];\n\theader.push(new Cell(0, 0, \"\", \"Student Name:\", \"\"));\n\tfor(let i=0; i<month.length; i++){\n\t\tlet day = month[i];\n\t\t// header.push(\n\t\t// \tnew Cell(\n\t\t// \t\t0, \n\t\t// \t\ti+1, \n\t\t// \t\t\"\", \n\t\t// \t\t`<abbr title=\"${days[day.getDay()]} ${months[day.getMonth()]} ${day.getDate()}, ${day.getFullYear()}\">${aMonths[day.getMonth()]} ${day.getDate()}</abbr>`, \n\t\t// \t\t\"\"\n\t\t// \t)\n\t\t// );\n\t\theader.push(\n\t\t\tnew Cell(\n\t\t\t\t0, \n\t\t\t\ti+1, \n\t\t\t\t\"\", \n\t\t\t\t`${aMonths[day.getMonth()]} ${day.getDate()}</abbr>`, \n\t\t\t\t\"\"\n\t\t\t)\n\t\t);\n\t}\n\tattendence.push(header);\n\n\tfor(let i=0; i<students.length; i++){\n\t\tlet row = [];\n\t\trow.push(new Cell(i+1, 0, \"\", students[i], \"\"));\n\t\tfor(let j=0; j<month.length; j++){\n\t\t\trow.push(new Cell(i+1, j+1, \"\", \"\", \"\"));\n\t\t}\n\t\tattendence.push(row);\n\t}\n\n\treturn attendence;\n}", "function getTopStudents(){\n\n var iCounter = 0;\n var iCounterInner = 0;\n var sTableBody=\"\";\n var sResult=\"\";\n\n var oTopStudents = oSubject1;\n\n oTopStudents.sort(function (a,b){\n return b.Percentage-a.Percentage;\n });\n\n for(iCounter = 0; iCounter < 5; iCounter++){\n if(oSubject1){\n sTableBody = sTableBody + \"<tr>\";\n for(iCounterInner = 0; iCounterInner < sHeaderList.length; iCounterInner++){\n if(sHeaderList[iCounterInner] !== \"\"){\n var sSubject = oSubject1[iCounter][sHeaderList[iCounterInner].replace(\" \",\"\")];\n if(sSubject){\n sResult = sSubject; \n }\n else{\n sResult = \"NA\";\n }\n sTableBody = sTableBody + \"<td>\" + sResult + \"</td>\";\n }\n }\n sTableBody = sTableBody + \"</tr>\";\n }\n}\nreturn sTableBody;\n }", "function mostrarExamen(){\n //Recoge la información del formulario\n var nQuestions = getValue('n_questions');\n var typeQuestions = getValue('type_question'); //0 Español-Ingles, 1 Inglés español, 2 aleatorio\n var bAyuda = getValue('with_help'); \n var nGroup = getValue('numberGroup'); \n\n // En caso de seleccionar todas las respuestas\n if (nQuestions == 0) {\n nQuestions = arrayVerb.length;\n }\n\n document.getElementById(\"resultadoFinal\").innerHTML='';\n document.getElementById(\"palabrasCorrectas\").innerHTML='';\n document.getElementById(\"examList\").innerHTML='';\n\n exam = new examen(nQuestions, typeQuestions, bAyuda, nGroup);\n\n addHeaderTable(\"examList\");\n document.getElementById(\"lblMaxGrupos\").innerHTML = \"Max. \" + exam.nTotalGrupo;\n document.getElementById(\"examList\").innerHTML += exam.showExam();\n document.getElementById(\"btnResult\").disabled = false;\n \n}", "function yourScore() {\n return fname + ' scored ' + (mid + final);\n }", "function results() {\n // Answer variables.\n correct = 0;\n incorrect = 0;\n unanswered = 0;\n\n for (var i = 1; i < 11; i++) {\n\n if ($(\"input[name='q\" + i + \"']:checked\").val() == \"x\") {\n\n correct++;\n } else if ($(\"input[name='q\" + i + \"']:checked\").val() === undefined) {\n\n unanswered++;\n } else {\n\n incorrect++;\n }\n\n // Display results and hide unwanted elements.\n \n $(\"#quiz\").hide();\n $(\"#whichState\").hide();\n $(\"#validate\").hide();\n $(\"#score\").html(\"Correct: \" + correct + \"<br/>Incorrect: \" + incorrect + \"<br/>Unanswered: \" + unanswered);\n $(\"#timer\").hide();\n $(\"#tally\").show();\n $(\"#clear\").show();\n $(\"#jack\").show();\n }\n\n }", "function showStats() {\n body.style.display = \"none\";\n ansDiv.style.display = \"none\";\n statsEl.style.display = \"flex\";\n correctEl.textContent = \"Score: \" + stats;\n}", "function displayAssessmentReport(result){\n var keys=Object.keys(result[0]);\n\n //tempArray is used to store one type of grade (hw,exam,or proj) at a time:\n var tempArray=[];\n\n //outter for is to loop on the keys that are available in each student object,\n //i.e gives one grade type at a time.\n for (var i=0; i<=keys.length-1; i++){\n\n //the inside foreach loops on all students.\n result.forEach(function(element){\n if (element[keys[i]] !== null){\n tempArray.push(element[keys[i]]);\n }\n });\n\n //if it is not an empty array then scale it and update the view.\n if(tempArray.length > 0){\n //scale one grade type at a time:\n scale(tempArray);\n\n //re empty the tempArray for the next iteration.\n tempArray=[];\n\n //Updating the View:\n var $tr=$(\"<tr class='assessment-report'>\"), $th=$(\"<th>\"), $tdT=$(\"<td>\"), $tdAB=$(\"<td>\"), $tdC=$(\"<td>\"), $tdDF=$(\"<td>\");\n\n //appending table data tags to a table row.\n $th.text(keys[i]);\n $tr.append($th);\n $tdT.text(assessmentScale.total);\n $tr.append($tdT);\n $tdAB.text(assessmentScale.satisfactory);\n $tr.append($tdAB);\n $tdC.text(assessmentScale.developing);\n $tr.append($tdC);\n $tdDF.text(assessmentScale.unsatisfactory);\n $tr.append($tdDF);\n\n //populating download obj and array with data, this data is sent to the server when generating pdf report.\n var assessmentObj={workType:\"\", totalNum:\"\", satisfactory:\"\", developing:\"\", unsatisfactory:\"\"};\n assessmentObj.workType= keys[i];\n assessmentObj.totalNum= assessmentScale.total;\n assessmentObj.satisfactory= assessmentScale.satisfactory;\n assessmentObj.developing= assessmentScale.developing;\n assessmentObj.unsatisfactory= assessmentScale.unsatisfactory;\n assessmentArray.push(assessmentObj);\n\n //appending the table row to the whole table.\n $(\".assessment-report-table\").append($tr);\n }//end if\n }//end of outter for.\n}//end of displayAssessmentReport function.", "function displayScore() {\n var score = $('<p>',{id: 'question'});\n \n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n \n function final() {\n ('Συγχαρητήρια! Απάντησες σωστά και στις 5 ερωτήσεις');\n }\n return score;\n }", "function displayScore() {\n // Create the score\n $('.score').append(`<b>${followers}</b><p>Followers</p>`);\n // Create the post counter\n $('.numPosts').append(`<b>${posts.length}</b><p>Posts</p>`);\n // Create the follower counter\n $('.following').append(`<b>644</b><p>Following</p>`);\n}", "function displayList(students) {\n document.querySelector(\"#all-students\").innerHTML = \"\";\n if (hasBeenHacked === true) {\n randomizeBloodType();\n students.forEach(displayStudent);\n console.log(\"hacked\");\n } else {\n students.forEach(displayStudent);\n console.log(\"not hacked yet\");\n }\n\n // Display current data for allStudents array (and expelledStudents array)\n document.querySelector(\".students-gryffindor\").textContent = \"Students in Gryffindor: \" + allStudents.filter((student) => student.house === \"Gryffindor\").length;\n document.querySelector(\".students-hufflepuff\").textContent = \"Students in Hufflepuff: \" + allStudents.filter((student) => student.house === \"Hufflepuff\").length;\n document.querySelector(\".students-ravenclaw\").textContent = \"Students in Ravenclaw: \" + allStudents.filter((student) => student.house === \"Ravenclaw\").length;\n document.querySelector(\".students-slytherin\").textContent = \"Students in Slytherin: \" + allStudents.filter((student) => student.house === \"Slytherin\").length;\n\n document.querySelector(\".students-total\").textContent = \"Students in total: \" + allStudents.length;\n document.querySelector(\".students-expelled\").textContent = \"Students expelled: \" + expelledStudents.length;\n}", "function showResults(questions, quizContainer, resultsContainer){\r\n\t\t// gather answer containers from our quiz\r\n\tvar answerContainers = quizContainer.querySelectorAll('.answers');\r\n\t\r\n\t// keep track of user's answers\r\n\tvar userAnswer = '';\r\n\tvar numCorrect = 0;\r\n\t\r\n\t// for each question...\r\n\tfor(var i=0; i<questions.length; i++){\r\n\r\n\t\t// find selected answer\r\n\t\tuserAnswer = (answerContainers[i].querySelector('input[name=question'+i+']:checked')||{}).value;\r\n\t\t\r\n\t\t// if answer is correct\r\n\t\tif(userAnswer===questions[i].correctAnswer){\r\n\t\t\t// add to the number of correct answers\r\n\t\t\tnumCorrect=numCorrect+2;\r\n\t\t\t\r\n\t\t\t// color the answers green\r\n\t\t\tanswerContainers[i].style.color = 'lightgreen';\r\n\t\t}\r\n\t// if answer is wrong or blank\r\n\t\telse{\r\n\t\t\t// color the answers red\r\n\t\t\tanswerContainers[i].style.color = 'red';\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\r\n\t// show number of correct answers out of total\r\n\tresultsContainer.innerHTML ='Your scores is ' + numCorrect +'%' + ' out of ' + (questions.length*2) + '%';\r\n\t// alert('Your scores is ' + numCorrect +'%' + ' out of ' + (questions.length*2) + '%');\r\n\t\r\n}", "function showScores() {\n console.log(\"YAY! You SCORED: \", score);\n\n console.log(\"Check out the high scores, if you should be there ping me and I'll update it\");\n\n highScores.map(score => console.log(score.name, \" : \", score.score))\n}", "function showResultPage() {\n if (console.log('test completed')) {\n\n //log \"time/score\" to High Scores page//\n\n //Automatically open High Scores HTML//\n\n }\n}", "function findBestStudent(sortA,h){\n //read each object inside of Array.\n var x;\n var txt = \"\";\n var arrayBestStudent;\n for (i=0; i < sortA.length;i++){\n var alu = sortA[i];\n for (x in alu) {\n if(alu.grade >= h){\n txt += alu[x] + \", \";\n }\n }\n txt=txt+\"<br>\";\n document.getElementById(\"bestStudent\").innerHTML = txt;\n }\n }", "function generateResults(){\n //grabs answer user selected, current question number, and correct answer\n let selected = $('input[type=radio]:checked', '#question-form').val();\n let allQuestions = store.questions;\n let currentQuestionNumber = store.questionNumber;\n let correct = Object.values(allQuestions)[currentQuestionNumber].correctAnswer;\n \n //determines which view to generate based on if users selected the correct answer. if so, increments the score. determines\n if (correct === selected && currentQuestionNumber < store.questions.length) {\n store.score++;\n return generateCorrectPage();\n }\n else if (correct !== selected && currentQuestionNumber < store.questions.length) {\n return generateWrongPage();\n }\n}", "function showScores() {\n $(\"#showQuestionsDiv\").hide();\n $(\"#showResultDiv\").show();\n $(\"#showAnswersDiv\").show();\n var time = $(\"#time\").text();\n var id = \"quizresult-\" + uuidv4();\n var scoreValue = 0;\n for (var i = 0; i < quiz.score.length; i++) {\n scoreValue += quiz.score[i];\n }\n var totalquestions = quiz.questions.length;\n var sessionData = getUserSessionData();\n var userId = sessionData.userid, email = sessionData.useremail;\n var quizresult = {\n \"userid\": userId,\n \"email\": email,\n \"id\": id,\n \"categoryname\": categoryName,\n \"score\": scoreValue,\n \"totalquestions\": totalquestions,\n \"correct\": scoreValue,\n \"totaltime\": time,\n \"timestamp\": new Date(),\n }\n var per = parseInt((scoreValue / totalquestions) * 100) + \" %\";\n $(\"#totalQuestions\").text(totalquestions);\n $(\"#correctQuestions\").text(scoreValue);\n $(\"#wrongQuestions\").text(totalquestions - scoreValue);\n $(\"#percentage\").text(per);\n $(\"#score\").text(scoreValue + \" out of \" + totalquestions);\n var gameOverHTML = \"<h1>Result</h1>\";\n gameOverHTML += \"<h2 id='score'> Your scores: \" + scoreValue + \"</h2>\";\n $(\"#result\").html(gameOverHTML);\n $.each(quiz.questions, function (i, n) {\n\n var optionsForAnswer = n['options'];\n var label1 = '<label class=\"option radio btn\" id=\"label1\" for=\"option1\">' + optionsForAnswer[0] + '</label><br>';\n var label2 = '<label class=\"option radio btn\" id=\"label2\" for=\"option2\">' + optionsForAnswer[1] + '</label><br>';\n var label3 = '<label class=\"option radio btn\" id=\"label3\" for=\"option3\">' + optionsForAnswer[2] + '</label><br>';\n var label4 = '<label class=\"option radio btn\" id=\"label4\" for=\"option4\">' + optionsForAnswer[3] + '</label><br></div>';\n var questionAnswerShow = '<h4 class=\"card-subtitle mb-2 text-muted\" id=\"question\">' + (i + 1) + ' . ' + n['question'] + '</h4><br><div class=\"container\" role=\"group\" aria-label=\"Basic radio toggle button group\">'\n\n var userAnswerIndex = -1;\n if (n.userAnswer != undefined) {\n userAnswerIndex = parseInt(n.userAnswer.charAt(6)) - 1;\n }\n\n var index = 0;\n $.each(n.options, function (j, m) {\n if (m == n.answer) {\n index = j;\n }\n })\n\n\n if (index == userAnswerIndex) {\n if (index == 0) {\n label1 = '<label class=\"option radio btn\" id=\"label1\" for=\"option1\" style=\"background-color:#92f081;\">' + optionsForAnswer[0] + '</label><br>';\n } else if (index == 1) {\n label2 = '<label class=\"option radio btn\" id=\"label2\" for=\"option2\" style=\"background-color:#92f081;\">' + optionsForAnswer[1] + '</label><br>';\n } else if (index == 2) {\n label3 = '<label class=\"option radio btn\" id=\"label3\" for=\"option3\" style=\"background-color:#92f081;\">' + optionsForAnswer[2] + '</label><br>';\n } else if (index == 3) {\n label4 = '<label class=\"option radio btn\" id=\"label4\" for=\"option4\" style=\"background-color:#92f081;\">' + optionsForAnswer[3] + '</label><br></div>';\n }\n } else {\n if (index == 0) {\n label1 = '<label class=\"option radio btn\" id=\"label1\" for=\"option1\" style=\"background-color:#92f081;\">' + optionsForAnswer[0] + '</label><br>';\n } else if (index == 1) {\n label2 = '<label class=\"option radio btn\" id=\"label2\" for=\"option2\" style=\"background-color:#92f081;\">' + optionsForAnswer[1] + '</label><br>';\n } else if (index == 2) {\n label3 = '<label class=\"option radio btn\" id=\"label3\" for=\"option3\" style=\"background-color:#92f081;\">' + optionsForAnswer[2] + '</label><br>';\n } else if (index == 3) {\n label4 = '<label class=\"option radio btn\" id=\"label4\" for=\"option4\" style=\"background-color:#92f081;\">' + optionsForAnswer[3] + '</label><br></div>';\n }\n if (userAnswerIndex == 0) {\n label1 = '<label class=\"option radio btn\" id=\"label1\" for=\"option1\" style=\"background-color:#f07373;\">' + optionsForAnswer[0] + '</label><br>';\n } else if (userAnswerIndex == 1) {\n label2 = '<label class=\"option radio btn\" id=\"label2\" for=\"option2\" style=\"background-color:#f07373;\">' + optionsForAnswer[1] + '</label><br>';\n } else if (userAnswerIndex == 2) {\n label3 = '<label class=\"option radio btn\" id=\"label3\" for=\"option3\" style=\"background-color:#f07373;\">' + optionsForAnswer[2] + '</label><br>';\n } else if (userAnswerIndex == 3) {\n label4 = '<label class=\"option radio btn\" id=\"label4\" for=\"option4\" style=\"background-color:#f07373;\">' + optionsForAnswer[3] + '</label><br></div>';\n }\n\n }\n var fullDiv = questionAnswerShow + label1 + label2 + label3 + label4;\n //console.log(fullDiv);\n $('#showAnswersList').append(fullDiv);\n });\n addQuizResult(quizresult);\n}", "function displayStudent2(alu){\n\n//var alu = JSON.parse('[{ \"Name\":\"John\", \"Age\":31,\"Gender\":\"Male\",\"Courses\":[{ \"season\":\"Winter\", \"name\":\"CIT-160\", \"finalGrade\":\"A\" },{ \"season\":\"Winter\", \"name\":\"WDD-100\", \"finalGrade\":\"A\" },{ \"season\":\"Fall\", \"name\":\"CIT-230\", \"finalGrade\":\"-A\" },{ \"season\":\"Winter\", \"name\":\"CIT-261\", \"finalGrade\":\"Nothing yet\"}]},{ \"Name\":\"Alfredo\", \"Age\":34,\"Gender\":\"Male\",\"Courses\":[{ \"season\":\"Winter\", \"name\":\"CIT-160\", \"finalGrade\":\"B\" },{ \"season\":\"Winter\", \"name\":\"WDD-100\", \"finalGrade\":\"B\" },{ \"season\":\"Fall\", \"name\":\"CIT-230\", \"finalGrade\":\"B\" },{ \"season\":\"Winter\", \"name\":\"CIT-261\", \"finalGrade\":\"B\"}]}]');\n\n\n\n //read each object inside of Array.\n var y;\n var txt = \"\";\n var txt2 = \"\";\n var txt3 = \"\";\n var stu = \"\";\n\n\n //var stu = \"Name: \"+alu.Name+\" - Age:\"+alu.Age+\" - Gender: \"+alu.Gender;\n for (i=0; i < alu.length;i++){\n for(y in alu[i].Courses){\n //var al = alu[i];\n var stu = \"Name: \"+alu[i].Name+\" - Age:\"+alu[i].Age+\" - Gender: \"+alu[i].Gender+\"<br>\";\n\n\n txt2 += \"Season: \"+alu[i].Courses[y].season+\" - Course: \"+alu[i].Courses[y].name + \" - Final Grade: \"+alu[i].Courses[y].finalGrade+\"<br> \";\n\n //this allows to add the name of the student only one time. \n var cant = (alu[i].Courses.length - 1); \n\n if(y == cant){\n txt3 += \"<strong>\"+stu+\"</strong>\"+\"<br>\"+txt2;\n txt3=txt3+\"<br>\";\n document.getElementById(\"listStu2\").innerHTML = \"<br><br>\"+txt3+\"<br><br>\";\n txt2 = \"\";\n }\n }\n\n }\n\n}", "function highScoreDisplay() {\r\n var showDiv = document.getElementById(\"highScoreTable\");\r\n if (showDiv.style.display === \"none\") {\r\n showDiv.style.display = \"block\";\r\n } else {\r\n showDiv.style.display = \"none\";\r\n }\r\n}", "function showScores() {\n console.log(\"Wooohooo! You SCORED: \", currScore);\n\n console.log(\"Check out the high scores. (Updated Automatically.)\");\n\n highScores.map(score => console.log(score.name, \" : \", score.hScore))\n}", "function displayStudents(data) {\n for (index in data.students) {\n $('body').append(\n '<p>' + data.students[index].text + '</p>');\n }\n}", "* overviewPrint (request, response) {\n const categories = yield Category.all(),\n result = yield Result.get(request.param('id')),\n user = yield request.auth.getUser(),\n type = request.input('type'),\n date = moment().format('YYYY-mm-DD hh:mm:ss')\n\n result.sortCandidates((a, b) => {\n return result.getJudgesAverage(b.id) - result.getJudgesAverage(a.id)\n })\n\n if (type == 'winner') {\n result.sliceTop(1)\n }\n\n if (type == 'top-5') {\n result.sliceTop(5)\n }\n\n yield response.sendView('dashboard/score/overview_print', {\n categories, result, user, date\n })\n }", "function showSummary() {\n stop();\n $(\".quiz\").hide();\n $(\".summary\").show();\n $(\"#scoreCorrect\").text(\"Correct Answers: \" + scoreCorrect);\n $(\"#scoreIncorrect\").text(\"Incorrect Answers: \" + scoreIncorrect);\n\n}", "function displayProfile(times,temps){\n\tvar num_times = times.length;\n\t\n\tfor(i = 0 ; i < num_times ; i++){\n\t\tvar num_rows = profileTable.rows.length;\n\t\tvar row = profileTable.insertRow(num_rows);\n\t\t\n\t\tvar cell1 = row.insertCell(0);\n\t\tcell1.innerHTML = times[i];\n\t\t\n\t\tvar cell2 = row.insertCell(1);\n\t\tcell2.innerHTML = temps[i];\n\t}\n}", "function searchByJambScore(){\n var score= document.getElementById(\"score\").value;\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n document.getElementById(\"studentTable\").innerHTML =this.responseText;\n }\n }\n xhttp.open(\"POST\", \"config/get_table_by_jamb_score.php\", true);\n xhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xhttp.send(\"jamb_score=\"+score);\n }", "function viewRoles() {\r\n var query = 'SELECT * FROM role';\r\n connection.query(\"SELECT employee.first_name, employee.last_name, role.title AS Title FROM employee JOIN role ON employee.role_id = role.id;\", \r\n function(err, res) {\r\n if (err) throw err\r\n console.table(res)\r\n questions();\r\n })\r\n}", "function displayScore() {\n titleEl.textContent = (\"High scores:\")\n titleEl.style = (\"color: black\");\n footerEl.style = (\"display: none\");\n timerEl.textContent = (JSON.stringify(highScores[0][\"initials\"]))\n penalty.textContent = (JSON.stringify(highScores[0][\"score\"]))\n penalty.style = (\"color: black\");\n}", "function Results(){\n \n //display score\n $('#msg').html(\"Your current score is \" + correct + \" out of 10.\");\n \n //hide timer and seconds\n $('#holder').show();\n $('#seconds').html(\"\");\n \n //Display grade depending on score\n if((correct/10)>=0.9){\n $('#timer').attr('src','GradeA.jpg');\n }else if((correct/10)>=0.8){\n $('#timer').attr('src','GradeB.jpg');\n }else if((correct/10)>=0.7){\n $('#timer').attr('src','GradeC.jpg');\n }else if((correct/10)>=0.6){\n $('#timer').attr('src','GradeD.jpg');\n }else{\n $('#timer').attr('src','GradeF.jpg');\n }\n }", "function gradeQuiz() {\n var usersArray = makeUserArray();\n scoreQuiz(usersArray);\n colorAnswers(usersArray);\n}", "function tabulateAnswers() {\n // initialize variables for each choice's score\n // If you add more choices and outcomes, you must add another variable here.\n var yes1score = 0;\n var no1score = 0;\n var yes2score = 0;\n var no2score = 0;\n var yes3score = 0;\n var no3score = 0;\n var yes4score = 0;\n var no4score = 0;\n var yes5score = 0;\n var no5score = 0;\n var yes9score = 0;\n var no9score = 0;\n\n var c1score = 0;\n var c2score = 0;\n var c3score = 0;\n var c4score = 0;\n\n // get a list of the radio inputs on the page\n var choices = document.getElementsByTagName('input');\n console.log(choices)\n // loop through all the radio inputs\n for (i=0; i<choices.length; i++) {\n // if the radio is checked..\n if (choices[i].checked) {\n // add 1 to that choice's score\n if (choices[i].value == 'yes1score') {\n yes1score = yes1score + 1;\n }\n if (choices[i].value == 'no1score') {\n no1score = no1score + 1;\n }\n if (choices[i].value == 'yes2score') {\n yes2score = yes2score + 1;\n }\n if (choices[i].value == 'yes3score') {\n yes3score = yes3score + 1;\n }\n if (choices[i].value == 'no2score') {\n no3score = no3score + 1;\n }\n if (choices[i].value == 'c4') {\n c4score = c4score + 1;\n }\n if (choices[i].value == 'yes1') {\n c1score = c1score + 1;\n }\n if (choices[i].value == 'c2') {\n c2score = c2score + 1;\n }\n if (choices[i].value == 'c3') {\n c3score = c3score + 1;\n }\n if (choices[i].value == 'c4') {\n c4score = c4score + 1;\n }\n if (choices[i].value == 'c4') {\n c4score = c4score + 1;\n }\n if (choices[i].value == 'c4') {\n c4score = c4score + 1;\n }\n\n //calling all the text boxes\n var answerbox = document.getElementById('box');\n\n // If you add more choices and outcomes, you must add another if statement below.\n }\n }\n // Find out which choice got the highest score.\n // If you add more choices and outcomes, you must add the variable here.\n var maxscore = Math.max(yes1score,no1score,yes2score,no2score,yes3score,no3score,yes4score,no4score,yes5score,no5score,yes9score,no9score);\n\n // Display answer corresponding to that choice\n var answerbox = document.getElementById('answer');\n if (c1score == maxscore) { // If user chooses the first choice the most, this outcome will be displayed.\n answerbox.innerHTML = \"Thank you for taking our survey! Feel free to contact us for more questions or feedback\";\n }\n if (c2score == maxscore) { // If user chooses the second choice the most, this outcome will be displayed.\n answerbox.innerHTML = \"Thank you for taking our survey! Feel free to contact us for more questions or feedback\";\n }\n if (c3score == maxscore) { // If user chooses the third choice the most, this outcome will be displayed.\n answerbox.innerHTML = \"Thank you for taking our survey! Feel free to contact us for more questions or feedback\";\n }\n if (c4score == maxscore) { // If user chooses the fourth choice the most, this outcome will be displayed.\n answerbox.innerHTML = \"Thank you for taking our survey! Feel free to contact us for more questions or feedback\";\n }\n // If you add more choices, you must add another response below.\n}", "function previewScore() {\n userInfo = getData(\"userInfo\");\n sortedByScore(userInfo);\n if (numRefresh == 0) {\n swal(\"Tips\", \"Click F5 to reload the Score Board\");\n }\n status1.innerHTML = \"\";\n choice.innerHTML = \"\";\n scoreBody.innerHTML = \"\";\n header.innerHTML = \"\";\n\n var congra = document.createElement(\"H1\");\n congra.innerHTML = \"Congratulations!\";\n congra.classList.add(\"congra\");\n header.appendChild(congra);\n\n var message = document.createElement(\"H2\");\n message.innerHTML = \"Scoreboard\";\n message.classList.add(\"alignCenter\");\n scoreBody.appendChild(message);\n\n let scoreTable = document.createElement(\"table\");\n scoreTable.classList.add(\"table\");\n scoreTable.classList.add(\"table-striped\");\n scoreTable.classList.add(\"table-hover\");\n\n let scoreHead = document.createElement(\"thead\");\n let tBody = document.createElement(\"tbody\");\n let firstRow = document.createElement(\"tr\");\n firstRow.classList.add(\"firstRow\");\n\n let numCol = document.createElement(\"th\");\n numCol.innerHTML = \"#\";\n let firstCol = document.createElement(\"th\");\n firstCol.innerHTML = \"Name\";\n let secondCol = document.createElement(\"th\");\n secondCol.innerHTML = \"Category\";\n let thirdCol = document.createElement(\"th\");\n thirdCol.innerHTML = \"Score\";\n firstRow.appendChild(numCol);\n firstRow.appendChild(firstCol);\n firstRow.appendChild(secondCol);\n firstRow.appendChild(thirdCol);\n scoreHead.appendChild(firstRow);\n scoreTable.appendChild(scoreHead);\n scoreBody.appendChild(scoreTable);\n\n for (let index = 0; index < userInfo.length - 1; index++) {\n const element = userInfo[index];\n let currRow = document.createElement(\"tr\");\n let currNum = document.createElement(\"th\");\n currNum.innerHTML = String(index + 1);\n let currName = document.createElement(\"td\");\n currName.innerHTML = element.name;\n let currCat = document.createElement(\"td\");\n currCat.innerHTML = element.categoryNum;\n let currProgress = document.createElement(\"td\");\n let progressDiv = document.createElement(\"div\");\n progressDiv.classList.add(\"progress\");\n progressDiv.style.width = \"100%\";\n let currProgressbar = document.createElement(\"Div\");\n currProgressbar.classList.add(\"progress-bar\");\n currProgressbar.classList.add(\"bg-success\");\n currProgress.setAttribute(\n \"title\",\n \"Answered \" + element.answered + \" out of \" + element.questionNum\n );\n currProgressbar.style.width =\n (element.answered / element.questionNum) * 100 + \"%\";\n progressDiv.appendChild(currProgressbar);\n currProgress.appendChild(progressDiv);\n\n currRow.appendChild(currNum);\n currRow.appendChild(currName);\n currRow.appendChild(currCat);\n currRow.appendChild(currProgress);\n tBody.appendChild(currRow);\n }\n scoreTable.appendChild(tBody);\n\n var tryAgain = document.createElement(\"button\");\n tryAgain.innerHTML = \"Try Again\";\n tryAgain.classList.add(\"btn\");\n tryAgain.classList.add(\"btn-primary\");\n tryAgain.addEventListener(\"click\", function () {\n let countPlayer = parseInt(getData(\"countPlayer\"));\n countPlayer -= 1;\n if (countPlayer == 0) {\n localStorage.clear();\n }\n localStorage.setItem(\"countPlayer\", JSON.stringify(countPlayer));\n window.location.href = \"./index.html\";\n });\n scoreBody.appendChild(tryAgain);\n\n document.addEventListener(\"keydown\", function (event) {\n switch (event.keyCode) {\n case 116: // 'F5'\n numRefresh += 1;\n previewScore();\n event.returnValue = false;\n event.keyCode = 0;\n window.status = \"We have disabled F5\";\n break;\n }\n });\n }", "function submitPage(){\n $scope.beginExamClicked = true;\n var testFinishTime=new Date();\n var totalAttempted= 0,totalCorrect=0;\n var questionStatsList=[];\n var questionStats={};\n for(var j=0; j<$rootScope.questions.length;j++){\n \tquestionStats={};\n \tquestionStats.examId=$rootScope.currentExam.examSetId;\n \tquestionStats.userId=$scope.userId;\n \tquestionStats.examDate=getDateTime();\n \tquestionStats.attemptNo=$rootScope.currentExam.currentAttempt;\n\n \tquestionStats.moduleName=getModuleName(j);\n \tquestionStats.questionId=\"question_\"+j;\n \tquestionStats.isCorrect='N';\n \tquestionStats.userAnswer=$rootScope.questions[j].user_selected_option;\n \tquestionStats.correctAnswer=$rootScope.questions[j].correct_option;\n \tquestionStats.score=0;\n \tquestionStats.timeTaken=\"00:00:00\";\n\n if($rootScope.questions[j].user_selected_option!='-1'){\n totalAttempted++;\n if($rootScope.questions[j].user_selected_option==$rootScope.questions[j].correct_option){\n totalCorrect++;\n questionStats.isCorrect='Y';\n questionStats.score=$rootScope.currentExam.correctMarks;\n }else{\n \tif($rootScope.currentExam.isNegativeMarks){\n \t\tquestionStats.score=$rootScope.currentExam.negativeMarks;\n \t}\n }\n questionStats.timeTaken=$rootScope.questions[j].timeTaken;\n }\n\n questionStatsList.push(questionStats);\n }\n $rootScope.currentExam.total_questions_attempted=totalAttempted;\n $rootScope.currentExam.total_questions_correct=totalCorrect;\n\n if($rootScope.currentExam.is_negative_marks_applicable){\n \t$rootScope.currentExam.score_obtained=totalCorrect*$rootScope.currentExam.correct_marks-(totalAttempted-totalCorrect)*$rootScope.currentExam.negativeMarks;\n \t}else{\n \t\t$rootScope.currentExam.score_obtained=totalCorrect*$rootScope.currentExam.correctMarks;\n \t}\n $rootScope.currentExam.total_time_taken=findTimeDifference(testStartTime,testFinishTime);\n\n //update modal & save in DB\n saveExamStats(questionStatsList);\n }", "function topicsSummaryMultiplePapers()\n {\n\t var points=[\"You did a splendid Job I can't believe you scored Fullest Percentage, But don't let this you to get into relax mode.\",\n\t\t\t\"Excellent Job! You Performed Well in the Examination but don't be relaxed\",\n\t\t\t\"You scored a very good score, But Why did you miss the remaining look at them once\",\n\t\t\t\"You have Scored Good Score but you missed others look at them\",\n\t\t\t\"Ok, But it's not up to your level must Consider this don't leave it\",\n\t\t\t\"I believe You Have the ability to score fullest, May be I think your hardWork is not as expected. So Work hard Buddy\",\n\t\t\t\"Hey! the score is not as expected. What happend to you. I know this is not your score. But Why is this happend? Take it seriously\",\n\t\t\t\"It's too low. Anything wrong? I can't expect this kind of score. You Have to put more efforts and hardwork. Hope you won't repeat this.\",\n\t\t\t\"Bad Score! Your HardWork is required.\",\n\t\t\t\"Worst Score! More and More HardWork is required\",\n\t\t\t\"No Comment! Please Think about Your progress\"];\n\t\tvar studyAdvice;\n\t\tvar st=\"<div class='row'>\";\n\t\tvar marks=0;\n\t\tvar marksPercent;\n\t \n\t\tvar d=[];\n\t\t var data=[];\n\t\t \n\t\t for(i=0;i<userAllPapersAnswers.length;i++)\n\t\t\t {\n\t\t\t \n\t\t\t for(j=0;j<userAllPapersAnswers[i].optionsList.length;j++)\n\t\t\t\t {\n\t\t\t\t d.push(userAllPapersAnswers[i].optionsList[j]);\n\t\t\t\t\t data.push(questionsAllPapersData[i].questionsList[j]);\n\t\t\t\t }\n\t\t\t\t\n\t\t\t\t\n\t\t\t }\n\t\t \n\t\t console.log(d);\n\t\t console.log(data);\n\t\t \n\t\t var answeredCount=0;\n\t\t var topicsToFocus=[];\n\t\t var tDuplicate=0;\n\t\t for(var i=0;i<d.length;i++)\n\t\t\t {\n\t\t\t \n\t\t\t tDuplicate=0;\n\t\t\t if(d[i]!=\"NA\")\n\t\t\t \tansweredCount++;\n\t\t\t if(d[i]!=data[i].qkey)\n\t\t\t \t{\n\t\t\t \t for(j=0;j<topicsToFocus.length;j++)\n\t\t\t \t\t {\n\t\t\t \t\t if(data[i].topic==topicsToFocus[j])\n\t\t\t \t\t\t tDuplicate=1; \n\t\t\t \t\t }\n\t\t\t \t if(tDuplicate==0)\n\t\t\t \ttopicsToFocus.push(data[i].topic);\n\t\t\t \t\n\t\t\t \t}\n\t\t\t else{\n\t\t\t \tmarks++;\n\t\t\t }\n\t\t\t }\n\t\t marksPercent=parseInt((marks*100)/data.length);\n\t\t \n\t\t if(marksPercent>=100)\n\t\t\t studyAdvice=points[0];\n\t\t else if(marksPercent>=95)\n\t\t\t studyAdvice=points[1];\n\t\t else if(marksPercent>=90)\n\t\t\t studyAdvice=points[2];\n\t\t else if(marksPercent>=80)\n\t\t\t studyAdvice=points[3];\n\t\t else if(marksPercent>=70)\n\t\t\t studyAdvice=points[4];\n\t\t else if(marksPercent>=60)\n\t\t\t studyAdvice=points[5];\n\t\t else if(marksPercent>=45)\n\t\t\t studyAdvice=points[6];\n\t\t else if(marksPercent>=35)\n\t\t\t studyAdvice=points[7];\n\t\t else if(marksPercent>=20)\n\t\t\t studyAdvice=points[8];\n\t\t else if(marksPercent>=10)\n\t\t\t studyAdvice=points[9];\n\t\t else\n\t\t\t studyAdvice=points[10];\n\t\t \n\t\t \n\t\t var diffTopics=[];\n\t\t var diffTopicsQCount=[];\n\t\t tDuplicate=0;\n\t\t \n\t\t for(i=0;i<data.length;i++)\n\t\t\t {\n\t\t\t tDuplicate=0;\n\t\t\t for(j=0;j<diffTopics.length;j++)\n\t\t\t \t{\n\t\t\t \t if(data[i].topic==diffTopics[j])\n\t\t\t \t\t {\n\t\t\t \t\t tDuplicate=1;\n\t\t\t \t\t \n\t\t\t \t\t }\n\t\t\t \t}\n\t\t\t if(tDuplicate==0)\n\t\t\t \tdiffTopics.push(data[i].topic); \t\n\t\t\t }\n\t\t \n\t\t \n\t\t //Topic wise statistics\n\t\t var qCount=0;\n\t\t var wrongQCount=0;\n\t\t var wrongQuestion;\n\t\t var wrongQuestions=[];\n\t\t var multopics=[];\n\t\t for(i=0;i<diffTopics.length;i++)\n\t\t\t {\n\t\t\t \n\t\t\t wrongQCount=0;\n\t\t\t qCount=0;\n\t\t\t wrongQuestions=[];\n\t\t\t for(j=0;j<data.length;j++)\n\t\t\t \t {\n\t\t\t \t if(diffTopics[i]==data[j].topic)\n\t\t\t \t \t{\n\t\t\t \t \tqCount++;\n\t\t\t \t \t if(d[j]!=data[j].qkey)\n\t\t\t \t \t\t {\n\t\t\t \t \t\t wrongQCount++;\n\t\t\t \t \t\t wrongQuestions.push(new WrongQuestion(data[j].question,data[j].qkey,d[j],data[j].optionA,data[j].optionB,data[j].optionC,data[j].optionD,data[j].optionE));\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 multopics.push(new Topic(diffTopics[i],qCount,wrongQCount,wrongQuestions));\n\t\t\t }\n\t\t \n\t\tst=st+\"<div class='col-md-7'>\" +\n\t\t\t\t\"<p><span style='font-weight:600;font-size:12px;'>Total Number of Questions :</span> <span style='color:#00a69c'>\"+data.length+\"</span></p>\" +\n\t\t\t\t\"<p><span style='font-weight:600;font-size:12px;'>Total Number of Questions answered : </span> <span style='color:#00a69c'>\"+answeredCount+\"</span></p>\" +\n\t\t\t\t\"<p><span style='font-weight:600;font-size:12px;'>Total Number of Questions Correctly Answered : </span> <span style='color:#00a69c'>\"+marks+\"</span></p>\" +\n\t\t\t\t\"</div>\";\n\t\t\tif(marksPercent<=35)\n\t\t\t{\n\t\t\t\tst=st+\"<div class='col-md-5'><br><p style='marging-top:1%;'><span style='font-weight:600;font-size:12px;'>Your total score : </span><span class='redClass clrsClass'>\"+marksPercent+\"%</span></p>\"+\n\t\t\t\t\"</div></div>\";\n\t\t\t}\n\t\t\telse if(marksPercent>35 && marksPercent<=75)\n\t\t\t{\n\t\t\t\tst=st+\"<div class='col-md-5'><br><p style='marging-top:1%;'><span style='font-weight:600;font-size:12px;'>Your total score : </span><span class='clrAvg clrsClass'>\"+marksPercent+\"%</span></p>\"+\n\t\t\t\t\"</div></div>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tst=st+\"<div class='col-md-5'><br><p style='marging-top:1%;'><span style='font-weight:600;font-size:12px;'>Your total score : </span><span class='greenClass clrsClass'>\"+marksPercent+\"%</span></p>\"+\n\t\t\t\t\"</div></div>\";\n\t\t\t}\n\t\t\t\t\n\t\t\tst=st+\"<div class='row' style='border:1px solid #4e4e4e;border-radius:5px;'><div class='col-md-12'>\";\n\t\t\n\t\tif(answeredCount!=data.length)\n\t\tst=st+\"<span style='color:#4e4e4e;font-weight:600;'>Note : </span><span style='color:red'> It's not fare that you did not even attempt all Questions. The Exam Doesn't even have any Negative Marking</span>\"+\"<br>\";\n\t/*\n\t\tst=st+\"Different Topics Covered In this Question Paper\"+\"<br>\";\n\t\t\n\t\tfor(i=0;i<diffTopics.length;i++)\n\t\t{\n\t\t\tst=st+\"<span style='margin:3px;border-radius:20%;padding:5px;color:black;background-color:#DDD6D4'>\"+diffTopics[i]+\"</span>\";\n\t\t}\n\t\tst=st+\"<br>\";\n\t\t*/\n\t\t\n\t\tst=st+\"<canvas id='topicsBarGraph'></canvas>\" +\n\t\t\t\t\"</div></div>\" +\n\t\t\t\t\"<br><div class='row' style='height:450px;'><div class='col-md-8' style='height:450px;overflow:scroll;'>\";\n\t\t\n\t\t/*st=st+\"<p style='padding-top:1%;font-size:16px;text-align:center;font-weight:600px;color:#ff6666;'>Topics You have to Focus More\"+\"</p>\";\n\t\tfor(i=0;i<topicsToFocus.length;i++)\n\t\t{\n\t\t\tst=st+\"<p style='padding:5px;font-size:12px;text-align:center;width:90% !important;color:black;background-color:#DDD6D4'>\"+topicsToFocus[i]+\"</p>\";\n\t\t}\n\t\t\n\t\tst=st+\"</div>\" +\n\t\t\t\t\"<div class='col-md-8' style='overflow:scroll;height:440px;'>\";*/\n\t\t\n\t\tvar labelsData=[];\n\t\tvar percentData=[];\n\t\tvar colors=[];\n\t\tst=st+\"<p style='padding-top:1%;font-size:16px;text-align:center;font-weight:600;color:#ff6666;'>Look in Detail\"+\"</p>\";\n\t\tfor(i=0;i<multopics.length;i++)\n\t\t\t{\n\t\t\tst=st+\"<p style='font-weight:600;font-size:12px'>Topic: <span style='color:#ff6666'>\"+multopics[i].topic+\"</span> Score Percent : <span style='font-weight:500;color:#00a69c;'>\"+parseInt((multopics[i].qCount-multopics[i].wrongQCount)*100/multopics[i].qCount)+\"%</span></p>\";\n\t\t\t st=st+\"<p style='font-weight:600;font-size:12px'>Totoal Questions from Topic : <span style='font-weight:600;color:#000;'>\"+multopics[i].qCount+\"</span></p>\";\n\t\t\tif(multopics[i].wrongQCount!=0)\n\t\t\t\t{\n\t\t\t \n\t\t\t st=st+\"<p style='font-size:12px'>You did not Score for <span style='font-weight:600;color:#ff6666;'>\"+multopics[i].wrongQCount+\"</span> Questions</p>\";\n\t\t\t st=st+\"<p style='font-weight:600;font-size:12px'>Want To See Questions You missed scoring : <button class='btn btn-default' style='color:#ff6666;border:1px solid #ff6666;border-radius:5px;font-size:10px;font-weight:600;' onclick='displayD(\\\"wrongQuestions\"+i+\"\\\")'>Click Here</button></p><hr>\";\n\t\t\t st=st+\"<span id='wrongQuestions\"+i+\"' style='display:none'>\";\n\t\t\t for(j=0;j<multopics[i].wrongQuestions.length;j++)\n\t\t\t\t {\n\t\t\t\t st=st+\"<p><span style='color:red;font-size:12px;'>Question No: </span><span style='color:#00a69c'>\"+(j+1)+\"</span></p>\" +\n\t\t\t\t \t\t\"<p style='font-weight:600;font-size:12px;'> \"+multopics[i].wrongQuestions[j].question+\"</p>\";\n\t\t\t\t st=st+\"<p>A) \"+multopics[i].wrongQuestions[j].optionA+\"<span style='margin-left:10px;'>B) \"+multopics[i].wrongQuestions[j].optionB+\"</span><span style='margin-left:10px;'>C) \"+multopics[i].wrongQuestions[j].optionC+\"</span><span style='margin-left:10px;'>D) \"+multopics[i].wrongQuestions[j].optionD+\"</span><span style='margin-left:10px;'>E) \"+multopics[i].wrongQuestions[j].optionE+\"</span></p>\";\n\t\t\t\t st=st+\"<p>Key : <span style='font-weight:600;'>\"+multopics[i].wrongQuestions[j].qkey+\"</span><span style='margin-left:2%'> Your Answer: </span><span style='font-weight:600;'>\"+multopics[i].wrongQuestions[j].yourAnswer+\"</span></p><hr><br>\";\n\t\t\t\t \n\t\t\t\t st=st+\"<p>Google Help:<br> <a href='https://www.google.co.in/search?q=\"+multopics[i].wrongQuestions[j].question+\"' target='_blank'>Ask <i style='color:green' class='fa fa-google' aria-hidden='true'></i></a></p>\";\n\t\t\t\t }\n\t\t\t st=st+\"</span>\";\n\t\t\t}\n\t\t\t else{\n\t\t\t\t st=st+\"<p style='font-size:12px'>Good You have Answered All Questions</p>\";\n\t\t\t }\n\t\t\t labelsData.push(multopics[i].topic);\n\t\t\n\t\t\t percentData.push(parseInt((multopics[i].qCount-multopics[i].wrongQCount)*100/multopics[i].qCount));\n\t\t\t \n\t\t\t if(parseInt((multopics[i].qCount-multopics[i].wrongQCount)*100/multopics[i].qCount)>75)\n\t\t\t\t colors.push(\"green\");\n\t\t\t else if(parseInt((multopics[i].qCount-multopics[i].wrongQCount)*100/multopics[i].qCount)>45)\n\t\t\t colors.push(\"yellow\");\n\t\t\t else\n\t\t\t\t colors.push(\"red\");\n\t\t\t}\n\t\tst=st+\"</div><div class='col-md-4'>\";\n\t\t\n\t\tst=st+\"<p style='text-align:center;color:#00a69c;font-weight:600;font-size:16px;'>Study Advicer's Advice</p>\"+studyAdvice+\"<br>\";\n\t\t\t\t\n\t\tst=st+\"</div></div>\";\n\t\t\n\t\t$(\"#resultStats\").html(st);\n\t\tdisplayBarGraph('topicsBarGraph',percentData,'Topic Wise Analysis',labelsData,colors);\n\t\t\n\t \n\t\t\n\t\t\n\t \n\t $(\"#ajaxPageLoader\").hide();\n }" ]
[ "0.6070307", "0.60455674", "0.5981045", "0.5968265", "0.5938836", "0.5921643", "0.5915903", "0.5908307", "0.5901442", "0.5880422", "0.5879626", "0.5867868", "0.58676696", "0.5852028", "0.5844362", "0.5822221", "0.5815565", "0.5804962", "0.5804044", "0.57966375", "0.57965684", "0.5770804", "0.5766753", "0.5735065", "0.5734323", "0.5720786", "0.57089674", "0.56986314", "0.56944454", "0.56858796", "0.5680395", "0.56786287", "0.56699944", "0.5656218", "0.5646805", "0.5644074", "0.5638571", "0.5634103", "0.5634008", "0.56129414", "0.55983084", "0.5581314", "0.5579966", "0.557619", "0.5573712", "0.55709434", "0.5548191", "0.5543352", "0.55248946", "0.5507507", "0.54907817", "0.54834396", "0.5473485", "0.54715186", "0.54662114", "0.54655707", "0.54559517", "0.5454086", "0.54532355", "0.5449434", "0.54409975", "0.54322535", "0.54256845", "0.542511", "0.5421153", "0.5406097", "0.5404076", "0.53992194", "0.5397667", "0.5392519", "0.5383065", "0.5378723", "0.5373059", "0.53599036", "0.53540766", "0.534971", "0.53462464", "0.53440726", "0.5340615", "0.5334555", "0.5326567", "0.53207624", "0.53199774", "0.53178275", "0.5314138", "0.5313703", "0.5313669", "0.53122747", "0.529945", "0.5297643", "0.5294738", "0.52931505", "0.52927166", "0.52880675", "0.5278656", "0.5276238", "0.52732694", "0.52682686", "0.52670395", "0.5263253", "0.52621025" ]
0.0
-1
Used when displaying students who have taken exam to show links for answer and time logs
function viewScoreFormatter(value, row, index) { return [ '<a href="javascript:void(0)" onclick="showScoreTable(\'' + row.id + '\');" title="Answer Details">', '<i class="fa fa-check-square fa-2x ucf-colors-selected"></i>', '</a> ', '<a href="javascript:void(0)" onclick="showTimeTable(\'' + row.id + '\');" title="Time Audit">', '<i class="fa fa-clock fa-2x ucf-colors-selected"></i>', '</a>' ].join('') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showAbsenceDetails(nr) {\nif (nr != undefined) {\nelementToCheck = nr;\t\n} else {\nelementToCheck = activeElement;\n}\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == elementToCheck);\n//console.log(activeDataSet);\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSet['ende'])+'</b>';\t\n} else {\ncontent += \" am <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b>\";\t\n}\nanzeige = \"\";\nif (activeDataSet['adminMeldung'] != 0) {\nanzeige = \"Eintrag Sekretariat am: <b>\" + formatDateDot(activeDataSet['adminMeldungDatum'])+'</b><br/>';\t\n}\nif (activeDataSet['lehrerMeldung'] != \"0\") {\n\tif (teacherUser ==1) {\n\taddInfo = activeDataSet['lehrerMeldung'] + \"<b> (\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+')</b><br/>';\t\n\t} else {\n\taddInfo = \"Eintrag Lehrkraft<b> (\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+')</b><br/>';\t\n\t}\n\tanzeige += addInfo;\t\n}\nif (activeDataSet['elternMeldung'] != \"0\") {\nanzeige += \"Eintrag Eltern am: <b>\" + formatDateDot(activeDataSet['elternMeldungDatum'])+'</b>';\t\n}\nif (activeDataSet['kommentar'] != \"\") {\nanzeige += \"<br/>Kommentar: <b>\" + activeDataSet['kommentar']+'</b>';\t\n}\nif (activeDataSet['entschuldigt'] != \"0000-00-00\") {\nanzeige += \"Entschuldigung am: <b>\" + formatDateDot(activeDataSet['entschuldigt'])+'</b>';\t\n}\ncontent += '<br/>' + anzeige;\n\nreturn content;\t\n}", "function printAns(answer) {\n const TITLE = document.querySelector('#title');\n TITLE.textContent = 'You got: '+RESULTS_MAP[answer].title;\n const RESULT = document.querySelector('#test_result');\n RESULT.textContent = RESULTS_MAP[answer].contents;\n}", "function display(question, target) {\n\tvar d = new Date(question.timestamp);\n\t$(target).append(\"<div class='question click_option' onclick='redirect(\"+question.question_id+\");'>\" +\n\t\t\t\"<p class='qtitle'>\"+question.question_title+\"</p><span class='qauthor'><a href='user_profile.php?id=\"+\n\t\t\tquestion.auth+\"'>\"+question.screenName+\"</a></span><span class='qexcerpt'><pre>\"+excerpt(question.q)+\"</pre></span>\"+\n\t\t\t\"<span class='qstats'>\"+d.toLocaleDateString()+\" | \"+replies(question.replies)+\n\t\t\t\"<span class='tags'>\"+tagLinks(question.tags)+\"</span></span></div>\");\n}", "function renderExamResultDetails(type) {\n console.log('renderExamResultDetails() has been used.');\n \n hideElements(['challenge', 'progress', 'timer']);\n \n showElement('.result');\n\n\n var summary = validateExamAnswers();\n var className;\n var list = questions.answered;\n \n var html = '';\n\n html += '<div class=\"row\">';\n html += ' <div class=\"col mb-3\">';\n html += ' <div class=\"list-group mb-3\">';\n list.forEach(function(item, i) {\n className = item == 'correct' ? 'success' : 'danger';\n if (!type || type == 'common') {\n html += '<a href=\"#\" onclick=\"javascript:backToChallenge('+(i-1)+', \\'result\\', \\'common\\');\" class=\"list-group-item list-group-item-action list-group-item-'+className+'\">'+replaceBBCode(questions.used[i-1].name)+'</a>';\n } else {\n if (type == item) {\n html += '<a href=\"#\" onclick=\"javascript:backToChallenge('+(i-1)+', \\'result\\', \\''+item+'\\');\" class=\"list-group-item list-group-item-action list-group-item-'+className+'\">'+replaceBBCode(questions.used[i-1].name)+'</a>';\n }\n }\n });\n if (type == 'correct' || type == 'wrong') {\n var answered = type == 'correct' ? 'correctly' : 'incorrectly';\n var message = 'Questions answered ' + answered + ' not found.';\n if (summary[type].length == 0) {\n html += '<div class=\"alert alert-warning mb-2\" role=\"alert\">' + message + '</div>';\n }\n }\n html += ' </div>';\n\n html += ' <div class=\"col text-center mb-3\">';\n html += ' <button id=\"exam-results\" onclick=\"javascript:renderExamResult();\" class=\"btn btn-secondary\">' + getMessage('back_to_result', 'Back to exam result') + '</button>';\n html += ' </div>';\n html += '</div>';\n\n html += '</div>';\n\n \n // renderElement('.result', result + '<p class=\"advice\">' + advice + '</p>' + html);\n renderElement('.result', html);\n\n state = 'exam_result_rendered';\n}", "function directUserFromViewInfo() {\n if (nextStep == \"Departments\") {\n viewDepartments();\n }\n if (nextStep == \"Roles\") {\n viewRoles();\n }\n if (nextStep == \"Employees\") {\n viewEmployees();\n }\n if (nextStep == \"All Information\") {\n viewAll();\n } \n }", "function report_ToAnswer_emails() { report_emails( TO_ANSWER_LABEL_NAME, TA_REPORT_LABEL_NAME ); }", "function printExam(event) {\n console.log('printExam() has been used.');\n if ($('#print-button').hasClass('disabled')) {\n return;\n }\n\n console.log('Print event has been triggered.');\n initChallenge(properties['print_questions.skip_ignore_']);\n // generate first questions\n // generateQuestion(questions.used[challenge]);\n hideElement('#exams');\n showElement('.challenge');\n var html = '';\n for (var q in questions.all) {\n html += printQuestion(questions.all[q], parseInt(q));\n }\n\n renderElement('.challenge', html);\n\n // hideElement('#start');\n // hideElement('#print');\n // hideElement('#show-options');\n disableAction('start');\n disableAction('print');\n\n state = 'exam_printed';\n}", "function showQuestions(passQuestion) {\n questionEl.innerText = passQuestion.question;\n answerBtn1.innerText = passQuestion.answers[0].text;\n answerBtn2.innerText = passQuestion.answers[1].text;\n answerBtn3.innerText = passQuestion.answers[2].text;\n answerBtn4.innerText = passQuestion.answers[3].text;\n}", "function showAbsenceDetails(nr) {\nif (nr != undefined) {\nelementToCheck = nr;\t\n} else {\nelementToCheck = activeElement;\n}\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == elementToCheck);\n\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSet['ende'])+'</b>';\t\n} else {\ncontent += \" am <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b>\";\t\n}\nanzeige = \"\";\nif (activeDataSet['adminMeldung'] != 0) {\nanzeige = \"Eintrag Sekretariat am: <b>\" + formatDateDot(activeDataSet['adminMeldungDatum'])+'</b><br/>';\t\n}\nif (activeDataSet['beurlaubt'] == 0) {\n\tif (activeDataSet['lehrerMeldung'] != \"0\") {\n\tanzeige += \"Meldung Lehrer am: <b>\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+'</b><br/>';\t\n\t}\n\tif (activeDataSet['elternMeldung'] != \"0\") {\n\tanzeige += \"Eintrag Eltern am: <b>\" + formatDateDot(activeDataSet['elternMeldungDatum'])+'</b>';\t\n\t}\n\tif (activeDataSet['entschuldigt'] != \"0000-00-00\") {\n\tanzeige += \"Entschuldigung am: <b>\" + formatDateDot(activeDataSet['entschuldigt'])+'</b>';\t\n\t}\t\n}\nif (activeDataSet['kommentar'] != \"\") {\nanzeige += \"Kommentar: \" + activeDataSet['kommentar'];\t\n}\ncontent += '<br/>' + anzeige;\n\nreturn content;\t\n}", "function makeAnswerPage(index, userAns) {\n\tclearTimeout(sessionTime);\n\tclearInterval(intervalID);\n\tif (userAns == questions[index].correct) {\n\t\tnumCorrect++;\n\t\tansCorrect = true;\n\t}\n\telse {\n\t\tnumWrong++;\n\t\tansCorrect = false;\n\t}\n\tpartialClear();\n\tvar correctness = $(\"<h2>\");\n\tvar ansHeading = $(\"<h3>\");\n\tvar expDisplay = $(\"<p>\");\n\tvar answer = $(\"<p>\");\n\tvar c = questions[index].correct;\n\tif (userAns == null) {\n\t\tcorrectness.text(\"TIME'S UP!!!\");\n\t\t$(\"#questDiv\").append(correctness);\n\t\tansHeading.text(\"The correct answer is: \");\n\t\t$(\"#questDiv\").append(ansHeading);\n\t\tanswer.text(questions[index].answers[c]);\n\t\t$(\"#questDiv\").append(answer);\n\t}\n\telse if (ansCorrect == true) {\n\t\t\tcorrectness.text(\"CORRECT!!!\");\n\t\t\t$(\"#questDiv\").append(correctness);\n\t\t}\n\telse {\n\t\taudioEx.play();\n\t\tcorrectness.text(\"WRONG!!!\");\n\t\t$(\"#questDiv\").append(correctness);\n\t\tansHeading.text(\"The correct answer is: \");\n\t\t$(\"#questDiv\").append(ansHeading);\n\t\tanswer.text(questions[index].answers[c]);\n\t\t$(\"#questDiv\").append(answer);\n\t}\n\tvar image = $('<img id=\"answerImg\" src=\"' + questions[index].img + '\">');\n\t$(\"#questDiv\").append(image);\n\n\tif (ansCorrect == false || userAns == null) {\n\t\texpDisplay.text(questions[index].explain);\n\t\t$(\"#questDiv\").append(expDisplay);\n\t}\n\tquestionNum++;\n\tsessionTime = setTimeout(function() {makeQuestionPage(questionNum);}, 1000 * 10);\n}", "function show_answers() {\n $(\".answers\").show(500);\n $(\".result-info\").show(500);\n }", "function goHomeFromExams() {\n document.getElementById('classSpecific').style.display = \"none\";\n document.getElementById('welcome-div').style.display = \"block\";\n document.getElementById('wrapper').style.display = \"grid\";\n document.getElementById('doesNotExist').style.display = \"none\";\n document.getElementById('no-exams').style.display = \"none\";\n document.getElementById('exam-wrapper').style.display = \"none\";\n\n document.body.style.backgroundImage = \"none\"\n\n var examDataHasLoaded = false;\n}", "function populateQuizAnswer(link, answerText) {\n const divId = `crs_${courseId}_quz_${quizId}_stu_${studentId}`;\n const div = document.getElementById(divId);\n if (div) {\n if (link) {\n div.innerHTML = `<A HREF=\"${link}\" TARGET=\"_blank\">${answerText}</A>`;\n } else {\n div.innerText = answerText;\n }\n }\n }", "function showQuestions() {\n if (quizBank.length == questionCounter) {\n endQuiz();\n } else {\n questionDisplay.innerText = quizBank[questionCounter].question;\n showAnswers();\n }\n}", "function showAbsenceDetails_old() {\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == activeElement);\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSet['ende']);\t\n} else {\ncontent += \" am <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b>\";\t\n}\nanzeige = \"\";\nif (activeDataSet['adminMeldung'] != 0) {\nanzeige = \"Eintrag Sekretariat am: \" + formatDateDot(activeDataSet['adminMeldungDatum'])+'<br/>';\t\n}\nif (activeDataSet['lehrerMeldung'] != \"0\") {\nanzeige += \"Meldung Lehrer am: \" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+'<br/>';\t\n}\nif (activeDataSet['elternMeldung'] != \"0\") {\nanzeige += \"Eintrag Eltern am: \" + formatDateDot(activeDataSet['elternMeldungDatum']);\t\n}\nif (activeDataSet['kommentar'] != \"0\") {\nanzeige += \"Kommentar: \" + formatDateDot(activeDataSet['kommentar']);\t\n}\ncontent += '<br/>' + anzeige;\n\nreturn content;\t\n}", "function showResultPage() {\n if (console.log('test completed')) {\n\n //log \"time/score\" to High Scores page//\n\n //Automatically open High Scores HTML//\n\n }\n}", "function displayAnswer(answers) {\n var rows = [];\n answers.forEach(answer => {\n var my_answer = \"postedBy: \" + answer.user_id + \"<br><p>\" + answer.answer_body + \"</p><br>\"\n + \"<span id='actions_\" + answer.answer_id + \"'></span><br/><hr/>\";\n rows.push(my_answer);\n\n });\n rows.push(\"<span id='textarea_display'></span>\");\n document.getElementById('answers').innerHTML = rows.join('');\n showAnswerActions(answers);\n}", "function submitPage(){\n $scope.beginExamClicked = true;\n var testFinishTime=new Date();\n var totalAttempted= 0,totalCorrect=0;\n var questionStatsList=[];\n var questionStats={};\n for(var j=0; j<$rootScope.questions.length;j++){\n \tquestionStats={};\n \tquestionStats.examId=$rootScope.currentExam.examSetId;\n \tquestionStats.userId=$scope.userId;\n \tquestionStats.examDate=getDateTime();\n \tquestionStats.attemptNo=$rootScope.currentExam.currentAttempt;\n\n \tquestionStats.moduleName=getModuleName(j);\n \tquestionStats.questionId=\"question_\"+j;\n \tquestionStats.isCorrect='N';\n \tquestionStats.userAnswer=$rootScope.questions[j].user_selected_option;\n \tquestionStats.correctAnswer=$rootScope.questions[j].correct_option;\n \tquestionStats.score=0;\n \tquestionStats.timeTaken=\"00:00:00\";\n\n if($rootScope.questions[j].user_selected_option!='-1'){\n totalAttempted++;\n if($rootScope.questions[j].user_selected_option==$rootScope.questions[j].correct_option){\n totalCorrect++;\n questionStats.isCorrect='Y';\n questionStats.score=$rootScope.currentExam.correctMarks;\n }else{\n \tif($rootScope.currentExam.isNegativeMarks){\n \t\tquestionStats.score=$rootScope.currentExam.negativeMarks;\n \t}\n }\n questionStats.timeTaken=$rootScope.questions[j].timeTaken;\n }\n\n questionStatsList.push(questionStats);\n }\n $rootScope.currentExam.total_questions_attempted=totalAttempted;\n $rootScope.currentExam.total_questions_correct=totalCorrect;\n\n if($rootScope.currentExam.is_negative_marks_applicable){\n \t$rootScope.currentExam.score_obtained=totalCorrect*$rootScope.currentExam.correct_marks-(totalAttempted-totalCorrect)*$rootScope.currentExam.negativeMarks;\n \t}else{\n \t\t$rootScope.currentExam.score_obtained=totalCorrect*$rootScope.currentExam.correctMarks;\n \t}\n $rootScope.currentExam.total_time_taken=findTimeDifference(testStartTime,testFinishTime);\n\n //update modal & save in DB\n saveExamStats(questionStatsList);\n }", "function displayGrade(event) {\n console.log(questionIndex);\n var correctAnswer = questionArray[questionIndex].correct;\n console.log(correctAnswer);\n if (event.target.textContent === correctAnswer) {\n console.log(\"correct\");\n navigate();\n } else {\n // Adjust timer by -10 seconds\n secondsLeft -= 10;\n navigate();\n }\n}", "function answerTimeOut() {\n\n\t// If there's another question, display it.\n\tif (index < questionsArray.length - 1) {\n\t\tindex++;\n\t\tquestionID = questionsArray[index];\n\t\tgoToNextQuestion();\n\n\t// If there's no more questions, show results.\n\t} else {\n\t\tshowTriviaResults();\n\t}\n}", "getMCQAnswerString() {\n console.log('here in server/db helper');\n var allAnswers = '';\n for (let student in this.students) {\n if ('answer here', this.students[student].MCQAnswer) {\n console.log(this.students[student].MCQAnswer);\n allAnswers = allAnswers.concat(this.students[student].MCQAnswer);\n }\n }\n return allAnswers;\n }", "addStudentToStudentsExams(exam){\n if(!this.checkIfStudentInExamList(exam.student_id)[0]){\n this.students_exams.push(exam);\n }\n }", "function showResult(){\n let titles = [\"Master\",\"Champion\",\"Average\",\"Bad\"]; \n let nrOfCorrects = document.getElementById(\"nrOfCorrectAnswers\");\n let showTitle = document.getElementById(\"title\");\n let username = document.getElementById(\"username\");\n nrOfCorrects.innerHTML = \"You scored \" + \"<span>\" + quiz.correctAnswers + \"</span>\" + \" of\" + \" <span>\" + quiz.maxScore + \"</span>\" + \" points right!\";\n username.innerHTML = quiz.username;\n if(quiz.correctAnswers == quiz.maxScore){\n showTitle.innerHTML = titles[0];\n }\n else if(quiz.correctAnswers > 3){\n showTitle.innerHTML = titles[1];\n }\n else if(quiz.correctAnswers >= 2){\n showTitle.innerHTML = titles[2];\n }\n else if(quiz.correctAnswers < 2){\n showTitle.innerHTML = titles[3];\n }\n}", "function answersQuestionPrint() {\n questionChooser();\n answerChooser(currentQuestion);\n }", "function showAnswer(clicked){\n\n // if answer is correct\n if (clicked.attr(\"id\") === questionArr[questionIndex].answer[0]) {\n\n correctA++;\n\n // display\n $(\"#question-panel\").html(\"CORRRRRECT! The answer is... \" + \"<em>\" + questionArr[questionIndex].answer[1] + \"</em>\");\n clicked.addClass(\"correct\");\n console.log(\"Plankton voice: CORRRREECT!\");\n\n }\n\n // if answer is false\n else {\n\n incorrectA++;\n\n // display\n $(\"#question-panel\").html(\"Tartar sauce! The correct answer was... \" + \"<em>\" + questionArr[questionIndex].answer[1] + \"</em>\");\n clicked.addClass(\"incorrect\");\n $(\"#\" + questionArr[questionIndex].answer[0]).addClass(\"correct\");\n console.log(\"Dwight Schrute voice: FALSE!\");\n\n }\n\n // delay on next question so you have time to read answer\n setTimeout(function() {\n\n questionIndex++;\n renderQuestion();\n console.log(\"Answer displayed\", questionIndex);\n\n }, 3500);\n\n }", "function answer_student(id) {\n var parser = document.createElement('a');\n parser.href = window.location.href;\n var ta = parser.pathname.split('/')[2];\n socket.emit('remove_student_answer', {net_id: id.id, ta:ta});\n socket.emit('answer_student', {\"net_id\":id.id, \"ta\": ta});\n\n}", "function showResults(answer) {\n if (answer === questions[questionIndex].answer) {\n resultsEl.textContent = \"Correct!\";\n count++;\n } else {\n resultsEl.textContent = \"Incorrect!\";\n time = time - 5;\n timerEl.textContent = time;\n }\n setTimeout(nextQuestion, 1000);\n}", "function displayQuestions() {\n //gets the current question from global variable currentQuestion\n // display a question\n currentQuestion++;\n $(\".questions\").text(triviaQuestions[currentQuestion].questions);\n }", "function displayAdvice()\n {\n // Calculate error rate (in percent)\n var error = Math.round(my.current.errorRate)\n\n var repeatSubunit = error > 0\n\n // Update remark and advice\n var anchorElement = document.createElement('a')\n if (repeatSubunit) {\n Util.addChildren(my.html.remark, 'Reduce error')\n my.html.remark.title = 'Your error rate should not ' +\n 'exceed 0%.'\n\n Util.addChildren(anchorElement, 'Try again')\n anchorElement.href = '#restart'\n anchorElement.title = 'Please practice this lesson again.'\n } else {\n Util.addChildren(my.html.remark, 'Well done!')\n my.html.remark.title = 'You have satisfactorily ' +\n 'completed this lesson.'\n\n Util.addChildren(anchorElement, 'Next lesson')\n anchorElement.href = '#next'\n anchorElement.title = 'Please proceed with the next lesson.'\n }\n\n // Do not display 'Next lesson' advice if the user is at the\n // last subunit; display advice otherwise\n if (repeatSubunit || !currentSubunitIsTheLastSubunit()) {\n my.html.advice.appendChild(anchorElement)\n anchorElement.focus()\n }\n }", "function showQuestion() {\n if (questionCount === questionsObj.length) {\n stop();\n }\n else {\n $(\"#question\").html(questionsObj[questionCount].question);\n $(\"#answer1\").html(questionsObj[questionCount].choices[0]);\n $(\"#answer2\").html(questionsObj[questionCount].choices[1]);\n $(\"#answer3\").html(questionsObj[questionCount].choices[2]);\n $(\"#answer4\").html(questionsObj[questionCount].choices[3]);\n questionTime = 5;\n }\n }", "function showAnswerDefault () {\n\n incorrectA++;\n\n // display\n $(\"#question-panel\").html(\"Fish paste! The correct answer was... \" + \"<em>\" + questionArr[questionIndex].answer[1] + \"</em>\");\n $(\"#\" + questionArr[questionIndex].answer[0]).addClass(\"correct\");\n console.log(\"Dwight Schrute voice: NO ANSWER GIVEN!\");\n\n // delay on next question so you have time to read answer\n setTimeout(function() {\n\n questionIndex++;\n renderQuestion();\n\n }, 3500);\n\n }", "function showAnswers(container, answers) {\n container.empty();\n var i = 1;\n answers.forEach(function (a) {\n // FIXME: also deal with < > &\n text = a.text.replace(/\"/g, \"&#34;\");\n container.append('<li id=i class=\"answer\"><a href=\"#answer-description\">' + text + '<span class=\"ui-li-count\">' + (a.confidence * 100).toFixed(1) + '%</span></a></li>'\n\n /*'<tr><td class=\"i\">' + i + '.</td>'\n + '<td class=\"text\" title=\"' + text + '\">' + text + '</td>'\n + '<td class=\"scorebar\">' + /*score_bar(a.confidence)+*//*'</td>'\n + '<td class=\"score\">' + (a.confidence * 100).toFixed(1) + '%</td></tr>'*/);\n $(\"#answers\").listview().listview(\"refresh\");\n getAnswerDescription(i, answers);\n i++;\n });\n}", "function renderReviewResult() {\n console.log('renderExamResult() has been used.');\n\n hideElements(['challenge']);\n \n showElement('.result');\n\n var column = Math.ceil(questions.used.length / 3);\n \n var html = '';\n var answered = questions.exam.filter(el => el != undefined).length;\n var missing = questions.used.length - answered;\n var marked = questions.marked.filter(el => el == true).length;\n var onclick, ignored;\n\n html += '<div class=\"container\">';\n html += '<div>' + getMessage('answered_in_total', 'Answered in total') + ': <strong>'+answered+'</strong></div>';\n html += '<div>' + getMessage('missing_answers', 'Missing answers') + ' : <strong>'+missing+'</strong></div>';\n html += '<div>' + getMessage('marked_for_review', 'Marked for review') + ': <strong>'+marked+'</strong></div>';\n html += '<div class=\"row\">';\n for (var q in questions.used) {\n q = parseInt(q);\n if (q % column == 0) {\n html += '<div class=\"col-sm-4\">';\n }\n var answers = [];\n for (var ans in questions.exam[q+1]) {\n if (questions.exam[q+1][ans] == true) {\n answers.push(letters[ans].toUpperCase());\n }\n }\n var markedForReview = questions.marked[q] ? '*' : '';\n onclick = 'onclick=\"javascript:backToChallenge(this.getAttribute(\\'data-id\\'));\"';\n ignored = (questions.used[q].params.status && questions.used[q].params.status == 'ignored') ? '<span class=\"badge badge-danger\">'+getMessage('ignored', 'Ignored')+'</span>' : '';\n\n html += '';\n html += '<div>';\n html += ' <a id=\"r'+q+'\" href=\"#\" data-id=\"'+q+'\" '+onclick+' class=\"review-question\">'+(q+1)+'. '+answers.join(', ')+' '+markedForReview + ignored + '</a>';\n html += '</div>';\n if ((q+1) % column == 0) {\n html += '</div>';\n }\n }\n html += '</div>';\n html += '</ul>';\n\n // html += '<button id=\"additional-review\" onclick=\"javascript:backToChallenge(challenge);\" class=\"btn btn-secondary\">back to challenge</button>';\n\n renderElement('.result', html);\n}", "function ansSelection(event){\n event.preventDefault();\n \n if(event.target.matches(\"li\")){\n userId = event.target.id;\n var userAns = arrQues[k].options[userId];\n if(typeof userId !== \"undefined\"){\n resultDisplay.textContent = \"\";\n \n if(userAns === arrQues[k].a){ \n resultDisplay.textContent = \"Hurray Correct!!\"\n resultDisplay.setAttribute(\"style\", \"background-color:green; margin: 8px; width:150px; font-size: 20px;\");\n \n score = score+10; \n }else{ \n resultDisplay.textContent = \"Oops Wrong!!\"\n resultDisplay.setAttribute(\"style\", \"background-color:red; margin: 8px; width:150px; font-size: 20px;\"); totalSeconds = totalSeconds - 10;\n \n }\n k++;\n \n }\n \n // StartQuiz is being called to display successive questions\n startQuiz();\n if(liCount === arrQues.length){\n showResults();\n }\n liCount++;\n \n } \n}", "function getSingleReportDisplay(standupReport) {\n var report = \"*\" + standupReport.userName + \"* did their standup at \" + standupReport.datetime + \"\\n\";\n report += \"_What did you work on yesterday:_ `\" + standupReport.yesterdayQuestion + \"`\\n\";\n report += \"_What are you working on today:_ `\" + standupReport.todayQuestion + \"`\\n\";\n report += \"_Any obstacles:_ `\" + standupReport.obstacleQuestion + \"`\\n\\n\";\n return report;\n}", "displayUserView() {\n const questionnaire = this.props.questionnaire\n\n return(\n <div className=\"questionnaire-row\">\n <Link to={`/questionnaires/${questionnaire.id}`}\n onClick={ () => { this.props.fetchQuestionnaire(questionnaire.id) }}\n >\n <h3>\n { questionnaire.attributes.name }\n </h3>\n </Link>\n </div>\n )\n }", "function showAnswers(){\t\n\t\tvar rightAnswers = 0;\n\t\tvar wrongAnswers = 0;\n\t\tvar userInput1 = $('#a1 input:checked').val();\n\t\tvar userInput2 = $('#a2 input:checked').val();\n\t\tvar userInput3 = $('#a3 input:checked').val();\n\t\tvar userInput4 = $('#a4 input:checked').val();\n\t\tvar userInput5 = $('#a5 input:checked').val();\n\t\tif (userInput1 === 'quail'){\n\t\t\trightAnswers++;\n\t\t}\n\t\telse {\n\t\t\twrongAnswers++;\n\t\t}\n\t\tif (userInput2 === 'frog') {\n\t\t\trightAnswers++;\n\t\t}\n\t\telse {\n\t\t\twrongAnswers++;\n\t\t}\n\t\tif (userInput3 === 'bear') {\n\t\t\trightAnswers++;\n\t\t}\n\t\telse {\n\t\t\twrongAnswers++;\n\t\t}\n\t\tif (userInput4 === 'avacado') {\n\t\t\trightAnswers++;\n\t\t}\n\t\telse {\n\t\t\twrongAnswers++;\n\t\t}\n\t\tif (userInput5 === 'artichoke') {\n\t\t\trightAnswers++;\n\t\t}\n\t\telse {\n\t\t\twrongAnswers++;\n\t\t}\n\t\tconsole.log('Input1:' + userInput1);\n\t\tconsole.log('Input2: ' + userInput2);\n\t\tconsole.log('Input3: ' + userInput3);\n\t\tconsole.log('Input4: ' + userInput4);\n\t\tconsole.log('Input5: ' + userInput5);\n\t\tconsole.log('Right Answers: ' + rightAnswers);\n\t\tconsole.log('Wrong Answers: ' + wrongAnswers);\n\t\t$('#time').remove();\n\t\t$('#submitButton').remove();\n\t\t$('#formQuestions').remove();\n\t\t$('#questions').html('<div id=\"results\">Results</div>');\n\t\t$('#questions').html(\"<div>\" + 'Right Answers: ' + rightAnswers + \"</div>\");\n\t\t$('#questions').append(\"<div>\" + 'Wrong or Empty Answers: ' + wrongAnswers + \"</div>\");\n\n\t}", "function show(index){\n //simple function to show the quiz according to the choice of user\n Quizfact.getbyid(index); //Get the data by category of quiz\n\n\n}", "function ask(question) {\n console.log(this.teacher, question);\n}", "function nextQuestion(){\n previousQuestion = document.querySelector(\".\" + sectionArray[nextSectionIndex]);\n previousQuestion.style.display = \"none\";\n\n nextQuestionIndex++;\n nextSectionIndex++;\n \n // When the user gets to the last question, final score section will display. Otherwise, displays another question from the list in object\n if(nextQuestionIndex === lastQuestionIndex) {\n finalScoreMessage();\n } else {\n questionList();\n } \n}", "renderReadableQs() {\n const {\n questions,\n answers,\n } = this.props;\n\n if (answers.length) {\n return (\n <div>\n { this.renderSubviewHeaders(QUESTIONS_SUB_HEADER, ANSWERS_SUB_HEADER) }\n { questions.map((q, i) => (\n <li key={ q.id }>\n <div className=\"qa-section\">\n <div className=\"subview-content question\">\n { q.content }\n </div>\n </div>\n <div className=\"qa-section\">\n { answers.find(a => a.questionId === q.id.toString()).content }\n </div>\n </li>\n )) }\n </div>\n );\n }\n return this.getNoContentMessage(NOT_COMPLETED_REVIEW_HEADER);\n }", "function studentShow(i,page) {\n\t// Does the student belong to the choosen page?\t\n \tif (studentsData[i-1].group === page) {\n\t// If yes show them\n\n\t\t//Creating a new list\n\t\tlet li = document.createElement('li');\n\t\tul.appendChild(li);\n\t\tli.className = \"student-item cf\";\n\n\t\t/*Defining and appending with the right content div blocks per \n\t\teach new student taht we want to show */\n\t\tlet divOrdinal1 = 2*studentsData[i-1].member-1;\n\t\tlet divOrdinal2 = 2*studentsData[i-1].member;\n\n\t\tlet divNumber1 = 'div'+divOrdinal1;\n\t\tlet divNumber2 = 'div'+divOrdinal2;\n\n\t\tlet div1 = document.createElement(divNumber1);\n\t\tlet div2 = document.createElement(divNumber2);\n\t\tli.appendChild(div1);\n\t\tdiv1.className = \"student-details\";\n\t\tli.appendChild(div2);\n\t\tdiv2.className = \"joined-details\";\n\n\t\t$(div1).append(\"<img class='avatar' src=\" + studentsData[i-1].photo + \">\");\n\t\t$(div1).append(\"<h3> #\" + studentsData[i-1].idnumber + \" \"+ studentsData[i-1].name + \"</h3>\");\t\n\t\t$(div1).append(\"<span class='email'>\" + studentsData[i-1].email + \"</span>\");\n\n\t\t$(div2).append(\"<span class='date'>\" + studentsData[i-1].enrollment + \"</span>\");\n\n\t\t//Erasing any student search that could have been shown previously\t\n\t\t$('divLook').empty();\n\t\t \t};\t\n}", "function showTriviaResults() {\n\tshowSection(resultsPage);\n\t$(\"#correct-answers\").html(correctAnswers);\n\t$(\"#incorrect-answers\").html(incorrectAnswers);\n\t$(\"#unanswered\").html(unanswered);\n}", "function displayQuestion() {\n\t\t\tstartTime30();\t\n\t\t\t$(\"#question\").html(eachone[count].question);\n\t\t\t$(\"#option1\").html(eachone[count].option1.answer);\n\t\t\t$(\"#option2\").html(eachone[count].option2.answer);\n\t\t\t$(\"#option3\").html(eachone[count].option3.answer);\n\t\t\t$(\"#option4\").html(eachone[count].option4.answer);\n\t\t\t$(\"#okButton\").html(\"\");\n\t\t}", "function showQuestion() {\n\n questionSpot.textContent = questions[questionIndex].question;\n showAnswers(); \n \n \n}", "function DisplayResult(){\n\tanswers = answers.filter(function(e){return e});\n\t$(\"#content\").html('');\n\t$(\"#content\").append(\"<div class='page-header'><h1>\"+Language[\"Analysis\"]+\"</h1></div>\");\n\t$(\"#content\").append(\"<ul id='answerpanel'></ul>\");\n\tvar noAnswersGiven = 0;\n\tfor (var i = 0; i < answers.length;i++){\n\t\tvar text = \"\";\n\t\tif (answers[i].SelectedAnswer == null){\n\t\t\ttext =\"<b>\"+Language[\"NoAnswer\"]+\"</b>\";\n\t\t\tnoAnswersGiven++;\n\t\t}else\n\t\t\ttext = answers[i].SelectedAnswer.Text;\n\t\t$(\"#answerpanel\").append(\"<li>\"+answers[i].Question+\": \" + text+ \"</li>\");\n\t}\t\n\t\n\tif (noAnswersGiven == answers.length){\n\t\t$(\"#content\").append(\"<div class=\\\"alert alert-danger\\\" role=\\\"alert\\\">\"+Language[\"NoAnswersWarning\"]+\"</div\");\n\t}\n\t$(\"#content\").append(\"<a id =\\\"backToLastQuestion\\\" class='btn btn-primary btn-lg' role='button'>Zurück</a>\");\n\t$(\"#backToLastQuestion\").click(function(){\n\t\t$(\"#answerpanel\").fadeOut(function(){\n\t\t\t\t$(\"#answerpanel\").remove();\n\t\t\t\t$(\"#content\").append(\"<div id='answerpanel'></div>\"); \t\t\t\t\n\t\t\t\tLoadQuestion(--lastAnsweredQuestion.Id);\t\n \t\t});\n\t});\n\tif (noAnswersGiven != answers.length)\n\t$(\"#content\").append(\"<a id='showDistros' class='btn btn-success btn-lg' role='button'>\"+Language[\"ShowResults\"]+\"</a>\");\n\t$(\"#showDistros\").click(function(){\n\t\tLoadDistributionByAnswer();\n\t});\n}", "function answerTimeOut() {\n\n\n\n // If there's another question, display it.\n\n if (index < questionsArray.length - 1) {\n\n index++;\n\n questionID = questionsArray[index];\n\n goToNextQuestion();\n\n\n\n // If there's no more questions, show results.\n\n } else {\n\n showTriviaResults();\n\n }\n\n}", "function nextQandA() {\n\t\tCURRENT_QNUM += 1;\n\t\tvar curQuestion = nextQuestion();\n\t\tvar curAnswers = nextAnswers();\n\t\t\n\t\t// If no questions are left, display results. Else, display next Q&A.\n \t\tif (CURRENT_HP == 0) {\n\t\t\tshowResults(\"Game Over\");\n\t\t\tshowImage(\"img/pogo-revive.png\");\n\t\t\t// hide nav\n\t\t\t$('.navbar-toggle').animate({\n\t\t\t\tbottom: \"-100vh\"\n\t\t\t}, 800, \"swing\", function() {\n\t\t\t});\n\t\t\t$('.collapse').collapse('hide');\n\t\t} else if (curQuestion == \"\") {\n\t\t\tshowResults(\"Results\");\n\t\t\t\n\t\t\t// Medals\n\t\t\tvar medalImage = getMedal();\n\t\t\tshowImage(medalImage);\n\t\t\t\n\t\t} else {\n\t\t\t// Enable navbar toggle\n\t\t\t$('.navbar-toggle').attr(\"data-toggle\", \"collapse\");\n\t\t\t\n\t\t\t// Reallow click event for answers\n\t\t\tFLAG_ACTION = false;\n\t\t\t\n\t\t\tshowQuestion(curQuestion);\n\t\t\tshowAnswers(curAnswers);\n\t\t\tshowImage(\"\");\n\t\t} \n\t}", "function showAnswers(question, answers) {\n\tanswers.slideDown() // Slide the answer panel down\n}", "function topicsSummaryMultiplePapers()\n {\n\t var points=[\"You did a splendid Job I can't believe you scored Fullest Percentage, But don't let this you to get into relax mode.\",\n\t\t\t\"Excellent Job! You Performed Well in the Examination but don't be relaxed\",\n\t\t\t\"You scored a very good score, But Why did you miss the remaining look at them once\",\n\t\t\t\"You have Scored Good Score but you missed others look at them\",\n\t\t\t\"Ok, But it's not up to your level must Consider this don't leave it\",\n\t\t\t\"I believe You Have the ability to score fullest, May be I think your hardWork is not as expected. So Work hard Buddy\",\n\t\t\t\"Hey! the score is not as expected. What happend to you. I know this is not your score. But Why is this happend? Take it seriously\",\n\t\t\t\"It's too low. Anything wrong? I can't expect this kind of score. You Have to put more efforts and hardwork. Hope you won't repeat this.\",\n\t\t\t\"Bad Score! Your HardWork is required.\",\n\t\t\t\"Worst Score! More and More HardWork is required\",\n\t\t\t\"No Comment! Please Think about Your progress\"];\n\t\tvar studyAdvice;\n\t\tvar st=\"<div class='row'>\";\n\t\tvar marks=0;\n\t\tvar marksPercent;\n\t \n\t\tvar d=[];\n\t\t var data=[];\n\t\t \n\t\t for(i=0;i<userAllPapersAnswers.length;i++)\n\t\t\t {\n\t\t\t \n\t\t\t for(j=0;j<userAllPapersAnswers[i].optionsList.length;j++)\n\t\t\t\t {\n\t\t\t\t d.push(userAllPapersAnswers[i].optionsList[j]);\n\t\t\t\t\t data.push(questionsAllPapersData[i].questionsList[j]);\n\t\t\t\t }\n\t\t\t\t\n\t\t\t\t\n\t\t\t }\n\t\t \n\t\t console.log(d);\n\t\t console.log(data);\n\t\t \n\t\t var answeredCount=0;\n\t\t var topicsToFocus=[];\n\t\t var tDuplicate=0;\n\t\t for(var i=0;i<d.length;i++)\n\t\t\t {\n\t\t\t \n\t\t\t tDuplicate=0;\n\t\t\t if(d[i]!=\"NA\")\n\t\t\t \tansweredCount++;\n\t\t\t if(d[i]!=data[i].qkey)\n\t\t\t \t{\n\t\t\t \t for(j=0;j<topicsToFocus.length;j++)\n\t\t\t \t\t {\n\t\t\t \t\t if(data[i].topic==topicsToFocus[j])\n\t\t\t \t\t\t tDuplicate=1; \n\t\t\t \t\t }\n\t\t\t \t if(tDuplicate==0)\n\t\t\t \ttopicsToFocus.push(data[i].topic);\n\t\t\t \t\n\t\t\t \t}\n\t\t\t else{\n\t\t\t \tmarks++;\n\t\t\t }\n\t\t\t }\n\t\t marksPercent=parseInt((marks*100)/data.length);\n\t\t \n\t\t if(marksPercent>=100)\n\t\t\t studyAdvice=points[0];\n\t\t else if(marksPercent>=95)\n\t\t\t studyAdvice=points[1];\n\t\t else if(marksPercent>=90)\n\t\t\t studyAdvice=points[2];\n\t\t else if(marksPercent>=80)\n\t\t\t studyAdvice=points[3];\n\t\t else if(marksPercent>=70)\n\t\t\t studyAdvice=points[4];\n\t\t else if(marksPercent>=60)\n\t\t\t studyAdvice=points[5];\n\t\t else if(marksPercent>=45)\n\t\t\t studyAdvice=points[6];\n\t\t else if(marksPercent>=35)\n\t\t\t studyAdvice=points[7];\n\t\t else if(marksPercent>=20)\n\t\t\t studyAdvice=points[8];\n\t\t else if(marksPercent>=10)\n\t\t\t studyAdvice=points[9];\n\t\t else\n\t\t\t studyAdvice=points[10];\n\t\t \n\t\t \n\t\t var diffTopics=[];\n\t\t var diffTopicsQCount=[];\n\t\t tDuplicate=0;\n\t\t \n\t\t for(i=0;i<data.length;i++)\n\t\t\t {\n\t\t\t tDuplicate=0;\n\t\t\t for(j=0;j<diffTopics.length;j++)\n\t\t\t \t{\n\t\t\t \t if(data[i].topic==diffTopics[j])\n\t\t\t \t\t {\n\t\t\t \t\t tDuplicate=1;\n\t\t\t \t\t \n\t\t\t \t\t }\n\t\t\t \t}\n\t\t\t if(tDuplicate==0)\n\t\t\t \tdiffTopics.push(data[i].topic); \t\n\t\t\t }\n\t\t \n\t\t \n\t\t //Topic wise statistics\n\t\t var qCount=0;\n\t\t var wrongQCount=0;\n\t\t var wrongQuestion;\n\t\t var wrongQuestions=[];\n\t\t var multopics=[];\n\t\t for(i=0;i<diffTopics.length;i++)\n\t\t\t {\n\t\t\t \n\t\t\t wrongQCount=0;\n\t\t\t qCount=0;\n\t\t\t wrongQuestions=[];\n\t\t\t for(j=0;j<data.length;j++)\n\t\t\t \t {\n\t\t\t \t if(diffTopics[i]==data[j].topic)\n\t\t\t \t \t{\n\t\t\t \t \tqCount++;\n\t\t\t \t \t if(d[j]!=data[j].qkey)\n\t\t\t \t \t\t {\n\t\t\t \t \t\t wrongQCount++;\n\t\t\t \t \t\t wrongQuestions.push(new WrongQuestion(data[j].question,data[j].qkey,d[j],data[j].optionA,data[j].optionB,data[j].optionC,data[j].optionD,data[j].optionE));\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 multopics.push(new Topic(diffTopics[i],qCount,wrongQCount,wrongQuestions));\n\t\t\t }\n\t\t \n\t\tst=st+\"<div class='col-md-7'>\" +\n\t\t\t\t\"<p><span style='font-weight:600;font-size:12px;'>Total Number of Questions :</span> <span style='color:#00a69c'>\"+data.length+\"</span></p>\" +\n\t\t\t\t\"<p><span style='font-weight:600;font-size:12px;'>Total Number of Questions answered : </span> <span style='color:#00a69c'>\"+answeredCount+\"</span></p>\" +\n\t\t\t\t\"<p><span style='font-weight:600;font-size:12px;'>Total Number of Questions Correctly Answered : </span> <span style='color:#00a69c'>\"+marks+\"</span></p>\" +\n\t\t\t\t\"</div>\";\n\t\t\tif(marksPercent<=35)\n\t\t\t{\n\t\t\t\tst=st+\"<div class='col-md-5'><br><p style='marging-top:1%;'><span style='font-weight:600;font-size:12px;'>Your total score : </span><span class='redClass clrsClass'>\"+marksPercent+\"%</span></p>\"+\n\t\t\t\t\"</div></div>\";\n\t\t\t}\n\t\t\telse if(marksPercent>35 && marksPercent<=75)\n\t\t\t{\n\t\t\t\tst=st+\"<div class='col-md-5'><br><p style='marging-top:1%;'><span style='font-weight:600;font-size:12px;'>Your total score : </span><span class='clrAvg clrsClass'>\"+marksPercent+\"%</span></p>\"+\n\t\t\t\t\"</div></div>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tst=st+\"<div class='col-md-5'><br><p style='marging-top:1%;'><span style='font-weight:600;font-size:12px;'>Your total score : </span><span class='greenClass clrsClass'>\"+marksPercent+\"%</span></p>\"+\n\t\t\t\t\"</div></div>\";\n\t\t\t}\n\t\t\t\t\n\t\t\tst=st+\"<div class='row' style='border:1px solid #4e4e4e;border-radius:5px;'><div class='col-md-12'>\";\n\t\t\n\t\tif(answeredCount!=data.length)\n\t\tst=st+\"<span style='color:#4e4e4e;font-weight:600;'>Note : </span><span style='color:red'> It's not fare that you did not even attempt all Questions. The Exam Doesn't even have any Negative Marking</span>\"+\"<br>\";\n\t/*\n\t\tst=st+\"Different Topics Covered In this Question Paper\"+\"<br>\";\n\t\t\n\t\tfor(i=0;i<diffTopics.length;i++)\n\t\t{\n\t\t\tst=st+\"<span style='margin:3px;border-radius:20%;padding:5px;color:black;background-color:#DDD6D4'>\"+diffTopics[i]+\"</span>\";\n\t\t}\n\t\tst=st+\"<br>\";\n\t\t*/\n\t\t\n\t\tst=st+\"<canvas id='topicsBarGraph'></canvas>\" +\n\t\t\t\t\"</div></div>\" +\n\t\t\t\t\"<br><div class='row' style='height:450px;'><div class='col-md-8' style='height:450px;overflow:scroll;'>\";\n\t\t\n\t\t/*st=st+\"<p style='padding-top:1%;font-size:16px;text-align:center;font-weight:600px;color:#ff6666;'>Topics You have to Focus More\"+\"</p>\";\n\t\tfor(i=0;i<topicsToFocus.length;i++)\n\t\t{\n\t\t\tst=st+\"<p style='padding:5px;font-size:12px;text-align:center;width:90% !important;color:black;background-color:#DDD6D4'>\"+topicsToFocus[i]+\"</p>\";\n\t\t}\n\t\t\n\t\tst=st+\"</div>\" +\n\t\t\t\t\"<div class='col-md-8' style='overflow:scroll;height:440px;'>\";*/\n\t\t\n\t\tvar labelsData=[];\n\t\tvar percentData=[];\n\t\tvar colors=[];\n\t\tst=st+\"<p style='padding-top:1%;font-size:16px;text-align:center;font-weight:600;color:#ff6666;'>Look in Detail\"+\"</p>\";\n\t\tfor(i=0;i<multopics.length;i++)\n\t\t\t{\n\t\t\tst=st+\"<p style='font-weight:600;font-size:12px'>Topic: <span style='color:#ff6666'>\"+multopics[i].topic+\"</span> Score Percent : <span style='font-weight:500;color:#00a69c;'>\"+parseInt((multopics[i].qCount-multopics[i].wrongQCount)*100/multopics[i].qCount)+\"%</span></p>\";\n\t\t\t st=st+\"<p style='font-weight:600;font-size:12px'>Totoal Questions from Topic : <span style='font-weight:600;color:#000;'>\"+multopics[i].qCount+\"</span></p>\";\n\t\t\tif(multopics[i].wrongQCount!=0)\n\t\t\t\t{\n\t\t\t \n\t\t\t st=st+\"<p style='font-size:12px'>You did not Score for <span style='font-weight:600;color:#ff6666;'>\"+multopics[i].wrongQCount+\"</span> Questions</p>\";\n\t\t\t st=st+\"<p style='font-weight:600;font-size:12px'>Want To See Questions You missed scoring : <button class='btn btn-default' style='color:#ff6666;border:1px solid #ff6666;border-radius:5px;font-size:10px;font-weight:600;' onclick='displayD(\\\"wrongQuestions\"+i+\"\\\")'>Click Here</button></p><hr>\";\n\t\t\t st=st+\"<span id='wrongQuestions\"+i+\"' style='display:none'>\";\n\t\t\t for(j=0;j<multopics[i].wrongQuestions.length;j++)\n\t\t\t\t {\n\t\t\t\t st=st+\"<p><span style='color:red;font-size:12px;'>Question No: </span><span style='color:#00a69c'>\"+(j+1)+\"</span></p>\" +\n\t\t\t\t \t\t\"<p style='font-weight:600;font-size:12px;'> \"+multopics[i].wrongQuestions[j].question+\"</p>\";\n\t\t\t\t st=st+\"<p>A) \"+multopics[i].wrongQuestions[j].optionA+\"<span style='margin-left:10px;'>B) \"+multopics[i].wrongQuestions[j].optionB+\"</span><span style='margin-left:10px;'>C) \"+multopics[i].wrongQuestions[j].optionC+\"</span><span style='margin-left:10px;'>D) \"+multopics[i].wrongQuestions[j].optionD+\"</span><span style='margin-left:10px;'>E) \"+multopics[i].wrongQuestions[j].optionE+\"</span></p>\";\n\t\t\t\t st=st+\"<p>Key : <span style='font-weight:600;'>\"+multopics[i].wrongQuestions[j].qkey+\"</span><span style='margin-left:2%'> Your Answer: </span><span style='font-weight:600;'>\"+multopics[i].wrongQuestions[j].yourAnswer+\"</span></p><hr><br>\";\n\t\t\t\t \n\t\t\t\t st=st+\"<p>Google Help:<br> <a href='https://www.google.co.in/search?q=\"+multopics[i].wrongQuestions[j].question+\"' target='_blank'>Ask <i style='color:green' class='fa fa-google' aria-hidden='true'></i></a></p>\";\n\t\t\t\t }\n\t\t\t st=st+\"</span>\";\n\t\t\t}\n\t\t\t else{\n\t\t\t\t st=st+\"<p style='font-size:12px'>Good You have Answered All Questions</p>\";\n\t\t\t }\n\t\t\t labelsData.push(multopics[i].topic);\n\t\t\n\t\t\t percentData.push(parseInt((multopics[i].qCount-multopics[i].wrongQCount)*100/multopics[i].qCount));\n\t\t\t \n\t\t\t if(parseInt((multopics[i].qCount-multopics[i].wrongQCount)*100/multopics[i].qCount)>75)\n\t\t\t\t colors.push(\"green\");\n\t\t\t else if(parseInt((multopics[i].qCount-multopics[i].wrongQCount)*100/multopics[i].qCount)>45)\n\t\t\t colors.push(\"yellow\");\n\t\t\t else\n\t\t\t\t colors.push(\"red\");\n\t\t\t}\n\t\tst=st+\"</div><div class='col-md-4'>\";\n\t\t\n\t\tst=st+\"<p style='text-align:center;color:#00a69c;font-weight:600;font-size:16px;'>Study Advicer's Advice</p>\"+studyAdvice+\"<br>\";\n\t\t\t\t\n\t\tst=st+\"</div></div>\";\n\t\t\n\t\t$(\"#resultStats\").html(st);\n\t\tdisplayBarGraph('topicsBarGraph',percentData,'Topic Wise Analysis',labelsData,colors);\n\t\t\n\t \n\t\t\n\t\t\n\t \n\t $(\"#ajaxPageLoader\").hide();\n }", "function printQA() {\n var currentQA = getRandomQA();\n var message = '<h3 class=\"question\">Q: ' + currentQA.question + \"</h3>\";\n message += '<p class=\"answer\">A: ' + currentQA.answer + \"</p><footer>\";\n if (currentQA.readmore) {\n message += '<p><a class=\"readmore\" href=\"' + currentQA.readmore + '\">Read More...</a></p>';\n }\n if (currentQA.tags) {\n \tmessage += '<span class=\"tags small\">tags: ' + currentQA.tags + '</span>';\n }\n message += \"</footer>\";\n\n document.getElementById(\"qa-box\").innerHTML = message;\n}", "function displayQuestion () {\r\n //displays score after user answers final question\r\n if (questionIndex === finalQuestion){\r\n return displayScore();\r\n} \r\n var currentQuestion = myQuestions[questionIndex];\r\n question.innerHTML = \"<p>\" + currentQuestion.question + \"</p>\";\r\n answerA.innerHTML = myQuestions[questionIndex].answers.a;\r\n answerB.innerHTML = myQuestions[questionIndex].answers.b;\r\n answerC.innerHTML = myQuestions[questionIndex].answers.c;\r\n answerD.innerHTML = myQuestions[questionIndex].answers.d;\r\n }", "function showFAQUrl() {\n\tremoveMessageFromDivId();\n\tremoveSuccessOrFailureStrip();\n\tbookmarks.sethash('#moreinfo', showFooterPopup, messages['schedule_card_faq']);\t\n\treturn false;\n}", "function getResponseEntriesForStudent(){\n console.log(\"Getting all exercise response entries for \\\n teacher \" + teacherID +\", lesson \" + lessonID +\" and student \" + studentID);\n dbShellResponsesForStudent.transaction(function(tx){\n tx.executeSql(\"select row_id,teacher_id,student_id,lesson_id,exercise_id,response,scoremark,comment\\\n from responseandmark where teacher_id=? and student_id=? order by lesson_id,exercise_id\",[teacherID,studentID]\n ,renderResponseEntriesForStudent,dberrorhandlerForResponseForStudent);\n },dberrorhandlerForResponseForStudent);\n}", "function showAnswers(curAnswers) {\n\t\tvar numAnswers = curAnswers.length;\n\t\t\n\t\t// Hide the list of previous answers\n\t\t$( \".answer\" ).children('p').each(function( i ) {\n\t\t\t$(this).animate({\n\t\t\t\topacity: \"0\"\n\t\t\t}, 400, function() {\n\t\t\t\t$(this).text(\" \");\n\t\t\t});\n\t\t});\n\t\t\n\t\tsetTimeout(function() {\n\t\t\t$(\".answer\").animate({\n\t\t\t\twidth: \"16em\"\n\t\t\t\t}, 400, function() {\n\t\t\t});\n\t\t\t\n\t\t\t// Shuffle the list of current answers in array.\n\t\t\tshuffle(curAnswers); //.sort(function() { return 0.5 - Math.random() });\n\t\t\t\n\t\t\t// Update and then display the current answers\n\t\t\t$( \".answer\" ).promise().done(function() {\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tfor (var i = 0; i < numAnswers; i++) {\n\t\t\t\t\t\tvar parent = \"#a\" + (i + 1);\n\t\t\t\t\t\tvar textElement = \"#a\" + (i + 1) + \" p\";\n\t\t\t\t\t\t$(textElement).text(curAnswers[i].answer);\n\t\t\t\t\t\t$(textElement).animate({\n\t\t\t\t\t\t\topacity: \"1\"\n\t\t\t\t\t\t\t}, 400, function() {\n\t\t\t\t\t\t});\n\t\t\t\t\t\t$(parent).attr(\"title\",curAnswers[i].answer);\n\t\t\t\t\t}\n\t\t\t\t}, 300);\n\t\t\t\t\n\t\t\t\t$( \".answer\" ).each(function( i ) {\n\t\t\t\t\t$(this).animate({\n\t\t\t\t\t\twidth: '100%'\n\t\t\t\t\t\t}, 400, function() {\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t}, 500);\n\t}", "function showResults(exercisePassed ) {\n self.exercise.blockUIElements();\n\n self.dom.buttons.done.hide()\n self.dom.buttons.tryAgain.show();\n self.dom.buttons.showCorrectAnswer.hide();\n\n self.data.exercisePassed = exercisePassed;\n\n renderResultBlock();\n\n if (self.config.showDetails) {\n self.dom.buttons.details.show();\n } else {\n self.dom.buttons.details.hide();\n }\n }", "function showSolutions() {\n $(document).ready(function() {\n $('.solution-link').show();\n $('.next-question').hide();\n $('.topic-solution-link').show();\n $('.topic-next-question').hide();\n\n $('.toggle-hide-video').hide();\n\n $('.toggle-video').on('click', function(event){\n event.preventDefault();\n var linkText = $(this).text();\n if (linkText === 'Show Video') {\n $(this).prev().css(\"display\",\"\");\n $(this).text('');\n $(this).append(\"<i class='fa fa-arrow-up' aria-hidden='true'></i> Hide Video\");\n $(\".toggle-hide-video\").show();\n } else {\n $(this).prev().css(\"display\",\"none\");\n $(this).text('Show Video');\n $(\".toggle-hide-video\").hide();\n }\n });\n\n $('.toggle-hide-video').on('click', function(event){\n event.preventDefault();\n $(this).next().css(\"display\",\"none\");\n $(this).next().next().text('Show Video');\n $(\".toggle-hide-video\").hide();\n });\n\n $('.chapter-collapsable').next().hide();\n $('.lesson-div').hide();\n\n $(\".topic-headings\").css(\"margin\",\"10px auto\");\n $(\".lesson-headings\").css(\"margin\",\"6px auto\");\n $(\".topic-questions-headings\").css(\"margin\",\"6px auto\");\n\n var collapsable = function(event){\n event.preventDefault();\n if ($(this).next().is(':visible')){\n $(this).next().hide();\n } else {\n $(this).next().show();\n }\n };\n\n $('.chapter-collapsable').on('click', collapsable);\n\n $('.lesson-collapsable').on('click', collapsable);\n\n var submitSolution = function(event){\n event.preventDefault();\n var identifier = event.target.id.split(\"-\");\n var topicId = identifier[0];\n var lessonId = identifier[1];\n var lessonExp = $(\"#lesson-\" + lessonId + \"-exp\");\n var topicExp = $(\"#topic-\" + topicId + \"-exp\");\n var topicNextLevelExp = $(\"#topic-\" + topicId + \"-next-level-exp\");\n var topicNextLevel = $(\"#topic-\" + topicId + \"-next-level\");\n var endTopicExp = $(\"#end-topic-\" + topicId + \"-exp\");\n var endTopicNextLevelExp = $(\"#end-topic-\" + topicId + \"-next-level-exp\");\n var endTopicNextLevel = $(\"#end-topic-\" + topicId + \"-next-level\");\n var submitSolutionForm = $(this).parent();\n var postAddress = submitSolutionForm.attr('action');\n\n var answersArray = [];\n var i = 1;\n\n while (i < 20) {\n var answerLabelClass = '.answer-label-' + i;\n var studentAnswerClass = '.student-answer-' + i;\n var answerLabel = $(this).siblings(\".answer-answers\").children(answerLabelClass).attr(\"for\");\n if (!answerLabel) { break; }\n var exactLabel = answerLabel.replace(\"answers_\", \"\");\n var studentAnswer = $(this).siblings(\".answer-answers\").children(studentAnswerClass).val();\n if (studentAnswer === \"\") { return; }\n answersArray.push([exactLabel,studentAnswer]);\n i++;\n }\n\n var choice = submitSolutionForm.find('input:checked[name=\"choice\"]').val();\n\n if (typeof choice === 'undefined' && answersArray.length === 0)\n {\n return;\n }\n\n var question_id = submitSolutionForm.find('input[name=\"question_id\"]').val();\n var lesson_id = submitSolutionForm.find('input[name=\"lesson_id\"]').val();\n var topic_id = submitSolutionForm.find('input[name=\"topic_id\"]').val();\n var authenticity_token = submitSolutionForm.find('input[name=\"authenticity_token\"]').val();\n var solutionTitle = $(this).siblings(\".solution-title\");\n var solutionText = $(this).siblings(\".solution-text\");\n var correctDiv = $(this).siblings(\"#correct\");\n\n $(this).hide();\n $(this).siblings('.topic-next-question').show();\n $(this).siblings('.next-question').show();\n\n var params = {\n 'choice': choice,\n 'js_answers': answersArray,\n 'question_id': question_id,\n 'lesson_id': lesson_id,\n 'topic_id': topic_id,\n 'authenticity_token': authenticity_token }\n\n $.post(postAddress, params, function(response){\n solutionTitle.text(\"Solution\");\n solutionText.text(response.question_solution);\n if (response.solution_image_url){\n solutionText.append(\n \"<img class='solution-image' src='\" + response.solution_image_url + \"' alt='medium'>\"\n );\n }\n correctDiv.text(response.message);\n if (typeof lesson_id === 'undefined'){\n endTopicExp.text(response.topic_exp);\n endTopicNextLevelExp.text(response.topic_next_level_exp);\n endTopicNextLevel.text(response.topic_next_level);\n } else {\n lessonExp.text(response.lesson_exp);\n }\n topicExp.text(response.topic_exp);\n topicNextLevelExp.text(response.topic_next_level_exp);\n topicNextLevel.text(response.topic_next_level);\n\n if (response.choice) {\n correctDiv.css(\"color\", \"green\");\n } else {\n if (response.correctness > 0) {\n correctDiv.css(\"color\", \"orange\");\n } else {\n correctDiv.css(\"color\", \"red\");\n };\n };\n\n MathJax.Hub.Typeset();\n });\n };\n\n\n var topicNextQuestion = function(event){\n event.preventDefault();\n var nextQuestionLink = $(this);\n var nextQuestionDiv = $(this).parent().parent();\n var nextQuestionForm = $(this).parent();\n var answerChoices = $(this).siblings('.answer-choices');\n var answerAnswers = $(this).siblings('.answer-answers');\n\n $.get(this.href, function(response){\n if (response.question === \"\") {\n nextQuestionDiv.empty();\n nextQuestionDiv.append(\"<div class='request-more-questions'>Well done! You have attempted all the questions available for this lesson, contact us to ask for more!</div>\")\n } else {\n\n nextQuestionForm.siblings('.question-header').children('.question-exp').text(response.question.experience);\n\n if (typeof response.topic_bonus_exp === 'undefined'){\n nextQuestionForm.siblings('.question-header').children('.streak-mtp').text(response.lesson_bonus_exp);\n } else {\n nextQuestionForm.siblings('.question-header').children('.streak-mtp').text(response.topic_bonus_exp);\n };\n\n nextQuestionForm.siblings('.question-text').text(response.question.question_text);\n nextQuestionForm.children('.form-question-id').val(response.question.id);\n\n if (response.question_image_urls){\n questionImage = nextQuestionForm.siblings('.question-image');\n questionImage.html(\"\")\n response.question_image_urls.forEach(function(image_url){\n questionImage.append(\n \"<img class='question-image' src='\" + image_url + \"' alt='medium'>\"\n )\n })\n }\n\n nextQuestionForm.children('.solution-title').text('');\n nextQuestionForm.children('.solution-text').text('');\n nextQuestionForm.children('.question-result').text('');\n\n answerChoices.empty();\n\n var choices = response.choices;\n var choices_urls = response.choices_urls;\n for (var i = 0, len = choices.length; i < len; i++) {\n answerChoices.append(\"<input class='question-choice' type='radio' id='choice-\"\n + choices[i].id +\"' \" + \"name='choice' value=\" + choices[i].id\n + \">\" + '<span style=\"padding-left:10px;\">' + choices[i].content + '</span>');\n if (choices_urls) {\n answerChoices.append(\n \"<img class='choice-image' src='\" + choices_urls[i] + \"' alt='medium'>\"\n );\n }\n answerChoices.append(\"<br>\");\n }\n\n answerAnswers.empty();\n\n var answers = response.answers;\n for (var j = 0, len = answers.length; j < len; j++) {\n answerAnswers.append(\n '<label class=\"answer-label-' + (j+1) + ' answer-label-style\" for=\"answers_'\n + answers[j].label + '\">' + answers[j].label + '</label>'\n + '<input class=\"student-answer-' + (j+1) + '\" type=\"text\" name=\"answers['\n + answers[j].label + ']\" id=\"answers_' + answers[j].label + '\" />'\n + '<span class=\"answer-hint\">' + answers[j].hint + '</span><br>'\n );\n }\n\n nextQuestionLink.hide();\n nextQuestionForm.children('.topic-solution-link').show();\n nextQuestionForm.children('.solution-link').show();\n MathJax.Hub.Typeset();\n }\n });\n };\n\n $('.solution-link').on('click',submitSolution);\n $('.next-question').on('click', topicNextQuestion);\n\n });\n MathJax.Hub.Typeset();\n}", "function reviewExam(index)\n{\n console.log(\"This functionality isn't implemented yet!\");\n}", "function showNeedHelpUrl() {\n\tremoveMessageFromDivId();\n\tremoveSuccessOrFailureStrip();\n\tbookmarks.sethash('#moreinfo',showFooterPopup, messages['gettingStartedUrl']);\n\treturn false;\n}", "function showQuestionDetailsEvent(paragraphName, questionID) {\n if (!featureEnabled) return;\n logger().logQuestionRequest(simpaticoEservice, paragraphName, questionID);\n }", "function helpMeInstructor(err) {\n console.info(\n `\n Did you hit CORRECT the endpoint?\n Did you send the CORRECT data?\n Did you make the CORRECT kind of request [GET/POST/PATCH/DELETE]?\n Check the Kwitter docs 👉🏿 https://kwitter-api.herokuapp.com/docs/#/\n Check the Axios docs 👉🏿 https://github.com/axios/axios\n TODO: troll students\n `,\n err\n );\n}", "function showTriviaResults() {\n\n showSection(resultsPage);\n\n $(\"#correct-answers\").html(correctAnswers);\n\n $(\"#incorrect-answers\").html(incorrectAnswers);\n\n $(\"#unanswered\").html(unanswered);\n\n}", "function displayQuestion() {\n $(\".questions\").text(currentQuestionData.question);\n $(\".answer-1\").text(currentQuestionData.otherAnswers[0]);\n $(\".answer-2\").text(currentQuestionData.otherAnswers[1]);\n $(\".answer-3\").text(currentQuestionData.otherAnswers[2]);\n $(\".answer-4\").text(currentQuestionData.otherAnswers[3]);\n }", "function loadExams(){\n $('#exam-content').load('load-exam_content.php');\n $('#info-message').html('');\n hideFirstTD();\n }", "function showRemediation() {\n\n // gather objectives\n if (_objectives) {\n\n var gatheredRemedationPages = [];\n\n _objectives.forEach( function(objective) {\n if (objective.pass !== true) {\n if (objective.remediationq) {\n gatheredRemedationPages = gatheredRemedationPages.concat(objective.remediationq)\n }\n }\n });\n\n // if remediation pages found trigger remediation\n if (gatheredRemedationPages.length > 0) {\n setTimeout(function() {\n RemediationActions.create(gatheredRemedationPages);\n }, 0.1);\n }\n }\n}", "showQuestionDetailsForAnswer(questionId, title, questionBody, username) {\n document.getElementById('question-title').textContent = title;\n document.getElementById('username').textContent = username;\n document.getElementById('questiontext-holder').textContent = questionBody;\n }", "function studentsShow (page) {\n let i = 1\t\n for (let=1; i<= studentsNumber; i +=1){\n \tstudentShow (i,page);\n \t$('ul.student-list').show();\t\n }\n}", "function seeResults() {\n store.quizStarted = false;\n store.questionNumber ++;\n}", "function startQuiz(answer) {\n hideWelcome();\n questionDisplay(answer);\n timer();\n}", "function listenResultsClick() {\n\tconst resultsLink = document.getElementById('display-results');\n\tresultsLink.addEventListener('click', () => {\n\t\t// send page view to Analytics\n\t\tgtag('config', 'UA-170700693-2', {\n\t\t\tpage_title: 'resultat-detall',\n\t\t\tpage_path: '/resultat-detall',\n\t\t});\n\t\t// send Analytics event\n\t\tgtag('event', 'display-results', {\n\t\t\tevent_category: state.age,\n\t\t\tevent_label: `score: ${state.score}`,\n\t\t});\n\t\t// clean HTML\n\t\tcontent.innerHTML = '';\n\t\t// create Results title\n\t\tconst resultsTitle = document.createElement('h1');\n\t\tresultsTitle.textContent = 'Resultats';\n\t\tcontent.appendChild(resultsTitle);\n\t\t// create list of answers\n\t\tconst answers = document.createElement('ul');\n\t\tstate.collectedAnswers.map((item) => {\n\t\t\tconst uniqueAnswer = document.createElement('li');\n\t\t\tuniqueAnswer.id = 'answer-item';\n\t\t\tuniqueAnswer.innerHTML = `${\n\t\t\t\titem.correct\n\t\t\t\t\t? '<i class=\"fas fa-check-circle answer-summary\" id=\"correct-answer\"></i>'\n\t\t\t\t\t: '<i class=\"fas fa-times-circle answer-summary\" id=\"wrong-answer\"></i>'\n\t\t\t}<p>Pregunta: ${item.question} | Resposta: ${item.answer}</p>`;\n\t\t\t// uniqueAnswer.textContent = `Pregunta: ${item.question} | Resposta: ${\n\t\t\t// \titem.answer\n\t\t\t// } | ${item.correct ? 'Correcte' : 'Equivocada'}`;\n\t\t\tanswers.appendChild(uniqueAnswer);\n\t\t});\n\t\tcontent.appendChild(answers);\n\n\t\t// CTA button\n\t\tconst ctaButton = document.createElement('button');\n\t\tctaButton.id = 'tryAgain';\n\t\tctaButton.textContent = `Torna-ho a provar`;\n\t\tcontent.appendChild(ctaButton);\n\t\t// social media buttons\n\t\tdisplaySocialMediaButtons(content);\n\t});\n}", "function results() {\n selectedAnswers = $(displayTest.find(\"input:checked\"));\n //if user is correct\n if (\n selectedAnswers[0].value === testSetup[currentQuestion - 1].questionAnswer\n ) {\n //add to correct score and display on element\n correct++;\n $(\"#correct\").text(\"Answers right: \" + correct);\n } else {\n //if user is wrong then add to wrong score and display on element\n wrong++;\n $(\"#incorrect\").text(\"Wrong answers: \" + wrong);\n }\n //check to see if the user has reached the end of the test\n if (currentQuestion === 10) {\n //toggle finalize modal at end of test to display score\n $(\"#modalMatch\").modal(\"toggle\");\n $(\"#testScore\").text(\n \"End of test! You scored a \" + (parseFloat(correct) / 10) * 100 + \"%\"\n );\n //show postTest element\n $(\"#postTest\").show();\n $(\"#submitTest\").hide();\n }\n }", "function showQuestion() {\n // quiz questions along with possible answers\n questionEl.innerHTML = questions[currentQuesIndex].question;\n answerA.innerHTML = questions[currentQuesIndex].choiceA;\n answerB.innerHTML = questions[currentQuesIndex].choiceB;\n answerC.innerHTML = questions[currentQuesIndex].choiceC;\n\n}", "function showScore () {\n\t$(\".questions\").hide();\n\t$(\".result\").show();\n\tshowScore();\n}", "function showQuestion(questionNumber) {\n \n currentQuestion = questionNumber;\n var questionDetails = questionAnswersOptions[questionNumber-1];;\n var question = questionDetails.question;\n var options = questionDetails.options;\n \n $(\"#questionTxt\").html(question);\n $(\"#questionCounter\").html(showQuestionCounter(questionNumber));\n var optionsHtml = \"\";\n $('#optionsContainer').html(optionsHtml);\n \n for ( var i = 0; i < options.length; i++ ) {\n // Use of AND operator\n if ( answerByStudent[questionNumber] && answerByStudent[questionNumber] === (i+1) ) {\n optionsHtml += '<input type=\"radio\" name=\"option\" checked onclick=\"calculateMarks('+(i+1)+');\"><label id=\"opt'+(i+1)+'\">' + options[i] + '</label><br>';\n } else {\n optionsHtml += '<input type=\"radio\" name=\"option\" onclick=\"calculateMarks('+(i+1)+');\"><label id=\"opt'+(i+1)+'\">' + options[i] + '</label><br>';\n }\n }\n $('#optionsContainer').html(optionsHtml);\n if(questionNumber === questionAnswersOptions.length){\n $(\"#nextBtn\").hide()\n }else{\n $(\"#nextBtn\").show()\n }\n}", "function showQuestions(question, options, answerIndex){\n\t//sets question\n\t$(\".question-title\").html(question);\n\n\t//sets question image\n\tvar questionImageSrc = questions[nextQuestionIndex].questionImage;\n\t$(\".question-image\").attr(\"src\", questionImageSrc);\n\n\t//sets question options\n\t$(\".question-answers\").empty();\n\tfor(var i = 0; i < options.length; i++){\n\t\tvar correctAnswer = false;\n\t\tif(i == answerIndex){\n\t\t\tcorrectAnswer = true;\n\t\t}\n\t\t$(\".question-answers\").append('<li class=\"option-list\" data-correct-answer=\"' + correctAnswer + '\">' + options[i] + '</li>');\n\t}\n}", "_goToResults() {\n const formattedTime = formatTime(this._model.time);\n getStats(this._model.correctQuestions, this._model.time, formattedTime)\n .then((resultStats) => {\n result.stats = resultStats;\n Application.showStats();\n })\n .catch((res) => {\n result.stats.time = formattedTime;\n Application.showStats();\n });\n setStats({time: this._model.time, answers: this._model.correctQuestions});\n this._stopFn();\n document.body.removeEventListener('timer-tick', this._tick);\n }", "function showResults(){\n\n\t// gather answer containers from our quiz\n\tconst answerContainers = quizContainer.querySelectorAll('.answers');\n \n\t// keep track of user's answers\n\tlet numCorrect = 0;\n \n\t// for each question...\n\tmyQuestions.forEach( (currentQuestion, questionNumber) => {\n \n\t // find selected answer\n\t const answerContainer = answerContainers[questionNumber];\n\t const selector = `input[name=question${questionNumber}]:checked`;\n\t const userAnswer = (answerContainer.querySelector(selector) || {}).value;\n \n\t // if answer is correct\n\t if(userAnswer === currentQuestion.correctAnswer){\n\t\t// add to the number of correct answers\n\t\tnumCorrect++;\n \n\t\t//color the answers green\n\t\tanswerContainers[questionNumber].style.color = 'blue';\n\t }\n\t // if answer is wrong or blank\n\t else{\n\t\t// color the answers red\n\t answerContainers[questionNumber].style.color = 'red';\n\t }\n\t});\n \n\t// show number of correct answers out of total\n\tresultsContainer.innerHTML = `Your score is : ${numCorrect} out of ${myQuestions.length}`;\n }", "function quesIdentifiesStudent(ques) \n { \n if (ques.indexOf('first') != -1)\n {\n return true;\n }\n else if (ques.indexOf('last') != -1)\n {\n return true;\n }\n else if (ques.indexOf('name') != -1)\n {\n return true;\n }\n \n else if (ques == 'id')\n {\n return true;\n }\n \n var id_index = ques.indexOf('id');\n if (id_index != -1)\n {\n if (id_index > 0)\n {\n if (ques[id_index-1] == ' ')\n {\n // e.g. \"student id\"\n return true;\n }\n }\n } \n else if (ques.indexOf('id:') != -1)\n {\n // e.g. student id:\n return true;\n }\n else if (ques.indexOf('identity') != -1)\n {\n return true;\n }\n else if (ques.indexOf('identifier') != -1)\n {\n return true;\n }\n else if (ques.indexOf('class') != -1)\n {\n return true;\n }\n else if (ques.indexOf('section') != -1)\n {\n return true;\n }\n else if (ques.indexOf('period') != -1)\n {\n return true;\n }\n else if (ques.indexOf('room') != -1)\n {\n return true;\n }\n else if (ques.indexOf('student') != -1)\n {\n return true;\n }\n else if (ques.indexOf('teacher') != -1)\n {\n return true;\n }\n else if (ques.indexOf('email') != -1)\n {\n return true;\n }\n else if (ques.indexOf('e-mail') != -1)\n {\n return true;\n }\n \n // spanish\n else if (ques.indexOf('correo') != -1)\n {\n return true;\n }\n \n return false;\n }", "function showQuestions() {\n $(questionText).text(quizObject[index].question);\n $(optionA).text(quizObject[index].answerA);\n $(optionB).text(quizObject[index].answerB);\n $(optionC).text(quizObject[index].answerC);\n $(optionD).text(quizObject[index].answerD);\n }", "function showAnswer()\n {\n let displayAnswer;\n saveAnswer=(QuizObj[index].answer); // retrieve answer from object in array \n // console.log(`index is Ans :${index}`);\n // console.log(`saveAnswer is ${saveAnswer+1}`);\n // console.log(`retrieve answer from object ${QuizObj[0].possible1}`)\n \n displayAnswer=\"possible\"+saveAnswer;\n\n \n console.log(`answer is : ${QuizObj[index][displayAnswer]}`); //bad expression\n //console.log(\"answer2222 is \"+QuizObj[0][1]);\n \n //clear div tag answers\n $(\".answersContainer\").empty();\n $(\".answersContainer\").html(`<h3 class=\"validation\"> ${check} </h3> <img src=\"${QuizObj[index].visual}\" class=\"result .img-rounded img-responsive\">`);\n $(\".answersContainer\").append(`<h2 class=\"answer\">answer is ${QuizObj[index][displayAnswer]} </h2>`);\n\n index++; // Next question\n if(index>15) // Stop counter if reach end of Quizz (quizzobj[0].length-1)\n {\n clearInterval(intervalId);\n clockrunning=false;\n showResults(); \n return endQuizz;\n }\n setTimeout(time5sec,3000); // set timeOut to 3 sec before next question \n }", "function quizUser() // TODO Implement actual timer\n{\n if (questionNum > 5)\n {\n endQuiz(timer.toFixed(2));\n return;\n }\n\n // Get question and populate relevent text in quizzer\n let question = quiz[questionNum-1];\n txt_question.innerHTML = question.q;\n btn_answer1.innerHTML = question.o[0];\n btn_answer2.innerHTML = question.o[1];\n btn_answer3.innerHTML = question.o[2];\n btn_answer4.innerHTML = question.o[3];\n}", "function whatIsQuestion() {\n\n if(anonymousvotingAddr.state() > 0) {\n var q = anonymousvotingAddr.question();\n document.getElementById('title').innerHTML = q;\n }\n}", "function updateInstructorInfo(nameMap, text, foundLocal) {\n\n\tvar tdIndexInstructor = nameMap.tdIndexInstructor;\n\tvar lname = nameMap.lname;\n\tvar name = nameMap.name;\n\n\tif(text.indexOf('No results were found') > -1) {\n\t\tfor(var tdIndex=0, tc = nameMap.td.length; tdIndex < tc; tdIndex++) {\n\t\t\tnameMap\n\t\t\t.td[tdIndex]\n\t\t\t.attr('title','No record found in the directory')\n\t\t}\n\t\tif(localStorage.getItem('sched.param(debug)') !== '0') {\n\t\t\tconsole.log('Employee directory has no record for \\'' + lname + '\\'');\n\t\t}\n\t}\n\telse {\n\t\tfor(var tdIndex=0, tc = nameMap.td.length; tdIndex < tc; tdIndex++) {\n\t\t\tnameMap\n\t\t\t.td[tdIndex]\n\t\t\t.addClass('td-tooltip')\n\t\t\t.empty();\n\t\t}\n\t\tvar tipContent =\n\t\t\t$('<div>')\n\t\t\t.addClass('name-tooltip')\n\t\t\t.append(text)\n\t\t\t.append(\n\t\t\t\t$('<span>')\n\t\t\t\t.html(\n\t\t\t\t\t'<br><br>See all employees having last name starting with \\'' +\n\t\t\t\t\t'<a href=\"https://gsw.edu/searchDirectory/employee/search.php?name=' + lname + '\" ' +\n\t\t\t\t\t'target=\"_blank\">' + lname + '</a>\\''\n\t\t\t\t)\n\t\t\t);\n\t\tvar a = $('<a>')\n\t\t\t.attr('href','')\n\t\t\t.click(function(){\n\t\t\t\t/*\n\t\t\t\tif($('#container').hasClass('blur')) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\tvar clickElement = $(this);\n\t\t\t\t//-- Create tooltip container if does not exist\n\t\t\t\tif($('div.tooltip-container').length === 0) {\n\t\t\t\t\t$('#topOfThePage')\n\t\t\t\t\t.after(\n\t\t\t\t\t\t$('<div>')\n\t\t\t\t\t\t.addClass('tooltip-container')\n\t\t\t\t\t\t.addClass('no-print')\n\t\t\t\t\t\t.click(function(){\n\t\t\t\t\t\t\t$(this).remove();\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tvar toolTipContainer =\n\t\t\t\t\t$('div.tooltip-container')\n\t\t\t\t\t.html(tipContent)\n\t\t\t\t\t.css({\n\t\t\t\t\t\t'position' : 'absolute'\n\t\t\t\t\t})\n\t\t\t\tif(isMobile()) {\n\t\t\t\t\ttoolTipContainer\n\t\t\t\t\t.css({\n\t\t\t\t\t\t'left' : ($(window).width() - toolTipContainer.width())/2,\n\t\t\t\t\t\t'top' : ($(window).height() - toolTipContainer.height())/2 + $(window).scrollTop()\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttoolTipContainer\n\t\t\t\t\t.css({\n\t\t\t\t\t\t'top' : clickElement.offset().top - toolTipContainer.height(),\n\t\t\t\t\t\t'left' : clickElement.offset().left - toolTipContainer.width()\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t})\n\t\t\t.text(name)\n\t\t\t.appendTo(nameMap.td);\n\t}\n}", "function display(questionIndex) {\n quizContainer.innerHTML = \" \";\n ulCreate.innerHTML = \" \";\n //To display questions\n for (var i = 0; i < myQuestions.length; i++) {\n var userQuestion = myQuestions[questionIndex].question;\n var userChoices = myQuestions[questionIndex].answers;\n quizContainer.textContent = userQuestion;\n quizContainer.setAttribute(\"style\", \"width:100%;\")\n }\n // To dispalay the relatives answers\n userChoices.forEach(function (answerList) {\n var listAnswer = document.createElement(\"li\");\n listAnswer.setAttribute(\"id\", \"listAnswer\")\n listAnswer.textContent = answerList;\n quizContainer.appendChild(ulCreate);\n ulCreate.appendChild(listAnswer);\n listAnswer.addEventListener(\"click\", (compare));\n\n });\n}", "function whatIsTheAns(){\n $('#currentQ').empty();\n $('.myChoice').empty();\n $('.question').empty();\n\n // The correct answer is pulled out from the object myQuestions and stored in var theAnswerText\n var theAnswerText = myQuestions[currentQ].answerArray[myQuestions[currentQ].correctAnswer];\n var theAnswerNum = myQuestions[currentQ].correctAnswer;\n //link img if you wish 144\n\n if((userAns === theAnswerNum) && (isAnswered === true)){\n correctAns++;\n $('#prompt').html(prompt.whenCorrect);\n } else if ((userAns !== theAnswerNum) && (isAnswered === true)){\n wrongAns++;\n $('#prompt').html(prompt.whenIncorrect);\n $('#fixedAns').html('The correct answer was: ' + theAnswerText);\n } else {\n noAns++;\n $('#prompt').html(prompt.whenNoTimeLeft);\n $('#fixedAns').html('The correct answer was: ' + theAnswerText);\n isAnswered = true;\n }\n\n if (currentQ === (myQuestions.length-1)){\n setTimeout(results, 1000);\n } else {\n currentQ++;\n setTimeout(displayQuestion, 1000);\n }\n\n}", "function showQuestion(){\n\ttimeRemaining = 30\n\ttimer = setInterval(timerFunction, 1000);\n\tif (index > 0) {\n\t\t$(\"#previous\").removeClass(\"initialHide\");\n\t}\n\tif (index == 4) {\n\t\t$(\"#next\").text(\"Get my Results\");\n\t}\n\n// Set the timer and the text for the questions\n\t$(\"#timer\").text(timeRemaining);\n\t\t$(\"#hint\").text(\"\");\n\t\t$(\"#question,#answers,#next\").removeClass('initialHide');\n\t\t$(\"#question-text\").text(currentQuestion.question);\n\t\t$(\"#question-sentence\").text(currentQuestion.sentence);\n\t\t$(\"#answer-one\").text(currentQuestion.answers.a);\n\t\t$(\"#answer-two\").text(currentQuestion.answers.b);\n\t\t$(\"#answer-three\").text(currentQuestion.answers.c);\n\t\t$(\"#answer-four\").text(currentQuestion.answers.d);\n\n\t\t$('p.answer-border').click(function(){\n\t\t\tanswerChoice = $(this).html();\n\t\t\tcheckAnswer();\n\t\t})\n}", "function results() {\n $(\"#questions\").hide();\n $(\"#options\").hide();\n $(\"#time-left\").hide();\n $(\"#results\").show();\n $(\"#correct\").html(\"Correct Answers:\" + correctAnswersCount);\n $(\"#incorrect\").html(\"Wrong Answers:\" + incorrectAnswersCount);\n\n\n}", "function viewRoles() {\r\n var query = 'SELECT * FROM role';\r\n connection.query(\"SELECT employee.first_name, employee.last_name, role.title AS Title FROM employee JOIN role ON employee.role_id = role.id;\", \r\n function(err, res) {\r\n if (err) throw err\r\n console.table(res)\r\n questions();\r\n })\r\n}", "function getQuizPage() {\n \n}", "function showEvidenceQuestionsByMethod(mp_method) {\r\n if (mp_method == \"Case Report\") { \r\n\t$(\"#caseReport\").css(\"display\",\"block\");\r\n } else if (mp_method == \"Clinical study\") {\r\n\t$(\"#clinicalTrial\").css(\"display\",\"block\");\t\t\r\n } else if (mp_method == \"Metabolic Experiment\") {\r\n\t$(\"#metabolic\").css(\"display\",\"block\");\t\t\r\n } else if (mp_method == \"Transport Experiment\") {\r\n\t$(\"#transport\").css(\"display\",\"block\");\t\t\t\r\n } else {\r\n\tconsole.log(\"[ERROR] evidence type undefined: \" + mp_method);\r\n }\r\n}", "function loadStudentExamData(name, code) {\n document.getElementById('examSpecific').style.display = \"none\";\n document.getElementById('student-exam-data').style.display = \"initial\";\n document.body.style.backgroundImage = \"none\";\n var answer = \"\";\n var finalId;\n\n //linear-gradient(135deg, rgb(245, 247, 250) 0%, rgb(195, 207, 226) 100%);\n\n var table = document.getElementsByClassName('table');\n for(var i = 0; i < table.length; i++) {\n table[i].style.display = \"none\";\n }\n\n firebase.database().ref(\"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem(\"className\") + \"/Students\").once('value', function(snapshot) {\n for(var info in snapshot.val()) {\n var data = snapshot.val()[info];\n var id = data.split(\";\")[0];\n var fullName = data.split(\";\")[1];\n\n if(name == fullName) {\n finalId = id;\n }\n }\n });\n\n firebase.database().ref(\"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem(\"className\") + \"/Exams/\" + code).once('value', function(snapshot) {\n var data = (snapshot.val().responses[name][Object.keys(snapshot.val().responses[name])[0]]);\n\n document.getElementById('resetStatus').onclick = function() {\n for(var takenKey in snapshot.val().taken) {\n var id = (snapshot.val().taken[takenKey]);\n\n if(id == finalId) {\n firebase.database().ref(\"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem(\"className\") + \"/Exams/\" + code + \"/taken/\").child(takenKey).remove()\n }\n }\n\n swal(\"Success!\", name + \"'s taken status has been reset. \" + name + \" should be able to retake exam now.\", 'success')\n }\n\n var studentPoints = data.totalScore / 100 * snapshot.val()[Object.keys(snapshot.val())[0]].examTotalPoints;\n document.getElementById('score-num').innerHTML = (studentPoints).toFixed(0) + \" / \" + snapshot.val()[Object.keys(snapshot.val())[0]].examTotalPoints;\n document.getElementById('score').innerHTML = data.totalScore + \"%\";\n\n var corrAnswer = \"\";\n sessionStorage.setItem(\"totalPointsExcludingFr\", 0);\n\n for(var i = 0; i < Object.keys(data.answers).length; i++) {\n\n if(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].type == \"tf\") {\n corrAnswer = snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].choices[0];\n }\n else if(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].type == \"mc\"){\n corrAnswer = snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].checked;\n }\n else if(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].type == \"fr\") {\n corrAnswer = \"\";\n }\n createGradedQuestion(\n // PARAM: studAnswer\n data.answers[i].split(\";\")[1],\n // PARAM: corrAnswer\n corrAnswer,\n // PARAM: numAnswerChoices\n Object.keys(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].choices).length,\n // PARAM: numPoints\n snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].points,\n // PARAM: questions\n snapshot.val()[Object.keys(snapshot.val())[0]].questions[i],\n // PARAM: studName\n name,\n // PARAM: examCurrentCode\n code,\n // PARAM: examTotalPoints\n snapshot.val()[Object.keys(snapshot.val())[0]].examTotalPoints\n );\n }\n });\n}", "function displayQuestion() {\n hideResults();\n $(\"#answer\").hide();\n $(\"#time\").show();\n showDiv();\n $(\"#question\").html(question[questionCount]);\n $(\"#choice1\").html(firstChoice[questionCount]);\n $(\"#choice2\").html(secondChoice[questionCount]);\n $(\"#choice3\").html(thirdChoice[questionCount]);\n $(\"#choice4\").html(fourthChoice[questionCount]);\n }", "function show_subject_tab(){\n\t$(\"subject_tab\").show();\n\t\n\t$(\"subject_list\").show();\n\t$(\"subject_detail\").hide();\n\t$(\"subject_new\").hide();\n\t\n\t$(\"homeroom_tab\").hide();\n\t$(\"library_tab\").hide();\n\t$(\"exam_tab\").hide();\n\t$(\"homework_tab\").hide();\n\t$(\"student_tab\").hide();\n\t\n\ttab_on(1);\n}", "function HistoryAnswer(question,useAnswer,correct){\n this.question=question;\n this.useAnswer=useAnswer;\n this.correct=correct;\n resultHistory.push(this)\n }", "function showAnswer() {\n $(\"#questions\").empty();\n $(\".answers\").empty();\n\n var gif = $(\"<img class = 'answer-images'>\").attr(\"src\", questions[click - 1].Image);\n $(\".answers\").append(gif);\n var explanationDiv = $(\"<div>\");\n var answer = $(\"<h3 class = 'answer-explanations'>\").html(\"<b>Correct Answer: </b>\" + questions[click - 1].Correct);\n var explanation = $(\"<h3 class = 'answer-explanations'>\").text(questions[click - 1].explanation);\n explanationDiv.append(answer, explanation)\n $(\".answers\").append(explanationDiv);\n\n // temporarily utilize flexbox for explanation display\n $(\".answers\").css(\"display\", \"flex\");\n\n // ternary to reduce font-size of long explanations\n $(\".answer-explanations\").css(\"font-size\", questions[click - 1].explanation.length > 300 ? \"0.8em\" : \"1.0em\");\n\n var nextQuestionButton = $(\"<button>\").addClass(\"btn game-button next-question\").text(\"Skip\");\n $(\".answers\").append(nextQuestionButton);\n\n\n showAnswerTimer = setTimeout(function () {\n $(\".answers\").css(\"display\", \"block\");\n if (click < questions.length) {\n nextQuestion();\n }\n else if (click === questions.length) {\n displayScore();\n }\n }, questions[click - 1].explanation.length > 300 ? 10000 : 6000);\n }", "function getExerciseEntriesFromLessons(){\n console.log(\"Getting Exercise Entries for lesson Page \" + lessonID);\n dbShellLessons.transaction(function(tx){ // put teacher_id also\n tx.executeSql(\"select lessonRow_id,teacher_id,lesson_id,exercise_id,exercise_title,exercise_detail,\\\n exercise_voice,exercise_image from lessons where lesson_id=? group by exercise_id\",[lessonID]\n ,renderEntriesForExerciseInLessonPage,dberrorhandlerForLessons);\n },dberrorhandlerForLessons);\n}", "function showQuestion() {\n if (trackQuestion == questions.length) {\n scorePage();\n } else {\n questionElement.textContent = questions[trackQuestion].question;\n btn1.textContent = questions[trackQuestion].answers[0];\n btn2.textContent = questions[trackQuestion].answers[1];\n btn3.textContent = questions[trackQuestion].answers[2];\n btn4.textContent = questions[trackQuestion].answers[3];\n trackQuestion++;\n console.log(trackQuestion);\n }\n}", "function displayQus(dataText) {\n var ansArr = document.querySelectorAll('.ans')\n id = 0\n if (ansArr) {\n ansArr.forEach(e => e.remove())\n }\n var qusText = document.querySelector('.ques-container h4')\n document.querySelector('.conclusion-container').style.display = \"block\"\n document.querySelector('.check').style.opacity = \"0\"\n document.querySelector('.check .explain').innerText = dataText[id].explain\n qusText.innerText = dataText[id].qus\n displayAns(dataText, id)\n}", "function displayQuestion(q) {\n var questionNum = questionIndex+1; // Used to display the question number\n var answerArray = [q.ans1,q.ans2,q.ans3,q.ans4] // Temporary array used to randomize the answer order\n\n shuffleArray(answerArray); // Shuffle the order of the answers\n\n clearTimeout(answerTimer); // Stop the question timer\n clearInterval(secondTimer); // Stop the second timer\n\n questionTimer = setTimeout(function(){displayAnswer(false, 1, questions[questionIndex])}, answerQuestionTime); // Set time allowed to answer question\n secondTimer = setInterval(secondCountdown, second); // Set interval time to count down seconds\n timeRemaining = answerQuestionTime/1000; //convert to seconds the time allowed to answer the question\n\n $(\"#nextQuestionTime\").hide(); // Hide the next question timer\n $(\"#timeRemaining\").html(\"Time Remaining: \"+timeRemaining+\" seconds\").show().css(\"color\",\"black\"); // Display the time remaining to answer question\n\n $(\"#questionNumber\").html(questionNum+\". \").show();; // Display question number\n $(\"#triviaQuestion\").html(q.question).show(); // Display the trivia question with possible answers\n $(\"#btn1\").html(answerArray[0]).attr(\"data-btnVal\",answerArray[0]).show();\n $(\"#btn2\").html(answerArray[1]).attr(\"data-btnVal\",answerArray[1]).show();\n $(\"#btn3\").html(answerArray[2]).attr(\"data-btnVal\",answerArray[2]).show();\n $(\"#btn4\").html(answerArray[3]).attr(\"data-btnVal\",answerArray[3]).show();\n enableButtons();\n}", "function displayQuestions(){\n\n\t//Start timer.\n\tintervalId = setInterval(displayTime, 1000);\n\n\t//If the time is over\n\t//timer = setTimeout(timeOut, 1000 * parseInt(sec));\n\n\tvar quiz = \"\";\n\tfor(var i=0; i<quizList.length; i++){\n\n\t\tvar multipleChoice = \"\";\n\n\t\t//Get mutiple choice for each question, set it's values according to the choices and set same name for each question to group them together.\n\t\tfor(var j=0; j<quizList[i].choices.length; j++){\n\t\t\tmultipleChoice += \"<br><input name=\" + quizList[i].name + \" type='radio' value=\" + quizList[i].choices[j] + \">&emsp;\" + quizList[i].choices[j]; \n\t\t}\n\n\t\t//Append all questions along with its choices\n\t\tquiz += \"<span class='question'>\" + quizList[i].question + \"</span>\" + multipleChoice + \"<hr>\";\n\t}\n\n\t//Append all question and its choices in the form and display it on screen\n\t$(\".quiz-form\").append(quiz);\n\t$('.form').show();\n\t$('.map-image').hide();\t\n\t$('#start').hide();\n}", "function showUsersGroups(answer) {\n var array = getUsersGroups(answer);\n console.log(answer + ' is found in the following groups: ');\n array.forEach(function (group) {\n console.log(group.group_name);\n });\n helpers.menuCallback();\n}" ]
[ "0.56101745", "0.55769306", "0.5533211", "0.55255497", "0.54794246", "0.5478765", "0.540295", "0.53932476", "0.53912115", "0.5383416", "0.5368344", "0.53406394", "0.5335031", "0.53270173", "0.52924526", "0.52783", "0.5273482", "0.5254491", "0.52541196", "0.5249005", "0.52458876", "0.52384245", "0.52310574", "0.5221921", "0.52218336", "0.5208683", "0.5206901", "0.52066267", "0.5201478", "0.51998353", "0.5196835", "0.5191954", "0.5185442", "0.5182603", "0.5181642", "0.51702857", "0.5147662", "0.51461875", "0.5145463", "0.51453346", "0.51424706", "0.51390916", "0.5134355", "0.5130477", "0.5129267", "0.51233774", "0.5123193", "0.5120737", "0.5118221", "0.5118134", "0.5117636", "0.5114436", "0.51051474", "0.5102811", "0.5091255", "0.50860685", "0.5082803", "0.508102", "0.50805646", "0.5076478", "0.5069649", "0.5069522", "0.5058809", "0.5056512", "0.5049044", "0.5043872", "0.5035933", "0.5034561", "0.5033038", "0.50199497", "0.5019505", "0.5019279", "0.5016656", "0.5015037", "0.5010458", "0.5006354", "0.5003624", "0.49983525", "0.49972442", "0.49967346", "0.4992223", "0.49910015", "0.49904266", "0.4989032", "0.49843967", "0.49798954", "0.49783638", "0.49765167", "0.49759537", "0.4974929", "0.49744695", "0.49693155", "0.49664935", "0.4966017", "0.4965223", "0.49647656", "0.49640772", "0.49597353", "0.49592084", "0.49591956", "0.4959113" ]
0.0
-1
Used when displaying students who have taken exam to show answer table for that user
function showScoreTable(id) { $('#clrButton').css('display', 'block'); $('#detailtable').bootstrapTable('destroy'); $('#detailtable').bootstrapTable({ url: baseURL + 'api/results/readByKey.php?key=' + id, Striped: true, tableSm: true, columns: [{ field : 'id', title: 'ID', }, { field: 'examID', title: 'Exam ID' }, { field: 'questionID', title: 'Question ID' }, { field: 'answered', title: 'Answered' }, { field: 'correctAnswer', title: 'Correct Answer' }, { field: 'seconds', title: 'Time (s)' }] }); let messageTxt = "<p><strong>Note: </strong>Answered 'z' means student did not answer that question. " document.getElementById("message").innerHTML = messageTxt; $('#message').css('display', 'block'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showAnswers(){\t\n\t\tvar rightAnswers = 0;\n\t\tvar wrongAnswers = 0;\n\t\tvar userInput1 = $('#a1 input:checked').val();\n\t\tvar userInput2 = $('#a2 input:checked').val();\n\t\tvar userInput3 = $('#a3 input:checked').val();\n\t\tvar userInput4 = $('#a4 input:checked').val();\n\t\tvar userInput5 = $('#a5 input:checked').val();\n\t\tif (userInput1 === 'quail'){\n\t\t\trightAnswers++;\n\t\t}\n\t\telse {\n\t\t\twrongAnswers++;\n\t\t}\n\t\tif (userInput2 === 'frog') {\n\t\t\trightAnswers++;\n\t\t}\n\t\telse {\n\t\t\twrongAnswers++;\n\t\t}\n\t\tif (userInput3 === 'bear') {\n\t\t\trightAnswers++;\n\t\t}\n\t\telse {\n\t\t\twrongAnswers++;\n\t\t}\n\t\tif (userInput4 === 'avacado') {\n\t\t\trightAnswers++;\n\t\t}\n\t\telse {\n\t\t\twrongAnswers++;\n\t\t}\n\t\tif (userInput5 === 'artichoke') {\n\t\t\trightAnswers++;\n\t\t}\n\t\telse {\n\t\t\twrongAnswers++;\n\t\t}\n\t\tconsole.log('Input1:' + userInput1);\n\t\tconsole.log('Input2: ' + userInput2);\n\t\tconsole.log('Input3: ' + userInput3);\n\t\tconsole.log('Input4: ' + userInput4);\n\t\tconsole.log('Input5: ' + userInput5);\n\t\tconsole.log('Right Answers: ' + rightAnswers);\n\t\tconsole.log('Wrong Answers: ' + wrongAnswers);\n\t\t$('#time').remove();\n\t\t$('#submitButton').remove();\n\t\t$('#formQuestions').remove();\n\t\t$('#questions').html('<div id=\"results\">Results</div>');\n\t\t$('#questions').html(\"<div>\" + 'Right Answers: ' + rightAnswers + \"</div>\");\n\t\t$('#questions').append(\"<div>\" + 'Wrong or Empty Answers: ' + wrongAnswers + \"</div>\");\n\n\t}", "function showQuestions() {\n if (quizBank.length == questionCounter) {\n endQuiz();\n } else {\n questionDisplay.innerText = quizBank[questionCounter].question;\n showAnswers();\n }\n}", "function checkAnswer () {\n console.log(userSelected.text);\n\n if (userSelected === questions[i].correctAnswer) {\n score ++;\n $(\"#score\").append(score);\n $(\"#answerCheck\").append(questions[i].rightReply);\n i++;\n } else {\n $(\"#answerCheck\").append(questions[i].wrongReply);\n i++;\n } \n }", "function markAnswer () {\r\n //Mark answer\r\n ///If no answer was given then do nothing\r\n if(userSession.userAnswers.length != 0)\r\n {\r\n ///Set a boolean flag variable to true - represents whether the user has gotten the whole question correct. Defaults to correct\r\n var allCorrect = true;\r\n\r\n ///Depending on the type of question\r\n switch(userSession.questionData.type)\r\n {\r\n case \"boxMatch\":\r\n ///For each answer\r\n for(var j = 0; j < userSession.userAnswers.length; j++)\r\n {\r\n ///If the correct answers don't contain the user answer \r\n ///Standard for string match questions\r\n if(userSession.correctAnswers[j] != userSession.userAnswers[j]) {\r\n ///The user got the question wrong\r\n allCorrect = false;\r\n }\r\n }\r\n break;\r\n \r\n case \"multipleChoice\":\r\n if(userSession.userAnswers.length === userSession.correctAnswers.length)\r\n {\r\n ///For each user answer\r\n for(var j = 0; j < userSession.userAnswers.length; j++)\r\n {\r\n ///If the correct answers doesnt contain the user answer\r\n ///Multiple choice is segregated due to the lack of case sensitivity errors. Answers are stored the same as the question prompts are displayed\r\n if(!userSession.correctAnswers.includes(userSession.userAnswers[j])) {\r\n ///The user got the question wrong\r\n allCorrect = false;\r\n }\r\n } \r\n } else {\r\n allCorrect = false;\r\n }\r\n break; \r\n\r\n default:\r\n ///For each answer\r\n for(var j = 0; j < userSession.userAnswers.length; j++)\r\n {\r\n ///If the correct answers don't contain the user answer \r\n ///Standard for string match questions\r\n if(!userSession.correctAnswers.includes(userSession.userAnswers[j].toLowerCase())) {\r\n ///The user got the question wrong\r\n allCorrect = false;\r\n }\r\n }\r\n break;\r\n }\r\n\r\n ///If the user got the question completely correct\r\n if(allCorrect) {\r\n ///Update the user session to show that this question is correct\r\n userSession.isCorrect = true;\r\n }\r\n }\r\n}", "function generateQuestionResultsForm(answer) {\n if (answer == store.questions[store.questionNumber].correctAnswer) {\n store.score += 1;\n $('#question-container').append(\n `<p class=\"reply\">Correct!</p>`\n );\n } else {\n $('#question-container').append(\n `<p class=\"reply\">Sorry, the correct answer is: ${store.questions[store.questionNumber].correctAnswer}</p>`\n );\n }\n}", "function showResult(){\n let titles = [\"Master\",\"Champion\",\"Average\",\"Bad\"]; \n let nrOfCorrects = document.getElementById(\"nrOfCorrectAnswers\");\n let showTitle = document.getElementById(\"title\");\n let username = document.getElementById(\"username\");\n nrOfCorrects.innerHTML = \"You scored \" + \"<span>\" + quiz.correctAnswers + \"</span>\" + \" of\" + \" <span>\" + quiz.maxScore + \"</span>\" + \" points right!\";\n username.innerHTML = quiz.username;\n if(quiz.correctAnswers == quiz.maxScore){\n showTitle.innerHTML = titles[0];\n }\n else if(quiz.correctAnswers > 3){\n showTitle.innerHTML = titles[1];\n }\n else if(quiz.correctAnswers >= 2){\n showTitle.innerHTML = titles[2];\n }\n else if(quiz.correctAnswers < 2){\n showTitle.innerHTML = titles[3];\n }\n}", "function results() {\n selectedAnswers = $(displayTest.find(\"input:checked\"));\n //if user is correct\n if (\n selectedAnswers[0].value === testSetup[currentQuestion - 1].questionAnswer\n ) {\n //add to correct score and display on element\n correct++;\n $(\"#correct\").text(\"Answers right: \" + correct);\n } else {\n //if user is wrong then add to wrong score and display on element\n wrong++;\n $(\"#incorrect\").text(\"Wrong answers: \" + wrong);\n }\n //check to see if the user has reached the end of the test\n if (currentQuestion === 10) {\n //toggle finalize modal at end of test to display score\n $(\"#modalMatch\").modal(\"toggle\");\n $(\"#testScore\").text(\n \"End of test! You scored a \" + (parseFloat(correct) / 10) * 100 + \"%\"\n );\n //show postTest element\n $(\"#postTest\").show();\n $(\"#submitTest\").hide();\n }\n }", "function renderUser(user) {\n numQuestions = user.questions.length;\n\n // Populate list of unanswered questions\n for (let i = 0; i < numQuestions; i++) {\n if (!user.questions[i].answered) {\n remainingQuestions.push(user.questions[i]);\n } else {\n completedQuestions.push(user.questions[i].number);\n }\n }\n\n numCompleted = completedQuestions.length;\n var completedQuestionsString = \"\";\n for (var i = 0; i < numCompleted; i++) {\n completedQuestionsString += completedQuestions[i] + \", \";\n }\n $(\"#questions-completed\").html(completedQuestionsString);\n\n $(\"#num-questions\").html(numQuestions);\n $(\"#num-completed\").html(numCompleted);\n $(\"#username\").html(user.userName);\n $(\"#logged-in\").css(\"display\", \"block\");\n}", "function quizUser() // TODO Implement actual timer\n{\n if (questionNum > 5)\n {\n endQuiz(timer.toFixed(2));\n return;\n }\n\n // Get question and populate relevent text in quizzer\n let question = quiz[questionNum-1];\n txt_question.innerHTML = question.q;\n btn_answer1.innerHTML = question.o[0];\n btn_answer2.innerHTML = question.o[1];\n btn_answer3.innerHTML = question.o[2];\n btn_answer4.innerHTML = question.o[3];\n}", "function userSelection() {\n stopCountdown();\n if ($(this).attr(\"data-name\") == correctAnswers[questionSelector]) {\n rightWrong = true;\n correct++;\n var newScore = score += points;\n $(\"#score\").text(newScore);\n } else {\n incorrect++ \n }\n showResult();\n nextQuestion();\n }", "function showResults(){\n\n\t// gather answer containers from our quiz\n\tconst answerContainers = quizContainer.querySelectorAll('.answers');\n \n\t// keep track of user's answers\n\tlet numCorrect = 0;\n \n\t// for each question...\n\tmyQuestions.forEach( (currentQuestion, questionNumber) => {\n \n\t // find selected answer\n\t const answerContainer = answerContainers[questionNumber];\n\t const selector = `input[name=question${questionNumber}]:checked`;\n\t const userAnswer = (answerContainer.querySelector(selector) || {}).value;\n \n\t // if answer is correct\n\t if(userAnswer === currentQuestion.correctAnswer){\n\t\t// add to the number of correct answers\n\t\tnumCorrect++;\n \n\t\t//color the answers green\n\t\tanswerContainers[questionNumber].style.color = 'blue';\n\t }\n\t // if answer is wrong or blank\n\t else{\n\t\t// color the answers red\n\t answerContainers[questionNumber].style.color = 'red';\n\t }\n\t});\n \n\t// show number of correct answers out of total\n\tresultsContainer.innerHTML = `Your score is : ${numCorrect} out of ${myQuestions.length}`;\n }", "function results() {\n // Answer variables.\n correct = 0;\n incorrect = 0;\n unanswered = 0;\n\n for (var i = 1; i < 11; i++) {\n\n if ($(\"input[name='q\" + i + \"']:checked\").val() == \"x\") {\n\n correct++;\n } else if ($(\"input[name='q\" + i + \"']:checked\").val() === undefined) {\n\n unanswered++;\n } else {\n\n incorrect++;\n }\n\n // Display results and hide unwanted elements.\n \n $(\"#quiz\").hide();\n $(\"#whichState\").hide();\n $(\"#validate\").hide();\n $(\"#score\").html(\"Correct: \" + correct + \"<br/>Incorrect: \" + incorrect + \"<br/>Unanswered: \" + unanswered);\n $(\"#timer\").hide();\n $(\"#tally\").show();\n $(\"#clear\").show();\n $(\"#jack\").show();\n }\n\n }", "function showResults(){\n\n // gather answer containers from our quiz\n const answerContainers = quizContainer.querySelectorAll('.answers');\n \n // keep track of user's answers\n let numCorrect = 0;\n \n // for each question...\n myQuestions.forEach( (currentQuestion, questionNumber) => {\n \n // find selected answer\n const answerContainer = answerContainers[questionNumber];\n const selector = `input[name=question${questionNumber}]:checked`;\n const userAnswer = (answerContainer.querySelector(selector) || {}).value;\n \n // if answer is correct\n if(userAnswer === currentQuestion.correctAnswer){\n // add to the number of correct answers\n numCorrect++;\n \n // color the answers green\n answerContainers[questionNumber].style.color = 'lightgreen';\n }\n // if answer is wrong or blank\n else{\n // color the answers red\n answerContainers[questionNumber].style.color = 'red';\n }\n });\n \n // show number of correct answers out of total\n resultsContainer.innerHTML = `${numCorrect} out of ${myQuestions.length}`;\n}", "function generateResults(){\n //grabs answer user selected, current question number, and correct answer\n let selected = $('input[type=radio]:checked', '#question-form').val();\n let allQuestions = store.questions;\n let currentQuestionNumber = store.questionNumber;\n let correct = Object.values(allQuestions)[currentQuestionNumber].correctAnswer;\n \n //determines which view to generate based on if users selected the correct answer. if so, increments the score. determines\n if (correct === selected && currentQuestionNumber < store.questions.length) {\n store.score++;\n return generateCorrectPage();\n }\n else if (correct !== selected && currentQuestionNumber < store.questions.length) {\n return generateWrongPage();\n }\n}", "function renderAnswers(answers, userAnswer){\n const result = [];\n clearAnswers(multiAnswer);\n //add new answers\n answers.forEach((answer, index) => {\n const div = document.createElement('div'),\n p = document.createElement('p');\n if(stopQuiz){\n if(answer.isCorrect){\n div.classList.add('isCorrect');\n } else if (userAnswer.index === index && !answer.isCorrect){\n div.classList.add('isIncorrect');\n }\n }\n userAnswer && userAnswer.index === index ? \n div.classList.add('quiz__answer--multiple', 'quiz__answer--selected', `${stopQuiz && !answer.isCorrect ? 'isIncorrect': null}`) :\n div.classList.add('quiz__answer--multiple');\n p.innerHTML = answer.answer;\n div.appendChild(p);\n div.addEventListener('click', (e) => selectAnswer(e));\n multiAnswer.appendChild(div);\n });\n}", "function showResults(questions, quizContainer, resultsContainer){\r\n\t\t// gather answer containers from our quiz\r\n\tvar answerContainers = quizContainer.querySelectorAll('.answers');\r\n\t\r\n\t// keep track of user's answers\r\n\tvar userAnswer = '';\r\n\tvar numCorrect = 0;\r\n\t\r\n\t// for each question...\r\n\tfor(var i=0; i<questions.length; i++){\r\n\r\n\t\t// find selected answer\r\n\t\tuserAnswer = (answerContainers[i].querySelector('input[name=question'+i+']:checked')||{}).value;\r\n\t\t\r\n\t\t// if answer is correct\r\n\t\tif(userAnswer===questions[i].correctAnswer){\r\n\t\t\t// add to the number of correct answers\r\n\t\t\tnumCorrect=numCorrect+2;\r\n\t\t\t\r\n\t\t\t// color the answers green\r\n\t\t\tanswerContainers[i].style.color = 'lightgreen';\r\n\t\t}\r\n\t// if answer is wrong or blank\r\n\t\telse{\r\n\t\t\t// color the answers red\r\n\t\t\tanswerContainers[i].style.color = 'red';\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\r\n\t// show number of correct answers out of total\r\n\tresultsContainer.innerHTML ='Your scores is ' + numCorrect +'%' + ' out of ' + (questions.length*2) + '%';\r\n\t// alert('Your scores is ' + numCorrect +'%' + ' out of ' + (questions.length*2) + '%');\r\n\t\r\n}", "function assessAnswer(userLevel, userScore) {\n let a = correctAnswer[userLevel];\n // targets input answer based on userLevel\n let aGiven = document.querySelector('input[name=\"' + answerSelector[userLevel] + '\"]:checked').value\n //let aGiven = document.querySelector('input[name=\"q1\"]:checked').value\n if (aGiven == a){\n userLevel ++;\n // userScore += seconds;\n\n // load next question\n // displayQuestion(userLevel, userScore)\n\n runQuiz(userLevel, userScore)\n }\n else {\n failModal()\n }\n }", "function addAnswersToTable(nextRow, student) {\n let tdString = `<td>${student.name}</td>`\n for(let key in ANSWERS_SUM) {\n tdString += `<td>${student[key]}</td>`\n }\n nextRow.innerHTML += tdString\n}", "getMCQAnswerString() {\n console.log('here in server/db helper');\n var allAnswers = '';\n for (let student in this.students) {\n if ('answer here', this.students[student].MCQAnswer) {\n console.log(this.students[student].MCQAnswer);\n allAnswers = allAnswers.concat(this.students[student].MCQAnswer);\n }\n }\n return allAnswers;\n }", "function firstAnswer()\n\n {\n\n\t\n for (i=0 ; i<document.Q1.quiz.length ; i++) //this is the method of checking which radio button is checked by the user\n {\n if (document.Q1.quiz[i].checked==true) \n {\n var Answer = document.Q1.quiz[i].value\n }\n }\n\n \n//validation -- whether a radio button is checked \nvar Quiz = document.Q1.quiz; \n for(j=0; j<Quiz.length; j++){\n if(Quiz[j].checked)\n break;\n}\nif (j==Quiz.length) //if the user don't pick a radio button this loop will execute again and ask a answer from user untill he checked a one.\nreturn alert(\"Please select an answer \");\n\n \n \n // this is the nested if else statements to do some activities with the radio button which clicked by user \nif (Answer == \"1\" )\n { \n \n \tScore1 = 2; //this is the correct answer which placed in radio button 1.if he check this this will add 2 marks to the total\n\t\n\tvar item = document.getElementById(\"ImageIDCorrect1\"); //in this statement the image for the correct one(between 2 images) at the marks table \n if (item) { //will appear which was hidden already.\n\t\t\titem.className=(item.className=='hidden')?'unhidden':'hidden';\n }\n\t}\n\nelse if (Answer == \"2\"){ //if the user don't check the first answer then this will check this one and so on untill answer 4.\n \n Score1 = -1; //if he check this one it will deduct 1 mark from total.\n \n document.getElementById(\"A12\").style.color=\"#ff0000\"; //this wrong answer's font color which selected by user will be turned into red and display in marks table.\n \t\n\t\tvar item = document.getElementById(\"ImageIDWrong1\"); //And the image for a wrong answer will also display in the marks table\n\t\tif (item) {\n\t\t\titem.className=(item.className=='hidden')?'unhidden':'hidden';\n }\n\t}\n \nelse if (Answer ==\"3\"){ //same comment as in the Answer 2\n\n\tScore1 = -1;\n\tdocument.getElementById(\"A13\").style.color=\"#ff0000\"; \n\t\n\tvar item = document.getElementById(\"ImageIDWrong1\");\n\t\tif (item) {\n\t\t\titem.className=(item.className=='hidden')?'unhidden':'hidden';\n }\n}\n else if (Answer == \"4\"){ //same comment as in the Answer 2\n \n Score1 = -1;\n document.getElementById(\"A14\").style.color=\"#ff0000\";\n \t\n\t\tvar item = document.getElementById(\"ImageIDWrong1\");\n\t\tif (item) {\n\t\t\titem.className=(item.className=='hidden')?'unhidden':'hidden';\n }\n \n}\n \nvar item = document.getElementById(\"Question1\"); //here I use these statements to hide the question 1 after the user calls next question\n if (item) {\n item.className=(item.className=='unhidden')?'hidden':'unhidden';\n } \n \n \n var item = document.getElementById(\"Question2\"); // And after disappearing the Question1 next question, Question2 will appear.\n if (item) {\n item.className=(item.className=='hidden')?'unhidden':'hidden';\n }\n\n }", "function getResponseEntriesForStudent(){\n console.log(\"Getting all exercise response entries for \\\n teacher \" + teacherID +\", lesson \" + lessonID +\" and student \" + studentID);\n dbShellResponsesForStudent.transaction(function(tx){\n tx.executeSql(\"select row_id,teacher_id,student_id,lesson_id,exercise_id,response,scoremark,comment\\\n from responseandmark where teacher_id=? and student_id=? order by lesson_id,exercise_id\",[teacherID,studentID]\n ,renderResponseEntriesForStudent,dberrorhandlerForResponseForStudent);\n },dberrorhandlerForResponseForStudent);\n}", "displayAdminView() {\n var questionnaire = this.props.questionnaire.questionnaire_obj\n var questions = this.props.questionnaire.questions ? this.props.questionnaire.questions : []\n var users = this.props.questionnaire.users ? this.props.questionnaire.users : []\n var counter = 0\n\n return(\n <div>\n <div>\n <h3> {questionnaire.name} </h3>\n </div>\n\n <div>\n { // display questionnaire's questions at the top\n questions.map( (question) => {\n return(\n <div key={counter++}>\n <li> {`${counter}.`} {question.label} </li>\n </div>\n )\n })\n }\n </div>\n\n <div>\n { // generate a row for each user who has completed questionnaire\n users.map( (user) => {\n return(\n <QuestionnaireUserDataRow questionnaire={questionnaire}\n questions={questions}\n user={user}\n key={counter++}\n />\n )\n })\n }\n </div>\n </div>\n )\n }", "function scoreCount() {\n for (var i = 0; i < userSelection.length; i++) {\n // If user selected an answer\n if (userSelection[i].checked) {\n // check if what the user select is equal to the array answers\n\n if (answers.indexOf(userSelection[i].value) !== -1) {\n correctAnswer++;\n } else {\n incorrectAnswer++;\n }\n }\n }\n //check how many questions were blank by subtracting the if/else values from above from the total number of questions.\n\n var totalAnswered = correctAnswer + incorrectAnswer;\n\n if (totalAnswered !== totalQuestions) {\n blank = totalQuestions - totalAnswered;\n }\n\n $(\"#correct\").html(\" \" + correctAnswer);\n $(\"#incorrect\").html(\" \" + incorrectAnswer);\n $(\"#blank\").html(\" \" + blank);\n } //end scoreCount", "function checkUserAnswer(answer) {\n//when the user selects an answer and it is exactly equal to an index in the correctAnswer object key,\n\tif(answer.text() === questionList[getCurrentIndex()].ansArray[questionList[getCurrentIndex()].correctAnswer]) {\n return true;\n console.log(true);\n } else {\n return false;\n console.log(false);\n }\n}", "function mostrarExamen(){\n //Recoge la información del formulario\n var nQuestions = getValue('n_questions');\n var typeQuestions = getValue('type_question'); //0 Español-Ingles, 1 Inglés español, 2 aleatorio\n var bAyuda = getValue('with_help'); \n var nGroup = getValue('numberGroup'); \n\n // En caso de seleccionar todas las respuestas\n if (nQuestions == 0) {\n nQuestions = arrayVerb.length;\n }\n\n document.getElementById(\"resultadoFinal\").innerHTML='';\n document.getElementById(\"palabrasCorrectas\").innerHTML='';\n document.getElementById(\"examList\").innerHTML='';\n\n exam = new examen(nQuestions, typeQuestions, bAyuda, nGroup);\n\n addHeaderTable(\"examList\");\n document.getElementById(\"lblMaxGrupos\").innerHTML = \"Max. \" + exam.nTotalGrupo;\n document.getElementById(\"examList\").innerHTML += exam.showExam();\n document.getElementById(\"btnResult\").disabled = false;\n \n}", "function showScore () {\n\t$(\".questions\").hide();\n\t$(\".result\").show();\n\tshowScore();\n}", "addStudentToStudentsExams(exam){\n if(!this.checkIfStudentInExamList(exam.student_id)[0]){\n this.students_exams.push(exam);\n }\n }", "function checkAnswer(userAnswer) {\n if (secondsLeft > 0 && currentIndex < lastQuestionIndex) {\n if (questionArr[currentIndex].answer == userAnswer) {\n currentIndex++;\n renderQuestions(); \n isCorrect();\n } else {\n currentIndex++;\n secondsLeft -= 10;\n renderQuestions();\n isWrong();\n }\n } else {\n currentIndex = 0;\n finalScoreRender();\n }\n}", "function displayQuestion () {\r\n //displays score after user answers final question\r\n if (questionIndex === finalQuestion){\r\n return displayScore();\r\n} \r\n var currentQuestion = myQuestions[questionIndex];\r\n question.innerHTML = \"<p>\" + currentQuestion.question + \"</p>\";\r\n answerA.innerHTML = myQuestions[questionIndex].answers.a;\r\n answerB.innerHTML = myQuestions[questionIndex].answers.b;\r\n answerC.innerHTML = myQuestions[questionIndex].answers.c;\r\n answerD.innerHTML = myQuestions[questionIndex].answers.d;\r\n }", "function checkResult(userResponse, question) {\n\n if (question.correctAnswer === userResponse) {\n $contRight.removeClass(\"hide\");\n setTimeout(function() {\n showQuestion(\"Y\", question);\n $contRight.addClass(\"hide\");\n }, 500);\n } else {\n $contWrong.removeClass(\"hide\");\n setTimeout(function() {\n showQuestion(\"Y\", question);\n $contWrong.addClass(\"hide\");\n wrongCount++;\n }, 500);\n\n }\n}", "function questionTable() {\n\t\t if ($(\".questionnaire table\").length > 0) {\n\t\t\t\t$(\".questionnaire table\").addClass(\"questions\");\n\t\t\t\tvar question = new Array();\n\t\t\t\t//Create an array of all options\n\t\t\t\t$(\"table.questions tbody tr\").each(function() {\n\t\t\t \ttheanswers = new Array();\n\t\t\t\t q = $(this).find(\"th\").text();\n\t\t\t\t $(this).find(\"td\").each( function(index) {\n\t\t\t\t\t theseanswers = $(this).text().split(\"/\");\n\t\t\t\t\t for(var i in theseanswers) {\n\t\t\t\t\t\t\tfound = 0;\n\t\t\t\t\t\t\tfor(var j in theanswers) {\n\t\t\t\t\t\t\t if (theanswers[j] == theseanswers[i].replace(/^\\s+|\\r|\\n|\\s+$/g, '')) {\n\t\t\t\t\t\t\t\t\tfound = 1;\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!found) {\n\t\t\t\t\t\t\t theanswers.push(theseanswers[i].replace(/^\\s+|\\r|\\n|\\s+$/g, ''));\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\tquestion[$(this).find(\"th\").text()] = theanswers;\n\t\t\t\t});\n\t\t\t\tvar qs = new Array();\n\t\n\t\t\t\t//Create the HTML for each question and store it locally\n\t\t\t\tfor (key in question) {\n\t\t\t\t answers = \"<p>\"+key+\"</p>\";\n\t\t\t\t for (var i in question[key]) {\n\t\t\t\t\t\tanswers += \"<label><input type=\\\"checkbox\\\" value=\\\"1\\\"/> <span>\" + question[key][i] + \"</span></label> \";\n\t\t\t\t }\n\t\t\t\t qs.push(answers);\n\t\t\t\t}\n\t\n\t\t\t\t//Setup the HTML so the module will look right\n\t\t\t\t$(\"table.questions\").after(\"<div class=\\\"buttons\\\"><span class=\\\"startover\\\"><input type=\\\"button\\\" value=\\\"Start Over\\\"/></span><span class=\\\"next\\\"><input type=\\\"button\\\" value=\\\"Next\\\"/></span></div>\").fadeIn();\n\t\t\t\t$(\"table.questions\").hide().before(\"<div class=\\\"steps\\\">Step 1 of \" + qs.length + \"</div><div id=\\\"answers\\\">\" + qs[0] + \"</div>\");\n\t\t\t\t$(\"table.questions tfoot tr\").hide();\n\n\t\t\t\t$(\".startover\").hide();\n\t\t\n\t\t\t\tvar curview = 1;\n\n\t\t\t\t//On restart clear out all the data and set back to the begining\n\t\t\t\t$(\".startover input\").click(function() {\n\t\t \t\tcurview = 0;\n\t\t\t\t\t$(\"table.questions tbody tr td.green\").removeClass(\"green\");\n\t\t\t \t$(\"table.questions\").hide();\n\t\t\t \t//$(\"#answers\").html(\"<div/>\");\n\t\t\t \t$(\".next\").show();\n\t\t\t \t$(\".next input\").click();\n\t\t\t \t$(\".startover\").hide();\n\t\t\t });\n\n\n\t\t\t\t//When next is clicked either show the next question or show the results\n\t\t\t\t$(\".next input\").click(function() {\n\t\t\t \t//Go through all the inputs and set the appropriate ones to green\n\t\t\t \t$(\"#answers input:checked\").each( function() {\n\t\t\t\t\t\tanswercheck = $(this).parent().find(\"span\").text().replace(/^\\s+|\\r|\\n|\\s+$/g, '');\n\t\t\t\t\t\t$(\"table.questions tbody tr:eq(\"+(curview-1)+\") td\").each( function() {\n\t\t\t\t\t\t\tanswers = $(this).text().split(\"/\");\n\t\t\t\t\t\t\tfor (var i in answers) {\n\t\t\t\t\t\t\t\tif (answers[i].replace(/^\\s+|\\r|\\n|\\s+$/g, '') == answercheck) {\n\t\t\t\t\t\t\t\t $(this).addClass(\"green\");\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\n\t\t\t\t //Show the reset button if it isn't the first question\n\t\t\t \tif (curview >= 1) {\n\t\t\t\t \t\t$(\".startover\").fadeIn();\n\t\t\t \t}\n\n\t\t\t \t//If it is the last question\n\t\t\t \tif (curview == qs.length) {\n\t\t\t\t \t\t//Display the correct text and show the table.\n\t\t\t\t \t\t$(\"#answers\").fadeOut(\"slow\");\n\t\t\t\t \t\t$(\".next\").fadeOut();\n\t\t\t\t \t\t$(\".steps\").html(\"Complete\");\n\t\t\t\t \t\tvar numcols = $(\"table.questions tbody tr:first td\").length;\n\t\t\t\t \t\tvar counts = new Array();\n\t\t\t\t \t\tfor(i=0; i<numcols; i++) { counts[i]=0; }\n\n\t\t\t\t \t\t//count the winners for each column\n\t\t\t\t \t\t$(\"table.questions tbody tr\").each( function(index) {\n\t\t\t\t\t\t\tfor(i=0; i<numcols; i++) {\n\t\t\t\t\t\t\t counts[i] += $(this).find(\"td:eq(\"+i+\")\").hasClass(\"green\") ? 1 : 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t \t\twinners = new Array();\n\t\t\t\t \t\twinner = counts[0];\n\t\t\t\t \t\twinners[0] = 0;\n\t\t\t\t \t\t//Determine which column won\n\t\t\t\t \t\tfor(i=1; i<numcols; i++) {\n\t\t\t\t \t\tif (counts[i] > counts[i-1]) {\n\t\t\t\t\t \t\t\twinners = [];\n\t\t\t\t\t \t\t\twinners.push(i);\n\t\t\t\t\t \t\t\twinner = counts[i];\n\t\t\t\t \t\t} else if (counts[i] == winner) {\n\t\t\t\t\t \t\t\twinners[winners.length] = i;\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\tresults = \"\";\n\n\t\t\t\t \t\t//Create initial response based on how many answers there are\n\t\t\t\t \t\tif (winners.length > 1) {\n\t\t\t\t\t\t results = \"<p>Thank you for filling out the form. Based on the information you provided the following options will work for you: \";\n\t\t\t\t\t\t for(i=0; i<winners.length; i++) {\n\t\t\t\t\t\t\tif (i==1 && winners.length == 2) {\n\t\t\t\t\t\t\t results += \" and \";\n\t\t\t\t\t\t\t} else if (i>=1 && i!=winners.length-1) {\n\t\t\t\t\t\t\t results += \", \";\n\t\t\t\t\t\t\t} else if (i>1 && i==winners.length-1) {\n\t\t\t\t\t\t\t results += \", and \";\n\t\t\t\t\t \t\t\t}\n\t\t\t\t\t\t\tresults += \"<b>\"+ $(\"table.questions thead tr th:eq(\"+(winners[i]+1)+\")\").text() +\"</b>\";\n\t\t\t\t\t\t }\n\t\t\t\t\t\t results += \".</p>\";\n\t\t\t\t\t\t winnerslist = \"\";\n\t\t\t\t\t\t for(i=0; i<winners.length; i++) {\n\t\t\t\t\t\t\tif (i>0) { winnerslist += \", \"; }\n\t\t\t\t\t\t\twinnerslist += $(\"table.questions thead tr th:eq(\"+(i+1)+\")\").text();\n\t\t\t\t\t\t\tresults += \"<h2>\" + $(\"table.questions thead tr th:eq(\"+(i+1)+\")\").text() + \"</h2>\" + $(\"table.questions tfoot tr td:eq(\"+(i+1)+\")\").html();\n\t\t\t\t\t\t }\n\t\t\t\t\t\t pageTracker._trackEvent(\"Questionaire\", window.location, winnerslist);\n\t\t\t\t \t\t} else {\n\t\t\t\t\t\t results = \"<p>Thank you for filling out the form. Based on the information you provided the <b>\" + $(\"table.questions thead tr th:eq(\"+(winners[0]+1)+\")\").text() + \"</b> option works best for you.</p>\";\n\t\t\t\t\t\t results += \"<h2>\" + $(\"table.questions thead tr th:eq(\"+(winners[0]+1)+\")\").text() + \"</h2>\" + $(\"table.questions tfoot tr td:eq(\"+(winners[0]+1)+\")\").html();\n\t\t\t\t \t\t}\n\t\t\t\t \t\t$(\"#answers\").html(results).fadeIn();\n\t\t\t\t \t\t$(\"table.questions\").fadeIn();\n\t\t\t \t} else { //Change question\n\t\t\t\t \t\t$(\"#answers\").fadeOut(\"slow\", function() {\n\t\t\t\t\t \t$(this).html(qs[curview++]).fadeIn();\n\t\t\t\t\t\t});\n\t\t\t\t\t\t$(\".steps\").html(\"Step \" + (curview+1) + \" of \" + qs.length);\n\t\t\t\t\t}\n\t\t\t\t});\n \t\t}\n\t\t}", "function showQuizQuestions(questions, containerOfQuiz){\n let output = [];\n let answers;\n for(let i=0; i<questions.length; i++){\n // reset the list of answers\n answers = [];\n /* for each available answer, add a radio button for selection of only one answer (this will be \n removed via CSS and the whole label will be selectable by the user with stylings affecting the whole label) to show selection*/\n for(let letter in questions[i].answers){\n if (questions.hasOwnProperty(i)){\n answers.push(\n '<input type=\"radio\" id=\"'+ questions[i].answers[letter] +'\" name=\"question'+i+'\" value=\"'+letter+'\">' + '<label for=\"'+ questions[i].answers[letter] +'\">'+ questions[i].answers[letter] +'</label>'\n );\n }\n }\n // add questions and its answers to the quiz \n output.push(\n '<div class=\"question\"><h3 id=\"quiz-questions\">' +[i+1] + '. ' + questions[i].question + '</h3></div><br>' + '<div class=\"answers\">' + answers.join('') + '</div><br>'\n );\n }\n // combine question and it's answers into one string of html and put it on the page (for all 20 questions)\n containerOfQuiz.innerHTML = output.join('');\n }", "function renderResponseEntriesForExercise(tx,results){\n console.log(\"Rendering response entries of all students for exercise \" + exerciseID + \" of lesson \"+ lessonID + \" of teacher \" + teacherID);\n if (results.rows.length == 0) {\n console.log(\"No row found for the query in responseandmark table\");\n $(\"#studentListForEx\").html(\"<p>この練習はだれも答えてないです。</p>\");\n } else {\n var s = \"<table id='studentAndScores'><tr>\";\n console.log(\"Number of responses from students = \" + results.rows.length);\n \n dbShellStudents = window.openDatabase(\"StudentProfile\",2,\"StudentProfile\",1000000);\n \n //open student database\n //get info from StudentProfile database for student_id\n dbShellStudents.transaction(setupTable,dberrorhandler,function(){\n console.log(\"Getting student entries for exercise.\");\n\n dbShellStudents.transaction(\n function(tx){\n// console.log(\"teacher = \" + item.teacher_id + \"student=\" + item.student_id + \"lesson\" + item.lesson_id + \"exercise\" + item.exercise_id + \"response=\" + item.response);\n dbShellStudents.transaction(function(tx){\n for(var i=0; i<results.rows.length; i++) {\n //getting student info\n var student_ID = results.rows.item(i).student_id;\n var responseURI = results.rows.item(i).response;\n var scoreMark;\n if(results.rows.item(i).scoreMark == null)\n scoreMark = -1;\n var studentImageURI;\n var studentName;\n \n var item = results.rows.item(i);\n console.log(\"i=\"+i+\"id=\" + student_ID); //+ \"name=\" + studentName);\n (function(student_ID,scoreMark){\n tx.executeSql(\"select id,name,image from students where id=?\",[student_ID],\n function(tx,res){\n //studentID is unique\n studentImageURI = res.rows.item(0).image;\n studentName = res.rows.item(0).name;\n //\n //show student image, student name and score mark\n s = s +\n \"<div id ='responseFromStudent?id=\" + i + \"'>\"+\n \"<li>\" +\n \"<img height='40' width='40' src=\\\"\" + studentImageURI + \"\\\" ><br>\" +\n \"<p>\";\n \n if(scoreMark != -1){\n s += \"<p> スコアー:\" + scoreMark + \"</p>\";\n }\n \n s +=\"<a href='#response?studentID=\" + student_ID + \"&studentName=\" + studentName +\"'> 学生名:\" + studentName + \"</a>\" +\n \"</p><br>\";\n\n s +=\"</li>\"+\"</div>\";\n\n },\n function(err){\n console.log(\"Student info get Error: \"+err.message + \"\\nCode=\"+err.code);\n alert(\"Student info get Error: \"+err.message + \"\\nCode=\"+err.code);\n }\n );\n\n })(student_ID,scoreMark);\n }//end for\n }\n ,dberrorhandler,\n function(){\n s +=\"</tr>\"+\"</table>\";\n console.log(s);\n console.log(\"Showing the list\");\n $(\"#studentListForEx\").html(s);\n $(\"#studentListForEx\").listview().listview(\"refresh\");\n }\n );\n },\n dberrorhandler\n );\n \n });\n }\n}", "function viewEmployees() {\r\n connection.query(\"SELECT employee.first_name, employee.last_name, role.title, role.salary, department.name, CONCAT(e.first_name, ' ' ,e.last_name) AS Manager FROM employee INNER JOIN role on role.id = employee.role_id INNER JOIN department on department.id = role.department_id left join employee e on employee.manager_id = e.id;\", \r\n function(err, res) {\r\n if (err) throw err\r\n console.table(res)\r\n questions();\r\n })\r\n}", "function ansSelection(event){\n event.preventDefault();\n \n if(event.target.matches(\"li\")){\n userId = event.target.id;\n var userAns = arrQues[k].options[userId];\n if(typeof userId !== \"undefined\"){\n resultDisplay.textContent = \"\";\n \n if(userAns === arrQues[k].a){ \n resultDisplay.textContent = \"Hurray Correct!!\"\n resultDisplay.setAttribute(\"style\", \"background-color:green; margin: 8px; width:150px; font-size: 20px;\");\n \n score = score+10; \n }else{ \n resultDisplay.textContent = \"Oops Wrong!!\"\n resultDisplay.setAttribute(\"style\", \"background-color:red; margin: 8px; width:150px; font-size: 20px;\"); totalSeconds = totalSeconds - 10;\n \n }\n k++;\n \n }\n \n // StartQuiz is being called to display successive questions\n startQuiz();\n if(liCount === arrQues.length){\n showResults();\n }\n liCount++;\n \n } \n}", "function checkAnswer(ev) {\n let currentAnswer = ev.currentTarget.getAttribute('data-answer');\n // Store what answer the user chose in an array\n userAnswers.push(currentAnswer);\n // If the chosen answer is correct increase the score\n if(questionList[questionIndex].answer === currentAnswer) {\n score++;\n }\n // Raise questionIndex if it's not already the last question, if thats the case show the score\n if(questionIndex < questionList.length - 1) {\n questionIndex++;\n clearInterval(questionTimer);\n displayNewQuestion(questionIndex);\n } else {\n clearInterval(questionTimer);\n showResults();\n }\n}", "function displayAnswer(answers) {\n var rows = [];\n answers.forEach(answer => {\n var my_answer = \"postedBy: \" + answer.user_id + \"<br><p>\" + answer.answer_body + \"</p><br>\"\n + \"<span id='actions_\" + answer.answer_id + \"'></span><br/><hr/>\";\n rows.push(my_answer);\n\n });\n rows.push(\"<span id='textarea_display'></span>\");\n document.getElementById('answers').innerHTML = rows.join('');\n showAnswerActions(answers);\n}", "function displayEmployeeByManager(answers) {\n return connection.query(`SELECT * FROM (${viewCommand}) AS employee_combined WHERE Manager = ?`, answers.manager);\n}", "function quesIdentifiesStudent(ques) \n { \n if (ques.indexOf('first') != -1)\n {\n return true;\n }\n else if (ques.indexOf('last') != -1)\n {\n return true;\n }\n else if (ques.indexOf('name') != -1)\n {\n return true;\n }\n \n else if (ques == 'id')\n {\n return true;\n }\n \n var id_index = ques.indexOf('id');\n if (id_index != -1)\n {\n if (id_index > 0)\n {\n if (ques[id_index-1] == ' ')\n {\n // e.g. \"student id\"\n return true;\n }\n }\n } \n else if (ques.indexOf('id:') != -1)\n {\n // e.g. student id:\n return true;\n }\n else if (ques.indexOf('identity') != -1)\n {\n return true;\n }\n else if (ques.indexOf('identifier') != -1)\n {\n return true;\n }\n else if (ques.indexOf('class') != -1)\n {\n return true;\n }\n else if (ques.indexOf('section') != -1)\n {\n return true;\n }\n else if (ques.indexOf('period') != -1)\n {\n return true;\n }\n else if (ques.indexOf('room') != -1)\n {\n return true;\n }\n else if (ques.indexOf('student') != -1)\n {\n return true;\n }\n else if (ques.indexOf('teacher') != -1)\n {\n return true;\n }\n else if (ques.indexOf('email') != -1)\n {\n return true;\n }\n else if (ques.indexOf('e-mail') != -1)\n {\n return true;\n }\n \n // spanish\n else if (ques.indexOf('correo') != -1)\n {\n return true;\n }\n \n return false;\n }", "isAnswerCorrect (index) { return this.answers[index].isCorrect; }", "function checkAnswer() {\r\n STORE.view = 'feedback';\r\n let userSelectedAnswer = STORE.userAnswer;\r\n let correctAnswer = STORE.questions[STORE.questionNumber].correctAnswer;\r\n console.log('Checking answer...');\r\n if (userSelectedAnswer == correctAnswer) {\r\n STORE.score++;\r\n STORE.correctAnswer = true;\r\n }\r\n else {\r\n STORE.correctAnswer = false;\r\n }\r\n}", "function onClickAnswer(userAnswer) {\n if (formData[`answer${taskStep}`] === userAnswer) {\n setAnswerState('correct');\n setScore(score + 1);\n setTotalPossibleScore(totalPossibleScore + 1);\n } else {\n setAnswerState('incorrect');\n setTotalPossibleScore(totalPossibleScore + 1);\n }\n }", "function calculateMarks(answer) {\n var isCorrect = false;\n answerByStudent[currentQuestion] = answer;\n for ( var i = 0; i < questionAnswersOptions.length; i++) {\n if ( i === currentQuestion-1 && questionAnswersOptions[i].answerIndex === answer) {\n isCorrect = true;\n totalMarks += 1;\n }\n }\n}", "function displayQuestion() {\n\t\t\tstartTime30();\t\n\t\t\t$(\"#question\").html(eachone[count].question);\n\t\t\t$(\"#option1\").html(eachone[count].option1.answer);\n\t\t\t$(\"#option2\").html(eachone[count].option2.answer);\n\t\t\t$(\"#option3\").html(eachone[count].option3.answer);\n\t\t\t$(\"#option4\").html(eachone[count].option4.answer);\n\t\t\t$(\"#okButton\").html(\"\");\n\t\t}", "function checkAnswers() {\n if (userSelection == quizBank[questionCounter].correctAnswer) {\n score++;\n secondsLeft += 10;\n } else {\n secondsLeft -= 10;\n }\n questionCounter++;\n showQuestions();\n}", "function showResult(total) {\n quizContainer.innerHTML = '';\n $('#submitQuiz').hide();\n var remark = '';\n if(total <= 4) {\n remark = 'Better Luck Next Time!';\n } else if (total >= 5 && total <= 7) {\n remark = 'Well Done!';\n } else {\n remark = 'Excellent!';\n }\n resultContainer.innerHTML = `<p><span>${remark}</span> You scored ${total} out of 10.<h4>Play Again!</h4>`;\n saveUserResults(total);\n }", "function gradeQuiz() {\n var usersArray = makeUserArray();\n scoreQuiz(usersArray);\n colorAnswers(usersArray);\n}", "function show(index){\n //simple function to show the quiz according to the choice of user\n Quizfact.getbyid(index); //Get the data by category of quiz\n\n\n}", "function showResults(answer) {\n if (answer === questions[questionIndex].answer) {\n resultsEl.textContent = \"Correct!\";\n count++;\n } else {\n resultsEl.textContent = \"Incorrect!\";\n time = time - 5;\n timerEl.textContent = time;\n }\n setTimeout(nextQuestion, 1000);\n}", "function checkAnswers() {\n var correctAnswer = 0;\n var incorrectAnswer = 0;\n var noAnswer = 0;\n var arr = $(\".triviaQuestions\");\n for (var i = 0; i < arr.length; i++) {\n var questionDiv = $(arr[i]);\n var answer = questionDiv.find(\"input\").filter(\":checked\");\n if (answer.length != 1) {\n noAnswer++;\n }\n else {\n var isCorrect = $(answer[0]).data(\"answer\");\n if (isCorrect === true) {\n correctAnswer++;\n }\n else {\n incorrectAnswer++;\n }\n }\n }\n\n //print answer scores\n $(\"#correctAnswers\").text(correctAnswer);\n $(\"#incorrectAnswers\").text(incorrectAnswer);\n $(\"#noAnswers\").text(noAnswer);\n\n //hide start, questions, and timer on final score screen\n $(\"#start\").hide();\n $(\"#questions\").hide();\n $(\"#trackTime\").hide();\n\n //show score on final screen\n $(\"#score\").show();\n}", "function finalResultsView(score, totalAnswers, incorrectAnswers, correctedAnswers, incorrectAnswerValues, correctedAnswerValues, incorrectQuestionNumbers){\n \n var uq = document.getElementById('userQuiz');\n document.getElementById('userForm').remove();\n \n var h1 = document.createElement('h1');\n var tn = document.createTextNode('Your Final Score Is: ' + score + \" out of \" + totalAnswers);\n h1.appendChild(tn);\n uq.appendChild(h1);\n\n addDetailsToRv(uq, incorrectAnswers, incorrectQuestionNumbers, incorrectAnswerValues, correctedAnswerValues);\n addBtnToRv(uq);\n \n}", "function showAbsenceDetails(nr) {\nif (nr != undefined) {\nelementToCheck = nr;\t\n} else {\nelementToCheck = activeElement;\n}\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == elementToCheck);\n//console.log(activeDataSet);\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSet['ende'])+'</b>';\t\n} else {\ncontent += \" am <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b>\";\t\n}\nanzeige = \"\";\nif (activeDataSet['adminMeldung'] != 0) {\nanzeige = \"Eintrag Sekretariat am: <b>\" + formatDateDot(activeDataSet['adminMeldungDatum'])+'</b><br/>';\t\n}\nif (activeDataSet['lehrerMeldung'] != \"0\") {\n\tif (teacherUser ==1) {\n\taddInfo = activeDataSet['lehrerMeldung'] + \"<b> (\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+')</b><br/>';\t\n\t} else {\n\taddInfo = \"Eintrag Lehrkraft<b> (\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+')</b><br/>';\t\n\t}\n\tanzeige += addInfo;\t\n}\nif (activeDataSet['elternMeldung'] != \"0\") {\nanzeige += \"Eintrag Eltern am: <b>\" + formatDateDot(activeDataSet['elternMeldungDatum'])+'</b>';\t\n}\nif (activeDataSet['kommentar'] != \"\") {\nanzeige += \"<br/>Kommentar: <b>\" + activeDataSet['kommentar']+'</b>';\t\n}\nif (activeDataSet['entschuldigt'] != \"0000-00-00\") {\nanzeige += \"Entschuldigung am: <b>\" + formatDateDot(activeDataSet['entschuldigt'])+'</b>';\t\n}\ncontent += '<br/>' + anzeige;\n\nreturn content;\t\n}", "function userAnswered(value) {\n // Check if question was answered correctly\n if (value === currentQuestion.rightAnswer) {\n // Increase number of right answers\n numberOfRightAnswers += 1;\n // Increase current question\n currentQuestionNumber += 1;\n // Present next question\n nextQuestion();\n }else{\n endQuiz();\n }\n\n}", "function showQuiz(id)\r\n{\r\n\t// fill id=quizdata with selected quiz and show it\r\n\t// qtitle quiz_details, quizdata\r\n\tconsole.log('view quiz_id:'+id);\r\n\tvar quiz= $.grep(quizList, function(elem, indx){\r\n return elem.quiz_id == id; }\r\n\t);\r\n\tconsole.log('quiz:', quiz);\r\n\tquests=quiz[0].questions;\r\n\t//console.log('quests keys:',Object.keys(quests));\r\n\tconsole.log('quests:',quests);\r\n\t//properties of quiz, title, q_count, points, id?\r\n\t$('#qtitle').text(quiz[0].title+' Points: '+quiz[0].points_possible);\r\n\t//var details = 'Points: '+quiz[0].points_possible;\r\n\t//$('#quiz_details').html(details);\r\n\t\r\n\t// show the quiz questions in modal when clicked?\r\n\t// needs 2 columns or ?\r\n\t$('#quizselectable').empty();\r\n\tvar i=0;\r\n\tfor(var obj in quests)\r\n\t{\r\n\t\tvar txt = quests[i].text;//$.parseHTML(quests[i].text);//[object Text]\r\n\t\t$('#quizselectable').append('<li class=\"ui-widget-content\" data-id=\"'+quests[i][\"question_id\"]+'\">'+txt+'</li>');\r\n\t\ti+=1;// select by question_id\r\n\t}\r\n\t\r\n\t//http://api.jqueryui.com/1.12/selectable/#entry-examples\r\n\tclose_accordion_section();\r\n\t$('#accordion-2').addClass('active');\r\n\t// Open up the hidden content panel\r\n\t$('.accordion #accordion-2').slideDown(300).addClass('open');\r\n\t// select btn chooses this quiz for game\r\n}", "function showCorrectAnswer(){\n $(\"#answer\").removeClass('d-none');\n $(\"#answer\").show();\n console.log(\"Show correct answer\"+ansBank[index]);\n $(\"#answer\").append(\"<p>Correct answer is \" +ansBank[index]+\"</p>\");\n \n }", "function showResults() {\n // variables\n var table, tBody, row, cellDomain, cellRank, cellExplain, i;\n // change the div on display\n document.getElementById('questions').style.display = 'none';\n document.getElementById('rubric').style.display = 'block';\n\n // get the table\n table = document.getElementById('table');\n // create the <tbody>\n tBody = document.createElement(\"tbody\");\n\n // create the cells\n for (i = 0; i < DOMAINS.length; i++) {\n // the row\n row = document.createElement(\"tr\");\n // domain cell\n cellDomain = document.createElement(\"td\");\n cellDomain.appendChild(document.createTextNode(DOMAINS[i]));\n row.appendChild(cellDomain);\n // rank cell\n cellRank = document.createElement(\"td\");\n cellRank.className = \"rank\";\n cellRank.appendChild(document.createTextNode((score[i] + 1) + \"/\" + (QUESTIONS[i].length + 1)));\n row.appendChild(cellRank);\n // explanation cell\n var cellExplain = document.createElement(\"td\");\n if (flagTerminateDomain && score[i] == 2) {\n // \"Skill Communication\" special text\n cellExplain.appendChild(document.createTextNode(STATEMENT_SKILLED_COM_ALT));\n } else {\n // usual text\n cellExplain.appendChild(document.createTextNode(STATEMENTS[i][score[i]]));\n }\n row.appendChild(cellExplain);\n // add the row to the table\n tBody.appendChild(row);\n }\n table.appendChild(tBody);\n}", "function showQuizzes() {\n /* put 1/3 in each column inc to count, reset : inc colm */\n var count = Math.ceil(quizList.length/3);\n var col=0;\n var row=0;\n for (var i=0; i<quizList.length; i++) {\n content = '<div id='+quizList[i].quiz_id+' class=\"alert alert-info\">';// blue\n content += quizList[i].title;\n content += ': total questions: '+quizList[i].questions.length;//.question_count;\n //content += ' worth: '+quizList[i].points_possible;\n content += '</div>';\n $('#col_'+col).append(content);\n row++;\n if (row==count) { row=0; col++; }\n }\n //click quiz to view questions\n $('.alert').on('click', function(e) {\n e.preventDefault();\n selectedQuiz=e.target.id;// quiz_id\n orchidConfig.quiz_id = selectedQuiz;\n \n showQuizQuestions(selectedQuiz);\n });\n }", "function viewRoles() {\r\n var query = 'SELECT * FROM role';\r\n connection.query(\"SELECT employee.first_name, employee.last_name, role.title AS Title FROM employee JOIN role ON employee.role_id = role.id;\", \r\n function(err, res) {\r\n if (err) throw err\r\n console.table(res)\r\n questions();\r\n })\r\n}", "function checkPaperAnswers(email,qp_id,questions,testNameQP)\n{\n\tvar userOptions;\n\t$(\"#ajaxPageLoader\").show();\n\t$.get(\"viewPaperStudent/\"+questions, function(data)\n\t\t\t{\n\t\t\n\t\t$.get(\"userMOptions/\"+email+\"/\"+qp_id, function(d){\n\t\t\t\n\t\t\tconsole.log(d);\n\t\t\tuserOptions=d.split(\",\");\n\t\t\tconsole.log(userOptions.length+\" \"+data['questionsList'].length);\n\t\n\t\t\t\n\tvar st=\"<p class='testNameOfQPs'><span class='testNameTextHead'>Test Name : </span>\"+testNameQP+\"</p>\";\n\tconsole.log(questions);\n\tvar e=document.getElementById(\"resultStats\");\n\t\n\tvar t;var count=1;\n\tfor(var i=0;i<data['questionsList'].length;i++)\n\t{\n\t t=data['questionsList'][i];\n\t \n\tst=st+\"<div class='row'>\" +\n\t\t\t\"<div class='col-md-12'>\" +\n\t\t\t\"<span style='color:red;'>Question No : </span><span style='color:green'>\"+count+\"</span>\" +\n\t\t\t\"</div></div>\" +\n\t\t\t\"<div class='row'>\" +\n\t\t\t\"<div class='col-md-12'> <strong><pre>\"+t.question+\"</pre></strong></div></div>\" +\n\t\t\t\"<div class='row'>\" +\n\t\t\t\"<div class='col-sm-2'> A) \"+t.optionA+\"</div>\"+\"<div class='col-sm-2'> B) \"+t.optionB+\"</div>\" +\n\t\t\t\"<div class='col-sm-2'> C) \"+t.optionC+\"</div><div class='col-sm-2'> D) \"+t.optionD+\"</div><div class='col-sm-4'> E) \"+t.optionE+\"</div></div>\" +\n\t\t\t\"<div class='row'>\" +\n\t\t\t\"<div class='col-sm-4'><small> Key : </small><i><strong>\"+t.qkey+\"</i></strong></div>\" +\n\t\t\t\"<div class='col-sm-4'><small>Your Answer : </small><i><strong>\"+userOptions[i+1]+\"</i></strong></div>\" +\n\t\t\t\"<div class='col-sm-4'><small>Difficulty : </small><i><strong>\"+t.difficulty+\"</i></strong></div>\" +\n\t\t\t\"</div><div class='row'>Explanation:<br> <pre>\"+t.explanation+\"</pre></div>\"+\n\t\t\t\"<div class='row'>Google Help:<br> <a href='https://www.google.co.in/search?q=\"+t.question+\"' target='_blank'>Ask <i style='color:green' class='fa fa-google' aria-hidden='true'></i></a></div>\";\n\tcount+=1;\n\t}\n\te.innerHTML=st;\n\t$(\"#ajaxPageLoader\").hide();\n\t\t});\n\t\t\t});\n\t\n\t\n\t}", "function displayQuestions() {\n\n if (textcompletionquestions[questioncounter].correctanswer2) {\n $(\"#D\").hide();\n $(\"#E\").hide();\n $(\"#Dradio\").hide();\n $(\"#Eradio\").hide();\n }\n else{\n $(\"#D\").show();\n $(\"#E\").show();\n $(\"#Dradio\").show();\n $(\"#Eradio\").show()\n \n }\n\n $(\"#practice-question\").text(textcompletionquestions[questioncounter].question)\n $(\"#A\").text(textcompletionquestions[questioncounter].correctanswer1);\n $(\"#Aradio\").val(textcompletionquestions[questioncounter].correctanswer1);\n $(\"#B\").text(textcompletionquestions[questioncounter].wronganswerA1);\n $(\"#Bradio\").val(textcompletionquestions[questioncounter].wronganswerA1);\n $(\"#C\").text(textcompletionquestions[questioncounter].wronganswerB1);\n $(\"#Cradio\").val(textcompletionquestions[questioncounter].wronganswerB1);\n $(\"#D\").text(textcompletionquestions[questioncounter].wronganswerC1);\n $(\"#Dradio\").val(textcompletionquestions[questioncounter].wronganswerC1);\n $(\"#E\").text(textcompletionquestions[questioncounter].wronganswerD1);\n $(\"#Eradio\").val(textcompletionquestions[questioncounter].wronganswerD1);\n\n if (textcompletionquestions[questioncounter].correctanswer2) {\n $(\"#second-question-set\").show();\n $(\"#A2\").text(textcompletionquestions[questioncounter].correctanswer2);\n $(\"#A2radio\").val(textcompletionquestions[questioncounter].correctanswer2);\n $(\"#B2\").text(textcompletionquestions[questioncounter].wronganswerA2);\n $(\"#B2radio\").val(textcompletionquestions[questioncounter].wronganswerA2);\n $(\"#C2\").text(textcompletionquestions[questioncounter].wronganswerB2);\n $(\"#C2radio\").val(textcompletionquestions[questioncounter].wronganswerB2);\n }\n else{\n $(\"#second-question-set\").hide();\n }\n\n if (textcompletionquestions[questioncounter].correctanswer3) {\n $(\"#third-question-set\").show();\n $(\"#A3\").text(textcompletionquestions[questioncounter].correctanswer3);\n $(\"#A3radio\").val(textcompletionquestions[questioncounter].correctanswer3);\n $(\"#B3\").text(textcompletionquestions[questioncounter].wronganswerA3);\n $(\"#B3radio\").val(textcompletionquestions[questioncounter].wronganswerA3);\n $(\"#C3\").text(textcompletionquestions[questioncounter].wronganswerB3);\n $(\"#C3radio\").val(textcompletionquestions[questioncounter].wronganswerB3);\n }\n else{\n $(\"#third-question-set\").hide();\n }\n questioncounter=questioncounter+1;\n \n }", "function displayScore() {\n var score = $('<p>',{id: 'question'});\n \n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n\n var numIncorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].wrongAnswer) {\n numIncorrect++;\n }\n }\n \n score.append('Correct Answers:' + numCorrect);\n score.append('Incorrect Answers:' + numInorrect);\n \n \n }", "function showQuestion() {\n if (questionCount === questionsObj.length) {\n stop();\n }\n else {\n $(\"#question\").html(questionsObj[questionCount].question);\n $(\"#answer1\").html(questionsObj[questionCount].choices[0]);\n $(\"#answer2\").html(questionsObj[questionCount].choices[1]);\n $(\"#answer3\").html(questionsObj[questionCount].choices[2]);\n $(\"#answer4\").html(questionsObj[questionCount].choices[3]);\n questionTime = 5;\n }\n }", "function displayAnswer(event) {\n //showing answer corresponding to the question\n if (count1===count2+1){\n document.getElementById(\"answer\").innerHTML = questions[count2%3].answer;\n count2=count1;\n }\n //asking the user to click the question button first\n else {\n document.getElementById(\"answer\").innerHTML = \"Please click the question first.\";\n count2=count1;\n }\n}", "function loadStudentExamData(name, code) {\n document.getElementById('examSpecific').style.display = \"none\";\n document.getElementById('student-exam-data').style.display = \"initial\";\n document.body.style.backgroundImage = \"none\";\n var answer = \"\";\n var finalId;\n\n //linear-gradient(135deg, rgb(245, 247, 250) 0%, rgb(195, 207, 226) 100%);\n\n var table = document.getElementsByClassName('table');\n for(var i = 0; i < table.length; i++) {\n table[i].style.display = \"none\";\n }\n\n firebase.database().ref(\"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem(\"className\") + \"/Students\").once('value', function(snapshot) {\n for(var info in snapshot.val()) {\n var data = snapshot.val()[info];\n var id = data.split(\";\")[0];\n var fullName = data.split(\";\")[1];\n\n if(name == fullName) {\n finalId = id;\n }\n }\n });\n\n firebase.database().ref(\"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem(\"className\") + \"/Exams/\" + code).once('value', function(snapshot) {\n var data = (snapshot.val().responses[name][Object.keys(snapshot.val().responses[name])[0]]);\n\n document.getElementById('resetStatus').onclick = function() {\n for(var takenKey in snapshot.val().taken) {\n var id = (snapshot.val().taken[takenKey]);\n\n if(id == finalId) {\n firebase.database().ref(\"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem(\"className\") + \"/Exams/\" + code + \"/taken/\").child(takenKey).remove()\n }\n }\n\n swal(\"Success!\", name + \"'s taken status has been reset. \" + name + \" should be able to retake exam now.\", 'success')\n }\n\n var studentPoints = data.totalScore / 100 * snapshot.val()[Object.keys(snapshot.val())[0]].examTotalPoints;\n document.getElementById('score-num').innerHTML = (studentPoints).toFixed(0) + \" / \" + snapshot.val()[Object.keys(snapshot.val())[0]].examTotalPoints;\n document.getElementById('score').innerHTML = data.totalScore + \"%\";\n\n var corrAnswer = \"\";\n sessionStorage.setItem(\"totalPointsExcludingFr\", 0);\n\n for(var i = 0; i < Object.keys(data.answers).length; i++) {\n\n if(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].type == \"tf\") {\n corrAnswer = snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].choices[0];\n }\n else if(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].type == \"mc\"){\n corrAnswer = snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].checked;\n }\n else if(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].type == \"fr\") {\n corrAnswer = \"\";\n }\n createGradedQuestion(\n // PARAM: studAnswer\n data.answers[i].split(\";\")[1],\n // PARAM: corrAnswer\n corrAnswer,\n // PARAM: numAnswerChoices\n Object.keys(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].choices).length,\n // PARAM: numPoints\n snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].points,\n // PARAM: questions\n snapshot.val()[Object.keys(snapshot.val())[0]].questions[i],\n // PARAM: studName\n name,\n // PARAM: examCurrentCode\n code,\n // PARAM: examTotalPoints\n snapshot.val()[Object.keys(snapshot.val())[0]].examTotalPoints\n );\n }\n });\n}", "function viewByRole() {\n connection.query(\"SELECT first_name, last_name, role.title FROM((employee INNER JOIN role ON role_id = role.id) INNER JOIN department ON department_id = department.id);\", function (err, res) {\n if (err) throw err;\n console.log(\"\\n All employees retrieved from database by role. \\n\");\n console.table(res);\n askQuestions();\n });\n}", "function selectQuestions(userId, page, resultsPerPage, minDiff, minAns, callback) {\n\t// takes a paged list of Relations\n\tRelationFacade.pagedList(page, resultsPerPage, function (err, relations) {\n\t\tif (err || relations.length == 0) {\n\t\t\t// If there are no relations left ends the stack of recursion with an error.\n\t\t\t// This means that no phrases are left for that user to evaluate.\n\t\t\t//console.log(\"relations.length == 0 is true, callback\")\n\t\t\tcallback(err, []);\n\t\t}\n\t\telse {\n\t\t\t// For each Relation obtained check if there are phrases to show.\n\t\t\trelations.every(function (relation, index, relationsRef) {\n\t\t\t\t// Phrases to show will be stored in this array, reinitialized for each Relation.\n\t\t\t\tvar phrasesForUser = [];\n\t\t\t\t// Gets all the phrases by Relation.Name.\n\t\t\t\tPhraseFacade.listByRelationNameAndUserNotPresent(relation.Name, userId, function (err, phrases) {\n\t\t\t\t\t// For each Phrase checks if it has consensus and if the given user has already evalued it.\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\t//console.log(\"err on phrases, callback\")\n\t\t\t\t\t\t// If there are no phrases in DB for this relation\n\t\t\t\t\t\tcallback(err, []);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\telse if (phrases.length == 0 && index == relationsRef.length - 1) {\n\t\t\t\t\t\t// If this is the last iteration on relation and the db returned an empty list (user has already answered to that relation)\n\t\t\t\t\t\tselectQuestions(userId, ++page, resultsPerPage, minDiff, minAns, callback);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tphrases.every(function (phrase, i, phrasesRef) {\n\t\t\t\t\t\t\thasConsensus(minDiff, minAns, phrase, function (phraseHasConsensus) {\n\t\t\t\t\t\t\t\t// If user has not evalued it AND Phrase doesn't have consensus, adds it to phrasesForUser\n\t\t\t\t\t\t\t\tif (!phraseHasConsensus)\n\t\t\t\t\t\t\t\t\tphrasesForUser.push(phrase);\n\t\t\t\t\t\t\t\t// If this is the last iteration of the inner loop and we have results then \n\t\t\t\t\t\t\t\t// calls the callback and ends the recursion.\n\t\t\t\t\t\t\t\tif (i == phrasesRef.length - 1 && phrasesForUser.length != 0) {\n\t\t\t\t\t\t\t\t\tif (!hasCalled) {\n\t\t\t\t\t\t\t\t\t\t//console.log(\"phrases found, callback\")\n\t\t\t\t\t\t\t\t\t\tcallback(0, phrasesForUser);\n\t\t\t\t\t\t\t\t\t\thasCalled = true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// If this is the last iteration of both loops then recursively call selectQuestions on next page\n\t\t\t\t\t\t\t\tif (i == phrasesRef.length - 1 && index == relationsRef.length - 1 && phrasesForUser.length == 0)\n\t\t\t\t\t\t\t\t\tselectQuestions(userId, ++page, resultsPerPage, minDiff, minAns, callback);\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t// else continue looping on phrases\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t// If phrasesForUser has obtained stuff from at least 1 phrase then exit the loop on relations\n\t\t\t\tif (phrasesForUser.length != 0) return false;\n\t\t\t\t// else continue looping on relations\n\t\t\t\telse return true;\n\t\t\t});\n\t\t}\n\t});\n}", "function submitPage(){\n $scope.beginExamClicked = true;\n var testFinishTime=new Date();\n var totalAttempted= 0,totalCorrect=0;\n var questionStatsList=[];\n var questionStats={};\n for(var j=0; j<$rootScope.questions.length;j++){\n \tquestionStats={};\n \tquestionStats.examId=$rootScope.currentExam.examSetId;\n \tquestionStats.userId=$scope.userId;\n \tquestionStats.examDate=getDateTime();\n \tquestionStats.attemptNo=$rootScope.currentExam.currentAttempt;\n\n \tquestionStats.moduleName=getModuleName(j);\n \tquestionStats.questionId=\"question_\"+j;\n \tquestionStats.isCorrect='N';\n \tquestionStats.userAnswer=$rootScope.questions[j].user_selected_option;\n \tquestionStats.correctAnswer=$rootScope.questions[j].correct_option;\n \tquestionStats.score=0;\n \tquestionStats.timeTaken=\"00:00:00\";\n\n if($rootScope.questions[j].user_selected_option!='-1'){\n totalAttempted++;\n if($rootScope.questions[j].user_selected_option==$rootScope.questions[j].correct_option){\n totalCorrect++;\n questionStats.isCorrect='Y';\n questionStats.score=$rootScope.currentExam.correctMarks;\n }else{\n \tif($rootScope.currentExam.isNegativeMarks){\n \t\tquestionStats.score=$rootScope.currentExam.negativeMarks;\n \t}\n }\n questionStats.timeTaken=$rootScope.questions[j].timeTaken;\n }\n\n questionStatsList.push(questionStats);\n }\n $rootScope.currentExam.total_questions_attempted=totalAttempted;\n $rootScope.currentExam.total_questions_correct=totalCorrect;\n\n if($rootScope.currentExam.is_negative_marks_applicable){\n \t$rootScope.currentExam.score_obtained=totalCorrect*$rootScope.currentExam.correct_marks-(totalAttempted-totalCorrect)*$rootScope.currentExam.negativeMarks;\n \t}else{\n \t\t$rootScope.currentExam.score_obtained=totalCorrect*$rootScope.currentExam.correctMarks;\n \t}\n $rootScope.currentExam.total_time_taken=findTimeDifference(testStartTime,testFinishTime);\n\n //update modal & save in DB\n saveExamStats(questionStatsList);\n }", "function checkAnswer(answer){\r\n correct = myQuestions[questionIndex].correctAnswer;\r\n\r\n //on correct answer for question that is not final question, takes user to next question\r\n if (answer === correct && questionIndex !== finalQuestion){\r\n score++;\r\n questionIndex++;\r\n displayQuestion();\r\n \r\n // on incorrect answer that is not final question, removes 5 seconds from timer \r\n }else if (answer !== correct && questionIndex !== finalQuestion){\r\n questionIndex++;\r\n displayQuestion();\r\n timeLeft -=5; // takes 5 seconds off of timer for incorrect answer\r\n \r\n // after last question, displays the user's score\r\n }else{\r\n displayScore();\r\n }\r\n}", "function showQuestion() {\n // quiz questions along with possible answers\n questionEl.innerHTML = questions[currentQuesIndex].question;\n answerA.innerHTML = questions[currentQuesIndex].choiceA;\n answerB.innerHTML = questions[currentQuesIndex].choiceB;\n answerC.innerHTML = questions[currentQuesIndex].choiceC;\n\n}", "function displayQuestions() {\n let q = triviaQuestions[questionCount];\n \n question.innerHTML = \"<p>\"+ q.question +\"</p>\";\n choice1.innerHTML = q.choice1;\n choice2.innerHTML = q.choice2;\n choice3.innerHTML = q.choice3;\n choice4.innerHTML = q.choice4;\n\n //Ends the quiz after the questions are finished and displays results\n if (questionCount > 9) {\n alert(\"The quiz is now over. Let's see your results.\");\n stopTimer();\n $(\"#timer\").hide();\n $(\"#trivia\").hide();\n showResults(); \n } \n }", "function getAnswers() {\n let questionAnswers = document.querySelectorAll('.answer');\n for (let i = 0; i < questionAnswers.length; i++) {\n answerSelection(questionAnswers[i]);\n }\n localStorage.setItem(\"userAnswers\", JSON.stringify(masterProfileObject))\n}", "function displayAnswer(userLevel) { \n \n // fades out previous answer on q2 and above, and then hides their shell\n if (userLevel > 0) {\n appear(answerBox[userLevel - 1], 100, -10, 50)\n setTimeout (function(){\n answerBox[userLevel - 1].style.display = \"none\";\n }, 600)\n answerBox[userLevel].style.display = \"block\";\n }\n // fades in answer after 4 seconds\n setTimeout(function() { \n appear(answerBox[userLevel], 0, 10, 50)\n }, 4000)\n }", "function keepingScore() {\n\n var userAnswer1 = $(\"input[name='answer1']:checked\").val();\n var userAnswer2 = $(\"input[name='answer2']:checked\").val();\n var userAnswer3 = $(\"input[name='answer3']:checked\").val();\n var userAnswer4 = $(\"input[name='answer4']:checked\").val();\n var userAnswer5 = $(\"input[name='answer5']:checked\").val();\n var userAnswer6 = $(\"input[name='answer6']:checked\").val();\n var userAnswer7 = $(\"input[name='answer7']:checked\").val();\n\n // Q1\n if (userAnswer1 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer1 == questions[0].answer) {\n\n correctAnswers++;\n }\n else {\n\n wrongAnswers++;\n }\n\n // Q2\n if (userAnswer2 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer2 == questions[1].answer) {\n\n correctAnswers++;\n }\n else {\n\n wrongAnswers++;\n }\n\n // Q3\n if (userAnswer3 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer3 == questions[2].answer) {\n\n correctAnswers++;\n }\n else {\n\n wrongAnswers++;\n }\n\n // Q4\n if (userAnswer4 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer4 == questions[3].answer) {\n\n correctAnswers++;\n }\n else {\n\n wrongAnswers++;\n }\n\n // Q5\n if (userAnswer5 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer5 == questions[4].answer) {\n\n correctAnswers++;\n }\n else {\n\n wrongAnswers++;\n }\n\n // Q6\n if (userAnswer6 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer6 == questions[5].answer) {\n\n correctAnswers++;\n }\n else {\n\n wrongAnswers++;\n }\n\n // Q7\n if (userAnswer7 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer7 == questions[6].answer) {\n\n correctAnswers++;\n }\n else {\n\n wrongAnswers++;\n } \n\n}", "function displayQuestions() {\n //gets the current question from global variable currentQuestion\n // display a question\n currentQuestion++;\n $(\".questions\").text(triviaQuestions[currentQuestion].questions);\n }", "function trackAnswers (correctAnswer, questionSet, selectedAnswer) {\n\n // mark question as answered\n questionSet.answered = true;\n\n if (correctAnswer){\n questionSet.correct = true;\n }\n else {\n questionSet.correct = false;\n }\n\n}", "function showSetsByUser(user) {\n\t\tif(user > 0) {\n\t\t\tjQuery(\".saved-set-listing\").css(\"display\",\"none\");\n\t\t\tjQuery(\".user-\" + user).css(\"display\",\"inline\");\t\n\t\t} else {\n\t\t\tjQuery(\".saved-set-listing\").css(\"display\",\"inline\");\n\t\t}\n\t}", "function makeAnswerPage(index, userAns) {\n\tclearTimeout(sessionTime);\n\tclearInterval(intervalID);\n\tif (userAns == questions[index].correct) {\n\t\tnumCorrect++;\n\t\tansCorrect = true;\n\t}\n\telse {\n\t\tnumWrong++;\n\t\tansCorrect = false;\n\t}\n\tpartialClear();\n\tvar correctness = $(\"<h2>\");\n\tvar ansHeading = $(\"<h3>\");\n\tvar expDisplay = $(\"<p>\");\n\tvar answer = $(\"<p>\");\n\tvar c = questions[index].correct;\n\tif (userAns == null) {\n\t\tcorrectness.text(\"TIME'S UP!!!\");\n\t\t$(\"#questDiv\").append(correctness);\n\t\tansHeading.text(\"The correct answer is: \");\n\t\t$(\"#questDiv\").append(ansHeading);\n\t\tanswer.text(questions[index].answers[c]);\n\t\t$(\"#questDiv\").append(answer);\n\t}\n\telse if (ansCorrect == true) {\n\t\t\tcorrectness.text(\"CORRECT!!!\");\n\t\t\t$(\"#questDiv\").append(correctness);\n\t\t}\n\telse {\n\t\taudioEx.play();\n\t\tcorrectness.text(\"WRONG!!!\");\n\t\t$(\"#questDiv\").append(correctness);\n\t\tansHeading.text(\"The correct answer is: \");\n\t\t$(\"#questDiv\").append(ansHeading);\n\t\tanswer.text(questions[index].answers[c]);\n\t\t$(\"#questDiv\").append(answer);\n\t}\n\tvar image = $('<img id=\"answerImg\" src=\"' + questions[index].img + '\">');\n\t$(\"#questDiv\").append(image);\n\n\tif (ansCorrect == false || userAns == null) {\n\t\texpDisplay.text(questions[index].explain);\n\t\t$(\"#questDiv\").append(expDisplay);\n\t}\n\tquestionNum++;\n\tsessionTime = setTimeout(function() {makeQuestionPage(questionNum);}, 1000 * 10);\n}", "function showUserAnswer(){\n\t\t$(\"#solution_\" + user_answer + \"_container\").css(\"background-color\", \"#730046\");\n\t\t$(\"#solution_\" + user_answer + \"_container\").css(\"color\", \"#DCDCDC\");\n\t\tif (user_type == 'host') {\n\t\t\t$(\"#reveal_answer\").fadeIn('slow');\n\t\t}\n\t}", "function displayQuestion(event) {\n document.getElementById(\"question\").innerHTML = questions[count1%3].question;\n document.getElementById(\"answer\").innerHTML = \"\";\n ++count1;\n //adjusting the display of the answer \n count2=count1-1;\n}", "getCompletedListData(questions, users, session) {\n const list = [];\n\n for (const key in session.user.answers) {\n const poll = questions[key];\n\n if (poll) {\n poll.askedBy = users[poll.author];\n poll.hasAnswer = true;\n list.push(poll);\n }\n }\n\n return list.sort((a, b) => {\n if (a.timestamp === b.timestamp) return 0;\n return a.timestamp > b.timestamp ? -1 : 1;\n });\n }", "function revealAnswer() {\n\n if (count === 0) {\n $(\".questionOne\").hide();\n $(\".answerOneTime\").show();\n array.push(\"firstQuestionAnswered\");\n nextQuestion();\n }\n}", "function results() {\n $(\"#questions\").hide();\n $(\"#options\").hide();\n $(\"#time-left\").hide();\n $(\"#results\").show();\n $(\"#correct\").html(\"Correct Answers:\" + correctAnswersCount);\n $(\"#incorrect\").html(\"Wrong Answers:\" + incorrectAnswersCount);\n\n\n}", "function showResults(questions, quizContainer, resultsContainer){\n \n //collect all answers from quiz\n var answerContainers = quizContainer.getElementsByClassName('answer');\n console.log(\"answerContainers\");\n console.log(answerContainers);\n //store all answers\n var userAnswer = '';\n var numCorrect = 0;\n \n // for each question, find the selected answer\n for(var i=0; i<questions.length; i++){\n userAnswer = (answerContainers[i].querySelector('input[name=question'+i+']:checked')||{}).value;\n \n //if answer is Correct\n if(userAnswer===questions[i].correctAnswer){\n // add to the number of correct answers\n numCorrect++;\n \n // color the answers green\n answerContainers[i].style.color = 'lightgreen';\n }\n // if the answer is wrong or blank\n else{\n // color the answers red\n answerContainers[i].style.color = 'red';\n }\n }\n \n // show the number of correct answer out of the total possible points\n resultsContainer.innerHTML = numCorrect + 'out of' + questions.length;\n }", "function show_answers() {\n $(\".answers\").show(500);\n $(\".result-info\").show(500);\n }", "function seeResults() {\n store.quizStarted = false;\n store.questionNumber ++;\n}", "function displayEmployeeByDepartment(answers) {\n return connection.query(`SELECT * FROM (${viewCommand}) AS employee_combined WHERE Department = ?`, answers.department);\n}", "function displayQuestion() {\n hideResults();\n $(\"#answer\").hide();\n $(\"#time\").show();\n showDiv();\n $(\"#question\").html(question[questionCount]);\n $(\"#choice1\").html(firstChoice[questionCount]);\n $(\"#choice2\").html(secondChoice[questionCount]);\n $(\"#choice3\").html(thirdChoice[questionCount]);\n $(\"#choice4\").html(fourthChoice[questionCount]);\n }", "function displayAnswer() {\n\t\tconsole.log('displayAnswer function start')\n\t\t\n\t\t$('#questionDisplay').hide();\n $('#answerDisplay').animate({height: 'toggle', opacity: '1'}, 1000);\n $(\"#currentQuestion\").html(currentQuestion + 1);\n \n\t\t//stop the timer\n clearInterval(intervalId);\n stop();\n\t\t\n\n\t\t//then check the answer user picked\n\t\t//if the answer is right\n\t\tif (userPick === allQuestions[currentQuestion].correctAnswer){\n\t\t\tconsole.log('you are right');\n\t\t\t//run the right answer function\n\t\t\trightChoice();\n }\n \n\t\t//if the answer is wrong\n\t\telse {\n\t\t\tconsole.log(userPick);\n\t\t\tconsole.log(allQuestions[currentQuestion].correctAnswer);\n\t\t\tconsole.log('you are wrong');\n\t\t\t//run the wrong answer function\n\t\t\tincorrect();\n\t\t}\n\n }", "function displayResults() {\n\n $(\"#time\").hide();\n $(\"#question1\").hide();\n $(\"#answer1\").hide();\n $(\"#question2\").hide();\n $(\"#answer2\").hide();\n $(\"#question3\").hide();\n $(\"#answer3\").hide();\n $(\"#question4\").hide();\n $(\"#answer4\").hide();\n $(\"#question5\").hide();\n $(\"#answer5\").hide();\n $(\"#question6\").hide();\n $(\"#answer6\").hide();\n $(\"#question7\").hide();\n $(\"#answer7\").hide();\n $(\"#submit\").hide();\n\n //This will disply the count of each correct, wrong and unanswered questions.\n $(\"#resultsMessage\").html();\n $(\"#correct\").html(\"Correct Answers: \" + correctAnswers);\n $(\"#wrong\").html(\"Wrong Answers: \" + wrongtAnswers);\n $(\"#unanswered\").html(\"Unanswered: \" + unanswered);\n}", "function displayScore() {\n var score = $('<p>', {id: 'question'}),\n numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (JSON.stringify(selections[i]) === JSON.stringify(questions[i].correctAnswer)) {\n numCorrect++;\n }\n }\n\n score.append('You have correctly answered ' + numCorrect + ' out of ' +\n questions.length + ' questions!!!');\n return score;\n }", "function topicsSummaryMultiplePapers()\n {\n\t var points=[\"You did a splendid Job I can't believe you scored Fullest Percentage, But don't let this you to get into relax mode.\",\n\t\t\t\"Excellent Job! You Performed Well in the Examination but don't be relaxed\",\n\t\t\t\"You scored a very good score, But Why did you miss the remaining look at them once\",\n\t\t\t\"You have Scored Good Score but you missed others look at them\",\n\t\t\t\"Ok, But it's not up to your level must Consider this don't leave it\",\n\t\t\t\"I believe You Have the ability to score fullest, May be I think your hardWork is not as expected. So Work hard Buddy\",\n\t\t\t\"Hey! the score is not as expected. What happend to you. I know this is not your score. But Why is this happend? Take it seriously\",\n\t\t\t\"It's too low. Anything wrong? I can't expect this kind of score. You Have to put more efforts and hardwork. Hope you won't repeat this.\",\n\t\t\t\"Bad Score! Your HardWork is required.\",\n\t\t\t\"Worst Score! More and More HardWork is required\",\n\t\t\t\"No Comment! Please Think about Your progress\"];\n\t\tvar studyAdvice;\n\t\tvar st=\"<div class='row'>\";\n\t\tvar marks=0;\n\t\tvar marksPercent;\n\t \n\t\tvar d=[];\n\t\t var data=[];\n\t\t \n\t\t for(i=0;i<userAllPapersAnswers.length;i++)\n\t\t\t {\n\t\t\t \n\t\t\t for(j=0;j<userAllPapersAnswers[i].optionsList.length;j++)\n\t\t\t\t {\n\t\t\t\t d.push(userAllPapersAnswers[i].optionsList[j]);\n\t\t\t\t\t data.push(questionsAllPapersData[i].questionsList[j]);\n\t\t\t\t }\n\t\t\t\t\n\t\t\t\t\n\t\t\t }\n\t\t \n\t\t console.log(d);\n\t\t console.log(data);\n\t\t \n\t\t var answeredCount=0;\n\t\t var topicsToFocus=[];\n\t\t var tDuplicate=0;\n\t\t for(var i=0;i<d.length;i++)\n\t\t\t {\n\t\t\t \n\t\t\t tDuplicate=0;\n\t\t\t if(d[i]!=\"NA\")\n\t\t\t \tansweredCount++;\n\t\t\t if(d[i]!=data[i].qkey)\n\t\t\t \t{\n\t\t\t \t for(j=0;j<topicsToFocus.length;j++)\n\t\t\t \t\t {\n\t\t\t \t\t if(data[i].topic==topicsToFocus[j])\n\t\t\t \t\t\t tDuplicate=1; \n\t\t\t \t\t }\n\t\t\t \t if(tDuplicate==0)\n\t\t\t \ttopicsToFocus.push(data[i].topic);\n\t\t\t \t\n\t\t\t \t}\n\t\t\t else{\n\t\t\t \tmarks++;\n\t\t\t }\n\t\t\t }\n\t\t marksPercent=parseInt((marks*100)/data.length);\n\t\t \n\t\t if(marksPercent>=100)\n\t\t\t studyAdvice=points[0];\n\t\t else if(marksPercent>=95)\n\t\t\t studyAdvice=points[1];\n\t\t else if(marksPercent>=90)\n\t\t\t studyAdvice=points[2];\n\t\t else if(marksPercent>=80)\n\t\t\t studyAdvice=points[3];\n\t\t else if(marksPercent>=70)\n\t\t\t studyAdvice=points[4];\n\t\t else if(marksPercent>=60)\n\t\t\t studyAdvice=points[5];\n\t\t else if(marksPercent>=45)\n\t\t\t studyAdvice=points[6];\n\t\t else if(marksPercent>=35)\n\t\t\t studyAdvice=points[7];\n\t\t else if(marksPercent>=20)\n\t\t\t studyAdvice=points[8];\n\t\t else if(marksPercent>=10)\n\t\t\t studyAdvice=points[9];\n\t\t else\n\t\t\t studyAdvice=points[10];\n\t\t \n\t\t \n\t\t var diffTopics=[];\n\t\t var diffTopicsQCount=[];\n\t\t tDuplicate=0;\n\t\t \n\t\t for(i=0;i<data.length;i++)\n\t\t\t {\n\t\t\t tDuplicate=0;\n\t\t\t for(j=0;j<diffTopics.length;j++)\n\t\t\t \t{\n\t\t\t \t if(data[i].topic==diffTopics[j])\n\t\t\t \t\t {\n\t\t\t \t\t tDuplicate=1;\n\t\t\t \t\t \n\t\t\t \t\t }\n\t\t\t \t}\n\t\t\t if(tDuplicate==0)\n\t\t\t \tdiffTopics.push(data[i].topic); \t\n\t\t\t }\n\t\t \n\t\t \n\t\t //Topic wise statistics\n\t\t var qCount=0;\n\t\t var wrongQCount=0;\n\t\t var wrongQuestion;\n\t\t var wrongQuestions=[];\n\t\t var multopics=[];\n\t\t for(i=0;i<diffTopics.length;i++)\n\t\t\t {\n\t\t\t \n\t\t\t wrongQCount=0;\n\t\t\t qCount=0;\n\t\t\t wrongQuestions=[];\n\t\t\t for(j=0;j<data.length;j++)\n\t\t\t \t {\n\t\t\t \t if(diffTopics[i]==data[j].topic)\n\t\t\t \t \t{\n\t\t\t \t \tqCount++;\n\t\t\t \t \t if(d[j]!=data[j].qkey)\n\t\t\t \t \t\t {\n\t\t\t \t \t\t wrongQCount++;\n\t\t\t \t \t\t wrongQuestions.push(new WrongQuestion(data[j].question,data[j].qkey,d[j],data[j].optionA,data[j].optionB,data[j].optionC,data[j].optionD,data[j].optionE));\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 multopics.push(new Topic(diffTopics[i],qCount,wrongQCount,wrongQuestions));\n\t\t\t }\n\t\t \n\t\tst=st+\"<div class='col-md-7'>\" +\n\t\t\t\t\"<p><span style='font-weight:600;font-size:12px;'>Total Number of Questions :</span> <span style='color:#00a69c'>\"+data.length+\"</span></p>\" +\n\t\t\t\t\"<p><span style='font-weight:600;font-size:12px;'>Total Number of Questions answered : </span> <span style='color:#00a69c'>\"+answeredCount+\"</span></p>\" +\n\t\t\t\t\"<p><span style='font-weight:600;font-size:12px;'>Total Number of Questions Correctly Answered : </span> <span style='color:#00a69c'>\"+marks+\"</span></p>\" +\n\t\t\t\t\"</div>\";\n\t\t\tif(marksPercent<=35)\n\t\t\t{\n\t\t\t\tst=st+\"<div class='col-md-5'><br><p style='marging-top:1%;'><span style='font-weight:600;font-size:12px;'>Your total score : </span><span class='redClass clrsClass'>\"+marksPercent+\"%</span></p>\"+\n\t\t\t\t\"</div></div>\";\n\t\t\t}\n\t\t\telse if(marksPercent>35 && marksPercent<=75)\n\t\t\t{\n\t\t\t\tst=st+\"<div class='col-md-5'><br><p style='marging-top:1%;'><span style='font-weight:600;font-size:12px;'>Your total score : </span><span class='clrAvg clrsClass'>\"+marksPercent+\"%</span></p>\"+\n\t\t\t\t\"</div></div>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tst=st+\"<div class='col-md-5'><br><p style='marging-top:1%;'><span style='font-weight:600;font-size:12px;'>Your total score : </span><span class='greenClass clrsClass'>\"+marksPercent+\"%</span></p>\"+\n\t\t\t\t\"</div></div>\";\n\t\t\t}\n\t\t\t\t\n\t\t\tst=st+\"<div class='row' style='border:1px solid #4e4e4e;border-radius:5px;'><div class='col-md-12'>\";\n\t\t\n\t\tif(answeredCount!=data.length)\n\t\tst=st+\"<span style='color:#4e4e4e;font-weight:600;'>Note : </span><span style='color:red'> It's not fare that you did not even attempt all Questions. The Exam Doesn't even have any Negative Marking</span>\"+\"<br>\";\n\t/*\n\t\tst=st+\"Different Topics Covered In this Question Paper\"+\"<br>\";\n\t\t\n\t\tfor(i=0;i<diffTopics.length;i++)\n\t\t{\n\t\t\tst=st+\"<span style='margin:3px;border-radius:20%;padding:5px;color:black;background-color:#DDD6D4'>\"+diffTopics[i]+\"</span>\";\n\t\t}\n\t\tst=st+\"<br>\";\n\t\t*/\n\t\t\n\t\tst=st+\"<canvas id='topicsBarGraph'></canvas>\" +\n\t\t\t\t\"</div></div>\" +\n\t\t\t\t\"<br><div class='row' style='height:450px;'><div class='col-md-8' style='height:450px;overflow:scroll;'>\";\n\t\t\n\t\t/*st=st+\"<p style='padding-top:1%;font-size:16px;text-align:center;font-weight:600px;color:#ff6666;'>Topics You have to Focus More\"+\"</p>\";\n\t\tfor(i=0;i<topicsToFocus.length;i++)\n\t\t{\n\t\t\tst=st+\"<p style='padding:5px;font-size:12px;text-align:center;width:90% !important;color:black;background-color:#DDD6D4'>\"+topicsToFocus[i]+\"</p>\";\n\t\t}\n\t\t\n\t\tst=st+\"</div>\" +\n\t\t\t\t\"<div class='col-md-8' style='overflow:scroll;height:440px;'>\";*/\n\t\t\n\t\tvar labelsData=[];\n\t\tvar percentData=[];\n\t\tvar colors=[];\n\t\tst=st+\"<p style='padding-top:1%;font-size:16px;text-align:center;font-weight:600;color:#ff6666;'>Look in Detail\"+\"</p>\";\n\t\tfor(i=0;i<multopics.length;i++)\n\t\t\t{\n\t\t\tst=st+\"<p style='font-weight:600;font-size:12px'>Topic: <span style='color:#ff6666'>\"+multopics[i].topic+\"</span> Score Percent : <span style='font-weight:500;color:#00a69c;'>\"+parseInt((multopics[i].qCount-multopics[i].wrongQCount)*100/multopics[i].qCount)+\"%</span></p>\";\n\t\t\t st=st+\"<p style='font-weight:600;font-size:12px'>Totoal Questions from Topic : <span style='font-weight:600;color:#000;'>\"+multopics[i].qCount+\"</span></p>\";\n\t\t\tif(multopics[i].wrongQCount!=0)\n\t\t\t\t{\n\t\t\t \n\t\t\t st=st+\"<p style='font-size:12px'>You did not Score for <span style='font-weight:600;color:#ff6666;'>\"+multopics[i].wrongQCount+\"</span> Questions</p>\";\n\t\t\t st=st+\"<p style='font-weight:600;font-size:12px'>Want To See Questions You missed scoring : <button class='btn btn-default' style='color:#ff6666;border:1px solid #ff6666;border-radius:5px;font-size:10px;font-weight:600;' onclick='displayD(\\\"wrongQuestions\"+i+\"\\\")'>Click Here</button></p><hr>\";\n\t\t\t st=st+\"<span id='wrongQuestions\"+i+\"' style='display:none'>\";\n\t\t\t for(j=0;j<multopics[i].wrongQuestions.length;j++)\n\t\t\t\t {\n\t\t\t\t st=st+\"<p><span style='color:red;font-size:12px;'>Question No: </span><span style='color:#00a69c'>\"+(j+1)+\"</span></p>\" +\n\t\t\t\t \t\t\"<p style='font-weight:600;font-size:12px;'> \"+multopics[i].wrongQuestions[j].question+\"</p>\";\n\t\t\t\t st=st+\"<p>A) \"+multopics[i].wrongQuestions[j].optionA+\"<span style='margin-left:10px;'>B) \"+multopics[i].wrongQuestions[j].optionB+\"</span><span style='margin-left:10px;'>C) \"+multopics[i].wrongQuestions[j].optionC+\"</span><span style='margin-left:10px;'>D) \"+multopics[i].wrongQuestions[j].optionD+\"</span><span style='margin-left:10px;'>E) \"+multopics[i].wrongQuestions[j].optionE+\"</span></p>\";\n\t\t\t\t st=st+\"<p>Key : <span style='font-weight:600;'>\"+multopics[i].wrongQuestions[j].qkey+\"</span><span style='margin-left:2%'> Your Answer: </span><span style='font-weight:600;'>\"+multopics[i].wrongQuestions[j].yourAnswer+\"</span></p><hr><br>\";\n\t\t\t\t \n\t\t\t\t st=st+\"<p>Google Help:<br> <a href='https://www.google.co.in/search?q=\"+multopics[i].wrongQuestions[j].question+\"' target='_blank'>Ask <i style='color:green' class='fa fa-google' aria-hidden='true'></i></a></p>\";\n\t\t\t\t }\n\t\t\t st=st+\"</span>\";\n\t\t\t}\n\t\t\t else{\n\t\t\t\t st=st+\"<p style='font-size:12px'>Good You have Answered All Questions</p>\";\n\t\t\t }\n\t\t\t labelsData.push(multopics[i].topic);\n\t\t\n\t\t\t percentData.push(parseInt((multopics[i].qCount-multopics[i].wrongQCount)*100/multopics[i].qCount));\n\t\t\t \n\t\t\t if(parseInt((multopics[i].qCount-multopics[i].wrongQCount)*100/multopics[i].qCount)>75)\n\t\t\t\t colors.push(\"green\");\n\t\t\t else if(parseInt((multopics[i].qCount-multopics[i].wrongQCount)*100/multopics[i].qCount)>45)\n\t\t\t colors.push(\"yellow\");\n\t\t\t else\n\t\t\t\t colors.push(\"red\");\n\t\t\t}\n\t\tst=st+\"</div><div class='col-md-4'>\";\n\t\t\n\t\tst=st+\"<p style='text-align:center;color:#00a69c;font-weight:600;font-size:16px;'>Study Advicer's Advice</p>\"+studyAdvice+\"<br>\";\n\t\t\t\t\n\t\tst=st+\"</div></div>\";\n\t\t\n\t\t$(\"#resultStats\").html(st);\n\t\tdisplayBarGraph('topicsBarGraph',percentData,'Topic Wise Analysis',labelsData,colors);\n\t\t\n\t \n\t\t\n\t\t\n\t \n\t $(\"#ajaxPageLoader\").hide();\n }", "function displayScore() {\r\n var score = $('<p>', {\r\n id: 'question'\r\n });\r\n var numCorrect = 0;\r\n for (var i = 0; i < selections.length; i++) {\r\n if (selections[i] === questions[i].correctAnswer) {\r\n numCorrect++;\r\n }\r\n }\r\n score.append('You got ' + numCorrect + ' out of ' +\r\n questions.length + '.');\r\n return score;\r\n }", "function whatIsTheAns(){\n $('#currentQ').empty();\n $('.myChoice').empty();\n $('.question').empty();\n\n // The correct answer is pulled out from the object myQuestions and stored in var theAnswerText\n var theAnswerText = myQuestions[currentQ].answerArray[myQuestions[currentQ].correctAnswer];\n var theAnswerNum = myQuestions[currentQ].correctAnswer;\n //link img if you wish 144\n\n if((userAns === theAnswerNum) && (isAnswered === true)){\n correctAns++;\n $('#prompt').html(prompt.whenCorrect);\n } else if ((userAns !== theAnswerNum) && (isAnswered === true)){\n wrongAns++;\n $('#prompt').html(prompt.whenIncorrect);\n $('#fixedAns').html('The correct answer was: ' + theAnswerText);\n } else {\n noAns++;\n $('#prompt').html(prompt.whenNoTimeLeft);\n $('#fixedAns').html('The correct answer was: ' + theAnswerText);\n isAnswered = true;\n }\n\n if (currentQ === (myQuestions.length-1)){\n setTimeout(results, 1000);\n } else {\n currentQ++;\n setTimeout(displayQuestion, 1000);\n }\n\n}", "function summarySection() {\n getStringKeys();\n\n $root.find('.card-box').hide();\n\n $('#root').append(summary_section);\n $('div.section-1').after(summary_footer);\n\n /* Check Show Correct Answer */\n if (Object.keys(row).length > 0) {\n // if (actionInstance.customProperties[3].value == 'Yes') {\n var correct_answer = $.parseJSON(actionInstance.customProperties[4].value);\n console.log('correct_answer: ');\n console.log(correct_answer);\n var count = 0;\n\n var ans_rsp = '';\n var score = 0;\n\n $('#root').find('div.card-box').each(function(i, val) {\n\n var searchIDs = $(val).find('input:checked').map(function() {\n return $(this).attr('id');\n });\n\n var correct_ans = '';\n var your_ans = '';\n\n if (JSON.stringify(correct_answer[count]) == JSON.stringify(searchIDs.get())) {\n /* Answer is correct */\n score = score + 1;\n var $summary_card = $('<div class=\"card-box card-blank bt\"></div>');\n var $summary_dtable = $('<div class=\"d-table\"></div>');\n var question = $(val).find('.question-title').text();\n $summary_card.append($summary_dtable);\n Localizer.getString('correct').then(function(result) {\n $summary_dtable.append(`<label>\n <strong>${question}</strong>\n </label>\n <label class=\"float-right\" id=\"status-${i}\">\n <span class=\"text-success\">${result}</span>\n </label>\n `);\n });\n\n $(val).find('label.custom-radio, label.custom-check').each(function(opt_ind, opt_val) {\n var opt_id = $(opt_val).find('input').attr('id');\n if ($.inArray(opt_id, correct_answer[count]) !== -1) {\n $summary_card.append(`<div class=\"form-group\">\n <div class=\"form-group alert alert-success\">\n <p class=\"mb0\">\n ${$(opt_val).text()}\n <i class=\"fa pull-right fa-check\"></i>\n </p>\n </div>\n </div>`);\n } else {\n $summary_card.append(`<div class=\"form-group\">\n <div class=\"form-group alert alert-normal\">\n <p class=\"mb0\">\n ${$(opt_val).text()}\n </p>\n </div>\n </div>`);\n }\n });\n\n } else {\n /* Answer is incorrect */\n var $summary_card = $('<div class=\"card-box card-blank bt\"></div>');\n var $summary_dtable = $('<div class=\"d-table\"></div>');\n var question = $(val).find('.question-title').text();\n $summary_card.append($summary_dtable);\n Localizer.getString('incorrect').then(function(result) {\n $summary_dtable.append(`<label>\n <strong>${question}</strong>\n </label>\n <label class=\"float-right\" id=\"status-${i}\">\n <span class=\"text-danger\">${result}</span>\n </label>\n `);\n });\n\n $(val).find('label.custom-radio, label.custom-check').each(function(opt_ind, opt_val) {\n var opt_id = $(opt_val).find('input').attr('id');\n if ($.inArray(opt_id, correct_answer[count]) !== -1) {\n if ($(opt_val).find('input').prop('checked') == true) {\n $summary_card.append(`<div class=\"form-group\">\n <div class=\"form-group alert alert-danger\">\n <p class=\"mb0\">\n ${$(opt_val).text()}\n <i class=\"fa fa-pull-right text-danger fa-check\"></i>\n </p>\n </div>\n </div>`);\n } else {\n $summary_card.append(`<div class=\"form-group\">\n <div class=\"form-group alert alert-normal\">\n <p class=\"mb0\">\n ${$(opt_val).text()}\n <i class=\"fa fa-pull-right text-success fa-check\"></i>\n </p>\n </div>\n </div>`);\n }\n } else {\n if ($(opt_val).find('input').prop('checked') == true) {\n $summary_card.append(`<div class=\"form-group\">\n <div class=\"form-group alert alert-danger\">\n <p class=\"mb0\">\n ${$(opt_val).text()}\n <i class=\"fa fa-pull-right fa-close\"></i>\n </p>\n </div>\n </div>`);\n } else {\n $summary_card.append(`<div class=\"form-group\">\n <div class=\"form-group alert alert-normal\">\n <p class=\"mb0\">\n ${$(opt_val).text()}\n </p>\n </div>\n </div>`);\n }\n }\n });\n\n }\n $('.summary-section').append($summary_card);\n count++;\n });\n $('.summary-section').append('<div class=\"ht-100\"></div>');\n\n console.log('total score: ');\n console.log(score);\n var score_is = Math.round((score / correct_answer.length) * 100);\n $('.summary-section').prepend(`<div class=\"\">\n <label>\n <strong>Score: </strong>${score_is}%\n </label>\n </div>`);\n Localizer.getString('quiz_summary').then(function(result) {\n $('.summary-section').prepend(`<div><h4>${result}</h4></div><hr>`);\n });\n\n /* } else {\n $('.submit-key').click();\n } */\n }\n\n}", "function renderReviewResult() {\n console.log('renderExamResult() has been used.');\n\n hideElements(['challenge']);\n \n showElement('.result');\n\n var column = Math.ceil(questions.used.length / 3);\n \n var html = '';\n var answered = questions.exam.filter(el => el != undefined).length;\n var missing = questions.used.length - answered;\n var marked = questions.marked.filter(el => el == true).length;\n var onclick, ignored;\n\n html += '<div class=\"container\">';\n html += '<div>' + getMessage('answered_in_total', 'Answered in total') + ': <strong>'+answered+'</strong></div>';\n html += '<div>' + getMessage('missing_answers', 'Missing answers') + ' : <strong>'+missing+'</strong></div>';\n html += '<div>' + getMessage('marked_for_review', 'Marked for review') + ': <strong>'+marked+'</strong></div>';\n html += '<div class=\"row\">';\n for (var q in questions.used) {\n q = parseInt(q);\n if (q % column == 0) {\n html += '<div class=\"col-sm-4\">';\n }\n var answers = [];\n for (var ans in questions.exam[q+1]) {\n if (questions.exam[q+1][ans] == true) {\n answers.push(letters[ans].toUpperCase());\n }\n }\n var markedForReview = questions.marked[q] ? '*' : '';\n onclick = 'onclick=\"javascript:backToChallenge(this.getAttribute(\\'data-id\\'));\"';\n ignored = (questions.used[q].params.status && questions.used[q].params.status == 'ignored') ? '<span class=\"badge badge-danger\">'+getMessage('ignored', 'Ignored')+'</span>' : '';\n\n html += '';\n html += '<div>';\n html += ' <a id=\"r'+q+'\" href=\"#\" data-id=\"'+q+'\" '+onclick+' class=\"review-question\">'+(q+1)+'. '+answers.join(', ')+' '+markedForReview + ignored + '</a>';\n html += '</div>';\n if ((q+1) % column == 0) {\n html += '</div>';\n }\n }\n html += '</div>';\n html += '</ul>';\n\n // html += '<button id=\"additional-review\" onclick=\"javascript:backToChallenge(challenge);\" class=\"btn btn-secondary\">back to challenge</button>';\n\n renderElement('.result', html);\n}", "function grade() {\n\n//question 1 answer r1\nif (answer1 === \"r1\") {\n correct++;\n } else if ((answer1 === \"r2\") || (answer1 === \"r3\")) {\n incorrect++;\n } else {\n unanswered++;\n }\n\n//question 2 answer r3\nif (answer2 === \"r3\") {\n correct++;\n } else if ((answer2 === \"r2\") || (answer2 === \"r1\")) {\n incorrect++;\n } else {\n unanswered++;\n }\n//question 3 answer r1\nif (answer3 === \"r1\") {\n correct++;\n } else if ((answer3 === \"r2\") || (answer3 === \"r3\")) {\n incorrect++;\n } else {\n unanswered++;\n }\n//question 4 answer r2\nif (answer4 === \"r2\") {\n correct++;\n } else if ((answer4 === \"r1\") || (answer4 === \"r3\")) {\n incorrect++;\n } else {\n unanswered++;\n }\n//question 5 answer r3\nif (answer5 === \"r3\") {\n correct++;\n } else if ((answer5 === \"r2\") || (answer5 === \"r1\")) {\n incorrect++;\n } else {\n unanswered++;\n }\n}", "function userInCorrectAnswerSubmitted(answer) {\n $('.correct-updater').html(`Incorrect! The correct answer is: ${store.randomQuestion.correctAnswer}`);\n}", "function displayScore() {\r\n var score = $('<p>',{id: 'question'}); \r\n var numCorrect = 0;\r\n for (var i = 0; i < selections.length; i++) {\r\n if (selections[i] === questions[i].correctAnswer) {\r\n numCorrect++;\r\n }\r\n }\r\n \r\n score.append('You got ' + numCorrect + ' questions out of ' +\r\n questions.length + ' right!!!');\r\n return score;\r\n }", "function showQuestion() {\n // generate random index in array\n index = Math.floor(Math.random() * triviaQuestions.length);\n pick = triviaQuestions[index];\n // console log displayed object properties\n console.log(pick.question, pick.choices, pick.answer, index)\n\n // display question in div\n $(\"#questionDiv\").html(\"<h2>\" + pick.question + \"</h2>\");\n // iterate through answer array and display in div\n for (var i = 0; i < pick.choices.length; i++) {\n var userchoices = $(\"<div>\");\n userchoices.addClass(\"selections\");\n userchoices.html(pick.choices[i]);\n userchoices.attr(\"data-guessvalue\", i);\n $(\"#answerDiv\").append(userchoices);\n // answer position in array\n }\n\n // click guess answer\n $(\".selections\").click(function () {\n // grab answer position in array\n userGuess = parseInt($(this).attr(\"data-guessvalue\"));\n\n // if user guess right or wrong\n // if right: stop timer, add to right answer tally, display correct! text and picture\n if (userGuess === pick.answer) {\n stop();\n rightCount++;\n userGuess = \"\";\n $(\"#answerDiv\").html(\"<p>Correct!</p>\");\n hidepicture();\n\n // if wrong: stop timer, add to wrong answer tally, display oh no! text and picture\n } else {\n stop();\n wrongCount++;\n userGuess = \"\";\n $(\"#answerDiv\").html(\"<p>Oh no!<br><small>The correct answer is:</small> \" + pick.choices[pick.answer] + \"!</p>\");\n hidepicture();\n }\n })\n }", "function displayQuestions() {\n\n\t$('#questions').html(qAndA[0][0]);\n\t//correct answer-this points out the specific array index the correct choice is held in.\n correctAns = qAndA[0][3]; \n\n $('#ans1').html(qAndA[0][1]);\t\n $('#ans2').html(qAndA[0][2]);\n $('#ans3').html(qAndA[0][3]);\n $('#ans4').html(qAndA[0][4]);\n\n $('#questions1').html(qAndA[1][0]);\n \n correctAns = qAndA[1][3];\n\n $('#ans5').html(qAndA[1][1]);\t\n $('#ans6').html(qAndA[1][2]);\n $('#ans7').html(qAndA[1][3]);\n $('#ans8').html(qAndA[1][4]);\n\n\n $('#questions2').html(qAndA[2][0]);\n\n correctAns = qAndA[2][3];\n\n $('#ans9').html(qAndA[2][1]);\t\n $('#ans10').html(qAndA[2][2]);\n $('#ans11').html(qAndA[2][3]);\n $('#ans12').html(qAndA[2][4]);\n\n $('#questions3').html(qAndA[3][0]);\n\n correctAns = qAndA[3][3];\n\n $('#ans13').html(qAndA[3][1]);\t\n $('#ans14').html(qAndA[3][2]);\n $('#ans15').html(qAndA[3][3]);\n $('#ans16').html(qAndA[3][4]);\n\t\n\t\n\ttimer();\n}", "function process_answer_submission() {\n var user_answer = given_answer();\n update_question_result(is_correct_answer(user_answer));\n document.getElementById(\"submitter\").style.visibility=\"hidden\";\n}" ]
[ "0.59104276", "0.590197", "0.5895059", "0.57925963", "0.5764439", "0.5708902", "0.57062334", "0.5676252", "0.567605", "0.56626326", "0.5660694", "0.5655947", "0.56482685", "0.5624674", "0.56226724", "0.56033754", "0.5600502", "0.5593046", "0.5591988", "0.5591", "0.5588687", "0.558711", "0.55809397", "0.5570293", "0.5565203", "0.5565101", "0.55639243", "0.55629236", "0.55607927", "0.5558272", "0.5557946", "0.555713", "0.55560845", "0.55506104", "0.5548291", "0.5538232", "0.55305004", "0.55225015", "0.5520286", "0.5519427", "0.5506461", "0.55020595", "0.5497362", "0.5494129", "0.5492578", "0.5490913", "0.5489762", "0.5486806", "0.5484762", "0.5472704", "0.5471529", "0.5471221", "0.5469958", "0.54666185", "0.5465078", "0.5464077", "0.5460867", "0.54568356", "0.5450727", "0.5450018", "0.5444816", "0.54417545", "0.5440823", "0.5432499", "0.541702", "0.54159033", "0.5412797", "0.5410608", "0.5402674", "0.5397434", "0.5385393", "0.53836066", "0.5378118", "0.5375605", "0.5375246", "0.5369078", "0.536652", "0.5365823", "0.5365564", "0.5364545", "0.53614444", "0.5361365", "0.5360774", "0.5356467", "0.5352997", "0.5352994", "0.53495264", "0.5346222", "0.5343939", "0.5343753", "0.5343516", "0.5337839", "0.5332635", "0.53308624", "0.53274333", "0.5323379", "0.5322244", "0.5321985", "0.5321216", "0.5317254", "0.53136" ]
0.0
-1
Used when displaying students who have taken exam to show timelog table for that user
function showTimeTable(id) { $('#clrButton').css('display', 'block'); $('#detailtable').bootstrapTable('destroy'); $('#detailtable').bootstrapTable({ url: baseURL + 'api/timelog/readByKey.php?key=' + id, Striped: true, tableSm: true, columns: [{ field : 'id', title: 'ID', }, { field: 'examID', title: 'Exam ID' }, { field: 'questionID', title: 'Question ID' }, { field: 'actionWord', title: 'Action' }, { field: 'actionTime', title: 'Time of Action' }] }); let messageTxt = "<p><strong>Note: </strong>Action shows exam start and students clicking buttons (Next, Previous, Finish). " + "It shows timeout if they ran out of time on the exam, followed by the timer pushing the finish button." document.getElementById("message").innerHTML = messageTxt; $('#message').css('display', 'block'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showUserGifts(){\r\n \r\n // get from database mission type assigned for this day and appends to HTML\r\n appendGifts(userGifts,'neutral')\r\n }", "function updateResultsHdrs(dateInfo) {\n var userMsg;\n \n if (user === '') {\n userMsg = 'Timed results';\n } else {\n userMsg = 'Timed results for ' +user;\n }\n \n $(\"#scores_date\").text(dateInfo);\n $(\"#scores_numRange\").html('Number range: ' +\n 'Level ' + (model.diff + 1) + ', ' +\n model.nums[0] + ' through ' +\n model.nums[model.nums.length - 1]);\n\n if (typeof(user) !== 'undefined') {\n $('#test_user').empty().append(userMsg);\n $('#scores_user').text('Name: ' + user);\n }\n }", "function timeAndUserTracking($el, $usr) {\n var shortTime = $el.find(\".simpletime\");\n\n // Add info to activeuserarray\n activeUserArray.push($usr.text());\n //activeUserTimes.push(militarytime);\n activeUserTimes.push(shortTime.text());\n\n // Moved here to add user activity from any time rather than only once each 10 secs. (Was in tab tick function, place it back there if performance suffers)\n processActiveUsersList();\n }", "function workflowRecordHistory (row) {\n if ( row['DT_INSERTED'] !== null ) {\n ins_time = ellapseTime ( row['DT_INSERTED'] );\n }\n if ( row['DT_UPDATED'] !== null ) {\n upd_time = ellapseTime ( row['DT_UPDATED'] );\n }\n\n if (row['INSERTED_BY'] ) {\n txt = '<span class=\"timelogValue\" title=\"' + JS_CREATED + '\"><i class=\"fas fa-user-plus timelogIcon\"></i> ' + row['INSERTED_BY'] + '</span> ';\n if (ins_time) {\n txt += '<span class=\"timelogValue\" title=\"' + JS_ELAPSED_TIME + '\"><i class=\"fas fa-history timelogIcon quad-left-padding-10\"></i> ' + ins_time + '</span>';\n }\n }\n\n if (row['CHANGED_BY'] ) {\n txt += '<span class=\"visible-xs visible-sm visible-md visible-lg timelogValue timelogChanged\" title=\"' + JS_LAST_CHANGED + '\"><i class=\"fas fa-user-edit timelogIcon\"></i> ' + row['CHANGED_BY'];\n if (upd_time) {\n txt += ' <span title=\"' + JS_ELAPSED_TIME + '\"><i class=\"fas fa-history timelogIcon quad-left-padding-10\"></i> ' + upd_time + '</span>';\n }\n txt += '</span> ';\n }\n return txt;\n}", "function displayRegisterInfo(register) {\n getConnection((err, connection) => {\n let title\n let details = []\n let classes = []\n let attendance = []\n let students = []\n if (err) console.log('no connection');\n connection.query('SELECT t.class_ID, t.startTime, t.duration, t.group_ID, g.description, t.firstInstructor_ID, l.name, e1.firstName as aFirstName, e1.lastName as aLastName, e2.firstName as bFirstName, e2.lastName as bLastName FROM classes AS t INNER JOIN groups AS g ON t.group_ID = g.group_ID INNER JOIN locations AS l ON g.location_ID = l.location_ID INNER JOIN employees AS e1 ON t.firstInstructor_ID = e1.employee_ID INNER JOIN employees AS e2 ON t.secondInstructor_ID = e2.employee_ID WHERE class_ID = ?', [register], (error, rows, fields) => {\n if (error) throw error;\n for (row in rows) {\n title = ('<h1>' + rows[row].description + ', ' + rows[row].startTime.getDate() + '/' + (rows[row].startTime.getMonth() + 1) + '/' + rows[row].startTime.getFullYear() + ' ' + rows[row].startTime.getHours() + ':' + rows[row].startTime.getMinutes() + '</h1>');\n details.push('ID: ' + rows[row].class_ID + ' <br />')\n details.push('Start time: ' + rows[row].startTime.getDate() + '/' + (rows[row].startTime.getMonth() + 1) + '/' + rows[row].startTime.getFullYear() + ' ' + rows[row].startTime.getHours() + ':' + rows[row].startTime.getMinutes() + '<br />');\n details.push('Finish time: ' + rows[row].startTime.getDate() + '/' + (rows[row].startTime.getMonth() + 1) + '/' + rows[row].startTime.getFullYear() + ' ' + (rows[row].startTime.getHours() + rows[row].duration) + ':' + rows[row].startTime.getMinutes() + '<br />');\n details.push('Group: ' + rows[row].description + '<br />');\n details.push('Location: ' + rows[row].name + '<br />')\n details.push('First instructor: ' + rows[row].aFirstName + \" \" + rows[row].aLastName + '<br />')\n details.push('Second instructor: ' + rows[row].bFirstName + \" \" + rows[row].bLastName + '<br />')\n }\n document.getElementById('register-info-title').innerHTML = title\n document.getElementById('register-info-details').innerHTML = details.join('')\n });\n connection.query('SELECT * FROM attendance INNER JOIN students ON attendance.student_ID = students.student_ID WHERE class_ID = ? ORDER BY students.lastName;', [register], (error, rows, fields) => {\n if (error) throw error;\n attendance.push('<p>' + rows.length + ' students attended this class</p>')\n attendance.push('<table class=\"table-striped\"><thead><tr><th>ID</th><th>First Name</th><th>Last Name</th></tr></thead><tbody>')\n for (row in rows) {\n attendance.push('<tr>');\n attendance.push('<td type=\"button\" id=\"button-student-info\" data-id=\"' + rows[row].student_ID + '\" data-modal=\"student-info\">' + rows[row].student_ID + ' </td>');\n attendance.push('<td type=\"button\" id=\"button-student-info\" data-id=\"' + rows[row].student_ID + '\" data-modal=\"student-info\">' + rows[row].firstName + ' </td>');\n attendance.push('<td type=\"button\" id=\"button-student-info\" data-id=\"' + rows[row].student_ID + '\" data-modal=\"student-info\">' + rows[row].lastName + '</td>');\n attendance.push('</tr>');\n }\n attendance.push('</tbody></table>')\n if (rows.length == 0)\n document.getElementById('register-info-attendance').innerHTML = '<p>Not a single student attended this class</p>'\n else\n document.getElementById('register-info-attendance').innerHTML = attendance.join('')\n });\n connection.query('SELECT * FROM students WHERE mainGroup_ID = (SELECT group_ID FROM classes WHERE class_ID = ?) ORDER BY students.lastName;', [register], (error, rows, fields) => {\n if (error) throw error;\n students.push('<p>' + rows.length + ' students signed</p>')\n students.push('<table class=\"table-striped\"><thead><tr><th>ID</th><th>First Name</th><th>Last Name</th></tr></thead><tbody>')\n for (row in rows) {\n students.push('<tr>');\n students.push('<td type=\"button\" id=\"button-student-info\" data-id=\"' + rows[row].student_ID + '\" data-modal=\"student-info\">' + rows[row].student_ID + ' </td>');\n students.push('<td type=\"button\" id=\"button-student-info\" data-id=\"' + rows[row].student_ID + '\" data-modal=\"student-info\">' + rows[row].firstName + ' </td>');\n students.push('<td type=\"button\" id=\"button-student-info\" data-id=\"' + rows[row].student_ID + '\" data-modal=\"student-info\">' + rows[row].lastName + '</td>');\n students.push('</tr>');\n }\n students.push('</tbody></table>')\n if (rows.length == 0)\n document.getElementById('register-info-students').innerHTML = '<p>No students signed</p>'\n else\n document.getElementById('register-info-students').innerHTML = students.join('')\n });\n connection.release()\n })\n document.getElementById('button-register-edit').style.visibility=\"visible\"\n document.getElementById('button-register-save').style.visibility=\"hidden\"\n}", "function displayQueryLogs() {\n\t\t\t$scope.queryLogsBusy = true;\n\t\t\tdisplayLogsTimeout = $timeout(function() {\n\t\t\t\tvar queryLogsStamp=lastLogStamp;\n\t\t\t\tjawsService.getQueryLogs(curQueryId,lastLogStamp,CONFIG.LOGS_PER_PAGE)\n\t\t\t\t\t.then(function(response) {\n\t\t\t\t\t\tvar logsNum = response.logs.length;\n\t\t\t\t\t\t//remove first log as we already processed it in last request\n\t\t\t\t\t\tif (queryLogsStamp!==0)\n\t\t\t\t\t\t\tresponse.logs.shift();\n\t\t\t\t\t\t\n\t\t\t\t\t\taddLogs(response.logs);\n\t\t\t\t\t\tif (logsNum >= CONFIG.LOGS_PER_PAGE) \n\t\t\t\t\t\t\tdisplayQueryLogs();\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$scope.queryLogsBusy = false;\n\t\t\t\t\t});\n\t\t\t\t},10);\n\t\t\t\n\t\t}", "showScoreTable(){\n console.log(\"\\n********* \"+this.mode+\" - tour \"+this.tour+\" *********\");\n console.table(this.players, [\"name\",\"max\"]);\n }", "function displayRecords() {\n Alert.render(\n `Current best times for running the 100 metres dash <br><br>\n <b>WOMEN'S RECORD:</b> <br>10.49 seconds (set by Florence Griffith-Joyner in 1988)<br>\n <b>MEN'S RECORD:</b> <br>9.58 seconds (set by Usain Bolt in 2009)`)\n}", "function userTable() { }", "function showAbsenceDetails(nr) {\nif (nr != undefined) {\nelementToCheck = nr;\t\n} else {\nelementToCheck = activeElement;\n}\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == elementToCheck);\n//console.log(activeDataSet);\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSet['ende'])+'</b>';\t\n} else {\ncontent += \" am <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b>\";\t\n}\nanzeige = \"\";\nif (activeDataSet['adminMeldung'] != 0) {\nanzeige = \"Eintrag Sekretariat am: <b>\" + formatDateDot(activeDataSet['adminMeldungDatum'])+'</b><br/>';\t\n}\nif (activeDataSet['lehrerMeldung'] != \"0\") {\n\tif (teacherUser ==1) {\n\taddInfo = activeDataSet['lehrerMeldung'] + \"<b> (\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+')</b><br/>';\t\n\t} else {\n\taddInfo = \"Eintrag Lehrkraft<b> (\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+')</b><br/>';\t\n\t}\n\tanzeige += addInfo;\t\n}\nif (activeDataSet['elternMeldung'] != \"0\") {\nanzeige += \"Eintrag Eltern am: <b>\" + formatDateDot(activeDataSet['elternMeldungDatum'])+'</b>';\t\n}\nif (activeDataSet['kommentar'] != \"\") {\nanzeige += \"<br/>Kommentar: <b>\" + activeDataSet['kommentar']+'</b>';\t\n}\nif (activeDataSet['entschuldigt'] != \"0000-00-00\") {\nanzeige += \"Entschuldigung am: <b>\" + formatDateDot(activeDataSet['entschuldigt'])+'</b>';\t\n}\ncontent += '<br/>' + anzeige;\n\nreturn content;\t\n}", "render() {\n return (\n <div>\n <h3>Logged Exercises</h3>\n <table className=\"table\">\n <thead className=\"thead-light\">\n <tr>\n <th>Username</th>\n <th>Description</th>\n <th>Duration</th>\n <th>Date</th>\n <th>Actions</th>\n </tr>\n </thead>\n <tbody>\n {this.exerciseList()}\n </tbody>\n </table>\n </div>\n );\n }", "function getAllCompletedWorkoutsByUserName(res, user) { //get complete workouts\n Log.find({author:user}, function (err, workout) {\n if (err) res.send(err);\n res.json(workout);\n },{}).where({completed:true});\n}", "function showTime() {\r\n\t\r\n\r\n let today = new Date(),\r\n hour = today.getHours(),\r\n min = today.getMinutes(),\r\n sec = today.getSeconds();\r\n\r\n // Set AM or PM\r\n const amPm = hour >= 12 ? 'PM' : 'AM';\r\n\r\n // 12hr Format\r\n hour = hour % 12 || 12;\r\n\r\n // Output Time\r\n \r\n \tdashboardWelcomeText.innerHTML = `${hour}<span>:</span>${addZero(min)}<span>:</span>${addZero(\r\n sec\r\n \t)} ${showAmPm ? amPm : ''}`;\r\n \r\n \tcurrentDate = new Date();\r\n var currentYear = currentDate.getFullYear();\r\n var currentMonth = convertToMonth(currentDate.getMonth());\r\n var currentDay = convertToDayofWeek(currentDate.getDay());\r\n \r\n todayDayElement.innerHTML = currentDate.getDate();\r\n todayMonthElement.innerHTML = currentMonth;\r\n\r\n //auto join feature\r\n // Get classes from localStorage\r\n var classes = JSON.parse(localStorage.getItem('user')).evtList;\r\n var nextClass;\r\n var nextDate;\r\n notificationTable.innerHTML=\"\";\r\n\r\n // Loop through the classes\r\n for(var i = 0;i < classes.length;i++){\r\n\r\n \t\r\n var startTime = classes[i].start.toString();\r\n var endTime = classes[i].end.toString(); \r\n\r\n startDate = new Date(currentDate.getTime());\r\n startDate.setHours(startTime.split(\":\")[0]);\r\n startDate.setMinutes(startTime.split(\":\")[1]);\r\n startDate.setSeconds(startDate.getSeconds()-10)\r\n \r\n endDate = new Date(currentDate.getTime());\r\n endDate.setHours(endTime.split(\":\")[0]);\r\n endDate.setMinutes(endTime.split(\":\")[1]);\r\n\r\n var main=document.getElementById(\"main\");\r\n\r\n //warning system, next class notification, looping through the events until next event is found\r\n if(!nextDate && startDate>currentDate){\r\n \tnextClass = classes[i];\r\n\t nextDate = startDate;\r\n\t changeVariable = true;\r\n }\r\n \r\n if(startDate < nextDate && startDate>currentDate) {\r\n \t\tnextClass = classes[i];\r\n\t \tnextDate = startDate;\r\n\t \tchangeVariable = true;\r\n \t\r\n }\r\n \t\r\n \t//functions to automatically join zooms\r\n if( autojoin && hasJoined[i] == false && startDate < currentDate && endDate > currentDate){ \t\r\n \t//checking exact date if the repeated days aren't included. checks the day of weak of repeated\r\n \tif(classes[i].rptList.length == 0 && currentYear == classes[i].yr && currentMonth == classes[i].mt && currentDate.getDate() == classes[i].dy){\r\n \t\t//make a one time event that will not run again\r\n \t\thasJoined[i] = true;\r\n \t\twindow.open(classes[i].zoom);\r\n \t} \r\n \telse if(classes[i].rptList.includes(currentDay)){\r\n \t\t//make a one time event that will not run again\r\n \t\thasJoined[i] = true;\r\n \t\twindow.open(classes[i].zoom);\r\n \t}\r\n }\r\n else if(autojoin && hasJoined[i] == true && startDate < currentDate && endDate > currentDate){\r\n \t\r\n \tif(classes[i].rptList.length == 0 && currentYear == classes[i].yr && currentMonth == classes[i].mt && currentDate.getDate() == classes[i].dy){\r\n \t\tvar tr = document.createElement('TR');\r\n\t\t\t\tvar td = document.createElement('TD');\r\n\t\t\t\tvar notifications = [].slice.call(notificationTable.childNodes, 1);\r\n\t\t\t\t\r\n\t\t \ttd.appendChild(document.createTextNode(\"- Currently in \"+classes[i].name));\r\n\t\t \ttr.appendChild(td);\r\n\t\t \tnotificationTable.appendChild(tr);\r\n \t} \r\n \telse if(classes[i].rptList.includes(currentDay)){\r\n\r\n \t\tvar tr = document.createElement('TR');\r\n\t\t\t\tvar td = document.createElement('TD');\r\n\t\t\t\tvar notifications = [].slice.call(notificationTable.childNodes, 1);\r\n\t\t\t\tvar trButton = document.createElement('TR');\r\n\t\t \ttd.appendChild(document.createTextNode(\"- Currently in \"+classes[i].name));\r\n\t\t \ttr.appendChild(td);\r\n\t\t \ttd = document.createElement('TD')\r\n\r\n\t\t\t\t// add a button control.\r\n\t\t\t\tvar button = document.createElement('input');\r\n\r\n\t\t\t\t// set the attributes.\r\n\t\t\t\tbutton.setAttribute('type', 'button');\r\n\r\n\t\t\t\tbutton.setAttribute('class','joinClassButton')\r\n\t\t\t\tbutton.setAttribute('value', 'Join '+classes[i].name);\r\n\r\n\t\t\t\t// add button's \"onclick\" event.\r\n\t\t\t\tbutton.setAttribute('onclick', 'window.open(\\''+classes[i].zoom+'\\')' );\r\n\t\t\t\tbutton.setAttribute('style', 'background-color: '+centralColor)+';';\r\n\r\n\t\t\t\ttd.appendChild(button);\r\n\r\n\t\t\t\ttrButton.appendChild(td);\r\n\r\n \t\t\r\n \t\t\r\n\t\t \t\r\n\r\n\t\t \t\tnotificationTable.appendChild(tr);\r\n\t\t \t\tnotificationTable.appendChild(trButton);\r\n \t\t\r\n\r\n\r\n \t\t\r\n \t}\r\n \t\t\t\t\r\n\t\t \t\t\r\n\t\t \t\r\n \t\t}\r\n \t}\r\n\r\n\r\n \tvar moveon = true;\r\n\r\n \t\r\n\r\n \tif(nextClass != null && changeVariable){\r\n \tvar tr = document.createElement('TR');\r\n \tvar trButton = document.createElement('TR');\r\n\t\tvar td = document.createElement('TD');\r\n\t\tvar notifications = [].slice.call(notificationTable.childNodes, 1);\r\n\t\t\r\n \ttd.appendChild(document.createTextNode(\"- Joining next event, \"+nextClass.name+\", at \"+nextClass.start));\r\n \ttr.appendChild(td);\r\n \t\r\n\t \t\r\n \tvar inlist = false;\r\n\r\n \tfor(var i=0;i<notifications.length;i++){\r\n \t\t\r\n\r\n\t\t if(notifications[i].innerHTML==tr.innerHTML){\r\n\t\t inlist = true;\r\n\t\t \r\n\t\t }\r\n\t\t \r\n\t\t }\r\n\r\n\t\t moveon = false;\r\n \tif(inlist == false){\r\n \t\tif(nextClass.rptList.length == 0 && currentYear == nextClass.yr && currentMonth == nextClass.mt && currentDate.getDate() == nextClass.dy){\r\n \t\ttd = document.createElement('TD')\r\n\r\n\t\t\t\t// add a button control.\r\n\t\t\t\tvar button = document.createElement('input');\r\n\r\n\t\t\t\t// set the attributes.\r\n\t\t\t\tbutton.setAttribute('type', 'button');\r\n\r\n\t\t\t\tbutton.setAttribute('class','joinClassButton')\r\n\t\t\t\tbutton.setAttribute('value', 'Join '+nextClass.name);\r\n\r\n\t\t\t\t// add button's \"onclick\" event.\r\n\t\t\t\tbutton.setAttribute('onclick', 'window.open(\\''+nextClass.zoom+'\\')' );\r\n\t\t\t\tbutton.setAttribute('style', 'background-color: '+centralColor)+';';\r\n\r\n\t\t\t\ttd.appendChild(button);\r\n\r\n\t\t\t\ttrButton.appendChild(td);\r\n\r\n \t\tnotificationTable.appendChild(tr);\r\n \t\tnotificationTable.appendChild(trButton);\r\n \t\tupdateColors();\r\n \t} \r\n \telse if(nextClass.rptList.includes(currentDay)){\r\n \t\ttd = document.createElement('TD')\r\n\r\n\t\t\t\t// add a button control.\r\n\t\t\t\tvar button = document.createElement('input');\r\n\r\n\t\t\t\t// set the attributes.\r\n\t\t\t\tbutton.setAttribute('type', 'button');\r\n\r\n\t\t\t\tbutton.setAttribute('class','joinClassButton')\r\n\r\n\t\t\t\tbutton.setAttribute('style','background-color:'+centralColor+';')\r\n\t\t\t\tbutton.setAttribute('value', 'Join '+nextClass.name);\r\n\r\n\t\t\t\t// add button's \"onclick\" event.\r\n\t\t\t\tbutton.setAttribute('onclick', 'window.open(\\''+nextClass.zoom+'\\')' );\r\n\t\t\t\tbutton.setAttribute('style', 'background-color: '+centralColor)+';';\r\n\r\n\t\t\t\ttd.appendChild(button);\r\n\r\n\t\t\t\ttrButton.appendChild(td);\r\n\r\n \t\tnotificationTable.appendChild(tr);\r\n \t\tnotificationTable.appendChild(trButton);\r\n \t\tupdateColors();\r\n\r\n \t\t\r\n \t}else{\r\n \t\tmoveon = true;\r\n \t}\r\n \t\t\r\n \t}\r\n\r\n\t\t\r\n\r\n\r\n\t\tchangeVariable = false;\r\n }\r\n\r\n if(moveon){\r\n \tvar tr = document.createElement('TR');\r\n\t\tvar td = document.createElement('TD');\r\n\t\tvar notifications = [].slice.call(notificationTable.childNodes, 1);\r\n\t\t\r\n\t\tvar noNewEventsString = \"- No events today.\";\r\n \t\r\n \tif(classes.length>0){\r\n \t\tvar noNewEventsString = \"- Congratulations, you have no more events today.\";\r\n \t}\r\n \ttd.appendChild(document.createTextNode(noNewEventsString));\r\n \ttr.appendChild(td);\r\n \t\r\n \t\r\n \tvar inlist = false;\r\n \tfor(var i=0;i<notifications.length;i++){\r\n \t\t\r\n\r\n\t\t if(notifications[i].innerHTML==tr.innerHTML){\r\n\t\t inlist = true;\r\n\t\t \r\n\t\t }\r\n\t\t \r\n\t\t }\r\n \tif(inlist == false){\r\n \t\tnotificationTable.appendChild(tr);\r\n \t}\r\n }\r\n\r\n // updateColors();\r\n\r\n \tsetTimeout(showTime, 1000);\r\n}", "function displayTable($level) {\n console.log($level);\n // Uses the getShortestTimes() function in accessdb.php to query the database\n // and get the shortest times for that level. Then displays those times in\n // a table.\n $.post(\"accessdb.php\", { function: \"getShortestTimes\", level: $level }, function(data) {\n let users = [];\n let placementNumber = 1;\n for (let i = 0; i < data.length && placementNumber <= 10; i++) {\n let name = data[i]['user_name'];\n if (users.indexOf(name) === -1) {\n let gameTime = data[i]['game_time'];\n if (gameTime > 0) {\n let row = document.createElement(\"tr\"); // creates a row.\n row.className = 'scoreRow';\n let placementCell = document.createElement(\"td\");\n let placement = document.createTextNode(placementNumber);\n placementCell.appendChild(placement);\n let usernameCell = document.createElement(\"td\");\n let username = document.createTextNode(name);\n usernameCell.appendChild(username);\n let timeCell = document.createElement(\"td\");\n let time = document.createTextNode(\"\" + (Math.round(gameTime / 100) / 10) + \"s\");\n timeCell.appendChild(time);\n\n // adds cells to the row: placement, username, and time.\n row.appendChild(placementCell);\n row.appendChild(usernameCell);\n row.appendChild(timeCell);\n\n $(\"#besttimes\").append(row); // adds the row to the table.\n users.push(name);\n placementNumber++;\n }\n }\n }\n }, \"json\");\n }", "function showSetsByUser(user) {\n\t\tif(user > 0) {\n\t\t\tjQuery(\".saved-set-listing\").css(\"display\",\"none\");\n\t\t\tjQuery(\".user-\" + user).css(\"display\",\"inline\");\t\n\t\t} else {\n\t\t\tjQuery(\".saved-set-listing\").css(\"display\",\"inline\");\n\t\t}\n\t}", "function display(user)\n{\n\tif (user == \"P\") document.getElementById(\"participant\").style.visibility = \"visible\";\n\telse document.getElementById(\"experimenter\").style.visibility = \"visible\";\n}", "function showFormarttedInfo(user) {\n console.log('user Info', \"\\n id: \" + user.id + \"\\n user: \" + user.username + \"\\n firsname: \" + user.firsName + \"\\n \");\n}", "function displayProfile(times,temps){\n\tvar num_times = times.length;\n\t\n\tfor(i = 0 ; i < num_times ; i++){\n\t\tvar num_rows = profileTable.rows.length;\n\t\tvar row = profileTable.insertRow(num_rows);\n\t\t\n\t\tvar cell1 = row.insertCell(0);\n\t\tcell1.innerHTML = times[i];\n\t\t\n\t\tvar cell2 = row.insertCell(1);\n\t\tcell2.innerHTML = temps[i];\n\t}\n}", "async function showAttendanceInOutTime(){\n arrOnSites = await getDataAttendance();\n if(!arrOnSites) {\n AlertService.showAlertError('Không có dữ liệu', '', 4000);\n arrFilteredOnSites = [];\n }\n else arrFilteredOnSites = arrOnSites.slice();\n showPagination(arrOnSites, 1);\n}", "function showTimePastToUser(data){\n Swal.fire({\n title: '<strong>TIEMPO DÍA: ' + getCorrectDateFormat(data[0].fecha) + '</strong>',\n icon: 'info',\n html:\n getTypeOfDay(data[0].sol, data[0].prec)\n + '<p>Temperatura máxima (°C): ' + getCorrectData(data[0].tmax) + '</p>'\n + '<p>Temperatura mínima (°C): ' + getCorrectData(data[0].tmin) + '</p>'\n + '<p>Temperatura media (°C): ' + getCorrectData(data[0].tmed) + '</p>'\n + getTypeOfPrec(data[0].prec) + '<br>' +\n getCopyrightInfo(),\n showCloseButton: true,\n showCancelButton: false,\n focusConfirm: false,\n confirmButtonText:\n '<i class=\"fa fa-thumbs-up\"></i> Aceptar',\n confirmButtonAriaLabel: 'Thumbs up, great!',\n });\n }", "function getUserTimetable(userID, semesterID, callback) {\n pool.getConnection(function(err, connection) {\n if(err) {\n connection.release();\n return callback(err);\n }\n\n connection.query('SELECT `classTimeID`, `classID`, `day`, `time`, `buildingNumber`, `roomNumber`, `sort`, `subjectID`, `duration` FROM `UserClassTime` NATURAL JOIN `ClassTime` NATURAL JOIN `Class` NATURAL JOIN `Subject` WHERE `userID` = ? AND `semesterID` = ?;', [userID, semesterID], function(err, rows) {\n if(err) {\n connection.release();\n return callback(err);\n }\n\n // Release the connection\n connection.release();\n\n // Run callback\n callback(null, rows);\n });\n });\n}", "function getResponseEntriesForStudent(){\n console.log(\"Getting all exercise response entries for \\\n teacher \" + teacherID +\", lesson \" + lessonID +\" and student \" + studentID);\n dbShellResponsesForStudent.transaction(function(tx){\n tx.executeSql(\"select row_id,teacher_id,student_id,lesson_id,exercise_id,response,scoremark,comment\\\n from responseandmark where teacher_id=? and student_id=? order by lesson_id,exercise_id\",[teacherID,studentID]\n ,renderResponseEntriesForStudent,dberrorhandlerForResponseForStudent);\n },dberrorhandlerForResponseForStudent);\n}", "function selectLog(uid) {\n UserRecords.focusID(uid);\n }", "function userTableUpdateRow(data, user) {\n\tvar show_others = userTableShowOthers();\n\tvar tbl = document.getElementById('user-stats-table');\n\tvar backlink = \"FIXME\";\n\t\n\tvar userRow = 0;\n\tfor (var i = 1; i<tbl.rows.length; i++) {\n\t\tif (tbl.rows[i].cells[0].id == 'user-stats-table-' + user) \n\t\t\tuserRow=i;\n\t}\n\tif (userRow == 0) {\n\t\tconsole.log(\"userTableAddRow user \"+user+\" not found!\");\n\t\treturn;\n\t}\n\tvar row = tbl.rows[userRow];\n\t\n\t// Second cell is time of last access\n\tvar accesstime_cell = row.cells[1];\n\taccesstime_cell.innerHTML = data.last_access[user];\n\tif (data.last_access[user] == 0 || data.last_access == false) accesstime_cell.innerHTML = \"Never\";\n\t\n\tglobal_stats[user] = {};\n\t\n\t// Header contains sorted list of assignments, so we will use it as template\n\tvar end = tbl.rows[0].cells.length;\n\tif (show_others) end--;\n\tfor (var i=3; i<end; i++) {\n\t\tvar cell = tbl.rows[0].cells[i];\n\t\tvar asgn = cell.assignmentName;\n\t\tvar asgn_path = cell.assignmentPath;\n\t\t\n\t\t// No stats for path\n\t\tif (data.stats[user].length == 0 || !data.stats[user].hasOwnProperty(asgn)) {\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\tvar asgn_stats = data.stats[user][asgn];\n\t\t\n\t\tvar asgn_cell = row.cells[i];\n\t\tasgn_cell.innerHTML = \"<i class=\\\"fa fa-clock-o\\\"></i> \";\n\t\t// Convert seconds to minutes rounded to 2 places\n\t\tvar mins = asgn_stats['time'] / 60\n\t\tmins = Math.round(mins * 100) / 100;\n\t\tasgn_cell.innerHTML += mins;\n\t\t\n\t\tif (asgn_stats.hasOwnProperty('builds'))\n\t\t\tasgn_cell.innerHTML += \"<i class=\\\"fa fa-wrench\\\"></i> \" + asgn_stats['builds'];\n\t\tif (asgn_stats.hasOwnProperty('builds_succeeded'))\n\t\t\tasgn_cell.innerHTML += \"<i class=\\\"fa fa-gear\\\"></i> \" + asgn_stats['builds_succeeded'];\n\t\tif (asgn_stats.hasOwnProperty('test_results'))\n\t\t\tasgn_cell.innerHTML += \"<i class=\\\"fa fa-check\\\"></i> \" + asgn_stats['test_results'];\n\t\t\n\t\tasgn_cell.innerHTML = \"<a href=\\\"?user=\" + user + \"&amp;path=\" + asgn_path + \"&amp;backlink=\" + backlink + \"\\\">\" + asgn_cell.innerHTML + \"</a>\";\n\t\t\n\t\tglobal_stats[user][asgn_path] = { time: mins, builds: asgn_stats['builds'], builds_succeeded: asgn_stats['builds_succeeded'], test_results: asgn_stats['test_results'] };\n\t}\n\t\n\t// Calculate stats for \"others\" column\n\tif (show_others) {\n\t\tvar others_time = 0;\n\t\tvar others_builds = 0;\n\t\tvar others_builds_succeeded = 0;\n\t\t\n\t\tfor (var asgn in data.stats[user]) {\n\t\t\tif (!data.stats[user].hasOwnProperty(asgn)) continue;\n\t\t\tif (asgn.match(show_others_regex)) continue;\n\t\t\n\t\t\tvar asgn_stats = data.stats[user][asgn];\n\t\t\t\n\t\t\t// Add to \"others\" stats\n\t\t\tothers_time += asgn_stats['time'];\n\t\t\tif (asgn_stats.hasOwnProperty('builds')) others_builds += asgn_stats['builds'];\n\t\t\tif (asgn_stats.hasOwnProperty('builds_succeeded')) others_builds_succeeded += asgn_stats['builds_succeeded'];\n\t\t}\n\t\t\n\t\t// Others cell\n\t\tvar others_cell = row.cells[ row.cells.length - 1 ];\n\t\tothers_cell.innerHTML = \"<i class=\\\"fa fa-clock-o\\\"></i> \";\n\t\t// Convert seconds to minutes rounded to 2 places\n\t\tvar mins = others_time / 60\n\t\tmins = Math.round(mins * 100) / 100;\n\t\tothers_cell.innerHTML += mins;\n\t\t\n\t\tif (others_builds > 0) \n\t\t\tothers_cell.innerHTML += \"<i class=\\\"fa fa-wrench\\\"></i> \" + others_builds;\n\t\tif (others_builds_succeeded > 0)\n\t\t\tothers_cell.innerHTML += \"<i class=\\\"fa fa-gear\\\"></i> \" + others_builds_succeeded;\n\t}\n}", "function showTableOfUsers(result) {\n if(result.length>0) {\n var html = '<table class=\"primary\">';\n html += '<thead><tr>';\n html += '<th>Time</th>';\n html += '<th>First Name</th>';\n html += '<th>Last Name</th>';\n html += '<th>Email</th>';\n // html += '<th>Location</th>';\n html += '</tr></thead>';\n html += '<tbody>';\n for(var i in result) {\n var d = result[i].doc;\n if (d) {\n html += '<tr>';\n html += '<td>' + d.id + '</td>';\n html += '<td>' + d.nameFirst + '</td>';\n html += '<td>' + d.nameLast + '</td>';\n html += '<td>' + d.nameEmail + '</td>';\n // html += '<td>' + d.userLocation + '</td>';\n html += '</tr>';\n // html += '<tr>';\n var i;\n for (i=0; i<d.userLocation.length; i++){\n html += '<tr>' + '<th>Location</th>' + '</tr>';\n html += '<tr>' +'<td>' + d.userLocation[i] + '</td>' + '</tr>' ;\n }\n // html += '</tr>';\n }\n } \n html += '</tbody></table>';\n } else {\n html = \"nothing here\";\n }\n \n $(\"#divResults\").html(html);\n} //END showTableOfUsers();", "function getSingleReportDisplay(standupReport) {\n var report = \"*\" + standupReport.userName + \"* did their standup at \" + standupReport.datetime + \"\\n\";\n report += \"_What did you work on yesterday:_ `\" + standupReport.yesterdayQuestion + \"`\\n\";\n report += \"_What are you working on today:_ `\" + standupReport.todayQuestion + \"`\\n\";\n report += \"_Any obstacles:_ `\" + standupReport.obstacleQuestion + \"`\\n\\n\";\n return report;\n}", "function timeQuestion() {\n //If is different is because the user have not responded all questions\n if (countQuestion != questionList.length) {\n countTime--;\n $(\"#time\").text(countTime);\n\n //If countTime is zero is because the time finished\n if (countTime == 1) {\n countLoose++;\n visibleAnswer(false, true);\n }\n }\n //The responded all question, and we have to stop timer\n else {\n clearInterval(time);\n }\n }", "function userTableShowOthers() {\n\tvar tbl = document.getElementById('user-stats-table');\n\tvar row = tbl.rows[0];\n\tvar end = row.cells.length-1;\n\tvar idlast = row.cells[end].id;\n\tif (idlast == \"show_others\") return true;\n\treturn false;\n}", "function onTimeForTheExam(input = []) {\n let [examHour, examMinutes, arrivalHour, arrivalMinutes] = [...input].map(Number);\n let examMins = (examHour * 60) + examMinutes;\n let arrivalMins = (arrivalHour * 60) + arrivalMinutes;\n let timeDiffMins = examMins - arrivalMins;\n\n let output = [];\n if (timeDiffMins > 30) {\n output.push('Early');\n if (timeDiffMins > 59) {\n let h = Math.floor(timeDiffMins / 60);\n let min = timeDiffMins % 60;\n if (min < 10) {\n min = '0' + min;\n }\n output.push(`${h}:${min} hours before the start`);\n } else {\n output.push(`${timeDiffMins} minutes before the start`);\n }\n } else if (timeDiffMins >= 0) {\n output.push('On time');\n if (timeDiffMins !== 0) {\n output.push(`${timeDiffMins} minutes before the start`);\n }\n } else {\n output.push('Late');\n timeDiffMins = Math.abs(timeDiffMins);\n if (timeDiffMins > 59) {\n let h = Math.floor(timeDiffMins / 60);\n let min = timeDiffMins % 60;\n if (min < 10) {\n min = '0' + min;\n }\n output.push(`${h}:${min} hours after the start`);\n } else {\n output.push(`${timeDiffMins} minutes after the start`);\n }\n }\n return output.join('\\n');\n}", "constructor(user) {\n this.userId = user.id;\n this.date = date;\n this.hoursSleptToday = 0;\n this.sleepQualityToday = 0;\n this.hoursSleptAverage = 0;\n this.sleepQualityAverage = 0;\n this.hoursRecord = [];\n this.qualityRecord = []\n }", "function displayLogs(logs) {\r\n let html = '';\r\n for (let log of logs) {\r\n html += `<tr>\r\n <td>${log.id}</td>\r\n <td>${log.studentId}</td>\r\n <td>${log.created}</td>\r\n <td>${log.stream}</td>\r\n <td>\r\n <a class=\"waves-effect waves-light btn\" onclick=\"deleteLog(${log.id})\" href=\"#logsTable\">DELETE</a>\r\n </td>\r\n </tr>`;\r\n }\r\n document.querySelector('#logsTable').innerHTML = html;\r\n }", "function displayUserResults() {\n state.userResults.forEach(function (item) {\n let htmlItem = $('.js-userResult.templ').clone();\n htmlItem.find('.js-name-title').append(`${item.firstName} ${item.lastName}`);\n htmlItem.find('.js-name').attr('uid', item._id);\n htmlItem.find('.js-name').attr('firstName', item.firstName);\n htmlItem.find('.js-username').append(`(${item.username})`);\n if (item.watchlist.length === 1) {\n htmlItem.find('.js-listCount').append(`${item.watchlist.length} item in their Watchlist.`);\n } else {\n htmlItem.find('.js-listCount').append(`${item.watchlist.length} items in their Watchlist.`);\n }\n htmlItem.removeClass('templ');\n $('.js-userResults-list').append(htmlItem);\n $('.js-userResults').removeClass('hidden');\n $('.js-userResults').show();\n });\n $('.js-noUsers').addClass('hidden');\n $('.js-watchlist').hide();\n $('.js-watchlist-results').html('');\n $('.results').hide();\n $('.js-results-container').html('');\n $('.js-returnButton').removeClass('hidden');\n $('.js-welcome').addClass('hidden');\n}", "function showData(e) {\n e.preventDefault();\n console.log(\"current user = \", user);\n }", "function viewUsersession(a) {\n $(\"li.actparent\").toggleClass(\"actparent\");\n $(\".username.act\").toggleClass(\"act\");\n //name = $(\".username.act\").html()\n $(a).find(\".username\").toggleClass(\"act\");\n $(a).toggleClass(\"actparent\");\n name = $(\".username.act\").html();\n console.log(name);\n $(\".usrnam\").text(name);\n $(\"#userhistorypane\").css(\"opacity\", \"0\");\n dbOperations(\"sessions\", \"select_operation\", [\"users_session\", \"username\", String($(\".username.act\").html())]);\n check_for_active_row(\"username\", \"acc\");\n $(\"#userhistorypane\").animate({\n opacity: 1\n })\n}", "function directUserFromViewInfo() {\n if (nextStep == \"Departments\") {\n viewDepartments();\n }\n if (nextStep == \"Roles\") {\n viewRoles();\n }\n if (nextStep == \"Employees\") {\n viewEmployees();\n }\n if (nextStep == \"All Information\") {\n viewAll();\n } \n }", "function renderResponseEntriesForExercise(tx,results){\n console.log(\"Rendering response entries of all students for exercise \" + exerciseID + \" of lesson \"+ lessonID + \" of teacher \" + teacherID);\n if (results.rows.length == 0) {\n console.log(\"No row found for the query in responseandmark table\");\n $(\"#studentListForEx\").html(\"<p>この練習はだれも答えてないです。</p>\");\n } else {\n var s = \"<table id='studentAndScores'><tr>\";\n console.log(\"Number of responses from students = \" + results.rows.length);\n \n dbShellStudents = window.openDatabase(\"StudentProfile\",2,\"StudentProfile\",1000000);\n \n //open student database\n //get info from StudentProfile database for student_id\n dbShellStudents.transaction(setupTable,dberrorhandler,function(){\n console.log(\"Getting student entries for exercise.\");\n\n dbShellStudents.transaction(\n function(tx){\n// console.log(\"teacher = \" + item.teacher_id + \"student=\" + item.student_id + \"lesson\" + item.lesson_id + \"exercise\" + item.exercise_id + \"response=\" + item.response);\n dbShellStudents.transaction(function(tx){\n for(var i=0; i<results.rows.length; i++) {\n //getting student info\n var student_ID = results.rows.item(i).student_id;\n var responseURI = results.rows.item(i).response;\n var scoreMark;\n if(results.rows.item(i).scoreMark == null)\n scoreMark = -1;\n var studentImageURI;\n var studentName;\n \n var item = results.rows.item(i);\n console.log(\"i=\"+i+\"id=\" + student_ID); //+ \"name=\" + studentName);\n (function(student_ID,scoreMark){\n tx.executeSql(\"select id,name,image from students where id=?\",[student_ID],\n function(tx,res){\n //studentID is unique\n studentImageURI = res.rows.item(0).image;\n studentName = res.rows.item(0).name;\n //\n //show student image, student name and score mark\n s = s +\n \"<div id ='responseFromStudent?id=\" + i + \"'>\"+\n \"<li>\" +\n \"<img height='40' width='40' src=\\\"\" + studentImageURI + \"\\\" ><br>\" +\n \"<p>\";\n \n if(scoreMark != -1){\n s += \"<p> スコアー:\" + scoreMark + \"</p>\";\n }\n \n s +=\"<a href='#response?studentID=\" + student_ID + \"&studentName=\" + studentName +\"'> 学生名:\" + studentName + \"</a>\" +\n \"</p><br>\";\n\n s +=\"</li>\"+\"</div>\";\n\n },\n function(err){\n console.log(\"Student info get Error: \"+err.message + \"\\nCode=\"+err.code);\n alert(\"Student info get Error: \"+err.message + \"\\nCode=\"+err.code);\n }\n );\n\n })(student_ID,scoreMark);\n }//end for\n }\n ,dberrorhandler,\n function(){\n s +=\"</tr>\"+\"</table>\";\n console.log(s);\n console.log(\"Showing the list\");\n $(\"#studentListForEx\").html(s);\n $(\"#studentListForEx\").listview().listview(\"refresh\");\n }\n );\n },\n dberrorhandler\n );\n \n });\n }\n}", "function examtimetable(){\n\n var request= new XMLHttpRequest();\n\n var formData = new FormData();\n\n // retreiving data from html page\n formData.append(\"studentNumber\", sessionStorage.getItem('username'));\n\n //sending post data to external api\n request.open(\"POST\",\"http://127.0.0.1:8000/api/viewExamTimetable\");\n\n // logic for handling received data\n request.onload=function(){\n var data=JSON.parse(request.responseText);\n console.log(data); \n\n //populating table with user data received from database\n for (var i=0;i<data.length;i++) {\n //console.log(i);\n document.getElementById(parseInt(i+1)+ \"x\" + parseInt(1)).innerHTML =data[i]['date'] ;\n document.getElementById(parseInt(i+1)+ \"x\" + parseInt(2)).innerHTML =data[i]['module'] ;\n document.getElementById(parseInt(i+1)+ \"x\" + parseInt(3)).innerHTML =data[i]['venue'] ;\n document.getElementById(parseInt(i+1)+ \"x\" + parseInt(4)).innerHTML =data[i]['period'] ;\n localStorage.setItem(\"exam-\" + parseInt(i+1)+ \"x\" + parseInt(3), String(data[i]['venue']));\n\n\n }\n\n //disabling table elements which have no data so they are not clickable\n for (var i=1; i<6; i++ ){\n for (var j=1; j<5; j++){\n if (!document.getElementById(String(i) +\"x\"+ String(j)).innerHTML){\n document.getElementById(String(i) +\"x\"+ String(j)).onclick=null;\n }\n }\n } \n\n }\n\n\n request.send(formData); \n\n}", "function printOneUser(user) {\n searchInput.value = \"\";\n errorMsg.innerText = \"\";\n userTable.innerHTML += `<tr>\n <td>${user.fullName}</td>\n <td>${user.age}</td>\n <td>${user.isMarried ? `Yes, with ${user.spouse}` : `No`}</td>\n <td>${user.city}</td>\n <td>${user.country}</td>\n <td>${user.pets.join(\", \")}`;\n}", "function startInterview(){\n // timer start \n // database upate user data\n // user id will be the object id? is that going to be safe? simply i will bcrypt the roomid and make it userid \n }", "addStudentToStudentsExams(exam){\n if(!this.checkIfStudentInExamList(exam.student_id)[0]){\n this.students_exams.push(exam);\n }\n }", "function getAndDisplayUserReport() {\n getUserInfo(displayUserReport);\n}", "function fnTeacherTimeTableSummaryView() {\n\tvar emptyTeacherTimeTableSummary = {\n\t\tfilter: {\n\t\t\tteacherName: \"\",\n\t\t\tteacherID: \"\",\n\t\t\tdate: \"\",\n\t\t\tauthStat: \"\"\n\t\t},\n\t\tSummaryResult: [{\n\t\t\tteacherName: \"\",\n\t\t\tteacherID: \"\"\n\t\t}]\n\t};\n\t// Screen Specific DataModel Starts\t\t\t\t\t\t\t\t\t\n\tvar dataModel = emptyTeacherTimeTableSummary;\n\tvar $scope = angular.element(document.getElementById('SubScreenCtrl')).scope();\n\tif ($scope.teacherName != null)\n\t\tdataModel.filter.teacherName = $scope.teacherName;\n\tif ($scope.teacherID != null)\n\t\tdataModel.filter.teacherID = $scope.teacherID;\n\tif ($scope.authStat != null)\n\t\tdataModel.filter.authStat = $scope.authStat;\n\t// Screen Specific DataModel Ends\n\tvar response = fncallBackend('TeacherTimeTableSummary', 'View', dataModel, [{\n\t\tentityName: \"teacherID\",\n\t\tentityValue: \"\"\n\t}], $scope);\n\treturn true;\n}", "function setupData() {\n $scope.assessmentOverallPerformance = {};\n $scope.assessmentOverallMatrix = \"\";\n $scope.userOrderList = \"\";\n\n GroupStatisticsFactory.getAssessmentOverallPerformance($scope.selectedAssessment).then(\n function(performanceBySubject) {\n // Este forEach() preenche completamente o $scope.assessmentOverallPerformance\n performanceBySubject.forEach(\n function(user, userIndex, userArray) {\n var listBySubject = user.listBySubject;\n $scope.assessmentOverallPerformance[user.username] = [];\n for (var i = 0; i < listBySubject.length; i++) {\n if (listBySubject[i].subject !== \"Espanhol\") {\n questionList = listBySubject[i].questionList;\n for (var j = 0; j < questionList.length; j++)\n questionList[j] = {\n questionNumber: questionList[j].questionNumber,\n isUserRight: questionList[j].userAnswer === questionList[j].correctAnswer ? 1 : 0\n };\n $scope.assessmentOverallPerformance[user.username] = $scope.assessmentOverallPerformance[user.username].concat(questionList);\n }\n }\n $scope.assessmentOverallPerformance[user.username].sort(function(a, b) {\n if (a.questionNumber < b.questionNumber)\n return -1;\n return +1;\n });\n }\n );\n // Agora preenchemos a matriz numérica, para o Octave, e a lista da ordem de usuários (para saber o que é cada linha da matriz)\n for (username in $scope.assessmentOverallPerformance) {\n $scope.userOrderList += username + \"\\n\";\n for (var i = 0; i < $scope.assessmentOverallPerformance[username].length; i++)\n $scope.assessmentOverallMatrix += $scope.assessmentOverallPerformance[username][i].isUserRight + \" \";\n $scope.assessmentOverallMatrix += \";\\n\";\n }\n }\n );\n }", "function renderUser(user) {\n numQuestions = user.questions.length;\n\n // Populate list of unanswered questions\n for (let i = 0; i < numQuestions; i++) {\n if (!user.questions[i].answered) {\n remainingQuestions.push(user.questions[i]);\n } else {\n completedQuestions.push(user.questions[i].number);\n }\n }\n\n numCompleted = completedQuestions.length;\n var completedQuestionsString = \"\";\n for (var i = 0; i < numCompleted; i++) {\n completedQuestionsString += completedQuestions[i] + \", \";\n }\n $(\"#questions-completed\").html(completedQuestionsString);\n\n $(\"#num-questions\").html(numQuestions);\n $(\"#num-completed\").html(numCompleted);\n $(\"#username\").html(user.userName);\n $(\"#logged-in\").css(\"display\", \"block\");\n}", "function teacherSchd(name, activity, grade,helper){\n\tvar table = document.getElementById(\"teachSchedule\");\n\tvar teachers=['Jennifer Winkler','Leane Sikes','Jackie Holowinski','Jean Rorro',\n\t'Carolyn Cooney','Kim McCloskey','Robert Crescitelli', 'Audrey Mutch',\n\t'Laura Cibbattoni', 'Rebecca Gloede'];\n\tvar formattedActivity=\"\";\n\tswitch(activity) {\n\t\tcase 'free':\n\t\tformattedActivity = 'Free Time';\n\t\tbreak;\n\t\tcase 'outdoor':\n\t\tformattedActivity = ' Outdoor Activity';\n\t\tbreak;\n\t\tcase 'talent':\n\t\tformattedActivity = 'Talent Show';\n\t\tbreak;\n\t\tcase 'crafts':\n\t\tformattedActivity = 'Arts & Crafts';\n\t\tbreak;\n\t\tcase 'group':\n\t\tformattedActivity = 'Group Activity';\n\t\tbreak;\n\t\tcase 'hallway':\n\t\tformattedActivity = 'Hallway Activity';\n\t\tbreak;\n\t\tcase 'kidTeach':\n\t\tformattedActivity = 'Kids Teaching Kids';\n\t\tbreak;\n\t\tdefault:\n\t\tformattedActivity = activity;\n\t\tbreak;\n\t}\n\n\tif(helper === 1){\n\t\t//setup the headers\n\t\tvar header = table.insertRow(-1);\n\t\tfor(teacher in teachers){\n\t\t\tvar head1 = header.insertCell();\n\t\t\thead1.innerHTML = teachers[teacher];\n\t\t}\n\n\t\t//setup table - assume each teacher has no more than 60 students.\n\t\tfor(var r = 0; r < 60; r++){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var t =0; t<10; t++){\n\t\t\t\tvar cell= row.insertCell();\n\t\t\t\tcell.innerHTML =\"\";\n\t\t\t}\n\t\t}\n\t}\n\t//add students to teachers table\n\tswitch(grade) {\n\t\tcase '1w':\n\t\ttable.rows[window.w1].cells[0].innerHTML = name + \": \" + formattedActivity;\n\t\twindow.w1++;\n\t\tbreak;\n\t\tcase '1s':\n\t\twindow.s1++;\n\t\tif(table.rows[window.s1].cells[1].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.s1].cells[1].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.s1].cells[1].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '2h':\n\t\twindow.h2++;\n\t\tif(table.rows[window.h2].cells[2].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.h2].cells[2].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.h2].cells[2].innerHTML = name + \": \" + formattedActivity;\n\n\t\tbreak;\n\t\tcase '2r':\n\t\twindow.r2++;\n\t\tif(table.rows[window.r2].cells[3].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.r2].cells[3].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.r2].cells[3].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '3c':\n\t\twindow.c3++;\n\t\tif(table.rows[window.c3].cells[4].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.c3].cells[4].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.c3].cells[4].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '3m':\n\t\twindow.m3++;\n\t\tif(table.rows[window.m3].cells[5].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.m3].cells[5].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.m3].cells[5].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '4c':\n\t\twindow.c4++;\n\t\tif(table.rows[window.c4].cells[6].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.c4].cells[6].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.c4].cells[6].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '4m':\n\t\twindow.m4++;\n\t\tif(table.rows[window.m4].cells[7].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.m4].cells[7].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.m4].cells[7].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '5c':\n\t\twindow.c5++;\n\t\tif(table.rows[window.c5].cells[8].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.c5].cells[8].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.c5].cells[8].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '5g':\n\t\twindow.g5++;\n\t\tif(table.rows[window.g5].cells[9].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.g5].cells[9].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.g5].cells[9].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\n\t\tdefault:\n\t\talert(\"Error: grade not found: \" + grade);\n\t}\n}", "function showActivityResults(results){\n\n $(\"#tableBody tr\").remove();\n var tbody = $(\"#tableBody\");\n\n $(\"#tableHeading tr\").remove();\n var thead = $(\"#tableHeading\");\n $(\n \"<tr>\"\n + \"<th>ID</th>\"\n + \"<th>Title</th>\"\n + \"<th>Creator</th>\"\n + \"</tr>\"\n ).appendTo(thead);\n\n for(var i = 0; i < results.length; i++){\n var a = results[i];\n var creator = users.filter(function(o){ return o.id == a.creator_id}) ;\n\n $(\"<tr>\" +\n \"<td>\" + a.id + \"</td>\" +\n \"<td>\" + a.title + \"</td>\" +\n \"<td>\" + creator[0].name + \"</td>\" +\n\n \"</tr>\").appendTo(tbody);\n }\n}", "function viewEmployees() {\r\n connection.query(\"SELECT employee.first_name, employee.last_name, role.title, role.salary, department.name, CONCAT(e.first_name, ' ' ,e.last_name) AS Manager FROM employee INNER JOIN role on role.id = employee.role_id INNER JOIN department on department.id = role.department_id left join employee e on employee.manager_id = e.id;\", \r\n function(err, res) {\r\n if (err) throw err\r\n console.table(res)\r\n questions();\r\n })\r\n}", "function viewByRole() {\n connection.query(\"SELECT first_name, last_name, role.title FROM((employee INNER JOIN role ON role_id = role.id) INNER JOIN department ON department_id = department.id);\", function (err, res) {\n if (err) throw err;\n console.log(\"\\n All employees retrieved from database by role. \\n\");\n console.table(res);\n askQuestions();\n });\n}", "function viewEmps() {\n let query = `SELECT e.id AS \"ID\", e.first_name AS \"FIRST NAME\", e.last_name AS \"LAST NAME\", \nr.title AS \"ROLE\", d.name AS \"DEPARTMENT\", r.salary AS \"SALARY\", \n(select concat(emp.first_name,' ',emp.last_name) from employee as emp where e.manager_id = emp.id) AS \"MANAGER\"\nFROM employee e \nLEFT JOIN role r ON e.role_id=r.id\nLEFT JOIN department d ON r.department_id = d.id;`;\n connection.query(query, (err, res) => {\n if (err) throw err;\n printTable(res);\n CMS();\n });\n}", "function fnTeacherTimeTableSummaryDetail() {\n\n\tvar $scope = angular.element(document.getElementById('SubScreenCtrl')).scope();\n\t// Specific Screen Scope Starts\n\t$scope.teacherName = \"\";\n\t$scope.teacherID = \"\";\n\t$scope.authStat = \"\";\n\t\n\t$scope.teacherNamereadOnly = true;\n\t$scope.teacherIDreadOnly = true;\n\t$scope.authStatreadOnly = true;\n\t$scope.recordStatreadOnly = true;\n\t$scope.mvwAddDeteleDisable = true; //Multiple View\n\t// Screen Specific Scope Ends\n\t// Generic Field starts\n\t$scope.operation = 'View';\n\t$scope.mastershow = true;\n\t$scope.detailshow = false;\n\t$scope.searchShow = false;\n\t$scope.selectedIndex = 0;\n\t// Generic Field Ends\t\n\tvar lscreenKeyObject = new Object();\n\tlscreenKeyObject.teacherID = $scope.TeacherTimeTableSummaryTable[$scope.selectedIndex].teacherID;\n\n\tfninvokeDetailScreen('TeacherTimeTable', lscreenKeyObject, $scope);\n\n\treturn true;\n}", "function getExerciseEntriesFromLessons(){\n console.log(\"Getting Exercise Entries for lesson Page \" + lessonID);\n dbShellLessons.transaction(function(tx){ // put teacher_id also\n tx.executeSql(\"select lessonRow_id,teacher_id,lesson_id,exercise_id,exercise_title,exercise_detail,\\\n exercise_voice,exercise_image from lessons where lesson_id=? group by exercise_id\",[lessonID]\n ,renderEntriesForExerciseInLessonPage,dberrorhandlerForLessons);\n },dberrorhandlerForLessons);\n}", "function submitPage(){\n $scope.beginExamClicked = true;\n var testFinishTime=new Date();\n var totalAttempted= 0,totalCorrect=0;\n var questionStatsList=[];\n var questionStats={};\n for(var j=0; j<$rootScope.questions.length;j++){\n \tquestionStats={};\n \tquestionStats.examId=$rootScope.currentExam.examSetId;\n \tquestionStats.userId=$scope.userId;\n \tquestionStats.examDate=getDateTime();\n \tquestionStats.attemptNo=$rootScope.currentExam.currentAttempt;\n\n \tquestionStats.moduleName=getModuleName(j);\n \tquestionStats.questionId=\"question_\"+j;\n \tquestionStats.isCorrect='N';\n \tquestionStats.userAnswer=$rootScope.questions[j].user_selected_option;\n \tquestionStats.correctAnswer=$rootScope.questions[j].correct_option;\n \tquestionStats.score=0;\n \tquestionStats.timeTaken=\"00:00:00\";\n\n if($rootScope.questions[j].user_selected_option!='-1'){\n totalAttempted++;\n if($rootScope.questions[j].user_selected_option==$rootScope.questions[j].correct_option){\n totalCorrect++;\n questionStats.isCorrect='Y';\n questionStats.score=$rootScope.currentExam.correctMarks;\n }else{\n \tif($rootScope.currentExam.isNegativeMarks){\n \t\tquestionStats.score=$rootScope.currentExam.negativeMarks;\n \t}\n }\n questionStats.timeTaken=$rootScope.questions[j].timeTaken;\n }\n\n questionStatsList.push(questionStats);\n }\n $rootScope.currentExam.total_questions_attempted=totalAttempted;\n $rootScope.currentExam.total_questions_correct=totalCorrect;\n\n if($rootScope.currentExam.is_negative_marks_applicable){\n \t$rootScope.currentExam.score_obtained=totalCorrect*$rootScope.currentExam.correct_marks-(totalAttempted-totalCorrect)*$rootScope.currentExam.negativeMarks;\n \t}else{\n \t\t$rootScope.currentExam.score_obtained=totalCorrect*$rootScope.currentExam.correctMarks;\n \t}\n $rootScope.currentExam.total_time_taken=findTimeDifference(testStartTime,testFinishTime);\n\n //update modal & save in DB\n saveExamStats(questionStatsList);\n }", "getCompletedListData(questions, users, session) {\n const list = [];\n\n for (const key in session.user.answers) {\n const poll = questions[key];\n\n if (poll) {\n poll.askedBy = users[poll.author];\n poll.hasAnswer = true;\n list.push(poll);\n }\n }\n\n return list.sort((a, b) => {\n if (a.timestamp === b.timestamp) return 0;\n return a.timestamp > b.timestamp ? -1 : 1;\n });\n }", "function showScoreScreen() {\n console.log(\"showScoreScreen() fires\");\n\n timerContainer.style.display = \"none\";\n\n // ensure no negative times\n if (timer < 0) {\n timer = 0;\n }\n\n // ensure timer/ score screen is correc at end;\n setCircleDashArray();\n\n //hide question and timer div\n questionDiv.style.display = \"none\";\n displayTimerDiv.style.display = \"none\"; \n \n // show score div\n scoreDiv.style.display = \"block\";\n\n //create score element and display\n var scoreDisplay = document.createElement(\"h1\");\n scoreDisplay.textContent = \"You scored \" + timer + \"!\";\n questionDiv.appendChild(scoreDisplay);\n\n saveUser();\n}", "function fnTeacherTimeTableSummaryMandatoryCheck(operation) {\n\tvar $scope = angular.element(document.getElementById('SubScreenCtrl')).scope();\n\n\tswitch (operation) {\n\t\tcase 'View':\n\t\t\tif ((($scope.teacherName == '' || $scope.teacherName == null) &\n\t\t\t\t\t($scope.authStat == '' || $scope.authStat == null || $scope.authStat == \"Select option\") &\n\t\t\t\t\t($scope.recordStat == '' || $scope.recordStat == null || $scope.recordStat == \"Select option\")))\n\n\t\t\t{\n\t\t\t\tfn_Show_Exception('FE-VAL-028');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t\tbreak;\n\n\t\tcase 'Detail':\n\t\t\treturn true;\n\t\t\tbreak;\n\t}\n\treturn true;\n}", "function tablesRecordHistory (val, type, row) {\n var txt = '';\n\n if (row['INSERTED_BY'] !== null || row['CHANGED_BY'] !== null) {\n if (row['INSERTED_BY'] !== null && row['CHANGED_BY'] === null) {\n txt = '<span class=\"timelogValue\" title=\"' + JS_CREATED + '\"><i class=\"fas fa-user-plus timelogIcon\"></i> ' + row['INSERTED_BY'] + ' - ' + row['DT_INSERTED'] + '</span>';\n } else if (row['INSERTED_BY'] === null && row['CHANGED_BY'] !== null) {\n txt = '<span class=\"visible-xs visible-sm visible-md visible-lg timelogValue timelogChanged\" title=\"' + JS_LAST_CHANGED + '\">' +\n '<i class=\"fas fa-user-edit timelogIcon\"></i> '\n + row['CHANGED_BY'] + ' em ' + row['DT_UPDATED']\n + '</span>';\n } else {\n txt = '<span class=\"timelogValue\" title=\"' + JS_CREATED + '\"><i class=\"fas fa-user-plus timelogIcon\"></i> ' + row['INSERTED_BY'] + ' - ' + row['DT_INSERTED'] + '</span>' +\n '<span class=\"visible-xs visible-sm visible-md visible-lg timelogValue timelogChanged\" title=\"' + JS_LAST_CHANGED + '\">' +\n '<i class=\"fas fa-user-edit timelogIcon\"></i> '\n + row['CHANGED_BY'] + ' em ' + row['DT_UPDATED']\n + '</span>';\n }\n } else {\n txt = '<span class=\"timelogValue\">&nbsp;</span>';\n }\n return txt;\n}", "function viewAllEmployees(promptUser) {\n connection.query(`SELECT emp.id, emp.first_name, emp.last_name, role.title, department.name AS department, role.salary, concat(mng.first_name,' ',mng.last_name) as manager FROM employee emp LEFT JOIN role ON emp.role_id = role.id LEFT JOIN department ON role.department_id = department.id\n LEFT JOIN employee mng ON emp.manager_id = mng.id ORDER BY emp.id`, function (err, data) {\n if (err) throw err;\n console.table(\"\\n\",data);\n promptUser();\n })\n}", "function printTimer() {\n let newCurrentTime = [timer.min, timer.sec, timer.millisecond];\n if (timer.millisecond < 99) {\n timer.millisecond += 1;\n } else if (timer.sec < 60) {\n timer.millisecond = 0;\n timer.sec += 1;\n } else {\n timer.sec = 0;\n timer.min += 1;\n }\n showTime.innerHTML = timeFormat();\n\n //for the table\n if (!firstTime && document.getElementById(\"timeRecord_body\").firstChild !== null) {\n let table_splitTime = document.getElementById(\"timeRecord_body\").firstChild;\n\n //for the table lapTime time running\n let table_lapTimeChange = table_splitTime.firstChild.nextSibling;\n table_lapTimeChange.innerHTML = otherTimeDifferent(timer.newlastSave, newCurrentTime);\n\n //for the table split time running\n let table_splitTimeChange = table_splitTime.firstChild.nextSibling.nextSibling;\n table_splitTimeChange.innerHTML = timeFormat();\n }\n}", "async function showAttendanceWorkMoreTime(){\n arrOnSites = await getDataAttendance();\n if(!arrOnSites) {\n AlertService.showAlertError('Không có dữ liệu', '', 4000);\n arrFilteredOnSites = [];\n }\n else arrFilteredOnSites = arrOnSites.slice();\n showPagination(arrOnSites, 2);\n}", "function viewtime(e) {\n const eventID = e.target.value;\n for(let i = 0; i < eventclass.length; i ++) {\n let apm = \"AM\";\n if(eventclass[i].apm == 0) {\n apm = \"AM\";\n } else {\n apm = \"PM\";\n }\n \n let endapm = \"AM\";\n if(eventclass[i].end_apm == 0) {\n endapm = \"AM\";\n } else {\n endapm = \"PM\";\n }\n let tag = eventclass[i].tag;\n if(tag == null) {\n tag = \"None\";\n }\n if(eventclass[i].id == eventID) {\n alert(\"Name: \" + eventclass[i].name +\"\\n Date: \" + eventclass[i].month + \"/\" + eventclass[i].day + \"/\" + eventclass[i].year + \"\\n Time: \"+ eventclass[i].hour + \":\" + eventclass[i].minute + \" \" + apm + \" - \" + eventclass[i].end_hour + \":\" + eventclass[i].end_minute + \" \" + endapm + \"\\n Tag: \" + tag);\n }\n }\n}", "function logs() {\n\t$.ajax({\n\t\turl \t: 'admin/getLogs',\n\t\ttype \t: 'post',\n\t\tdataType: 'json',\n\t\tsuccess : function(data) {\n\t\t\tvar html = '';\n\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\thtml += '<tr>'+\n\t\t\t\t\t\t\t'<td>'+data[i].fac_fname+' '+data[i].fac_mname+' '+data[i].fac_lname+' <small><i>'+data[i].task+' '+data[i].file_title+' on '+data[i].log_date+'</i></small></td>'+\n\t\t\t\t\t\t'</tr>';\n\t\t\t}\n\t\t\t$('#all-logs').html(html);\n\t\t},\n\t\terror \t: function() {\n\t\t\talert('error: getLogs');\n\t\t}\n\t});\n}", "function UserStatistic(user) {\n\t\t\tvar formData = {\n\t\t\t\t'Username' : user\n\t\t\t}\n\t\t\t\t$.post(\"/Home/UserData\", formData, function(response, status, xhr) {\n\t\t\t \n\t\t\t let deSerializedJson = parseJson(response)\n\n\t\t\t deSerializedJson.forEach(item => {\n\t\t\t \t$(`#${item.PartOf}`).append(`<p>${item.Destination1} To ${item.Destination2}</p>`)\n\t\t\t })\n\n\n\t\t\t}).fail(function(data){\n\t\t\t\t$('.flash').html('Something went wrong, Try Again')\n\t\t \t$('.flash').css( \"background-color\", \"red\");\n\t\t \t$(\"#newUser\").toggleClass(\"hide\");\n\t\t \t$(\"#user\").toggleClass(\"hide\");\n\t\t\t\t$('.wrapper').toggleClass(\"blur\")\n\t\t\t\t})\n\t}", "function viewAllEmployees() {\n const query = \"SELECT employee.id, employee.first_name, employee.last_name, role.title, department.department_name AS department, role.salary FROM employee LEFT JOIN role ON employee.role_id = role.id LEFT JOIN department on role.department_id = department.id\";\n db.query(query, function (err, res) {\n console.table(res);\n startTracker();\n });\n}", "function scoredisplay(){\r\n scorepage.style.display = \"block\";\r\n quiz.style.display = \"none\";\r\n timer.style.display = \"none\";\r\n let scorePercent = Math.round(100 * score/questions.length);\r\n scorealert.innerHTML = \"<h2>\" + \"Your score is\" + \" \" + scorePercent + \"%\" + \"</h2>\";\r\n record();\r\n }", "function showRuns(){\n\t\t//get runs object\n\t\tvar runs2 = getRunsObject();\n\n\t\t//check if not empty\n\t\tif(runs2 != '' && runs2 != null){\n\t\t\tfor(var i = 0; i < runs2.length; i++){\n\t\t\t\t$('#stats').append('<li class=\"ui-body-inherit ui-li-static\"><strong>Date: </strong>'+runs2[i][\"date\"]+\n\t\t\t\t\t'<br><strong>Distance: </strong>'+runs2[i][\"miles\"]+'m<div class=\"controls\">'+\n\t\t\t\t\t'<a href=\"#edit\" id=\"editLink\" data-miles=\"'+runs2[i][\"miles\"]+'\" data-date=\"'+runs2[i][\"date\"]+'\">Edit</a> | <a href=\"#delete\" id=\"deleteLink\" data-miles=\"'+runs2[i][\"miles\"]+'\" data-date=\"'+runs2[i][\"date\"]+'\" onclick=\"return deleteRun()\">Delete</a></div</li>');\n\t\t\t}\n\t\t\t$('#home').bind('pageinit', function(){\n\t\t\t\t$('#stats').listview('refresh');\n\t\t\t});\n\t\t}else{\n\t\t\t$('#stats').html('<p>You have no logged run </p>');\n\t\t}\n\t}", "function recall() {\n for (i = 0; i < lastLog.length; i++) {\n $(\"#dataTable\")\n .find(\"tbody\")\n .append(\n $(\"<tr>\").append(\n $(\"<td>\").append([1 + i]),\n $(\"<td>\").append(lastLog[i].Time),\n $(\"<td>\").append(lastLog[i].Equipment),\n $(\"<td>\").append(lastLog[i].Temperature),\n $(\"<td>\").append(lastLog[i].Employee)\n )\n );\n }\n}", "function scoreField(place, user) {\n document.getElementById('score'+place+'').style.display = 'block';\n document.getElementById('score'+place+'').innerHTML = \"<p>\"+place+ \": \"+user.name+\" \"+user.time.getFullYear() + \".\" +user.time.getMonth()+1+\".\" +user.time.getDate()+ \" \" +user.time.getHours()+\":\" +user.time.getMinutes()+\"</p>\";\n}", "function categorizingTime(callback){\n let currentDate = new Date();\n for(let i=0;i<user.eventsCurrent.length;i++){\n if(moment(currentDate).isAfter(user.eventsCurrent[i].datetime)){\n console.log(\"time is less!\");\n user.eventsAttended.push(user.eventsCurrent[i]);\n user.eventsCurrent.splice(i,1);\n user.save();\n }\n }\n callback();\n }", "_displayTable(users) {\n var html = \"\";\n for(var i = 1; i < users.get().length; i++) { // rows of users\n html += \"<tr class='row_id_\" + users.get()[i][\"id\"] + \"'><th>\" + users.get()[i][\"name\"] + \"</th>\";\n var row = this.eaters_table[i];\n \n var x = 0;\n for(var d = 0; d < 7; d++) { // days of the week\n if(row[x] && this.start_date.next_day(d).to_database_format() === row[x]['date']) {\n if (this.start_date.next_day(d + DEFAULTS.disabled_after) <= new Date()) {\n html += \"<td><input id='check_\" + i + \"_\" + d + \"' class='option-input checkbox' type='checkbox' checked disabled></td>\";\n } else {\n html += \"<td><input id='check_\" + i + \"_\" + d + \"' class='option-input checkbox' type='checkbox' checked></td>\";\n }\n x++;\n } else {\n if (this.start_date.next_day(d + DEFAULTS.disabled_after) <= new Date()) {\n html += \"<td><input id='check_\" + i + \"_\" + d + \"' class=\\\"option-input checkbox\\\" type=\\\"checkbox\\\" disabled></td>\";\n } else {\n html += \"<td><input id='check_\" + i + \"_\" + d + \"' class=\\\"option-input checkbox\\\" type=\\\"checkbox\\\"></td>\";\n }\n }\n }\n \n }\n html += \"</tr>\"\n var table = document.getElementById(\"sign_in\");\n table.innerHTML = table.innerHTML + html;\n }", "function viewEmployees() {\n connection.query(\n \"SELECT employee.id, first_name, last_name, roles.title, department.name AS department, roles.salary FROM employee INNER JOIN roles ON employee.role_id = roles.role_id INNER JOIN department ON roles.department_id = department.department_id\",\n (err, results) => {\n if (err) throw err;\n console.log(\"\\n\");\n console.table(results);\n console.log(\"===============================\");\n console.log(\"\\n \\n \\n \\n \\n \\n \\n\");\n }\n );\n // RETURN TO MAIN LIST\n runTracker();\n}", "function getStudentsAttendanceStatus() {\n var data = {};\n data.lessonid = $stateParams[\"lessonId\"];\n server.requestPhp(data, \"GetStudentsAttendance\").then(function (data) {\n $scope.students = data;\n\t\t\t/*\n\t\t\t\t0 - attending\n\t\t\t\t1 - late\n\t\t\t\t2 - not attending\n\t\t\t\t3 - didn't report yet\n\t\t\t*/\n });\n }", "function viewEmpByRole() {\n // SQL query to the db\n connection.query(\n \"SELECT CONCAT(e.first_name, ' ', e.last_name) AS Employee, r.title AS Title, r.salary AS Salary, d.name AS Department, IFNULL(CONCAT(m.first_name, ' ', m.last_name), 'NONE') AS 'Manager' FROM employee e LEFT JOIN employee m ON m.id = e.manager_id LEFT JOIN role r ON r.id = e.role_id LEFT JOIN department d ON d.id = r.department_id ORDER BY r.title;\",\n function (err, res) {\n if (err) throw err;\n let tableResults = [];\n for (var i = 0; i < res.length; i++) {\n var empObj = [res[i].Employee, res[i].Title, res[i].Salary, res[i].Department, res[i].Manager];\n tableResults.push(empObj);\n }\n console.clear();\n console.log(\" ----------------------------- \\n ALL COMPANY EMPLOYEES BY ROLE \\n -----------------------------\");\n console.table([\"Employee\", \"Title\", \"Salary\", \"Department\", \"Manager\"], tableResults);\n actions();\n }\n );\n}", "function displayTable() {\r\n dayMapsDB.transaction(function (transaction) {\r\n transaction.executeSql('SELECT * FROM dayMapsDB', [], function (tx, results) {\r\n var len = results.rows.length, i;\r\n for (i = 0; i < len; i++) {\r\n console.log(results.rows.item(i).id + \" \" + results.rows.item(i).date + \" \" + results.rows.item(i).efficiency + \" \" + results.rows.item(i).totalStartTime + \" \" + results.rows.item(i).totalStopTime);\r\n }\r\n }, null);\r\n });\r\n }", "function hideUserStatistics(deleteMe, deleteThem)\r\n{\r\n\tvar deleteArray, statBlock = !recursion && document.getElementsByClassName(\"user-statistics\")[0];\r\n\tif( !statBlock )\r\n\t\treturn;\r\n\t\r\n\tif( statBlock.parentNode.parentNode.getElementsByTagName(\"h1\")[0].textContent == login )\r\n\t\tdeleteArray = ( deleteMe instanceof Array ) ? deleteMe : [];//Your profile\r\n\telse\r\n\t\tdeleteArray = ( deleteThem instanceof Array ) ? deleteThem : [];//Someone else's profile\r\n\t\r\n\tif( deleteArray.indexOf(\"Statistics\") >= 0 )\r\n\t\tstatBlock.parentNode.getElementsByTagName(\"h2\")[0].style.display = \"none\";\r\n\t\r\n\tvar statLabels = statBlock.getElementsByTagName(\"th\");\r\n\t\r\n\tfor( var i = 0; i < statLabels.length; i++ )\r\n\t\tif( deleteArray.indexOf( statLabels[i].textContent ) >= 0 )\r\n\t\t\tstatLabels[i].parentNode.style.display = \"none\";\r\n}", "function viewEmpByMgr() {\n // SQL query to the db\n connection.query(\n \"SELECT CONCAT(e.first_name, ' ', e.last_name) AS Employee, r.title AS Title, r.salary AS Salary, d.name AS Department, IFNULL(CONCAT(m.first_name, ' ', m.last_name), 'NONE') AS 'Manager' FROM employee e LEFT JOIN employee m ON m.id = e.manager_id LEFT JOIN role r ON r.id = e.role_id LEFT JOIN department d ON d.id = r.department_id ORDER BY m.last_name;\",\n function (err, res) {\n if (err) throw err;\n let tableResults = [];\n for (var i = 0; i < res.length; i++) {\n var empObj = [res[i].Employee, res[i].Title, res[i].Salary, res[i].Department, res[i].Manager];\n tableResults.push(empObj);\n }\n console.clear();\n console.log(\n \" -------------------------------- \\n ALL COMPANY EMPLOYEES BY MANAGER \\n --------------------------------\"\n );\n console.table([\"Employee\", \"Title\", \"Salary\", \"Department\", \"Manager\"], tableResults);\n actions();\n }\n );\n}", "function printCollectedData(data){\n output = '';\n for(let x=0 ; x<data.length ; x++){\n output += `<tr>\n <td>${data[x].completed}</td>\n <td>${data[x].faults}</td>\n <td>${data[x].timePlayed}</td>\n </tr>`;\n }\n\n HTMLhistory.innerHTML = `\n <tr><th>Completed</th><th>Mistakes</th><th>Time played</th></tr>\n ${output}\n `;\n}", "function viewNotTakenExam() {\n highlightCurrent('#viewNotTakenExam');\n $('#mytable').bootstrapTable('destroy');\n $('#mytable').bootstrapTable({\n url: baseURL + 'api/users/readNotTakenExam.php',\n pagination: true,\n search: true,\n showButtonText: true,\n showSearchClearButton: true,\n buttonsClass: \"ucf\",\n sortName: 'uploadDate',\n columns: [{\n field: 'id',\n title: 'ID',\n sortable: 'true'\n }, {\n field: 'firstName',\n title: 'First Name',\n sortable: 'true'\n }, {\n field: 'lastName',\n title: 'Last Name',\n sortable: 'true'\n }, {\n field: 'uploadDate',\n title: 'Date Uploaded',\n sortable: 'true'\n }, {\n field: 'examID',\n title: 'Exam Assigned',\n formatter: 'examAssignedFormatter',\n sortable: 'true'\n }, {\n field: 'actionA',\n title: 'Delete',\n formatter: 'deleteUserFormatter',\n align: 'center' \n }]\n });\n}", "function listobjectdetails(data) {\n\tvar str = \"\";\n\tfor (var i = 0; i < data.length; i++) {\n\n\t\tstr += \"<tr>\" + \"<td id=studid\" + i + \">\" + data[i].stuid + \"</td>\"\n\t\t\t\t+ \"<td>\" + data[i].stuname + \"</td>\" + \"<td>\"\n\t\t\t\t+ checkGender(data[i].gender) + \"</td>\" + \"<td>\"\n\t\t\t\t+ data[i].unversity + \"</td>\" + \"<td>\" + data[i].classes\n\t\t\t\t+ \"</td>\" + \"<td>\" + checkStatus(data[i].status, i) + \"</td>\"\n\t\t\t\t+ \"</tr>\";\n\t}\n\n\tstr += \"</table>\";\n\n\treturn str;\n}", "getReport()\r\n\t{\r\n\t\tlet report = '';\r\n\r\n\t\tmembers.forEach( (member, duration) => s += member.username + '\\t\\t' + duration + ' seconds\\n' );\r\n\t\treturn report;\r\n\t}", "showEventTimespans() {\n const sortedEvents = [];\n for (const e of Object.keys(this.events.aggregates)) {\n const event = {\n 'name': e,\n };\n const eventInfo = this.events.aggregates[e];\n event.count = eventInfo.count;\n if (e.indexOf('visited-or-redrawn') >= 0) {\n /** Deprecated event for which timespan did not make sense. */\n event.avgTimeMS = '';\n } else {\n event.avgTimeMS = eventInfo.timeMS / eventInfo.count;\n }\n sortedEvents.push(event);\n }\n sortedEvents.sort((e1, e2) => {\n const t1 = e1.avgTimeMS || 0;\n const t2 = e2.avgTimeMS || 0;\n return t2 - t1;\n });\n for (const event of sortedEvents) {\n let rowHTML = '<tr>';\n rowHTML += '<td>' + event.name + '</td>';\n rowHTML += '<td>' + event.count + '</td>';\n let t = event.avgTimeMS;\n if (t) {\n t = Math.round(t);\n }\n rowHTML += '<td>' + t + '</td>';\n rowHTML += '</tr>\\n';\n this.eventsTable.insertAdjacentHTML('beforeend', rowHTML);\n }\n }", "function viewEmpByMngr() {\n const query = `\n SELECT\n employee.id AS EmployeeID,\n CONCAT(employee.first_name, \" \", employee.last_name) AS EmployeeName,\n role.title AS Role,\n department.name AS Department,\n CONCAT(manager.first_name, \" \", manager.last_name) AS Manager \n FROM employee\n LEFT JOIN employee manager \n ON manager.id = employee.manager_id\n INNER JOIN role \n ON (role.id = employee.role_id && employee.manager_id != 'NULL')\n INNER JOIN department \n ON (department.id = role.department_id)\n ORDER BY manager;`\n db.query(query, (err, response) => {\n if (err) { \n throw(err);\n return;\n }\n console.log(``);\n console.log(chalk.white.bold(`============================================================================================================`));\n console.log(` ` +chalk.white.bold(` Employee by Manager `));\n console.log(chalk.white.bold(`============================================================================================================`));\n console.table(response);\n console.log(chalk.white.bold(`============================================================================================================`));\n });\n init();\n}", "function create_logs(data, rl) {\n var table = $('<table></table>').addClass('table table-striped table-bordered dt-responsive nowrap').attr('id', \"jtable\").css(\"width\", \"100%\");\n var th = $('<thead><tr><td>SNO</td><td>Date/Time</td><td>Logged Message</td></tr></thead>').css(\"font-weight\", \"600\").appendTo(table);\n\n var count;\n //activelogspage = parseInt(activelogspage);\n if (activelogspage > 1) {\n count = ((activelogspage - 1) * noOflogrows) + 1;\n } else {\n count = 1;\n }\n for (var k = data.records.length - 1; k >= 0; k--) {\n var disdatetime = formatDate_ddmonyyyy(data.records[k].logged_at);\n disdatetime += ' ' + formatDateToTime(data.records[k].logged_at);\n $('<tr><td>' + count + '</td>'\n //+'<td>'+data.records[k].logged_at+'</td>'\n +\n '<td>' + disdatetime + '</td>' +\n '<td>' + data.records[k].message + '</td>' +\n '</tr>').attr('id', '').appendTo(table);\n count++;\n }\n $(\"#logstable\").html(table);\n var tp = Math.ceil(data.noOfRecords / noOflogrows);\n $(\"#totlogspages\").html(tp);\n activelogspage = parseInt(activelogspage);\n $('#logspagination').twbsPagination({\n totalPages: tp,\n visiblePages: 4,\n startPage: activelogspage,\n onPageClick: function(event, lpage) {\n $('#page-content').text('Page ' + lpage);\n show_logs(lrole, lpage);\n }\n });\n\n}", "function showReports() {\n console.log (\"What's \", selUser.id, \"???????\")\n $(\"#user-reports\").empty();\n $.get(\"/api/report_data\").then(function(data) {\n selUserReports = data;\n UserId = memberSelect.val;\n console.log(\"member select is \", memberSelect.val);\n console.log(data);\n $(\"#user-reports\").append(\n \"<thead><th>Report Created</th><th>Requests</th></thead>\"\n \n );\n //var SelUser\n for (var i = 1; i < selUserReports.length; i++){\n if (selUserReports[i].UserId === selUser.id) {\n //var SelUser = memberSelect.val();\n \n /* $(\"#user-reports\").append(\n \"<tr style='padding: 5px; color:#555; background-color:#FFF; background-image:none !important; border-bottom: solid 2px #666666;'><td style='padding: 10px;'>\" + selUserReports[i].UserId + \"</td><td style='padding: 10px; width:120px;'>\" + moment(selUserReports[i].createdAt).format(\"MMM DD, YYYY\") + \"</td><td style='padding: 10px;'>\" + selUserReports[i].pers_pr_req + \"</td></tr>\"\n ) */\n \n $(\"#user-reports\").append(\n \"<tr><td class='wrap' >\" + moment(selUserReports[i].createdAt).format(\"MMM DD, YYYY\") + \"</td><td>\" + selUserReports[i].pers_pr_req + \"</td></tr>\"\n )\n } else {}\n }\n });\n}", "function getStudents() {\r\n\t\t var levelid=$( \"#qps-level option:selected\").val();\r\n\t\t var roleid=\"3\"; //student role\r\n\t\t var _csrf = $(\"input[name='_csrf']\").val();\r\n\t\t \r\n\t\t var params={\"ownerid\":userId,\"roleid\":roleid,\"levelid\":levelid,\"_csrf\":_csrf};\r\n\t\t \r\n\t\t\t$.post('resteasy/qb/questionpaper/getUsersByLevelRoleOwner',params)\r\n\t\t\t .done(function(students){\r\n showStudents(students);\r\n\t\t\t })\r\n\t\t\t .fail(function(){\r\n\t\t var msg='<p>There was some problem getting student list. Please retry after some time.</p>';\r\n\t\t $('#examErrorMessage > p').remove();\r\n\t\t $(msg).appendTo('#examErrorMessage');\t \t \t \r\n\t\t \t document.getElementById('error').style.display='block';\t\t\t\t\r\n\t\t\t});\t\t \r\n\t }", "function viewRoles() {\r\n var query = 'SELECT * FROM role';\r\n connection.query(\"SELECT employee.first_name, employee.last_name, role.title AS Title FROM employee JOIN role ON employee.role_id = role.id;\", \r\n function(err, res) {\r\n if (err) throw err\r\n console.table(res)\r\n questions();\r\n })\r\n}", "function tc_find_patient_recently_viewed()\n{\ntry\n {\n var test_title = 'Patient Recently Viewed - Find patient recently viewed'\n login('cl3@regression','INRstar_5','Shared');\n add_patient('Regression', 'add_a_new_patient', 'M', 'Shared'); \n \n var first_name = get_patient_firstname();\n var surname = get_patient_surname();\n var patient_name = surname + ', ' + first_name;\n Log.Message(patient_name);\n \n var actual_list = patient_recently_viewed_list();\n Log.Message(patient_recently_viewed_list())\n \n data_contains_checker(actual_list,patient_name,test_title)\n\n Log_Off()\n }\n catch (e)\n {\n Log.Warning('Test \"' + test_title + '\" FAILED Exception Occured = ' + e);\n Log_Off(); \n }\n}", "function getWorkSessions(user, startDate, endDate) {\n\t\n}", "function viewAllRole() {\n connection.query(`SELECT title, salary FROM employee_tracker_db.role;`,\n function(err, res) {\n if (err) throw err;\n console.log(\"\\n\");\n // Log all results of the SELECT statement\n console.table(res);\n //go back to inital\n initialQuestion();\n });\n}", "accountDetails(request, response) {\n const loggedInUser = accounts.getCurrentUser(request);\n let assessments = assessmentStore.getUserAssessments(loggedInUser.id);\n let singularCondition = false;\n\n if (assessments.length == 1) {\n singularCondition = true;\n }\n\n const viewData = {\n user: loggedInUser,\n assessments: assessments.length,\n singularCondition: singularCondition,\n };\n\n response.render(\"accountDetails\", viewData);\n }", "function get_sec_schls(arg){\n \t\tvar details = '';\n\t\t$.ajax({\n\t\t\turl: base_url+'staff/fetch_edu_data/'+arg,\n\t\t\tdataType: \"JSON\"\n\t\t}).done(function (data) {\n\t\t\tif(data != null || data != \" \"){\n\t\t\t\t$('table.sec_sch').show();\n\t\t\t}\n\t\t\t\t$.each(data, function () {\n\t\t\t\t\tdetails += \"<tr>\"+\n\t\t\t\t\t\"<td class=\\\"use\\\">\"+ this.secsch_name +\"</td>\"+\n\t\t\t \"<td>\"+ this.secsch_entry_yr +\"</td>\"+\n\t\t\t \"<td>\"+ this.secsch_grad_yr +\"</td>\"+\n\t\t\t \"<td>\"+ this.secsch_qual +\"</td>\"+\n\t\t\t \"<td>\"+ \"<button class=\\\"rmv\\\">-</button>\" +\"</td>\"+\n\t\t\t \"</tr>\";\n\t\t\t});\n\t\t\t//alert(details);\n\n\t\t\t$(\".sec_sch tbody\").append(details);\n\t\t});\n\t}// The Secondary school fetch function ends here", "displayAdminView() {\n var questionnaire = this.props.questionnaire.questionnaire_obj\n var questions = this.props.questionnaire.questions ? this.props.questionnaire.questions : []\n var users = this.props.questionnaire.users ? this.props.questionnaire.users : []\n var counter = 0\n\n return(\n <div>\n <div>\n <h3> {questionnaire.name} </h3>\n </div>\n\n <div>\n { // display questionnaire's questions at the top\n questions.map( (question) => {\n return(\n <div key={counter++}>\n <li> {`${counter}.`} {question.label} </li>\n </div>\n )\n })\n }\n </div>\n\n <div>\n { // generate a row for each user who has completed questionnaire\n users.map( (user) => {\n return(\n <QuestionnaireUserDataRow questionnaire={questionnaire}\n questions={questions}\n user={user}\n key={counter++}\n />\n )\n })\n }\n </div>\n </div>\n )\n }", "function logData(){\n\t\tconsole.log(\"*********Student Data*********\");\n\t\tfor(var i=0; i<studentArray.length; i++){\n\t\t\tconsole.log(\"Name: \"+studentArray[i].name);\n\t\t\tconsole.log(\"Address: \"+studentArray[i].street+\", \"+studentArray[i].city+\", \"+studentArray[i].state);\n\t\t\tconsole.log(\"Grades: \"+studentArray[i].grades);\n\t\t\tconsole.log(\"Date:\"+studentArray[i].getDate());\n\t\t\tconsole.log(\"Average GPA: \"+studentArray[i].getAverage(studentArray[i].grades).toFixed(2));\n\t\t\tconsole.log(\"------------------------------\");\n\t\t}\n\t}", "function formatresults(){\nif (this.timesup==false){//if target date/time not yet met\nvar displaystring=\"<span style='background-color: #CFEAFE'>\"+arguments[1]+\" hours \"+arguments[2]+\" minutes \"+arguments[3]+\" seconds</span> left until launch time\"\n}\nelse{ //else if target date/time met\nvar displaystring=\"Launch time!\"\n}\nreturn displaystring\n}", "function startTime(){\n timer = setInterval(function() {\n studentCounter++;\n $(\".newDiv\").remove(); // removes previous element to be replaced by new student and counter.\n // checks end of array and wraps down to bottom of array if at top.\n if(studentCounter > dataLength){\n studentCounter = 0;\n studentInfo(infoData, studentCounter);\n }\n else {\n studentInfo(infoData, studentCounter);\n }\n }, totalTime); // sets how long to cycle through.\n }", "function startQuiz(quiz){\n //initilize the timer\n clearPage();\n var timer = setCountdown(quiz);\n count(timer);\n\n //if this isn't the first quiz in a session, it will show timer and line again\n $(\".feedback-line\").show();\n $(\".timer\").show();\n \n //print the current question to the screen\n printQuestion(quiz[currentQuestion], quiz);\n}", "function UserStatisticsHelper(props) {\n const { userID, start, end } = props;\n\n const visitDateStart = format(start, 'YYYY-MM-DD');\n const visitDateEnd = format(end, 'YYYY-MM-DD');\n\n return (\n <tr>\n {props.children}\n <td data-label='Range'>{format(start, 'dddd, MMM DD')} - {format(end, 'dddd, MMM DD')}</td>\n <td data-label='Appointments'>\n <QueryCount parameters={{\n queryID: 'appointments_' + visitDateStart + visitDateEnd,\n userID,\n visitDateStart,\n visitDateEnd,\n activityType: 'appointment',\n }} />\n </td>\n <td data-label='Warm Handoffs'>\n <QueryCount parameters={{\n queryID: 'warmHandoffs_' + visitDateStart + visitDateEnd,\n userID,\n visitDateStart,\n visitDateEnd,\n activityType: 'warmHandOff',\n }} />\n </td>\n <td data-label='HCH'>\n <QueryCount parameters={{\n queryID: 'hchScreenings_' + visitDateStart + visitDateEnd,\n userID,\n visitDateStart,\n visitDateEnd,\n activityType: 'hchScreening',\n }} />\n </td>\n <td data-label='Total Records'>\n <QueryCount parameters={{\n queryID: 'totalRecords_' + visitDateStart + visitDateEnd,\n userID,\n visitDateStart,\n visitDateEnd,\n }} />\n </td>\n </tr>\n );\n}", "function logTimeClick(evt) {\n\n // clear any error messages\n errorMessage('');\n\n // get issue ID\n var issueId = evt.target.getAttribute('data-issue-id')\n\n // time input\n var timeInput = document.querySelector('input[data-issue-id=' + issueId + ']');\n // date input\n var dateInput = document.querySelector('input[class=issue-log-date-input][data-issue-id=' + issueId + ']');\n\n // validate time input\n if (!timeInput.value.match(/[0-9]{1,4}[wdhm]/g)) {\n errorMessage('Time input in wrong format. You can specify a time unit after a time value \"X\", such as Xw, Xd, Xh or Xm, to represent weeks (w), days (d), hours (h) and minutes (m), respectively.');\n return;\n }\n\n // hide total time and show loading spinner;\n toggleVisibility('div[class=\"issue-total-time-spent\"][data-issue-id=' + issueId + ']');\n toggleVisibility('div[class=\"loader-mini\"][data-issue-id=' + issueId + ']');\n\n var startedTime = getStartedTime(dateInput.value);\n\n JIRA.updateWorklog(issueId, timeInput.value, startedTime)\n .then(function(data) {\n getIssue(issueId);\n }, function(error) {\n // hide total time and show loading spinner;\n toggleVisibility('div[class=\"issue-total-time-spent\"][data-issue-id=' + issueId + ']');\n toggleVisibility('div[class=\"loader-mini\"][data-issue-id=' + issueId + ']');\n genericResponseError(error);\n });\n\n }", "function quizTime() {\n for(i=0;i<quesBank[sport_name].length;i++){\n console.log(chalk.bgYellow(`Question ${i + 1}: `));\n console.log(quesBank[sport_name][i].question);\n var ans = readLineSync.question(\"Your answer: \");\n if (ans === quesBank[sport_name][i].answer) {\n console.log(chalk.green(\"\\n Wohoo Correct Answer! You scored 1 points.\"))\n score += 1;\n console.log(chalk.bgBlue(`Current score: ${score}`));\n console.log(\"––––––––––\\n\\n\");\n }\n else {\n console.log(chalk.red(\"\\nWrong Answer! You scored 0 points.\"));\n console.log(chalk.bgBlue(`Current score: ${score}`));\n console.log(\"––––––––––\\n\\n\");\n }\n };\n}", "function viewEmp() {\n connection.query(\"SELECT employee.first_name, employee.last_name, emp_role.title, emp_role.salary, department.dept_name, manager.first_name AS 'manager_firstname', manager.last_name AS 'manager_lastname' FROM employee LEFT JOIN emp_role ON employee.role_id = emp_role.id LEFT JOIN department ON emp_role.department_id = department.id LEFT JOIN employee manager ON employee.manager_id = manager.id;\", function (err, res) {\n if (err) throw err;\n console.table(res);\n main();\n });\n}", "function viewJoined() {\n connection.query(\"SELECT role.title, role.salary, employee.first_name, employee.last_name, manager_id, department.name FROM ((employee_tracker_db.role INNER JOIN employee_tracker_db.employee ON role.id = employee.role_id) INNER JOIN employee_tracker_db.department ON role.department_id = department.id)\", (err, results) => {\n if (err) throw err\n console.table(results)\n action()\n })\n}" ]
[ "0.58583695", "0.5732366", "0.57255733", "0.54637855", "0.52712095", "0.52372104", "0.52216506", "0.51944023", "0.5191071", "0.516531", "0.5131335", "0.5127975", "0.5085845", "0.50857645", "0.5080348", "0.50790644", "0.5075201", "0.5073733", "0.50713944", "0.50704074", "0.50389546", "0.5038939", "0.50133955", "0.50004214", "0.49997252", "0.49806014", "0.4979091", "0.49724582", "0.49719808", "0.49656823", "0.4940011", "0.49374926", "0.4928032", "0.49178848", "0.4916807", "0.49139565", "0.4911125", "0.4908065", "0.48834458", "0.48828533", "0.48713136", "0.48677483", "0.48648074", "0.4863486", "0.48611897", "0.4839401", "0.48367718", "0.48316076", "0.48310652", "0.48290372", "0.48252913", "0.4823846", "0.4810807", "0.48095968", "0.4808706", "0.4808526", "0.4803744", "0.48026043", "0.48016164", "0.47965524", "0.47960913", "0.47953093", "0.47938326", "0.4791471", "0.47912034", "0.4791045", "0.47896096", "0.47863618", "0.47856766", "0.47826317", "0.4782346", "0.47802144", "0.4762169", "0.47591844", "0.47576004", "0.47566095", "0.47546843", "0.47530997", "0.4751226", "0.4750272", "0.4749644", "0.474605", "0.47431955", "0.47368598", "0.47322854", "0.47238487", "0.47227922", "0.47199062", "0.47172162", "0.47164562", "0.47162205", "0.471324", "0.47113124", "0.47098306", "0.47094297", "0.4707576", "0.4705159", "0.4696966", "0.46940333", "0.46876442" ]
0.5091104
12
garante que o valor fornecido como argumento esteja dentro da gama de valores esperada.
set valorFace(novoValorface) { if ((novoValorface >= 1) && (novoValorface <= 6)) { return this._valorFace = novoValorface } else { return "Valor inválido para a face do dado" } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkArgs(o) {\n let count = 0;\n for (let key in o) {\n if (o[key] == true) count++;\n }\n if (count == 0) {\n confirm(\"Please select at least one parameter\");\n setOptions(o);\n } else return;\n}", "function imprimeArgumentos() {\n console.log(arguments);\n}", "function saludarArgumentos(referencia){\n console.log(arguments);\n}", "function parametros (nombre, apellido, edad) {\n var nombre = nombre || \"Carlos\";\n var apellido = apellido || \"Suarez\";\n var edad = edad || 23;\n console.log(nombre, apellido, edad);\n}", "function test (arg){\n // var argument = arg; (arg n'est pas défini (undefined ou false) alors valeur par défaut = 567)\n var argument = arg || 567;\n\n console.log(argument)\n}", "function agregarValorX(boton){\n parametroX = boton.variable;\n}", "function imprimeArguemntos(){\n console.log(arguments);\n}", "function ciao(mandi, hola){\n\tconst args = Array.from(arguments)\n\tconsole.log(mandi, hola)\n}", "function saludarArgumentos2(referencia){\n // retorna 1 porque asi se designo el return 1;\n return 1;\n // Algo que va despues de un return jamas se va a ejecutar\n}", "function get_arg() { return arguments; }", "function getArg(aArgs,aName,aDefaultValue){if(aName in aArgs){return aArgs[aName];}else if(arguments.length===3){return aDefaultValue;}else{throw new Error('\"'+aName+'\" is a required argument.');}}", "function argFunction(value = 'test') {\n console.log(value)\n}", "function validateOptionalArgType(functionName,type,position,argument){if(argument!==undefined){validateArgType(functionName,type,position,argument);}}", "get value() {\n return this.args.value;\n }", "function dArgVal(argToCheck, defVal)\r\n{\r\n\tif (argToCheck == undefined) \r\n\t{\r\n\t\treturn defVal;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn argToCheck;\r\n\t}\r\n}", "function ngModelPipelineCheckValue(arg) {\n containerCtrl.setHasValue(!ngModelCtrl.$isEmpty(arg));\n return arg;\n }", "function ngModelPipelineCheckValue(arg) {\n containerCtrl.setHasValue(!ngModelCtrl.$isEmpty(arg));\n return arg;\n }", "function Traite_Arguments(oArg) {\r\n\tvar Lg = \"fr\";\r\n\tvar stArguments = \"\";\r\n\ttry {\r\n\t\tstArguments += oArg.mois + \"|\";\r\n\t\tstArguments += oArg.annee + \"|\";\r\n\t\tstArguments += oArg.anneeDebut + \"|\";\r\n\t\tstArguments += oArg.anneeFin + \"|\";\t\t\r\n\t\tif (oArg.format) {\r\n\t\t\tstArguments += CodageFormatDate(oArg.format) + \"|\";\r\n\t\t} else {\r\n\t\t\tstArguments += CodageFormatDate(\"dd/MM/yyyy\") + \"|\";\r\n\t\t}\r\n\t\t\r\n\t\tstArguments += oArg.langue;\r\n\t} catch(e) { alert(\"PB Traite_Arguments : \" + e); }\r\n\t//alert(\"stArguments \" + stArguments);\r\n\treturn stArguments;\r\n}", "function verifyArgumentIsDefined(value) {\n if (typeof value !== \"string\" || value.length === 0) {\n throw new Error(\"Invalid usage: node \" + path.basename(__filename) + \" {directory-to-copy} {dependency-name}\");\n }\n}", "function parametros(nombre = \"Edgar\", apellido = \"Tarquino\", edad = 33) {\n\tvar nombre = nombre;\n\tvar apellido = apellido;\n\tvar edad = edad;\n\tconsole.log(nombre, apellido, edad);\n}", "function SimpleArgs() {\r\n}", "function optionQuantity(argvQuantity) {\n if ( argvQuantity == \"\") {\n console.log(\"Missing \" + argvOptionQuantity + \" or \" + argvOptionQuantityWord + \" parameter option argument value!\");\n process.exit(1); // failure\n }\n if ( isNaN(argvQuantity) ) {\n console.log(\"Invalid Number '\" + argvQuantity + \"'. Check \" + argvOptionQuantity + \" or \" + argvOptionQuantityWord + \" parameter option argument value!\");\n process.exit(1); // failure\n } \n quantity = Number(argvQuantity);\n}", "function check_param(par) { \n return (par != null && par.length > 0) ? par:'';\n}", "function tambah(){\n\n var i;\n var hasil = 0;\n\n for(i = 0; i < arguments.length ; i++){\n hasil += arguments[i];\n }\n\n return hasil;\n\n}", "function comprovaCampBuit(objecteRebut) {\n if (objecteRebut.value == \"\") {\n mostraMissatge(2);\n }\n console.log(objecteRebut.value);\n}", "function escogerValorMasGrande(elemetos){\n\n}", "function funkcijosPavadinimas(argumntas1, argumentas2) {\n // funkcijos body. kodas kuris bus vygdomas kai iskviesim funkcija\n // argumntas1 - lokalus kintamasis naudojamas tik sioje funkcijoje\n console.log(argumntas1);\n}", "function vaildator(value){\n if(value!=''){\n return value;\n }\n else{\n return '(name not given)';\n }\n}", "function checkMainArguments() {\n if (!this.operator) {\n error('\"operator\" parameter is missing');\n }\n\n if (!this.oldApiKey) {\n error('\"oldApiKey\" parameter is missing');\n }\n\n if (!this.newApiKey) {\n error('\"newApiKey\" parameter is missing');\n }\n}", "function foo() {\n\tvar a = arguments[0] !== (void 0) ? arguments[0] : 2;\n\tconsole.log( a );\n}", "function validateArgType(functionName,type,position,argument){validateType(functionName,type,ordinal(position)+\" argument\",argument);}", "function verify_required_arg(arg, errorMsg) {\n if ((_.isUndefined(arg) || _.isNull(arg))) {\n console.error(errorMsg);\n helpAndExit(1);\n }\n}", "function foo(a) {\n arguments[0] = 2;\n alert(a);\n}", "function isSimpleValue(arg) {\n if (Array.isArray(arg) || typeof arg === 'function') return false;\n if (arg == null || typeof arg !== 'object') return true;\n if (arg.valueOf && typeof arg.valueOf() !== 'object') {\n return true;\n }\n return false;\n }", "function argumentSurprise() {\n if (arguments) {\n for (var key in arguments) {\n console.log(arguments[key]); \n }\n } else {\n console.log('I\\'m empty');\n }\n}", "clearArguments() {\n // Clear arguments\n for (let i = 0; i < this.selected.args.length; i++) {\n this.selected.args[i].value = \"\";\n }\n }", "clearArguments() {\n // Clear arguments\n for (let i = 0; i < this.selected.args.length; i++) {\n this.selected.args[i].value = \"\";\n }\n }", "function contador(cant=10){\n console.log(\"cantidad: \"+cant);\n}", "function def(arg, val) { return (typeof arg !== 'undefined') ? arg : val; }", "function foo() {\n var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'www.wikipedia.com';\n var message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'Welcome to wikipedia';\n console.log(\"Argument with Default Parameter Url =\" + url);\n console.log(\"Argument with Default Parameter message =\" + message);\n}", "function recordArg(value) {\n\n if (options.json) {\n\n // Do our best to corece it into JSON\n if (!sg.isObject(value) && !_.isArray(value)) {\n if (_.isString(value)) {\n value = sg.safeJSONParse(value);\n }\n }\n\n // If still not an Object or Array, might be an error\n if (!sg.isObject(value) && !_.isArray(value)) {\n if (required) {\n self.argErrs = sg.ap(self.argErrs, {code: 'ENOTJSON', ...self.argTypes[defName]});\n return recordArg2(def);\n\n } else {\n value = { __just__ : value };\n }\n }\n }\n\n return recordArg2(value);\n }", "function a() {\n if(arguments.length<3) return;//arguments 갯수가 3보다 작으면 return해!\n console.log('my name is ', arguments[2])\n}", "function typeCheck(argumentNameToBeChecked, argumentValueToBeChecked) {\n\n var ii;\n\n for (ii = 0; ii < parser.options.length; ii++) {\n if (argumentNameToBeChecked === parser.options[ii].name) {\n argumentNameToBeChecked = parser.options[ii].name;\n break;\n }\n }\n\n if (parser.options[ii].type === \"number\") {\n return !isNaN(argumentValueToBeChecked);\n }\n if (parser.options[ii].type === \"string\") {\n return typeof (argumentValueToBeChecked) == \"string\";\n }\n if (parser.options[ii].type === \"boolean\") {\n return true;\n }\n}", "function validate() {\n\n if( _this.default ) return;\n\n if( !_this.args[0] ) {\n console.log('Error Name must be specified');\n return args.done();\n }\n }", "function parseArg(v, de, fmt) {\n var errs = [];\n if (typeof fmt.default !== \"undefined\" && typeof v === \"undefined\") {\n v = fmt.default;\n }\n if (fmt.required && typeof v === \"undefined\") {\n errs.push({ field: fmt.name, type: \"required\" });\n }\n if (typeof v === \"undefined\") {\n return { arg: v, errs: errs };\n }\n var lengthOpt = {\n max: fmt.maxLength ? fmt.maxLength : undefined,\n min: fmt.minLength ? fmt.minLength : 0,\n };\n if (fmt.type === \"string\") {\n if (typeof v !== \"string\") {\n errs.push({ field: fmt.name, type: \"string\" });\n }\n else if (v !== fmt.default && fmt.format === \"uuid\" && !validator.isUUID(v)) {\n errs.push({ field: fmt.name, type: \"uuid\" });\n }\n else if (v !== fmt.default && fmt.format === \"email\" && !validator.isEmail(v)) {\n errs.push({ field: fmt.name, type: \"email\" });\n }\n else if (!validator.isLength(v, lengthOpt)) {\n errs.push({ field: fmt.name, type: \"strlen\" });\n }\n }\n if (numberTypes.indexOf(fmt.type) !== -1) {\n if (typeof v !== \"number\") {\n errs.push({ field: fmt.name, type: \"number\" });\n }\n else if (!isInt(v) && fmt.type === \"integer\") {\n errs.push({ field: fmt.name, type: \"integer\" });\n }\n else if (typeof fmt.maximum !== \"undefined\" && v > fmt.maximum) {\n errs.push({ field: fmt.name, type: \"maximum\" });\n }\n else if (typeof fmt.minimum !== \"undefined\" && v < fmt.minimum) {\n errs.push({ field: fmt.name, type: \"minimum\" });\n }\n }\n if (fmt.type === \"object\") {\n if (typeof v !== \"object\") {\n errs.push({ field: fmt.name, type: \"object\" });\n }\n else {\n var tmp = parseObjectSchema(v, fmt);\n v = tmp.arg;\n errs = errs.concat(tmp.errs);\n }\n }\n if (fmt.type === \"array\") {\n if (!Array.isArray(v)) {\n errs.push({ field: fmt.name, type: \"array\" });\n }\n else if (!fmt.items) {\n throw notSupportError;\n }\n else if (fmt.minItems && v.length < fmt.minItems) {\n errs.push({ field: fmt.name, type: \"minItems\" });\n }\n else if (fmt.maxItems && v.length > fmt.maxItems) {\n errs.push({ field: fmt.name, type: \"maxItems\" });\n }\n else {\n if (fmt.items.properties) {\n for (var prop in fmt.items.properties) {\n if (fmt.items.properties.hasOwnProperty(prop)) {\n for (var _i = 0, v_1 = v; _i < v_1.length; _i++) {\n var vv = v_1[_i];\n var tmp = parseArg(vv[prop], vv[prop], fmt.items.properties[prop]);\n errs = errs.concat(tmp.errs);\n }\n }\n }\n }\n else {\n for (var _a = 0, v_2 = v; _a < v_2.length; _a++) {\n var vv = v_2[_a];\n var tmp = parseArg(vv, vv, fmt.items);\n errs = errs.concat(tmp.errs);\n }\n }\n if (fmt.items.required && fmt.items.required.length) {\n var requires = fmt.items.required;\n for (var _b = 0, requires_1 = requires; _b < requires_1.length; _b++) {\n var ii = requires_1[_b];\n var require_1 = ii;\n for (var _c = 0, v_3 = v; _c < v_3.length; _c++) {\n var jj = v_3[_c];\n if (typeof jj[require_1] === \"undefined\") {\n errs.push({ field: fmt.name + \".\" + require_1, type: \"required\" });\n }\n }\n }\n }\n }\n }\n if (fmt.type === \"boolean\" && typeof v !== \"boolean\") {\n errs.push({ field: fmt.name, type: \"boolean\" });\n }\n return { arg: v, errs: errs };\n}", "function\nASSERT_Argument(\n/*a)any*/arg\n){\n/*m)private any*/this.setArgument=function(\n/*a)any*/arg\n){\nreturn this.isWithoutQuote(arg) ? arg :\n\tthis.isArray(arg) ? this.setArrayQuoteOn(arg.concat()) :\t///copy array\n\tthis.setQuoteOn(arg);\n}\t//---setArgument\n\n/*m)private string*/this.setQuoteOn=function(\n/*a)string*/arg\n){\nif(this.isString(arg)){\n\targ = arg.replace(/\"/g, '&quot;');\n\targ = arg.replace(/'/g, '&apos;');\n\t}\nreturn '\"'+arg+'\"';\n}\t//---setQuoteOn\n\n/*m)private string*/this.setQuoteOff=function(\n/*a)any*/arg\n){\nif(this.isString(arg)){\n\targ = arg.replace(/&quot;/g, '\"');\n\targ = arg.replace(/&apos;/g, \"'\");\n\t}\nreturn (arg=='\"\"') ? arg : arg.substr(1, arg.length-2);\t///strip \"\" added by setQuoteOn\n}\t//---setQuoteOff\n\n/*m)private any[]*/this.setArrayQuoteOn=function(\n/*a)any[]*/arg\n){\nfor(var k in arg) if(this.isString(arg[k])) arg[k] = this.setQuoteOn(arg[k]);\nreturn arg;\n}\t//---setArrayQuoteOn\n\n/*m)private any[]*/this.setArrayQuoteOff=function(\n/*a)any[]*/arg\n){\nfor(var k in arg) if(this.isString(arg[k])) arg[k] = this.setQuoteOff(arg[k]);\nreturn arg;\n}\t//---setArrayQuoteOff\n\n/*m)private string*/this.setTagOn=function(\n/*a)string*/arg\n){\narg = arg.replace(/</g, '&lt;');\narg = arg.replace(/>/g, '&gt;');\nreturn arg;\n}\t//---setTagOn\n\n/*m)protected any*/this.getArgument=function(){\nreturn this.isArray(this.argument) ? this.getArrayArgument() : this.argument;\n}\t//---getArgument\n\n/*m)private (boolean)string*/this.getArrayArgument=function(){\nreturn this.argument.length ? '['+this.argument+']' : false;\t///empty array is false\n}\t//---getArrayArgument\n\n/*m)protected string*/this.getArgumentAsText=function(){\nif(this.isNull(this.argument)) return 'null';\nif(this.isUndefined(this.argument)) return 'undefined';\nif(this.isNumber(this.argument) || this.isBoolean(this.argument)) return this.argument.toString();\nif(this.isString(this.argument)) return this.getStringAsText(this.argument);\nif(this.isArray(this.argument)) return this.getArrayAsText(this.argument);\n}\t//---getArgumentAsText\n\n/*m)protected string*/this.getStringAsText=function(\n/*string*/arg\n){\nreturn this.setTagOn(this.setQuoteOff(arg));\n}\t//---getStringAsText\n\n/*m)protected string*/this.getArrayAsText=function(\n/*any[]*/arg\n){\nreturn '['+this.setArrayQuoteOff(arg)+']';\n}\t//---getArrayAsText\n\n/*m)private boolean*/this.isWithoutQuote=function(\n/*a)any*/arg\n){\nreturn this.isNumber(arg) || this.isBoolean(arg) || this.isNull(arg) || this.isUndefined(arg);\n}\t//---isWithoutQuote\n\n/*m)public boolean*/this.isNumber=function(\n/*a)any*/arg\n){\nreturn typeof(arg)==='number';\n}\t//---isNumber\n\n/*m)public boolean*/this.isString=function(\n/*a)any*/arg\n){\nreturn typeof(arg)==='string';\n}\t//---isString\n\n/*m)public boolean*/this.isUndefined=function(\n/*a)any*/arg\n){\nreturn arg===undefined;\n}\t//---isUndefined\n\n/*m)public boolean*/this.isNull=function(\n/*a)any*/arg\n){\nreturn arg===null;\n}\t//---isNull\n\n/*m)public boolean*/this.isBoolean=function(\n/*a)any*/arg\n){\nreturn arg===true || arg===false;\n}\t//---isBoolean\n\n/*m)public boolean*/this.isArray=function(\n/*a)any*/arg\n){\nreturn !this.isNull(arg) && typeof(arg)==='object' && (arg.length!==undefined);\n}\t//---isArray\n\n/*m)public boolean*/this.isObject=function(\n/*a)any*/arg\n){\nreturn !this.isNull(arg) && typeof(arg)==='object' && (arg.length===undefined);\n}\t//---isObject\n\n/*m)public boolean*/this.isEmpty=function(\n/*a)any*/arg\n){\nreturn ((this.isString(arg) || this.isArray(arg)) && !arg.length);\n}\t//---isEmpty\n\n/*private any*/this.argument = this.setArgument(arg);\n}\t//---ASSERT_Argument", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function conParametros(name, numero) {\n console.log(`mi nombre es ${name} y edad de ${numero} años`);\n}", "_validateFundsTrack(target, that, args) {\n const [option, value] = args;\n\n switch (option) {\n case 'parentSender':\n if (typeof value !== 'string') throw new Error('InvalidArgument: parentSender should be `string`');\n break;\n\n default:\n throw new Error(`InvalidArgument: ${option} option is not supported!`);\n }\n target.apply(that, args);\n }", "updateValue(arg1, arg2) {\n return \"une string\"\n }", "arg(name, type, defaultValue, description) {\n if (!description) {\n /* eslint-disable no-param-reassign */\n description = defaultValue;\n defaultValue = undefined;\n /* eslint-enable no-param-reassign */\n }\n\n invariant(this._field, `arg(...): '${name}' must appear under a field`);\n\n //If the first param is string, we do the normal setup with eh type, default value and description\n if (typeof name === 'string') {\n invariant(!this._field.args[name],\n `arg(...): '${name}' is already defined by ${this._field.name}`);\n\n this._field.args[name] = {name, type, description, defaultValue};\n }\n //if the first param name is not string, we assume it is a complete args definition\n else if(name.name){\n this._field.args[name.name] = name;\n }\n return this;\n }", "function receiveArguments()\n{\n if (arguments[0] && arguments[0].designTimeObj)\n {\n DS_DESIGN_TIME_ARG = arguments[0].designTimeObj;\n if (arguments[0].insertObj)\n {\n INSERT_OPTIONS_ARG = arguments[0].insertObj;\n }\n }\n}", "function ensure_have_value( name, value, isExitIfEmpty, isPrintValue, fnNameColorizer, fnValueColorizer ) {\n isExitIfEmpty = isExitIfEmpty || false;\n isPrintValue = isPrintValue || false;\n fnNameColorizer = fnNameColorizer || ( (x) => { return cc.info( x ); } );\n fnValueColorizer = fnValueColorizer || ( (x) => { return cc.notice( x ); } );\n var retVal = true;\n value = value.toString();\n if( value.length == 0 ) {\n retVal = false;\n console.log( cc.fatal(\"Error:\") + cc.error(\" missing value for \") + fnNameColorizer(name) );\n if( isExitIfEmpty )\n process.exit( 666 );\n }\n var strDots = \"...\", n = 50 - name.length;\n for( ; n > 0; -- n )\n strDots += \".\";\n log.write( fnNameColorizer(name) + cc.debug(strDots) + fnValueColorizer(value) + \"\\n\" ); // just print value\n return retVal;\n}", "function diaMaiorEntrada(args){ \n let maiorEntrada = args[0];\n\n for(let i = 0; i < args.length; i++){\n if(args[i].total >= maiorEntrada.total){\n maiorEntrada = args[i]; \n }\n }\n return maiorEntrada;\n \n}", "function MyAOJLib(value) { // @arg String = \"\" - comment\n//{@dev\n //$args(MyAOJLib, arguments);\n //$valid($type(value, \"String|omit\"), MyAOJLib, \"value\");\n//}@dev\n\n this._value = value || \"\";\n}", "function validarVacio() {\n //los argumentos serian inputs que se colocan cuando se llama a la funcion;\n var resultado = false;\n for (var i = 0; i < arguments.length; i++) {\n\n console.log(arguments[i]);\n if (typeof arguments[i] == \"string\" && arguments[i].replace(/\\s+/g, '').length != 0 ||\n typeof arguments[i] === \"number\" && !isNaN(arguments[i]) && arguments[i] > 0) {\n resultado = true;\n\n } else {\n resultado = false;\n break;\n }\n }\n return resultado;\n}", "function moar(first, second) {\r\n // On peut maintenant utiliser les variables « first » et « second » comme on le souhaite :\r\n\tconsole.log('Votre premier argument : ' + first);\r\n\tconsole.log('Votre deuxième argument : ' + second);\r\n}", "function validateUserInput(){\n if(arg2.length>0){\n return true\n }else {\n return false\n }\n }", "function miFuncion(a, b){\n console.log(arguments.length);\n console.log(\"La suma es: \" + (a+b));\n}", "function saludar(parametro){\n return parametro;\n}", "function mostrar(cadena = '') {\n console.log(cadena)\n}", "function cadastroSimples(nome, ...other){\n console.log(nome);\n console.log(other);\n console.log(other.length); \n console.log(arguments);\n}", "existAnyArguments() {\n const {supportingSituation, supportingActionGoal, notSupportingSituation, notSupportingActionGoal} = this.state;\n return (\n (supportingSituation !== undefined && supportingSituation.length > 0) ||\n (supportingActionGoal !== undefined && supportingActionGoal.length > 0) ||\n (notSupportingSituation !== undefined && notSupportingSituation.length > 0) ||\n (notSupportingActionGoal !== undefined && notSupportingActionGoal.length > 0)\n )\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function buscar_argumentos(){\n text = ''; //Function arguments\n\n //You get the selected option of select\n div = document.getElementById('functions').value;\n //If different from \"-Select-\"\n if (div != '-Select-'){\n //You get the arguments of the function selected\n arguments = document.getElementsByName(div);\n for(i=0;i<arguments.length;i++){\n if(arguments[i].style.display != 'none' ){\n\t\t\tif( arguments[i].value != ''){\n\t \ttext += arguments[i].value + ',';\n\t\t\t} \n }\n } \n armado_funcion(text);\n }\n}", "function Generica(param) {\n console.log(\"El tipo es: \" + typeof (param));\n return param;\n}", "function arg_len() { return arguments.length; }", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "function always() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return true;\n}", "function X(a) {\n a = 5;\n arguments[1] = 12;\n console.log(arguments)\n}", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n }", "function getArgumentValue(key){\n\t\tvar a=this.getArgumentValues();\n\t\tif(a.length<1) return '';\n\t\tfor(i=0;i<a.length;i++){\n\t\t\tif(a[i][0]==key) return a[i][1];\n\t\t}\n\t\treturn '';\n\t}", "function miFuncionUno (a,b){\n console.log(\"Suma: \"+ (a+b));\n // \"arguments\" is a property of objects but functions work as objects\n console.log(arguments);\n // \"arguments.length\" Number of arguments that enter the function. Can only be used inside the function.\n console.log(arguments.length); \n // \"arguments[0]\" Accesses the firtst argument position.\n console.log(arguments[0]); \n}", "function args() {\n\n}", "function sumar (numero1=0,numero2=0){ \n console.log(numero1 + numero2);\n}", "function someValue(element) {\n return element !== args[i]\n }", "function getArg(aArgs, aName, aDefaultValue) {\n\t\t if (aName in aArgs) {\n\t\t return aArgs[aName];\n\t\t } else if (arguments.length === 3) {\n\t\t return aDefaultValue;\n\t\t } else {\n\t\t throw new Error('\"' + aName + '\" is a required argument.');\n\t\t }\n\t\t}", "function validarParametrosBusqueda(){\n var idFicha = $(\"#lIdficha\").text();\n var idResult = listaIDSResultadoSel.length;\n var idInstr = $(\"#lIdInstructor\").text();\n \n if(idFicha != \"\" && idResult > 0 && idInstr != \"\"){\n return true;\n }\n\n return false;\n}", "function ngModelPipelineCheckValue(arg){containerCtrl.setHasValue(!ngModelCtrl.$isEmpty(arg));return arg;}", "argumentError() {\n if (\"error\" in this.argument) {\n return this.argument.error;\n }\n return \"NO ERROR!!!\";\n }", "argumentError() {\n if (\"error\" in this.argument) {\n return this.argument.error;\n }\n return \"NO ERROR!!!\";\n }", "function requiredParamsValid()\n{\n for(var i = 0; i< arguments.length; i++)\n {\n var argument = arguments[i];\n if(argument == undefined || argument == null)\n {\n return false;\n }\n }\n\n return true;\n}", "function argsDataType() {\n\n}", "function checkUnamedArguments(){\n\t\tvar arg = arguments; \n\t\tdebugger;\n\t}", "function resetFormValues(){\n if(arguments.length === 0) return\n for(let i=0; i<arguments.length; i++){\n if('value' in arguments[i]){\n arguments[i].value = '';\n }\n }\n\n}", "function validateOptionalArgType(functionName, type, position, argument) {\r\n if (argument !== undefined) {\r\n validateArgType(functionName, type, position, argument);\r\n }\r\n}", "function validateOptionalArgType(functionName, type, position, argument) {\r\n if (argument !== undefined) {\r\n validateArgType(functionName, type, position, argument);\r\n }\r\n}", "function validateOptionalArgType(functionName, type, position, argument) {\r\n if (argument !== undefined) {\r\n validateArgType(functionName, type, position, argument);\r\n }\r\n}", "function validaParametri(handleFrase, handleVelocita)\r\n{\r\n\tfrase = handleFrase.value;\r\n\tvelocita = handleVelocita.value;\r\n\t\r\n\tif (frase == \"\")\r\n\t{\r\n\t\talert(\"Inserire almeno un carattere\");\r\n\t\thandleFrase.focus();\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tif (frase == \"\")\r\n\t{\r\n\t\talert(\"Inserire almeno un carattere\");\r\n\t\thandleFrase.focus();\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tif (frase.match(/[\\|%]/)) // NON FUNZIONA\r\n\t{\r\n\t\talert(\"I caratteri \\, | e % non sono ammessi\");\r\n\t\thandleFrase.focus();\r\n\t\treturn false();\r\n\t}\r\n\t\r\n\tif (isNaN(velocita) || velocita <= 0)\r\n\t{\r\n\t\talert(\"La velocita' e' una quantita' intera positiva non nulla\");\r\n\t\thandleVelocita.value=\"120\";\r\n\t\thandleVelocita.focus();\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\treturn true;\r\n}", "function invalidArg(message) {\n if(message) console.log(message); //Shows the specific error message about the invalid argument\n validArgs = false; //Sets the valid arguments flag to false\n}", "function getSum(num1 = 1, num2 = 1) {\n console.log(arguments[0]);\n console.log(arguments[1]);\n}", "isEmpty (value, msg) {\n assert(lodash.isEmpty(value), msg || `params must be empty, but got ${value}`);\n }", "getArgs(ctx) {\n const args = [ctx.bufArg(), ctx.offArg()];\n if (this.ref.signature === 'value') {\n args.push(ctx.matchVar());\n }\n return args;\n }", "function getArgumentType(arg) {\n return arg === null ? 'null' : typeof arg;\n}", "validateParamOptions() {\n Object.keys(CmdLineParamsOptions).forEach(key => {\n if (!this.options[key]) {\n this.options[key] = CmdLineParamsOptions[key][0];\n } else if (!CmdLineParamsOptions[key].find(i => i === this.options[key])) {\n const options = CmdLineParamsOptions[key].join(' or ');\n throw new this.serverless.classes.Error(\n `Invalid ${key} parameter value, must be either ${options}.`\n );\n }\n });\n }", "function passingValueToParamDemo(a,b,c) {\n\treturn \"This got passed to me A \" + a + \" B \" + b + \" C \" + c;\n}" ]
[ "0.62486774", "0.60985136", "0.6087531", "0.5898541", "0.58918226", "0.5877578", "0.57816553", "0.5723362", "0.5722965", "0.5703619", "0.56968886", "0.5679531", "0.5675402", "0.5666764", "0.56407917", "0.5619447", "0.5619447", "0.561001", "0.5606852", "0.5591196", "0.55817884", "0.5581017", "0.55641735", "0.55256563", "0.5525546", "0.550245", "0.5495064", "0.5487679", "0.5470767", "0.5467071", "0.5462949", "0.546066", "0.5449112", "0.5446578", "0.54439574", "0.5439918", "0.5439918", "0.5430336", "0.5389889", "0.5367278", "0.53384346", "0.53382194", "0.5332967", "0.5332292", "0.5331103", "0.5329176", "0.5321048", "0.53169245", "0.5311487", "0.53109896", "0.5305543", "0.5305358", "0.5303821", "0.52789855", "0.52620596", "0.5257139", "0.52571195", "0.52430123", "0.52416635", "0.5240294", "0.52347594", "0.52345514", "0.522972", "0.5229371", "0.5229288", "0.5228383", "0.5226781", "0.52251875", "0.52251875", "0.52251875", "0.52251875", "0.52144784", "0.52144283", "0.5209761", "0.5209761", "0.52063936", "0.52001727", "0.5182869", "0.51795477", "0.51599777", "0.5158903", "0.51516724", "0.5151441", "0.5148218", "0.5146762", "0.5146762", "0.5142421", "0.51392716", "0.51313937", "0.5129164", "0.5126565", "0.5126565", "0.5126565", "0.51260585", "0.51151913", "0.51051575", "0.51046544", "0.5103507", "0.5102847", "0.51026267", "0.51009333" ]
0.0
-1
retorna um number representando a quantidade de faces do dado
getQuantidadeFaces() { return Faces }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getClosetDepth() { return this.faces.get(FaceOrientation.BASE).depth(); }", "function len(feet, inches, eigths) {\n var l = (12 * (feet || 0)) + (inches || 0) + ((eigths || 0) / 8); \n return pixels(l);\n}", "getFaceTurnCount() {\n return this.current == null ?this.ftm : this.ftm + this.countFaceTurns(this.current);\n }", "getDrawSize () {\r\n return Math.ceil(this.calories / this.gestation * 10)\r\n }", "_face(pos)\n {\n if (this._cells.length === 12) {\n return this._face4(pos);\n } else if (this._cells.length === 200) {\n return this._face50(pos);\n } else {\n throw new SyntaxError('_face: unsupported cube size');\n }\n }", "get numTriangles() {\n const numVertices = this.numVertices\n return numVertices >= 3 ? numVertices - 2 : 0\n }", "familiesPerFloor() {\n return this.numberOfFamilies / this.numberOfFloors;\n }", "adjacentFaceCounts() {\n return _.countBy(this.adjacentFaces(), 'numSides');\n }", "getDieValue() {\n\t\treturn this.faceValue;\n\t}", "getTotalOfSelectedCards() {\n return this.getSelectedDecks().reduce((total, deck) => total + deck.totalCards, 0)\n }", "function Die(num_faces) {\n\n}", "function fatorial(numero) {\n return 0\n}", "getDensity() {\n const density = this.mass / this.getVolume();\n return +density.toFixed(3);\n }", "getDensity() {\n const density = this.mass / this.getVolume();\n return +density.toFixed(3);\n }", "get foilCount() {\n return Math.floor(this.itemCount * 0.10); // 10% of questions will have a foil response\n }", "function countCoordinate (val){\n return (val * side ) + (side / 2);\n}", "_face4(pos)\n {\n if (pos.y < 0) {\n return undefined;\n } else if (pos.y < 4) {\n if ((8 <= pos.x) && (pos.x < 12)) {\n return 1;\n }\n } else if (pos.y < 8) {\n if ((0 <= pos.x) && (pos.x < 4)) {\n return 2;\n } else if ((4 <= pos.x) && (pos.x < 8)) {\n return 3;\n } else if ((8 <= pos.x) && (pos.x < 12)) {\n return 4;\n }\n } else if (pos.y < 12) {\n if ((8 <= pos.x) && (pos.x < 12)) {\n return 5;\n } else if ((12 <= pos.x) && (pos.x < 16)) {\n return 6;\n }\n }\n return undefined;\n }", "function getNBoxes(value){\n //creo una variabile che tenga conto del numero di quadrati da creare in base al livello di difficoltà\n let nBoxes;\n \n //assegno alla variabile nBoxes il numero di scatole che voglio creare\n if(value === \"1\"){\n //assegno alla variabile \"nBoxes\" il valore 49\n nBoxes = 49;\n }else if(value === \"2\"){\n //assegno alla variabile \"nBoxes\" il valore 81\n nBoxes = 81; \n }else if(value === \"3\"){\n //assegno alla variabile \"nBoxes\" il valore 100\n nBoxes = 100;\n }\n \n\n return nBoxes;\n \n}", "p(pos) { return Math.ceil((pos-1)/this.d); }", "getHeight() {\n return this.face.height();\n }", "dopusk_out() {\n\t\tvar ind = -1;\n\t\tvar a = 0;\n\t\tfor (let i=0; i<this.n; i++) {\n\t\t\tif (this.b_numerator[i] >= 0) continue;\n\t\t\tif (this.b_numerator[i]/this.b_denominator[i] <= a) {\n\t\t\t\tind = i;\n\t\t\t\ta = this.b_numerator[i]/this.b_denominator[i];\n\t\t\t}\n\t\t}\n\t\treturn ind;\n\t}", "maxDegree() {\n\t\tlet d = 0;\n\t\tfor (let u = 1; u <= this.n; u++) d = Math.max(d, this.degree(u));\n\t\treturn d;\n\t}", "function size() {\n out = 1;\n for (var dim in dimensions) {\n out *= dimensions[dim].members.length;\n }\n return out;\n }", "calculVitesseX(){\r\n //rajout de 1 facteur\r\n if (this.vitesseXFacteur < this.limiteFacteur){\r\n this.vitesseXFacteur +=1; // faire en fonction de la largeur du terrain\r\n }\r\n else {/*rien car la vitesse ne peux pas depasser la limite*/}\r\n }", "getTotalVolume() {\n return this.height * this.width * this.length;\n }", "getTotalVolume() {\n return this.height * this.width * this.length;\n }", "shelfSize()\n {\n return this.values.size * this.values.quantity;\n }", "getTotalVolume()\n {\n return this.water + this.red + this.green + this.blue;\n\n }", "Nr(){\n return this.Lj*12/6+1\n }", "_getPartOfCount() {\n\n // 8-neighborhood around\n const n = [\n Point.val(this.x - 1, this.y - 1),\n Point.val(this.x - 1, this.y),\n Point.val(this.x - 1, this.y + 1),\n Point.val(this.x, this.y - 1),\n Point.val(this.x, this.y + 1),\n Point.val(this.x + 1, this.y - 1),\n Point.val(this.x + 1, this.y),\n Point.val(this.x + 1, this.y + 1),\n ];\n\n const edges = n.filter(p => p === '-' || p === '|').length;\n const ind = [];\n for (let i = 0; i < 8; i++) {\n if (n[i] === '-' || n[i] === '|') ind.push(i);\n }\n\n switch (edges) {\n\n case 2:\n switch (ind[0]) {\n case 1: \n return ind[1] === 3 ? (n[0] === n[7] ? 2 : 1) : (n[2] === n[5] ? 2 : 1);\n case 3: \n return n[2] === n[5] ? 2 : 1;\n case 4: \n return n[0] === n[7] ? 2 : 1;\n }\n\n case 3: \n return n.filter(p => p === ' ').length === 5 ? 3 : 2;\n\n case 4:\n return n.filter(p => p === ' ').length;\n }\n }", "get bendFactor() {}", "Fv(){\n return this.shearReinf ? Math.min(3*Math.pow(this.fm,0.5),150) : Math.min(Math.pow(this.fm,0.5),50)\n }", "set valorFace(novoValorface) {\n if ((novoValorface >= 1) && (novoValorface <= 6)) {\n return this._valorFace = novoValorface\n } else {\n return \"Valor inválido para a face do dado\"\n }\n }", "function quantize(v) {\n var min = parseFloat(minmax_boxes[0].value);\n var max = parseFloat(minmax_boxes[1].value);\n var step = parseFloat(minmax_boxes[2].value);\n\n v = min + Math.round((v - min) / step) * step;\n if (isNaN(v)) return v;\n if (v > max) v = max;\n if (v < min) v = min;\n return v;\n}", "N() {\n return this.maxIteration - this.iteration;\n }", "officesPerFloor() {\n return this.numberOfOffices / this.numberOfFloors;\n }", "Fj(){\n return 0.18*Math.pow(386/this.Deff(),0.5)\n }", "function getPoints(accepted_count) {\n return (80 / (40 + accepted_count)).toFixed(2);\n}", "GetTileCount()\n\t{\n\t\tvar value = this.tileCountPerGrid * this.gridCount * this.tileCountPerGrid * this.gridCount ; \n\t\treturn value;\n\t}", "function getDepth(mag) {\n return (mag/10) \n }", "function face(num, base = 1) {\n var zero = '0.0';\n var one = '(0.**.0)';\n var two = `${one}-~[${zero}]`;\n var three = `(${two})+(${one})`;\n var four = `(${two})**(${two})`;\n var five = `(${two})*(${three})-(${one})`;\n var six = `(${two})**(${three})-(${two})`;\n var seven = `(${two})**(${three})-(${one})`;\n var eight = `(${two})**(${three})`;\n var nine = `(${three})**(${two})`;\n var ten = `(${one}+${nine})`;\n\n var faceNum = [zero, one, two, three, four, five, six, seven, eight, nine][num];\n return `((${faceNum})*(${ten}**${base}))`;\n}", "getUsedVolume() {\n var used = 0.0;\n for (var index in this.goods) {\n used += this.goods[index].getTotalVolume();\n }\n return used;\n }", "function quakeRadius(mag) {\n return ((mag+1) ** 2) * 30000;\n}", "_face50(pos)\n {\n if (pos.y < 0) {\n return undefined;\n } else if (pos.y < 50) {\n if ((50 <= pos.x) && (pos.x < 100)) {\n return 1;\n } else if ((100 <= pos.x) && (pos.x < 150)) {\n return 2;\n }\n } else if (pos.y < 100) {\n if ((50 <= pos.x) && (pos.x < 100)) {\n return 3;\n }\n } else if (pos.y < 150) {\n if ((0 <= pos.x) && (pos.x < 50)) {\n return 4;\n } else if ((50 <= pos.x) && (pos.x < 100)) {\n return 5;\n }\n } else if (pos.y < 200) {\n if ((0 <= pos.x) && (pos.x < 50)) {\n return 6;\n }\n }\n return undefined;\n }", "size() {\n // return position minus deposition\n return this.position - this.deposition;\n }", "get referencePixelsPerUnit() {}", "diameterMax() {\n let Dmax = 5.8 * Math.pow(this.mass, 1.0 / 3.0);\n return Dmax;\n }", "getColumnsAmount() { //metodo para calcular a quantidade de coluna disponivel baseado no tamanho do bloco, para saber as dimensoes do celular\n const width = Dimensions.get('window').width\n return Math.floor(width / this.blockSize)\n }", "get size() {\n // Return the quad count if if was cached\n let size = this._size;\n if (size !== null) return size;\n\n // Calculate the number of quads by counting to the deepest level\n size = 0;\n const graphs = this._graphs;\n let subjects, subject;\n for (const graphKey in graphs) for (const subjectKey in subjects = graphs[graphKey].subjects) for (const predicateKey in subject = subjects[subjectKey]) size += Object.keys(subject[predicateKey]).length;\n return this._size = size;\n }", "getBeamCount() {\n const beamCounts = this.notes.map(note => note.getGlyph().beam_count);\n\n const maxBeamCount = beamCounts.reduce((max, beamCount) => beamCount > max ? beamCount : max);\n\n return maxBeamCount;\n }", "function nbOfMale (){\n\n}", "factorizar(numero){\n let total = 1\n for (let i = 1; i <= numero; i++){\n total = total * i\n }\n return total;\n }", "getSurfaceArea() {\n const surfaceArea = 6 * Math.pow(this.length, 2);\n return +surfaceArea.toFixed(3);\n }", "function GetBigPsi() {\r\n\t\t\r\n\t\tvar BigPsi = Math.acos((iHatSrcX*NodeX) + (iHatSrcY*NodeY) + (iHatSrcZ*NodeZ)); \r\n\t\t\r\n\t\treturn BigPsi;\r\n\t}", "promedio(){\n let promedio = 0;\n let i =0;\n for(let x of this._data){\n i = i++;\n promedio = promedio + x;\n }\n return promedio/i;\n }", "get kurtosis(): ?number {\n if(this.alpha > 4) {\n return 6 * (Math.pow(this.alpha, 3) + Math.pow(this.alpha, 2) - 6 * this.alpha - 2) / (this.alpha * (this.alpha - 3) * (this.alpha - 4));\n }\n return undefined;\n }", "volume() {\n return this.length * this.width * this.height;\n }", "volume() {\n return this.length * this.width * this.height\n }", "get floorsCount() {\n return this._floorsCount;\n }", "get valueQuantity () {\r\n\t\treturn this.__valueQuantity;\r\n\t}", "function findNb(m) {\n var n = 0\n while (m > 0) m -= ++n ** 3\n return m ? -1 : n\n}", "lifeExpectancyVenus() {\n let venusianLifeExpectancy = Math.floor(this.lifeExpectancy/0.62);\n return venusianLifeExpectancy;\n }", "function GetGammaValue() {\r\n\t\tvar _DETECTOR_ORIENTATION\t=\t$('#' + DOM_FieldID_DetectorOrientation).val ();\r\n\r\n\t\tvar gamma = (((+_DETECTOR_ORIENTATION) - 45) * (Math.PI / 180));\r\n\t\t\r\n\t\treturn gamma;\r\n\t}", "balanceFactor () {\n const leftH = this.left ? this.left.height : 0\n const rightH = this.right ? this.right.height : 0\n return leftH - rightH\n }", "snpMDG(v) {\n // console.log(v)\n // console.log(Math.round(v/this.cellSize/this.scale) * this.cellSize/this.scale)\n return Math.round(v/this.cellSize) * this.cellSize\n }", "Ds(){\n return (12*Math.pow(this.hc+this.hd/2,3))/(12*this.n())\n }", "function calcularMediaRealPlantilla() {\r\n\tvar sumaMediasReales = 0;\r\n\tvar numeroJugadores = 0;\r\n\tfor (jugador in jugadores) {\r\n\t\tnumeroJugadores++;\r\n\t\tsumaMediasReales = sumaMediasReales + jugadores[jugador][\"mediareal\"];\r\n\t}\r\n\treturn sumaMediasReales/numeroJugadores;\r\n}", "function pieceValue(e) {\r\n if ( typeof e == 'number') {\r\n if (e > 0) { return 1; }\r\n if (e < 0) { return -1; }\r\n if (e == 0) { return 0; }\r\n } else { return 0; }\r\n}", "getPixelPerMeter() {\n\t\tlet ppm = new vec2(this.#_fusion.targetOutSize.x/this.#_augmentaScene.scene.x,this.#_fusion.targetOutSize.y/this.#_augmentaScene.scene.y);\n\t\treturn ppm;\n\t}", "function totalInches(feet,inches){\n return (feet*12)+inches;\n }", "get factor() {\n\t\treturn this.__factor;\n\t}", "getDim(){\n let n = (this.state.size);\n //toFixed(someNum) used to set floating point accuracy\n let width = (100/(2*n-1)).toFixed(2);\n let margin = (100/(4.5*n-1)).toFixed(2);\n // console.log(width,margin);\n return {width,margin}\n}", "get numTotalChoices() {\n // Iterates over all of the items in the collection.\n // Probably a bit slower than modifying a property directly when adding / removing items,\n // But a lot easier to maintain.\n return Array.from(this.choices.values(), (value) => value.totalNumber)\n .reduce((acc, cur) => acc + cur, 0)\n }", "getVolume() {\n const volume = (4 * Math.PI * Math.pow(this.radius, 3)) / 3;\n return +volume.toFixed(3);\n }", "function getCantidad(){\n\treturn Math.round(Math.random() * 100) + 1;\n}", "function livingVolume(height,width,depth){\n return height*width*depth; \n}", "get numVertices() {\n return this._coords.length / 2\n }", "function size() {\n return k;\n }", "function size(countOfCountry) {\n return countOfCountry.map(d => 25 + d / 2.5)\n }", "function numberCountInPercentage() {\n var totalSize = ar.length;\n var count = {\n posCount: 0,\n negCount: 0,\n zeroCount: 0\n };\n ar.forEach(function(num) {\n if (num > 0) {\n count.posCount++;\n } else if (num < 0) {\n count.negCount++;\n } else {\n count.zeroCount++;\n }\n });\n console.log(Number(count.posCount / totalSize).toFixed(6));\n console.log(Number(count.negCount / totalSize).toFixed(6));\n console.log(Number(count.zeroCount / totalSize).toFixed(6));\n}", "get size() {\n // Return the quad count if if was cached\n var size = this._size;\n if (size !== null) return size; // Calculate the number of quads by counting to the deepest level\n\n size = 0;\n var graphs = this._graphs,\n subjects,\n subject;\n\n for (var graphKey in graphs) for (var subjectKey in subjects = graphs[graphKey].subjects) for (var predicateKey in subject = subjects[subjectKey]) size += Object.keys(subject[predicateKey]).length;\n\n return this._size = size;\n }", "getVolume() {\n const volume = Math.pow(this.length, 3);\n return +volume.toFixed(3);\n }", "function factorServidor(intesidad, n){\n return n/(n - intesidad)\n}", "function nDozen(n) {\n return dozen * n;\n}", "function size() {\n\t return k;\n\t }", "function getInchesFromFeet(feet) {\nreturn feet * 12;\n}", "get valueQuantity () {\r\n\t\treturn this._valueQuantity;\r\n\t}", "get mode(): number {\n if(this.alpha >= 1) {\n return (this.alpha - 1) / (this.beta + 1);\n }\n return 0;\n }", "baseAmount() {return player.g.points}", "function montaConjuntos(){\r\n\treturn quantidadeDeLinha() / valorDeN();\r\n}", "fearFactor() {\n return this.FEARFULNESS / 100;\n }", "function sameValuePoints(faceValue) {\n return frequency()[faceValue + 1] * (faceValue + 1);\n}", "function contaFoglie(t){\r\n if(t == undefined){\r\n return 0\r\n }\r\n if(t.sx==undefined && t.dx==undefined) {\r\n return 1;\r\n }else{ \r\n return contaFoglie(t.sx) + contaFoglie(t.dx);\r\n }\r\n}", "function fMeasure() {\n\n\t//RECALL é a razão entre o número de registros relevantes (numero de erros marcados corretamente)\n\t//recuperado para o número total de registros relevantes na base de dados (numero de erros existentes, de fato).\n\tvar recall = 0;\n\tif (errosExistentes != 0) {\n\t\trecall = numErrosEncontrados / errosExistentes; \n\t}\n\n\t//A precisão é a razão entre o número de registros relevantes recuperados (o numero de erros marcados corretamente)\n\t// para o número total de registros recuperados (irrelevante e relevantes) (erros marcados corretamente e marcacoes incorretas)\n\tvar precision = 0;\n\tif (numErrosEncontrados + numMarcacoesIncorretas){\n\t\tprecision = numErrosEncontrados / (numErrosEncontrados + numMarcacoesIncorretas);\n\t}\n\n\tvar measure = 0;\n\tif (precision + recall != 0){\n\t\t// formula da f-measure;\n\t\tmeasure = 2 * precision * recall / (precision + recall);\n\t}\n\t// retorna a parte inteira do percentual f-measure.\n\treturn parseInt(measure * 100);\n}", "function IndicadorTotal () {}", "degree(u) {\n\t\tea && assert(this.validVertex(u));\n\t\tlet d = 0;\n\t\tfor (let e = this.firstAt(u); e != 0; e = this.nextAt(u,e)) d++;\n\t\treturn d;\n\t}", "function result(){\n console.log(gageFactor.value);\n}", "function getVertexCount(_ref6) {\n var drawMode = _ref6.drawMode,\n vertexCount = _ref6.vertexCount;\n\n var primitiveCount = getPrimitiveCount({ drawMode: drawMode, vertexCount: vertexCount });\n switch (drawMode) {\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"b\" /* default */].POINTS:\n return primitiveCount;\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"b\" /* default */].LINES:\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"b\" /* default */].LINE_STRIP:\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"b\" /* default */].LINE_LOOP:\n return vertexCount * 2;\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"b\" /* default */].TRIANGLES:\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"b\" /* default */].TRIANGLE_STRIP:\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"b\" /* default */].TRIANGLE_FAN:\n return vertexCount * 3;\n default:\n __WEBPACK_IMPORTED_MODULE_3_assert___default()(false);return 0;\n }\n}", "function get_new_die_simple(num_faces) {\n\n}", "function setBookshelfDepthUI(){\n\tvar hDiv = document.getElementById(\"depthOut\");\n\tvar inches = bookshelf.depth/25.4;\n\thDiv.value = parseFloat(inches).toFixed(1);\n}" ]
[ "0.5910529", "0.58487403", "0.57976043", "0.5757204", "0.5726624", "0.5698074", "0.5674776", "0.5673694", "0.56653804", "0.5654842", "0.56387395", "0.56376046", "0.55530626", "0.55530626", "0.5549682", "0.5529705", "0.5519555", "0.5514205", "0.55127513", "0.5497527", "0.5492643", "0.5489783", "0.5475576", "0.5472471", "0.5448721", "0.5448721", "0.54447573", "0.54351896", "0.54343027", "0.542916", "0.54234535", "0.54161507", "0.5411", "0.540542", "0.5402307", "0.5401826", "0.53939223", "0.5377341", "0.53585", "0.5341656", "0.5311158", "0.5286621", "0.5274395", "0.52720374", "0.5265761", "0.525694", "0.5245199", "0.524464", "0.52316725", "0.5224271", "0.5222026", "0.52208525", "0.5217086", "0.5212299", "0.52099097", "0.51914114", "0.5172565", "0.51707894", "0.51657706", "0.51651704", "0.5164315", "0.5162553", "0.5160959", "0.51607823", "0.51582664", "0.51580805", "0.51548356", "0.51540005", "0.51437", "0.5140008", "0.5138448", "0.5137813", "0.5132935", "0.51302326", "0.51212996", "0.5118635", "0.5117755", "0.5116928", "0.51168585", "0.51068556", "0.51057774", "0.5100413", "0.5085385", "0.5081484", "0.50809026", "0.50805855", "0.5078098", "0.50764304", "0.5075557", "0.50751287", "0.5072669", "0.5064908", "0.5062679", "0.5058993", "0.5058553", "0.5056827", "0.5056575", "0.5056401", "0.5055277", "0.50545543" ]
0.6200582
0
Lazy loads queries. Simple to use with infinite scroll. Loads result in decending order of creation date (or _id) may extend this in the future as need. Usage: Bind an instance of APILazy to the scope. Property exports: lazy.data = array of data; lazy.stopLoading = boolean indicating if it is either currently querying or there are no more results lazy.status = status object indicating if it is currently loading Public methods: removeData = splices out a item from the data query = runs query method. Automatically handles optimizing query using last_id and limit. Avoids using skips which are database intensive operations.
function APILazy(query_obj, initial_id, s_call, e_call) { this.query_obj = query_obj .sort("-_id"); this.last_id = initial_id; this.success_callback = angular.isFunction(s_call) ? s_call : angular.noop; this.error_callback = angular.isFunction(e_call) ? e_call : angular.noop; this.status = StatusService.create(); this.stopLoading = false; this.data = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fetchData() {\n this.initLoading();\n\n this.setFilters(this.qs_url, this.generateBaseFilters());\n this.data.filters = this.getFilters(this.qs_url);\n\n let qs = this.setQuerySet(this.view, this.qs_url).filter(this.getFiltersPrepared(this.qs_url)).prefetch();\n this.setQuerySet(this.view, this.qs_url, qs);\n\n this.getInstancesList(this.view, this.qs_url).then(instances => {\n this.setLoadingSuccessful();\n\n this.setInstancesToData(instances);\n\n if(this.view.schema.autoupdate) {\n this.startAutoUpdate();\n }\n\n }).catch(error => {\n this.setLoadingError(error);\n });\n\n this.getParentInstancesForPath();\n }", "function AjaxDataProvider() {\r\n // private\r\n var perPage = 10;\r\n var data = [];\r\n var url = \"http://192.168.60.167:3002/api.php\";\r\n var timer = null;\r\n var req = null; // ajax timer\r\n\r\n // events\r\n var onDataLoading = new Slick.Event();\r\n var onDataLoaded = new Slick.Event();\r\n\r\n function init() {}\r\n\r\n function isDataLoaded(from, to) {\r\n for (var i = from; i <= to; i++) {\r\n if (data[i] === undefined || data[i] === null) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n function clear() {\r\n for (var key in data) {\r\n delete data[key];\r\n }\r\n }\r\n\r\n function getData() {\r\n return data;\r\n }\r\n\r\n function prepareData(from, to) {\r\n if (req) {\r\n req.abort();\r\n for (var i = req.fromPage; i <= req.toPage; i++) {\r\n delete data[i * perPage];\r\n }\r\n }\r\n\r\n if (from < 0) {\r\n from = 0;\r\n }\r\n\r\n if (data.length > 0) {\r\n to = Math.min(to, data.length - 1);\r\n }\r\n\r\n var fromPage = Math.floor(from / perPage);\r\n var toPage = Math.floor(to / perPage);\r\n\r\n while (data[fromPage * perPage] !== undefined && fromPage < toPage)\r\n fromPage++;\r\n\r\n while (data[toPage * perPage] !== undefined && fromPage < toPage)\r\n toPage--;\r\n\r\n if (fromPage > toPage || ((fromPage == toPage) && data[fromPage * perPage] !== undefined)) {\r\n // TODO: look-ahead\r\n onDataLoaded.notify({from: from, to: to});\r\n return;\r\n }\r\n\r\n var recStart = (fromPage * perPage);\r\n var recCount = (((toPage - fromPage) * perPage) + perPage);\r\n\r\n url += \"?page=\" + recStart + \"&count=\" + recCount;\r\n\r\n if (timer !== null) {\r\n clearTimeout(timer);\r\n }\r\n\r\n timer = setTimeout(function () {\r\n for (var i = fromPage; i <= toPage; i++) {\r\n data[i * perPage] = null; // null indicates a 'timered but not available yet'\r\n }\r\n\r\n onDataLoading.notify({from: from, to: to});\r\n\r\n req = $.ajax({\r\n url: url,\r\n type: 'get',\r\n dataType: 'json',\r\n cache: true,\r\n success: function (resp, textStatus, xOptions) {\r\n onSuccess(resp, recStart);\r\n },\r\n error: function () {\r\n onError(fromPage, toPage);\r\n }\r\n });\r\n\r\n req.fromPage = fromPage;\r\n req.toPage = toPage;\r\n }, 50);\r\n }\r\n\r\n function refresh(from, to) {\r\n for (var i = from; i <= to; i++) {\r\n delete data[i];\r\n }\r\n\r\n getData(from, to);\r\n }\r\n\r\n function onError(fromPage, toPage) {\r\n console.log(\"Error loading pages \" + fromPage + \" to \" + toPage);\r\n }\r\n\r\n function onSuccess(resp, start) {\r\n var end = start;\r\n if (resp.data.length > 0) {\r\n end = start + resp.data.length;\r\n data.length += Math.min(parseInt(resp.data.length, 10),1000); // limitation of the API\r\n\r\n for (var i = 0; i < resp.data.length; i++) {\r\n var item = resp.data[i];\r\n data[start + i] = item;\r\n }\r\n }\r\n\r\n req = null;\r\n\r\n onDataLoaded.notify({from: start, to: end});\r\n }\r\n\r\n init();\r\n\r\n return {\r\n // properties\r\n \"getData\": getData,\r\n\r\n // methods\r\n \"clear\": clear,\r\n \"isDataLoaded\": isDataLoaded,\r\n \"prepareData\": prepareData,\r\n \"refresh\": refresh,\r\n\r\n // events\r\n \"onDataLoading\": onDataLoading,\r\n \"onDataLoaded\": onDataLoaded\r\n };\r\n }", "lazyLoad() {\n if(!this.state.loading && this.state.next) {\n const offset = this.state.offset + this.state.limit;\n this.getAlbums(offset);\n }\n }", "fetchData() {\n this.initLoading();\n let qs = this.setAndGetQuerySetFromSandBox(this.view, this.qs_url);\n this.data.instance = qs.cache = qs.model.getInstance({}, qs);\n this.setLoadingSuccessful();\n this.getParentInstancesForPath();\n }", "fetchData() {\n this.initLoading();\n let qs = this.setAndGetQuerySetFromSandBox(this.view, this.qs_url);\n this.data.instance = qs.cache = qs.model.getInstance({}, qs);\n this.setLoadingSuccessful();\n this.getParentInstancesForPath();\n }", "fetchData() {\n this.initLoading();\n this.getInstance(this.view, this.qs_url).then(instance => {\n this.setLoadingSuccessful();\n this.data.instance = instance;\n\n if(this.view.schema.autoupdate) {\n this.startAutoUpdate();\n }\n }).catch(error => {\n debugger;\n this.setLoadingError(error);\n });\n\n this.getParentInstancesForPath();\n }", "function getList() {\n vm.loading = true;\n vm.limit = 8;\n vm.offset = 0;\n vm.list = [];\n vm.noData = false;\n listService.getList(vm.query, vm.limit, vm.offset).then(function (data) {\n vm.offset += vm.limit;\n vm.list = data;\n vm.loading = false;\n vm.noData = !data.length;\n })\n }", "function JsonModel(options) {\n // private\n // var PAGESIZE = 50; replaced by options.limit\n var data = {length: 0};\n //var searchstr = \"apple\"; replaced by options.query\n //var sortcol = null; replace by options.sort\n //var sortdir = 1; replaced by options.dir\n var h_request = null;\n var req = null; // ajax request\n\n // events\n var onDataLoading = new Slick.Event();\n var onDataLoaded = new Slick.Event();\n \n // settings\n var defaults = {\n baseUrl: '',\n urlParams: null, // (Object) name=>value, add base params to the Url\n action: 'getCollection', // Save/Remove/GetObject/GetCollection\n limit: 25, // Pagesize/limit\n sort: null, // the column/field to sort\n dir: 'ASC', // ASC or DESC\n queryColumn: null, // search column \n query: null, // search string\n ajaxMethod: 'jsonp', // json, jsonp, ajax\n ajaxType: 'GET', // GET/POST\n callback: \"callback\" // the default callback function \n \n };\n \n \n /**\n * constructor\n */\n function init() {\n options = $.extend({}, defaults, options);\n }\n\n /**\n * \n */\n function isDataLoaded(from, to) {\n for (var i = from; i <= to; i++) {\n if (data[i] == undefined || data[i] == null) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * \n */\n function clear() {\n for (var key in data) {\n delete data[key];\n }\n data.length = 0;\n }\n\n /**\n * @param (int) start (start record)\n * @param (int) to (end record)\n */\n function ensureData(start, to) {\n \n if (req) {\n req.abort();\n for (var i = req.fromPage; i <= req.toPage; i++) {\n data[i * options.limit] = undefined;\n }\n }\n\n if (start < 0) {\n start = 0;\n }\n\n var fromPage = Math.floor(start / options.limit);\n var toPage = Math.floor(to / options.limit);\n\n while (data[fromPage * options.limit] !== undefined && fromPage < toPage)\n fromPage++;\n\n while (data[toPage * options.limit] !== undefined && fromPage < toPage)\n toPage--;\n\n if (fromPage > toPage || ((fromPage == toPage) && data[fromPage * options.limit] !== undefined)) {\n // TODO: look-ahead\n //console.log(\"return ensureData\");\n return;\n }\n\n var url = options.baseUrl + ( options.baseUrl.indexOf(\"?\") >= 0 ? \"\" : \"?\") + \n \"query=\" + options.query + \n \"&start=\" + start + \n \"&limit=\" + options.limit +\n \"&sort=\" + options.sort +\n \"&dir=\" + options.dir +\n \"&action=\" + options.action + \n paramString(options.urlParams);\n\n if (h_request != null) {\n clearTimeout(h_request);\n }\n\n h_request = setTimeout(function () {\n for (var i = fromPage; i <= toPage; i++)\n data[i * options.limit] = null; // null indicates a 'requested but not available yet'\n //console.log(\"ensure load Data\");\n onDataLoading.notify({from: start, to: to});\n // alert(\"URL: \" + url);\n switch (options.ajaxMethod) {\n case 'jsonp':\n req = $.jsonp({\n url: url,\n callbackParameter: options.callback,\n cache: true, // \n success: onSuccess,\n error: function () {\n onError(fromPage, toPage)\n }\n });\n break;\n case 'json':\n default:\n req = $.ajax({\n type: options.ajaxType,\n url: url,\n callbackParameter: options.callback,\n cache: true, // \n success: onSuccess,\n error: function () {\n onError(fromPage, toPage)\n }\n });\n break;\n }\n \n req.fromPage = fromPage;\n req.toPage = toPage;\n }, 50);\n }\n /**\n * Ajax on fail/error\n * @param fromPage - the page it came form?\n * @param toPage\n */\n function onError(fromPage, toPage) {\n // alert(\"error loading pages \" + fromPage + \" to \" + toPage);\n var from = 0;\n var to = 0;\n \n req = null;\n onDataLoaded.notify({from: from, to: to});\n $('#jsonMessage')\n .html('Error')\n .fadeIn('fast')\n .fadeOut(2500);\n \n }\n /**\n * Ajax onSuccess\n * @param response\n */\n function onSuccess(resp) {\n /* types: dataTables, modx, .NET */\n var total = 0;\n var count = 0;\n var newData = {};\n \n var type = 'MODX';\n switch( type) {\n case 'dataTables':\n total = resp.iTotalRecords;// total in DB\n count = resp.iTotalDisplayRecords;//\n newData = resp.aaData;\n break;\n case '.NET':\n break;\n case 'MODX'://\n total = resp.total;// total in DB\n count = resp.count;//\n newData = resp.data;\n default:\n break;\n }\n // turn resp into: \n \n var from = this.fromPage * options.limit;\n var to = from + count;\n \n data.length = parseInt(total);\n\n for (var i = 0; i < count; i++) {\n data[from + i] = newData[i];\n data[from + i].index = from + i;\n }\n req = null;\n onDataLoaded.notify({from: from, to: to});\n $('#jsonMessage')\n .html(resp.message)\n .fadeIn('fast')\n .fadeOut(2500);\n }\n /**\n * Reload data\n * @param (Int) from\n * @param (Int) to \n */\n function reloadData(from, to) {\n for (var i = from; i <= to; i++)\n delete data[i];\n \n ensureData(from, to);\n }\n\n /**\n * Set the sort\n * @param (String) column\n * @param (String) dir\n */\n function setSort(column, dir) {\n options.sort = column;\n options.dir = dir;\n clear();\n }\n /**\n * Set the params\n * @param (String) name\n * @param (String) value\n */\n function setParam(name,value) {\n var len = options.urlParams.length;\n var set = false;\n for ( i=0; i < len; i++ ) {\n if ( options.urlParams[i].name == name ) {\n options.urlParams[i].value = value;\n set = true;\n }\n }\n if ( !set ) {\n options.urlParams.push({'name': name, 'value':value});\n }\n }\n /**\n * set the search \n * @param (String) str\n */\n function setSearch(str) {\n options.query = str;\n clear();\n }\n /**\n * make a url from an object\n */\n function paramString(object) {\n var string = '';\n var len = object.length;\n //console.log(\"O: \" + object );\n //console.log(\"Len: \" + len);\n for ( i=0; i < len; i++ ) {\n //console.log (\"Name: \" + object[i].name );\n //console.log (\"Name: \" + object[i][0] + \" v: \" + object[i][1] );\n //alert(\"Name: \"+ object[i]);\n string += '&'+ object[i].name+'='+object[i].value;\n }\n return string;\n }\n /**\n * now run the constuctor\n */\n init();\n\n return {\n // properties\n \"data\": data,\n \n // methods\n \"clear\": clear,\n \"isDataLoaded\": isDataLoaded,\n \"ensureData\": ensureData,\n \"reloadData\": reloadData,\n \"setSort\": setSort,\n \"setParam\": setParam,\n \"setSearch\": setSearch,\n \n // events\n \"onDataLoading\": onDataLoading,\n \"onDataLoaded\": onDataLoaded\n };\n }", "function query( model, q, options ) {\n\tif( model.name == \"Model\" ) {\n\t\tthrow \"Cannot invoke method directly on Model class\";\n\t}\n\n\tif( options != undefined ) {\n\t\tif( options.hasOwnProperty( \"limit\" ) && typeof options.limit == \"number\" ) {\n\t\t\tq = q.limit( options.limit );\n\t\t}\n\t\tif( options.hasOwnProperty( \"offset\" ) && typeof options.limit == \"offset\" ) {\n\t\t\tq = q.offset( options.offset );\n\t\t}\n\t}\n\n\treturn \tcache.fields( model.name )\n\t\t\t.then( ( fields ) => q.then( ( rows ) => rows.map( ( row, index, array ) => {\n\t\t\t\tlet obj = fields.assign( row, new model() );\n\n\t\t\t\tif( options != undefined && \"lazy\" in options && options[\"lazy\"] == true ) {\n\t\t\t\t\treturn obj;\n\t\t\t\t}\n\t\t\t\treturn cache.relationships( model.name ).attach( obj, fields );\n\t\t\t} )));\n}", "fetchInitialData(){\n\t\tModel.prototype.fetch.apply(this, arguments)\n\t\tthis.collect.fetch()\n\t}", "getPagedData(data) {\n const startIndex = this.paginator.pageIndex * this.paginator.pageSize;\n return data.splice(startIndex, this.paginator.pageSize);\n }", "getPagedData(data) {\n const startIndex = this.paginator.pageIndex * this.paginator.pageSize;\n return data.splice(startIndex, this.paginator.pageSize);\n }", "function loadMore() {\n listService.getList(vm.query, vm.limit, vm.offset).then(function (data) {\n if(data.length) {\n vm.offset += vm.limit;\n vm.list = vm.list.concat(data);\n }\n })\n }", "buildQuery() {\n if (!this._odataOptions) {\n throw new Error('Odata Service requires certain options like \"top\" for it to work');\n }\n this._odataOptions.filterQueue = [];\n const queryTmpArray = [];\n // When enableCount is set, add it to the OData query\n if (this._odataOptions.enableCount === true) {\n const countQuery = (this._odataOptions.version >= 4) ? '$count=true' : '$inlinecount=allpages';\n queryTmpArray.push(countQuery);\n }\n if (this._odataOptions.top) {\n queryTmpArray.push(`$top=${this._odataOptions.top}`);\n }\n if (this._odataOptions.skip) {\n queryTmpArray.push(`$skip=${this._odataOptions.skip}`);\n }\n if (this._odataOptions.orderBy) {\n let argument = '';\n if (Array.isArray(this._odataOptions.orderBy)) {\n argument = this._odataOptions.orderBy.join(','); // csv, that will form a query, for example: $orderby=RoleName asc, Id desc\n }\n else {\n argument = this._odataOptions.orderBy;\n }\n queryTmpArray.push(`$orderby=${argument}`);\n }\n if (this._odataOptions.filterBy || this._odataOptions.filter) {\n const filterBy = this._odataOptions.filter || this._odataOptions.filterBy;\n if (filterBy) {\n this._filterCount = 1;\n this._odataOptions.filterQueue = [];\n let filterStr = filterBy;\n if (Array.isArray(filterBy)) {\n this._filterCount = filterBy.length;\n filterStr = filterBy.join(` ${this._odataOptions.filterBySeparator || 'and'} `);\n }\n if (typeof filterStr === 'string') {\n if (!(filterStr[0] === '(' && filterStr.slice(-1) === ')')) {\n this.addToFilterQueueWhenNotExists(`(${filterStr})`);\n }\n else {\n this.addToFilterQueueWhenNotExists(filterStr);\n }\n }\n }\n }\n if (this._odataOptions.filterQueue.length > 0) {\n const query = this._odataOptions.filterQueue.join(` ${this._odataOptions.filterBySeparator || 'and'} `);\n this._odataOptions.filter = query; // overwrite with\n queryTmpArray.push(`$filter=${query}`);\n }\n // join all the odata functions by a '&'\n return queryTmpArray.join('&');\n }", "fetchData() {\n this.initLoading();\n this.setAndGetInstanceFromSandBox(this.view, this.qs_url).then(instance => {\n this.setLoadingSuccessful();\n this.data.instance = instance;\n }).catch(error => {\n this.setLoadingError(error);\n debugger;\n });\n\n this.getParentInstancesForPath();\n }", "function List(data) {\n if (!(data instanceof Object)) {\n throw new TypeError('Invalid data type for argument `data`.');\n }\n List.__super__.constructor.call(this);\n this.page = data.page;\n this.prevPage = data.prevPage;\n this.nextPage = data.nextPage;\n this.pageCount = data.pageCount;\n this.count = data.count;\n this.limit = data.limit;\n this.order = data.order;\n this.asc = data.asc;\n }", "queryAllFilterLatestData(callback) {\n this.collection.find({}).project({_id: 0, data: {$slice: -1}})\n .toArray(callback);\n }", "function getData(take, skip, options) {\n skip = (skip || 0) < 0 ? 0 : skip; // default value to 0\n take = (take || 1) < 1 ? 1 : take; // default value to 1\n\n if (!angular.isFunction(_request)) {\n return $q.reject('Factory was initialized without a request function');\n }\n\n if (!angular.equals(_lastRequestedOptions, options)) {\n _cache = [];\n _lastRequestedOptions = angular.copy(options);\n }\n\n if (allCached(skip, take)) {\n return buildResponseFromCache(skip, take);\n }\n\n var p = $q.defer();\n\n _request(\n { limit: take + skip, start: skip, options: options }\n ).then(function (response) {\n response.cache = false;\n tagRows(response, skip);\n processCache(response, skip);\n p.resolve(response);\n }).catch(function (response) {\n p.reject(response);\n });\n\n return p.promise;\n }", "function QueryCollection() {\n\t\t}", "function queryData(){\r\n\t// Let user know the status (will convert this to a function)\r\n\t$('.status-message').text(\"Querying top players...\");\r\n\t// We are finding all of the top 1000 players\r\n\tqueryPlayers().then(data => {\r\n\t\t// Establish all \"global\" variables we'll need to define to use calculative data\r\n\t\tlet allBattles = []; \r\n\t\tlet allDecks = [];\r\n\t\tlet calcData = {};\r\n\t\t// This can be changed from 1-1000. Ideal is 200 for production\r\n\t\t// let max = STORE.totalPlayers;\r\n\t\tlet max = 200;\r\n\t\t// This tracks how many promises are returned\r\n\t\tlet completedQueries = 0;\r\n\t\t// This is used as an index for the current call\r\n\t\tlet current = 0;\r\n\t\t// This is a variable used for initial display of data\r\n\t\t// Once we hit a threshold, this turns false and the user is forced to press \"refresh\" for more data\r\n\t\tlet initRender = false;\r\n\t\t/* We have rate limiting on our API of 50 req/sec\r\n\t\t Considering we call the API 200 times, I set\r\n\t\t an interval of 1 call per 1 second to avoid any\r\n\t\t trouble in the future of multiple people accessing\r\n\t\t the site */\r\n\t let playerQueryLimiting = setInterval(function () {\r\n\t \t// If our current player query is less than the max we want to call\r\n\t \tif(current < max - 1){\r\n\t \t\t// Update the status to let the user know queries are still occuring... even if no data is coming back\r\n\t \t\t$('.status-message').text(`Querying player #${data[current].tag}...`);\r\n\t \t\t// Query an individual player\r\n\t\t queryPlayerData(data[current].tag)\r\n\t\t \t.then(battleData => {\r\n\t\t \t\t// Add all returned battles from a single player query to our allBattles\r\n\t\t \t\tbattleData.forEach(battle => {\r\n\t\t \t\t\tallBattles.push(battle)\r\n\t\t \t\t\tallDecks.push(helpers.makeDeckStorage(battle.team[0].deckLink))\r\n\t\t \t\t})\r\n\t\t \t\t// Update UI to tell user how much data is collected\r\n\t\t \t\t$('.total-battle-data').html(`Available: <span class=\"total-battle-total\">${allBattles.length} battles</span>`);\r\n\t\t \t\t// Increase our Promise resolution count\r\n\t\t \t\tcompletedQueries++;\r\n\t\t \t\t/* Update the progress bar (we assume 10 battles is enough to display data)\r\n\t\t \t\t Hence we use the completed Promises * 10 to pass in 10% for every promise completed \r\n\t\t \t\t If data is rendered we don't need to keep calling this */\r\n\t\t \t\tif(!initRender && completedQueries < 10){\r\n\t\t \t\t\t$updateProgressBar(completedQueries*10, false);\r\n\t\t \t\t}\r\n\t\t \t\t// If the results aren't rendered AND the queries ARE 10 or more\r\n\t\t\t\t if(!initRender && completedQueries >= 10){\r\n\t\t\t\t \t$('.extra-info').html(\"We will query additional players. Select 'Refresh' at any time to update info.\");\r\n\t\t\t\t \t// We set this so this condition never happens until user hits Refresh\r\n\t\t\t\t \tinitRender = true;\r\n\t\t\t\t \t// We render the data\r\n\t\t\t\t \tcalcData = $refreshData(allBattles, allBattles.length);\r\n\t\t\t\t \t$updateProgressBar(100, true);\r\n\t\t\t\t }\r\n\t\t\t\t if(completedQueries == max - 1){\r\n\t\t\t\t \t$('.status-message').html(\"All data is collected.\");\r\n\t\t\t\t \t$('#progress-wrapper').slideUp('fast');\r\n\t\t\t\t }\r\n\t\t\t\t // calcData = $refreshData(allBattles, allBattles.length);\r\n\r\n\t \t})\r\n\t \t} else {\r\n\t \t\t// We sent every query we wanted to. Alert the user\r\n\t \t\t$('.status-message').text(\"All queries sent. Awaiting data to return.\");\r\n\t \t\t// We kill the setInterval so it stops querying\r\n\t \t\tclearTimeout(playerQueryLimiting);\r\n\t \t}\r\n\t \t// No matter what, the current should always increase if this function keeps getting called.\r\n\t current++;\r\n\t }, 1000);\r\n\t // We have an event handler to allow a button click to utilize our allBattles and allDecks data\r\n\t $('#refresh-btn').on('click', function(){\r\n\t \tcalcData = $refreshData(allBattles, allBattles.length);\r\n\t })\r\n\r\n\t $('#clash-cards').on('click', '.card', function(){\r\n\t \t$('.card').addClass('grayscale').removeClass('active');\r\n\t \t$(this).addClass('active');\r\n\t \tlet cardId = $(this).data('id');\r\n\t \tlet validCards = calcData.topCards;\r\n\t \tlet validDecks = calcData.decks;\r\n\t \tlet sortedDecks = helpers.sortOnCount(validDecks, validCards);\r\n\t \tlet deckLinks = helpers.findDecks(cardId, sortedDecks);\r\n\t \t$('#deck-links').empty().append($renderDecks(deckLinks, calcData.cards));\r\n\t\t});\r\n\r\n\t})\r\n}", "clearCache() {\n if (!this.dataProvider) {\n return;\n }\n\n this._pendingRequests = {};\n const filteredItems = [];\n\n for (let i = 0; i < (this.size || 0); i++) {\n filteredItems.push(this.__placeHolder);\n }\n\n this.filteredItems = filteredItems;\n\n if (this.opened) {\n this._loadPage(0);\n } else {\n this._forceNextRequest = true;\n }\n }", "function getPageData(pageNum, query) {\n return loadData()\n .then(complete);\n\n function complete(response) {\n database = response.data;\n sortData(query);\n filterData(query);\n var pageData = getPageItems(pageNum);\n return pageData;\n }\n }", "function fetch() {\n $scope.isLoading = true;\n $http.post(url+'/api/user/getUserList', {\n // skip: $scope.searchParams.begin,\n skip: $scope.searchParams.limit,\n page: $scope.searchParams.pageNum - 1\n })\n .success(function (data) {\n $scope.isLoading = false;\n console.log('fetch userList from server success:', data);\n $scope.data_store = data.instances.list;\n $scope.userList = $scope.data_store;\n $scope.searchParams.total = data.instances.pageNum;\n\n })\n .error(function (data) {\n $scope.isLoading = false;\n alert('Internal server error');\n console.log('got error:', data);\n });\n }", "list({ skip = 0, limit = 50, ...query } = {}) {\n return this.find(query)\n .sort({ created: 1 })\n .skip((+skip) * (+limit))\n .limit(+limit)\n .exec();\n }", "function fetchResults() {\n // Backbone fetch for more results from API\n Alloy.Collections.entry.fetch({\n urlparams: {\n \"numResults\":10,\n \"page\":pager.page()\n },\n\n add: true, // Don't reset the collection, but add to it (in theory to prevent setItems and use appendItems...?)\n\n silent: true, // Don't trigger an \"add\" event for every model, but just one \"fetch\" (prevent multiple binding events)\n\n success : function(e) {\n //Ti.API.log(JSON.stringify(e));\n\n // init setMarker of ListView for lazy loading of more entries\n var markerVal = pager.page() * 10 -1; // always 1 less than length of list\n $.lvEntries.setMarker({sectionIndex:0, itemIndex: markerVal });\n\n // Move on pager for next API call\n pager.next();\n\n }, error : function() {\n alert('error');\n }\n });\n}", "getAll(requestSize = 2000, acceptHeader = \"application/json;odata=nometadata\") {\r\n Logger.write(\"Calling items.getAll should be done sparingly. Ensure this is the correct choice. If you are unsure, it is not.\", 2 /* Warning */);\r\n // this will be used for the actual query\r\n // and we set no metadata here to try and reduce traffic\r\n const items = new Items_1(this, \"\").top(requestSize).configure({\r\n headers: {\r\n \"Accept\": acceptHeader,\r\n },\r\n });\r\n // let's copy over the odata query params that can be applied\r\n // $top - allow setting the page size this way (override what we did above)\r\n // $select - allow picking the return fields (good behavior)\r\n // $filter - allow setting a filter, though this may fail due for large lists\r\n this.query.forEach((v, k) => {\r\n if (/^\\$select|filter|top|expand$/i.test(k)) {\r\n items.query.set(k, v);\r\n }\r\n });\r\n // give back the promise\r\n return new Promise((resolve, reject) => {\r\n // this will eventually hold the items we return\r\n const itemsCollector = [];\r\n // action that will gather up our results recursively\r\n const gatherer = (last) => {\r\n // collect that set of results\r\n [].push.apply(itemsCollector, last.results);\r\n // if we have more, repeat - otherwise resolve with the collected items\r\n if (last.hasNext) {\r\n last.getNext().then(gatherer).catch(reject);\r\n }\r\n else {\r\n resolve(itemsCollector);\r\n }\r\n };\r\n // start the cycle\r\n items.getPaged().then(gatherer).catch(reject);\r\n });\r\n }", "function DataApi() { }", "function DataApi() { }", "pagination() {\n //Convert the data into Int using parseInt(string, base value)\n // || 1 is used in case user does not specify any page value similarly for limit default is 10\n const page = parseInt(this.queryStr.page, 10) || 1;\n const limit = parseInt(this.queryStr.limit, 10) || 10;\n // to get the data on pages rather than page 1\n const skipResults = (page - 1) * limit;\n\n //skip method is used to skip through the specified number of data\n //limit method is used to limit the no of data returned at a time.\n this.query = this.query.skip(skipResults).limit(limit);\n\n return this;\n }", "function getData(query, callback) {\n query.api_key = apiKey;\n query.limit = 100;\n\n $.getJSON(endpointURL, query, callback);\n }", "items() {\n if(this.cache){\n return Promise.resolve(this.cache);\n }\n return this.formQueryAndSend('get').then(response => {\n let instances = [];\n let data = response.data.results;\n let prefetch_fields = this._getPrefetchFields();\n\n for(let item in data){\n instances.push(\n this.model.getInstance(data[item], this.clone())\n );\n }\n\n // if prefetch fields exist, loads prefetch data.\n if(prefetch_fields && prefetch_fields.length > 0) {\n return this._loadPrefetchData(prefetch_fields, instances).then(() => {\n this.api_count = response.data.count;\n this.cache = instances;\n return instances;\n });\n }\n\n // otherwise returns instances.\n this.api_count = response.data.count;\n this.cache = instances;\n return instances;\n }).catch(error => {\n debugger;\n throw error;\n })\n }", "function DataService() {\n this.findingsindex = 0;\n this.setData([]);\n }", "function _fetchData() {\n var _rows = rows();\n var _windowSize = windowSize();\n var _windowPosition = windowPosition();\n var availableRowCount = AutomatonModel.getRowCount();\n\n // figure out the range we need to fetch, and fetch it.\n var end = Math.min(_windowPosition, availableRowCount);\n var start = Math.max(0, end - _windowSize);\n var fetchedRows = AutomatonModel.getRange(start, end);\n\n // adjust the automaton size if it looks like that has changed\n var _size = 0;\n if (fetchedRows.length) {\n _size = fetchedRows[0].data.length;\n }\n if (_size > automatonSize() || _size === 0) {\n automatonSize(_size);\n }\n\n // store the fetched rows in the viewModel.\n rows(fetchedRows);\n }", "function query_api(data){\n return $http.get('/api/base/search/', {params: data || {}}).success(function(data){\n $scope.results = $scope.display = data.objects;\n });\n }", "function AppData() {\n const [{ users, todos, posts }, isLoading] = useFetch((fetch) => ({\n todos: fetch(\"todos\"), //the simple api endpoints could be called that way\n users: fetch(\"users\"),\n posts: fetch(\"posts\", {\n queryParams: { userId: \"1\", id: 2 },\n }), //the api endpoints with query parameters could be called that way with infinite number of query parameters\n }));\n\n const usersList = users ? users.map((u) => <li key={u.id}>{u.name}</li>) : \"\";\n\n return (\n <div className=\"App\">\n {isLoading && <FancyLoader />}\n {<ul>{usersList}</ul>}\n </div>\n );\n}", "fetchMore(options) {\n var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (options.amount <= 0 || startIndex >= this.children.length) {\n return _Promise2.default.resolve([]);\n }\n if (!options.skipReplies) {\n return this.fetchTree(options, startIndex);\n }\n var ids = getNextIdSlice(this.children, startIndex, options.amount, _constants.MAX_API_INFO_AMOUNT).map(function (id) {\n return 't1_' + id;\n });\n // Requests are capped at 100 comments. Send lots of requests recursively to get the comments, then concatenate them.\n // (This speed-requesting is only possible with comment Listings since the entire list of ids is present initially.)\n var promiseForThisBatch = this._r._getListing({ uri: 'api/info', qs: { id: ids.join(',') } });\n var nextRequestOptions = _extends({}, options, { amount: options.amount - ids.length });\n var promiseForRemainingItems = this.fetchMore(nextRequestOptions, startIndex + ids.length);\n return _Promise2.default.all([promiseForThisBatch, promiseForRemainingItems]).then(_flatten3.default);\n }", "loadData(direction){\n let page = 0; \n \n if (direction === 'prev')\n page = this.state.page-1;\n if (direction === 'next')\n page = this.state.page+1;\n \n let start = page*this.state.limit;\n start = 'start='+start+'&'; \n let limit = this.state.limit +1;\n limit = 'limit='+limit;\n let search = this.state.search;\n let filters = this.state.filters;\n console.log('url');\n console.log(start+limit+search+filters);\n \n fetch('http://54.234.236.252/api/leads?'+start+limit+search+filters, {\n method: 'get',\n headers: new Headers({\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Headers': 'Cache-Control, Pragma, Origin, Authorization, Content-Type, X-Requested-With', \n 'Access-Control-Request-Method': 'get',\n 'Content-Type': 'application/json'\n }) \n }).then(function(response) {\n return response.json();\n }).then((leads) => {\n if (leads.length===0){\n alert('No existen resultados para la busqueda');\n }else{ \n this.toEnablePager(page, leads.length); \n if (leads.length>this.state.limit) leads.pop(); \n this.setState({filteredDataList:leads, page:page}) \n }\n }).catch(function(err) { \n // Error :(\n });\n }", "lazyLoadAppList() {\n // get original list start from\n startPage = this.appListPager\n // get original list end to\n endPage = this.appListPager + 1\n // update counter\n this.appListPager = this.appListPager + 1\n\n if (this.appListPager <= this.maxAppListPager) {\n this.lazyAppListData = this.lazyAppListData.concat(this.appListData.slice(this.appListSizePerPage * startPage, this.appListSizePerPage * endPage))\n this.setState({\n appListData: this.lazyAppListData\n })\n }\n }", "fetch(pageOffset, pageSize, stats) {\n return Api.search('', pageOffset + 1, pageSize)\n .then(data => data.users)\n .catch(error => {\n _this.refs.errAlert.open();\n _this.setState({\n errMsg:\n 'Looks like you are offline now. Please connect your connection and try again',\n });\n });\n }", "function render_datasets() {\n return page.async(function(flush_data) {\n var collection = db.get(\"query\", \"results\");\n var req = context(\"req\");\n var user = req.user;\n var conditions = { username: user.username };\n\n var query_data;\n var datasets;\n var metadatas;\n var found_data = {};\n\n var after = _.after(2, function() {\n var datasetsEl = $(\"<div />\");\n var hiddenEl = $(\"<div class='hidden_datasets noselect' />\");\n var parentEl = $(\"<div />\");\n parentEl.append(datasetsEl);\n\n var headerEl = $(\"<h1 />\");\n headerEl.text(\"hidden/\");\n headerEl.prepend(\"<span class='status'>&gt;</span>\");\n\n parentEl.append(hiddenEl);\n hiddenEl.append(headerEl);\n\n _.each(datasets, function(table) {\n if (table.table_name === \"undefined\") { return; }\n\n var metadata_ = {\n name: table.table_name,\n description: ''\n };\n\n if (metadatas) {\n var newdata = _.find(metadatas, function(m) {\n if (!m) { return; }\n\n var this_name = m.table.table_name || m.table;\n var table_name = table.table_name || table;\n\n return table_name === this_name;\n });\n\n if (newdata) {\n _.extend(metadata_, _.clone(newdata.metadata));\n }\n\n }\n\n var table_name = metadata_.name.table_name || metadata_.name;\n var dataset_tokens = table_name.split(backend.SEPARATOR);\n var display_name = metadata_.display_name || dataset_tokens.join(\"/\");\n if (backend.SEPARATOR != \"/\") {\n while (display_name.indexOf(backend.SEPARATOR) >= 0) {\n display_name = display_name.replace(backend.SEPARATOR, \"/\");\n }\n }\n\n found_data[table_name] = metadata_;\n metadata_.display_name = display_name;\n\n });\n\n\n\n\n\n // Do a descending sort on query counts\n var sorted_datasets = _.sortBy(datasets, function(dataset) {\n return found_data[dataset.table_name || dataset.name].display_name;\n });\n\n var parents = {};\n\n _.each(sorted_datasets, function(table) {\n var metadata_ = found_data[table.table_name];\n var table_name = metadata_.name.table_name;\n var display_name = metadata_.display_name;\n var dataset_tokens = display_name.split(\"/\");\n var superset = dataset_tokens[0];\n\n if (!rbac.check(\"query\", table.table_name, user.username)) { return; }\n\n var editable = dataset_is_editable(table.table_name, user);\n var cmp = $C(\"dataset_tile\", {\n name: table_name || table.table_name,\n display_name: display_name.replace(superset + \"/\", \"\"),\n description: metadata_.description,\n editable: editable,\n client_options: {\n dataset: table.table_name\n },\n delegate: {\n \"change\" : \"table_changed\",\n \"click .delete\" : \"handle_delete_clicked\"\n }\n });\n\n if (metadata_.hide_dataset == \"true\") {\n hiddenEl.append(cmp.toString());\n } else {\n var supersetEl = parents[superset];\n if (!supersetEl) {\n parents[superset] = $(\"<div class='superset clearfix noselect'>\");\n supersetEl = parents[superset];\n supersetEl.attr(\"id\", superset);\n\n var headerEl = $(\"<h1 />\");\n headerEl.text(superset + \"/\");\n headerEl.prepend(\"<span class='status' >&gt;</span>\");\n\n supersetEl.append(headerEl);\n datasetsEl.append(supersetEl);\n\n }\n\n supersetEl.append(cmp.toString());\n }\n\n });\n\n flush_data(parentEl.toString());\n });\n\n backend.get_tables(function(tables) {\n datasets = tables;\n after();\n });\n\n metadata.all(function(datas) {\n metadatas = datas;\n after();\n });\n })(); // deref the asyncccccy\n}", "static clearQueryData() {\n this.standardizeQueryData();\n queryData[this.className()] = {};\n }", "$reload() {\n if (!this.loaded()) {\n return this.$promise();\n }\n if (!this.reloading()) {\n this[$reloading] = this.$rawFetchAll().then(this.populate);\n }\n return this[$reloading];\n }", "function loadMore() {\n if (vm.paginationHelper['nextPage'] || vm.paginationHelper['nextPageQueries']) {\n var queryArray = [];\n //Building the query array with any existing query \n queryArray = queryArray.concat(vm.queryArray);\n\n if (vm.actions['LIST'].pagination) {\n createPaginationProvider();\n }\n if (vm.paginationHelper['nextPage']) {\n vm.PaginationProvider.url = vm.paginationHelper['nextPage'];\n }\n else {\n vm.PaginationProvider.url = vm.url;\n //Adding pagination queries to queryArray\n queryArray = queryArray.concat(vm.paginationHelper['nextPageQueries']);\n }\n vm.infiniteLoader = vm.PaginationProvider\n .list(queryArray)\n .then(function (response) {\n treatResponse(response, true);\n updatePaginationHelper(vm.paginationHelper.actualPage + 1, response);\n vm.onSuccessList({ elements: vm.catalogElemets });\n })\n .catch(function (errorElements) {\n ErrorHandler.errorTranslate(errorElements);\n vm.onErrorList({ error: errorElements });\n });\n\n }\n else {\n var error = 'No next page URL or queries found';\n vm.onErrorList({ error: error });\n throw (error);\n }\n }", "function loadAllComics (instance) {\n\n let comics = instance.comics.get(),\n limitPerLoad = instance.limitPerLoad,\n comicsOffset = instance.comicsOffset;\n\n Meteor.call('comics.getAll', limitPerLoad + 1, comicsOffset, function (err, res) {\n\n if (err) {\n console.log('error: ', err);\n }\n else if (res) {\n\n instance.comics.set(comics.concat(res.slice(0, limitPerLoad)));\n instance.comicsOffset += res.length - 1;\n\n if (res.length > limitPerLoad) {\n instance.canLoadMore = 'YES';\n }\n else {\n instance.canLoadMore = 'NO';\n }\n }\n\n instance.dataLoaded.set('YES');\n });\n}", "handleFetchRawData({offset=0, size=20, sort=[]}) {\n return this.getDataFromGuppy(this.state.allFields, sort, false, offset, size);\n }", "async getData(req, res) {\n try {\n const mType = await checkRole(req.query);\n const serachFields = await fieldParameters(req.query);\n const sortFields = await sortParameters(req.query);\n let { limit, calcSkip } = await pagination(req.query);\n const searchObject =\n serachFields.length === 0 ? {} : { $and: [...serachFields] };\n const sortObject =\n Object.keys(sortFields).length === 0 ? {} : { ...sortFields };\n const totalObject = await mongoose\n .model(mType)\n .find(searchObject)\n .sort(sortObject);\n const maxLimit = totalObject.length;\n // condition to check user should not exceed max limit\n limit > maxLimit\n ? ((limit = maxLimit), (calcSkip = 0))\n : calcSkip >= maxLimit - limit\n ? maxLimit - limit >= 0\n ? (calcSkip = maxLimit - limit)\n : 0\n : calcSkip;\n const data = await mongoose\n .model(mType)\n .find(searchObject)\n .sort(sortObject)\n .limit(limit)\n .skip(calcSkip);\n // condition to check whether data exists or not with and without search query.\n if (data.length === 0)\n return res\n .status(200)\n .json({ statusCode: 200, message: 'No data found!' });\n return res.status(200).json({ statusCode: 200, data, maxLimit });\n } catch (err) {\n return res.status(500).json({\n statusCode: 500,\n message: 'Server Error',\n });\n }\n }", "_pageData(data) {\n if (!this.paginator) {\n return data;\n }\n const startIndex = this.paginator.pageIndex * this.paginator.pageSize;\n return data.slice(startIndex, startIndex + this.paginator.pageSize);\n }", "handleFetchAndUpdateRawData({offset=0, size=20, sort=[]}) {\n return this.getDataFromGuppy(this.state.allFields, sort, true, offset, size);\n }", "function loadLocalData(){\n if($scope.loading){\n return;\n }\n $scope.loading = true;\n storeService.getAllEntries(soup.name, sortBy, 'ascending').then(function(result){\n $scope.entries = result.currentPageOrderedEntries;\n console.log('entries', $scope.entries);\n $scope.loading = false;\n }, function(err){\n $scope.loading = false;\n });\n }", "dataInit() {\n this.paginate.page = 1\n this.data = _.cloneDeep(this.model)\n }", "loadMore() {\n this.loadData(true);\n }", "_getRawObjects(options = {}) {\n // By default this method will respect skip and limit because .fetch(),\n // .forEach() etc... expect this behaviour. It can be forced to ignore\n // skip and limit by setting applySkipLimit to false (.count() does this,\n // for example)\n const applySkipLimit = options.applySkipLimit !== false;\n\n // XXX use OrderedDict instead of array, and make IdMap and OrderedDict\n // compatible\n const results = options.ordered ? [] : new LocalCollection._IdMap;\n\n // fast path for single ID value\n if (this._selectorId !== undefined) {\n // If you have non-zero skip and ask for a single id, you get nothing.\n // This is so it matches the behavior of the '{_id: foo}' path.\n if (applySkipLimit && this.skip) {\n return results;\n }\n\n const selectedDoc = this.collection._docs.get(this._selectorId);\n\n if (selectedDoc) {\n if (options.ordered) {\n results.push(selectedDoc);\n } else {\n results.set(this._selectorId, selectedDoc);\n }\n }\n\n return results;\n }\n\n // slow path for arbitrary selector, sort, skip, limit\n\n // in the observeChanges case, distances is actually part of the \"query\"\n // (ie, live results set) object. in other cases, distances is only used\n // inside this function.\n let distances;\n if (this.matcher.hasGeoQuery() && options.ordered) {\n if (options.distances) {\n distances = options.distances;\n distances.clear();\n } else {\n distances = new LocalCollection._IdMap();\n }\n }\n\n this.collection._docs.forEach((doc, id) => {\n const matchResult = this.matcher.documentMatches(doc);\n\n if (matchResult.result) {\n if (options.ordered) {\n results.push(doc);\n\n if (distances && matchResult.distance !== undefined) {\n distances.set(id, matchResult.distance);\n }\n } else {\n results.set(id, doc);\n }\n }\n\n // Override to ensure all docs are matched if ignoring skip & limit\n if (!applySkipLimit) {\n return true;\n }\n\n // Fast path for limited unsorted queries.\n // XXX 'length' check here seems wrong for ordered\n return (\n !this.limit ||\n this.skip ||\n this.sorter ||\n results.length !== this.limit\n );\n });\n\n if (!options.ordered) {\n return results;\n }\n\n if (this.sorter) {\n results.sort(this.sorter.getComparator({distances}));\n }\n\n // Return the full set of results if there is no skip or limit or if we're\n // ignoring them\n if (!applySkipLimit || (!this.limit && !this.skip)) {\n return results;\n }\n\n return results.slice(\n this.skip,\n this.limit ? this.limit + this.skip : results.length\n );\n }", "paginatePrevious(boundThis) {\n\n this.settings.offset = this.settings.offset - this.settings.show;\n \n const dataSet = this.run();\n\n boundThis.setState({dataToShow: dataSet.data})\n\n return dataSet\n }", "async function getAllData(page = 1) {\n const offset = helper.getOffset(page, config.listPerPage);\n const rows = await db.query(\n `SELECT * FROM data`,\n [offset, config.listPerPage]\n );\n const data = helper.emptyOrRows(rows);\n const meta = { page };\n\n return {\n data,\n meta\n }\n}", "function loadData (results) {\n\t\t\tself.isWaiting = false;\n\t\t\tself.error = null;\n\t\t\tfirstSearch = false;\n\n\t\t\t// If this was the first page, it includes record count and total pages .\n\t\t\tif (results.complete) {\n\t\t\t\tself.totalRecordCount = results.recordCount;\n\t\t\t\tself.dataResolvingParams.total(self.totalRecordCount);\n\t\t\t}\n\t\t\tif (results.data.length === 0) {\n\t\t\t\tself.data = null;\n\t\t\t\tself.dataResolvingParams.data = [];\n\t\t\t\tbuildErrorWithMessage(\"No records found.\");\n\t\t\t} else {\n\t\t\t\tself.error = null;\n\t\t\t\tself.data = results.data;\n\t\t\t\tself.defer.resolve(results.data);\n\t\t\t}\n\t\t}", "onPullDownRefresh(){\n this.setData({\n goodsList:[]\n })\n this.QueryParams.pagenum=1;\n this.getGoodsList();\n console.log('pull down')\n }", "fetchData() {\n let command = 'NarrativeService.list_all_data',\n params = { data_set: this.dataSet };\n if (this.state.wsIdFilter) {\n command = 'NarrativeService.list_workspace_data';\n params = { workspace_ids: [this.state.wsIdFilter] };\n }\n if (this.state.typeFilter) {\n params.types = this.types[this.state.typeFilter].full || [];\n }\n const otherParams = {\n include_type_counts: 1,\n simple_types: 0,\n ignore_narratives: 1,\n limit: OBJECT_COUNT_LIMIT,\n };\n Object.assign(params, otherParams);\n // params = {...params, ...otherParams};\n return Promise.resolve(this.serviceClient.sync_call(command, [params])).then(\n (data) => data[0]\n );\n }", "load() {\r\n // load item id, then load page data from new pages api\r\n return this.getItem(\"Id\", \"CommentsDisabled\").then(item => {\r\n return (new SharePointQueryable(this, `_api/sitepages/pages(${item.Id})`)).get().then(pageData => {\r\n this.commentsDisabled = item.CommentsDisabled;\r\n return this.fromJSON(pageData);\r\n });\r\n });\r\n }", "read(existing = [], { field, args, readField, cache }) {\n console.log(\"\\n\\nREAD existing = \", existing);\n const { skip, first } = args;\n\n // Read the number of items, so we can make pagination. For some reason when deleting an item, this is null the first time adn then runs two more times with the correct data?? ??!?!? ? ?? ? ? ? ? ?!?!?\n const data = cache.readQuery({\n query: gql`\n query PAGINATION_QUERY_CACHE {\n itemsConnection {\n aggregate {\n count\n }\n }\n }\n `,\n });\n\n const count = data?.itemsConnection?.aggregate?.count;\n console.log(\"count = \", count);\n\n const page = skip / first + 1;\n const pages = Math.ceil(count / first);\n // 3. See if we have the items we want in the existing cache\n const items = existing\n .slice(skip, skip + first)\n // we filter for empty spots because its likely we have padded spots with nothing in them. IE Someone visits page 3 directly, spots 1-8 will be empty\n .filter(x => x);\n // 4. Account for the last page, where there is incomplete data but we dont have any more so we just send it\n if (items.length && items.length !== args.first && page === pages) {\n console.log(\n `We don't have ${first} items, but it's the last page so we're just gonna send it!`\n );\n return items;\n }\n // 5. If there are enough items, return them.\n // It's possible that we only have 3 of the 4 items because we deleted something on the previous page, so if that is the case we need to go to the network\n if (items.length !== args.first) {\n // TODO: This breaks the last page where we might only have a few items....\n console.log(\n `We only have ${items.length} and we want ${args.first} so we're going to the network to fetch them`\n );\n return; // return undefined so it hits the network\n }\n // 6. If there are items, return them.\n if (items.length) {\n console.log(\n `We have ${items.length} items! Gonna serve them from the cache`\n );\n return items;\n }\n // 7. Otherwise this function returns undefined and it will hit the network for the items, and call merge() for us\n console.log(\"No items! Requesting from network\");\n }", "function useFetchInfinite(favorites, filters) {\n const [pageNumber, setPageNumber] = React.useState(1)\n const [loading, setLoading] = React.useState(true)\n const [error, setError] = React.useState(false)\n const [characters, setCharacters] = React.useState([])\n const [hasMore, setHasMore] = React.useState(false)\n const [errorMessage, setErrorMessage] = React.useState(null)\n\n React.useEffect(() => {\n setCharacters([])\n setPageNumber(1)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [filters.name, filters.status, filters.gender, filters.species])\n\n React.useEffect(() => {\n setLoading(true)\n setError(false)\n client(`?page=${pageNumber}`, filters)\n .then(({data}) => {\n console.log('data:', data)\n\n data.results.map(result => {\n return (result.isFavorite = favorites.find(({id}) => id === result.id)\n ? 'true'\n : 'false')\n })\n setCharacters(previousCharacter => {\n return [...previousCharacter, ...data.results]\n })\n setHasMore(data.results.length >= 20)\n setLoading(false)\n })\n .catch(errorResponse => {\n setError(true)\n console.log('errorResponse:', errorResponse)\n setLoading(false)\n })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n filters.name,\n pageNumber,\n filters.status,\n filters.gender,\n filters.species,\n ])\n\n const changeIsFavorite = (id, isFavorite) => {\n setCharacters(\n characters.map(character =>\n character.id === id\n ? {...character, isFavorite: isFavorite}\n : character,\n ),\n )\n }\n\n const observer = React.useRef()\n const lastCharacterElementRef = React.useCallback(\n node => {\n if (loading || error) return\n if (observer.current) observer.current.disconnect()\n observer.current = new IntersectionObserver(entries => {\n if (entries[0].isIntersecting && hasMore) {\n setPageNumber(prevPageNumber => prevPageNumber + 1)\n }\n })\n if (node) observer.current.observe(node)\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [error, hasMore, loading],\n )\n\n return {\n loading,\n errorMessage,\n error,\n characters,\n hasMore,\n changeIsFavorite,\n lastCharacterElementRef,\n }\n}", "preprocess () {\n let items = []\n if (this.lokiQuery) {\n items = this.overpass.db.find(this.lokiQuery)\n }\n\n for (let i = 0; i < items.length; i++) {\n if (this.options.limit && this.count >= this.options.limit) {\n this.loadFinish = true\n return\n }\n\n const id = items[i].id\n\n if (!(id in this.overpass.cacheElements)) {\n continue\n }\n const ob = this.overpass.cacheElements[id]\n\n if (id in this.doneFeatures) {\n continue\n }\n\n // maybe we need an additional check\n if (this.lokiQueryNeedMatch && !this.filterQuery.match(ob)) {\n continue\n }\n\n // also check the object directly if it intersects the bbox - if possible\n if (ob.intersects(this.bounds) < 2) {\n continue\n }\n\n if ((this.options.properties & ob.properties) === this.options.properties) {\n this.receiveObject(ob)\n this.featureCallback(null, ob)\n }\n }\n\n if (this.options.limit && this.count >= this.options.limit) {\n this.loadFinish = true\n }\n }", "constructor(Model, db) {\n // Store internal copy of the Model protoype\n this._Model = Model;\n\n // Store internal copy of the DB API\n this._db = db;\n\n // Query parts\n this.pts = [];\n\n // Bind all public building methods to self\n this.gt = this.gt.bind(this);\n this.or = this.or.bind(this);\n this.lt = this.lt.bind(this);\n this.gte = this.gte.bind(this);\n this.lte = this.lte.bind(this);\n this.skip = this.skip.bind(this);\n this.sort = this.sort.bind(this);\n this.limit = this.limit.bind(this);\n this.elem = this.elem.bind(this);\n this.where = this.where.bind(this);\n this.match = this.match.bind(this);\n this.search = this.search.bind(this);\n this.ne = this.ne.bind(this);\n this.nin = this.nin.bind(this);\n this.in = this.in.bind(this);\n this.or = this.or.bind(this);\n this.and = this.and.bind(this);\n\n // Bind all public finalization methods to self\n this.sum = this.sum.bind(this);\n this.raw = this.raw.bind(this);\n this.find = this.find.bind(this);\n this.count = this.count.bind(this);\n this.remove = this.remove.bind(this);\n this.findOne = this.findOne.bind(this);\n }", "function reQuery() {\n\n // Update our different OData strings\n updateFilterString();\n updateSortString();\n\n // Refresh the visual collection, resulting in the table refreshing\n properties.visualCollection.refresh();\n\n }", "async function loadData() {\n const response = await api.get('/users', { \n params: {\n sortBy: 'id',\n order: 'desc'\n } \n })\n setUsers(response.data)\n }", "async function fetchData() {\n const { data } = await dataProvider(GET_LIST, LANG_API, {\n pagination: {\n page: 1,\n perPage: 1000,\n },\n sort: {\n field: 'id',\n order: 'ASC',\n },\n skipPrefix: true,\n });\n\n setIsLoading(false);\n setLanguageList(data);\n }", "function Query(applicationId, path, ql, options, success, failure) {\n if (path.lastIndexOf(\"/\", 0) !== 0) {\n path = \"/\" + path;\n }\n path = \"/\" + self.currentOrganization + \"/\" + applicationId + path;\n var client = self;\n var self = this;\n var query = {};\n var start_cursor = null;\n var next_cursor = null;\n var prev_cursor = null;\n\n function getServiceParams() {\n var params = {};\n if (ql) {\n params['ql'] = ql;\n }\n if (start_cursor) {\n params['cursor'] = start_cursor;\n }\n if (prev_cursor) {\n params['prev'] = prev_cursor;\n }\n if (options) {\n for (var name in options) {\n params[name] = options[name];\n }\n }\n return params;\n }\n this.getServiceParams = getServiceParams;\n\n function hasPrevious() {\n return prev_cursor != null;\n }\n this.hasPrevious = hasPrevious;\n\n function getPrevious() {\n start_cursor = null;\n next_cursor = null;\n if (prev_cursor) {\n start_cursor = prev_cursor.pop();\n send(\"GET\", null);\n }\n }\n this.getPrevious = getPrevious;\n\n function hasNext() {\n return next_cursor && start_cursor;\n }\n this.hasNext = hasNext;\n\n function getNext() {\n if (next_cursor && start_cursor) {\n prev_cursor = prev_cursor || [];\n prev_cursor.push(start_cursor);\n start_cursor = next_cursor;\n next_cursor = null;\n send(\"GET\", null);\n }\n }\n this.getNext = getNext;\n\n function send(method, data) {\n var params = getServiceParams();\n prev_cursor = null;\n next_cursor = null;\n start_cursor = null;\n apiRequest(method, path, params, data, function (data) {\n if (data.entities && data.entities.length > 1) {\n start_cursor = data.entities[0].uuid;\n if (data.params) {\n if (data.params.prev) {\n prev_cursor = data.params.prev;\n }\n if (data.params.cursor) {\n start_cursor = data.params.cursor[0];\n }\n }\n next_cursor = data.cursor;\n }\n if (success) {\n success(data, self);\n }\n }, function (data) {\n if (failure) {\n failure(data, self);\n }\n });\n }\n this.send = send;\n\n function post(obj) {\n if (obj) {\n send(\"POST\", JSON.stringify(obj));\n }\n }\n this.post = post;\n\n function put(obj) {\n if (obj) {\n send(\"PUT\", JSON.stringify(obj));\n }\n }\n this.put = put;\n\n function delete_() {\n send(\"DELETE\", null);\n }\n this.delete_ = delete_;\n }", "async _list(options = {}, { eventId } = {}) {\n /* Looks for an extra record past the limit to determine\n last page. */\n if (options.offset === null || options.offset === undefined) {\n if (options.limit !== undefined) delete options.limit;\n } else {\n if (!options.limit) options.limit = 21;\n else options.limit += 1;\n }\n\n /* Get a list of records. */\n let models, err;\n [err, models] = await to(this.Model.findAll(options));\n if (err) this._handleErrors(err, { eventId });\n\n this.cache.list = models;\n if (!models) return [];\n else return models.map(e => e.get({ plain: true }));\n }", "function _loadRemoteData() {\n $scope.isLoading = true;\n\n QueryService.getAvailableQueries(\"offers\")\n .then(function(result) {\n serveResult(result);\n })\n .catch(function(error) {\n console.log(error);\n alert('wystąpil błąd...');\n })\n .finally(function() {\n $scope.isLoading = false;\n });\n }", "getData(numRecords = undefined) {\n return !numRecords ? this.data : this.data.slice(0, numRecords);\n }", "fetchAlldonateUser(limit = _const_api_constant__WEBPACK_IMPORTED_MODULE_3__[\"API_CONFIG\"].pageSize, page = 1, where) {\n const skip = (page - 1) * limit;\n let filter = {\n limit,\n skip,\n where,\n };\n let httpParams = new _angular_common_http__WEBPACK_IMPORTED_MODULE_1__[\"HttpParams\"]();\n httpParams = httpParams.append('filter', JSON.stringify(filter));\n return this._http.get(this.baseUrl + _const_api_constant__WEBPACK_IMPORTED_MODULE_3__[\"API_ENDPOINT\"].donate.fetchAll, {\n params: httpParams\n });\n }", "function refreshResults() {\n\tif (_dataSource) {\n\t\t_pager.page(0);\n\t\t_dataSource.fetch(function(){\n\t\t // if callback is needed, place it here\n\t\t});\n\t}\t\n}", "function getData() {\n var queryParams = {\n propertySelection: \"179,7,10888003,8,\" + $scope.cfg.fieldIdToDisplay,//, // ids of fields to fetch\n queryExpression: \"'7' != 3\" //Status is not rejected\n //queryExpression: \"'8' != developer\" //Status is not rejected\n };\n\n var foo = rxRecordInstanceDataPageResource.withName($scope.cfg.recordDefinitionName);\n foo.get(100, 0, queryParams).then(\n function (allRecords) {\n $scope.myData = allRecords.data;\n }\n );\n }", "function refresh() {\n _model.dataAvailable = false;\n if (_model.requesting) {\n _model.requestPending = true;\n return;\n }\n _model.requesting = true;\n _eventHandler.emit('change');\n var query = {};\n query[\"data.archived.value\"] = { $ne: true };\n var filterKeys = Object.keys(_model.filters || {});\n for (var i = 0; i < filterKeys.length; i++) {\n var key = filterKeys[i];\n var value = _model.filters[key];\n\n switch (key) {\n case \"assigned\":\n switch (value) {\n case \"all\":\n break;\n case \"assigned\":\n query[\"data.assigned.value\"] = 1;\n break;\n case \"archived\":\n query[\"data.archived.value\"] = true;\n break;\n case \"unassigned\":\n default:\n query[\"data.assigned.value\"] = { $ne: 1 };\n }\n break;\n }\n }\n for (var key in _model.search || {}) {\n var value = _model.search[key] || \"\";\n value = value.trim();\n if (!value) {\n continue;\n }\n switch (key) {\n case \"poNumber\":\n query[\"data.po-number.value\"] = { $regex: value, $options: \"i\" };\n break;\n }\n }\n director.listObjects({\n type: \"po-record\",\n query: query,\n fields: {\n _id: 1,\n \"data\": 1\n },\n sort: {\n _id: -1\n },\n limit: _model.paging.rowsPerPage,\n skip: _model.paging.currentPage * _model.paging.rowsPerPage\n }, function (err, docs) {\n if (err) {\n return _eventHandler.emit('error', err);\n }\n _model.requesting = false;\n _model.dataAvailable = true;\n let inflatedDocs = [];\n for (var i = 0; i < docs.length; i++) {\n var doc = docs[i];\n if (!doc || !doc.data) {\n continue;\n }\n var inflatedDoc = DistModel.inflateObject(doc.data) || {};\n inflatedDoc._id = doc._id;\n inflatedDocs.push(inflatedDoc);\n }\n _model.data = inflatedDocs;\n _model.updateId = uuid();\n _eventHandler.emit('change');\n if (_model.requestPending) {\n _model.requestPending = false;\n refresh();\n }\n });\n}", "function currentData() {\n const begin = (currentPage - 1) * itemsPerPage;\n const end = begin + itemsPerPage;\n return data.slice(begin, end);\n }", "async doRefreshDataPage (isFullPage = false) {\n if (!this.checkRunEntity()) return // exit on error\n\n this.loadDone = false\n this.loadWait = true\n\n // save filters: other dimensions selected items\n this.filterState = Puih.makeFilterState(this.otherFields)\n\n // make microdata read layout and url\n const layout = Puih.makeSelectLayout(this.entityName, this.otherFields, [KEY_DIM_NAME, ATTR_DIM_NAME])\n layout.Offset = 0\n layout.Size = 0\n layout.IsFullPage = false\n if (this.isPages) {\n layout.Offset = this.pageStart || 0\n layout.Size = (!!this.pageSize && typeof this.pageSize === typeof 1) ? (this.pageSize || 0) : 0\n layout.IsFullPage = !!isFullPage\n }\n\n const u = this.omsUrl +\n '/api/model/' + encodeURIComponent(this.digest) +\n '/run/' + encodeURIComponent(this.runDigest) + '/microdata/value-id'\n\n // retrieve page from server, it must be: {Layout: {...}, Page: [...]}\n let isOk = false\n try {\n const response = await this.$axios.post(u, layout)\n const rsp = response.data\n\n let d = []\n if (!rsp) {\n this.pageStart = 0\n this.isLastPage = true\n } else {\n if ((rsp?.Page?.length || 0) > 0) {\n d = rsp.Page\n }\n this.pageStart = rsp?.Layout?.Offset || 0\n this.isLastPage = rsp?.Layout?.IsLastPage || false\n }\n\n // update pivot table view and set entity key dimension enums\n this.inpData = Object.freeze(d)\n\n const eLst = Array(this.inpData.length)\n for (let j = 0; j < this.inpData.length; j++) {\n eLst[j] = {\n value: this.inpData[j]?.Key || 0,\n name: this.inpData[j]?.Key.toString() || 'Invalid',\n label: this.inpData[j]?.Key.toString() || this.$t('Invalid key')\n }\n }\n this.dimProp[0].enums = Object.freeze(eLst)\n this.dimProp[0].selection = Array.from(eLst)\n this.dimProp[0].singleSelection = (this.dimProp[0].selection.length > 0) ? this.dimProp[0].selection[0] : {}\n\n this.loadDone = true\n this.ctrl.isPvDimsTickle = !this.ctrl.isPvDimsTickle\n this.ctrl.isPvTickle = !this.ctrl.isPvTickle\n isOk = true\n } catch (e) {\n let em = ''\n try {\n if (e.response) em = e.response.data || ''\n } finally {}\n console.warn('Server offline or microdata not found', em)\n this.$q.notify({ type: 'negative', message: this.$t('Server offline or microdata not found') + ': ' + this.entityName })\n }\n\n this.loadWait = false\n if (isOk) {\n this.dispatchMicrodataView({\n key: this.routeKey,\n pageStart: this.isPages ? this.pageStart : 0,\n pageSize: this.isPages ? this.pageSize : 0\n })\n }\n }", "fetchMore() {\n self.isFetchingMore = true\n const query = self.store.fetchLaunches(self.cursor)\n query.then(lc => self.doneFetchingMore(lc))\n return query\n }", "function fetchData() {\n console.log('IMonData: [Old API] Fetching...');\n var store = new Store();\n\n var baseUrl = 'https://thenetmonitor.org/v1/';\n\n var futures = [];\n\n ['datum_sources', 'countries', 'regions'].forEach(function(type) {\n var fut = HTTP.get.future()(baseUrl + type, { timeout: Settings.timeout });\n futures.push(fut);\n var results = fut.wait();\n store.sync(results.data);\n });\n\n Future.wait(futures);\n\n console.log('IMonData: [Old API] Inserting...');\n\n _.each(store.findAll('regions'), insertRegion);\n _.each(store.findAll('countries'), insertCountry);\n _.each(store.findAll('datum_sources'), insertIndicator);\n\n console.log('IMonData: [Old API] Inserted.');\n\n}", "function loadList() {\n var begin = ((currentPage - 1) * numberPerPage);\n var end = begin + numberPerPage;\n\n pageList = filteredData.slice(begin, end);\n console.log(pageList);\n renderTable(pageList);\n numberOfPages = getNumberOfPages(filteredData)\n check();\n}", "function loadData() {\n return dataService.getList()\n .then(function (res) {\n vm.fullList = athleteService.transformList(res);\n })\n .catch(exception.catcher('Failed to retrieve data'));\n }", "paginate(){\n const { page, limit } = this.queryString; // extract page and limit from queryString\n // ex: /api/v1/tours?page=2&limit=10 ==> displaying page nb 2 with 10 documents max per page\n // in this case => 1-10: page 1, 11-20: page 2, 21-30: page 3 .....\n const pageNb = page * 1 || 1; // convert to number || page 1 by default -- we by default limit, if one day we have 1000 documents...\n const limitSet = limit * 1 || 100; // 100 documents limit by page by default\n const skipValue = (pageNb - 1) * limitSet;\n // query = query.skip(10).limit(10); // skip amount of results that will be skiped\n this.query = this.query.skip(skipValue).limit(limitSet);\n\n return this; // for chaining ! return the object\n }", "function queryCollection(sUrl, aoData, callback, oSettings)\n {\n var linqArray = $linq(cacheData);\n\n $.each(oSettings.aoColumns,\n function (i, value)\n {\n var searchParams = oSettings.aoPreSearchCols[i];\n\n var fieldName = value.mData;\n\n // If we have eveything we need, build a filter string\n // that we can use to filter the data with\n // For now, we only support string searching\n if (searchParams && searchParams.sSearch != \"\" && fieldName)\n {\n if (value.sType === 'date')\n {\n var dateTime = moment(searchParams.sSearch, \"M/D/YYYY\");\n\n var dateString = moment().format(\"M/D/YYYY\");\n\n var matchString = new RegExp(dateString);\n\n linqArray =\n linqArray.where(\n \"x => x.\" + fieldName + \"&& x.\" + fieldName + \".match(\" + matchString + \")\");\n }\n else if (value.sType === 'int')\n {\n var matchString = new RegExp(searchParams.sSearch);\n\n linqArray =\n linqArray.where(\n \"x => x.\" + fieldName + \"&& x.\" + fieldName + \".toString().match(\" + matchString + \")\");\n }\n else\n {\n var matchString = new RegExp(searchParams.sSearch.toLowerCase());\n\n linqArray =\n linqArray.where(\n \"x => x.\" + fieldName + \" && x.\" +\n fieldName + \".toLowerCase().match(\" + matchString + \")\");\n }\n }\n });\n\n // If there are any sort parameters defined\n // then build out the orderby clause of the OData query\n if (oSettings.aaSorting.length > 0)\n {\n var sortParams = oSettings.aaSorting[0];\n\n var column = oSettings.aoColumns[sortParams[0]];\n\n var sort = \"x => x.\" + column.mData;\n\n if (sortParams[1] === 'desc')\n {\n linqArray = sortDescending(linqArray, column, sort);\n }\n else\n {\n linqArray = sortAscending(linqArray, column, sort);\n }\n }\n\n linqArray = linqArray\n .skip(oSettings._iDisplayStart)\n .take(oSettings._iDisplayLength);\n\n var finalResults = linqArray.toArray();\n\n updateSubscriptions(finalResults);\n\n var dataResults = {};\n\n dataResults.aaData = finalResults;\n\n dataResults.iTotalDisplayRecords = cacheData.length;\n dataResults.iTotalRecords = cacheData.length;\n\n callback(dataResults);\n }", "dataManager(sortOrder, pagination) {\n if (sortOrder[0].sortField != undefined) {\n this.orderBy = sortOrder[0].sortField;\n } else {\n this.orderBy = sortOrder[0].field;\n }\n this.orderDirection = sortOrder[0].direction;\n this.fetch();\n }", "grabAnimesUserrecs(data, mode = 'All') {\n let key = 'AnimesUserrecs_'+mode;\n let cond = '1=1';\n if (mode == 'New')\n cond = \"recs_check_ts is null\";\n return this.grabByIds({\n key: key,\n isByListOfIds: true,\n getTotalIdsCnt: () => data.totalIdsCnt,\n getListOfIds: () => data.listOfIds,\n /*getNextIds: (nextId, limit) => {\n return this.db.manyOrNone(\"\\\n select id \\\n from malrec_items \\\n where id >= $(nextId) \\\n and \" + cond + \"\\\n order by id asc \\\n limit $(limit) \\\n \", {\n nextId: nextId,\n limit: limit,\n }).then((rows) => {\n return {ids: !rows ? [] : rows.map((row) => parseInt(row.id)) };\n });\n },*/\n getDataForIds: (ids) => null,\n fetch: (id) => this.provider.getAnimeUserrecs({animeId: id}),\n process: (id, obj) => this.processer.processAnimeUserrecs(id, obj),\n });\n }", "function data() {\n\n var cache = {}, // meta and data for each resort\n db = database(cache),\n my = {};\n\n function fetchStatus(plugin, fetch, meta, data) {\n debug('Fetch: %s for %s', plugin, meta.id);\n meta.fetchInProgress[plugin] = true;\n fetch(meta, function(err, response) {\n meta.fetchInProgress[plugin] = false;\n meta.counter = 0;\n if (err) {\n // don't update data on error\n console.error('Errors when fetching %s status for:', plugin, data.id, err);\n return;\n }\n data.timestamp[plugin] = Date.now();\n data[plugin] = response;\n db.write(meta.id);\n });\n }\n\n function fetchStatusAll() {\n var now = Date.now();\n Object.keys(cache).forEach(function(id) {\n var resort = cache[id],\n data = resort.data,\n meta = resort.meta;\n plugins.forEach(function(plugin, fetch) {\n var sinceLastFetch = now - data.timestamp[plugin],\n fetchNow = false;\n if (meta.no && meta.no[plugin]) {\n // skip fetching if plugin declared as disabled\n return;\n }\n if (meta.fetchInProgress[plugin]) {\n debug(\"Fetch in progress: %s for %s\", plugin, id);\n return;\n }\n // fetch only if it's been really long time, or if it was sufficienly long time and\n // someone is interested in the latest status\n if (sinceLastFetch > fetch.interval.inactive) {\n debug('Inactive timeout elapsed: %s - %s', plugin, id);\n fetchNow = true;\n } else if (resort.meta.counter > 0 && sinceLastFetch > fetch.interval.active) {\n debug('Active timeout elapsed: %s - %s', plugin, id);\n fetchNow = true;\n }\n if (fetchNow) {\n fetchStatus(plugin, fetch, meta, data);\n }\n });\n });\n }\n\n function initCache(resorts) {\n Object.keys(resorts).forEach(function(id) {\n var info, resort;\n resort = resorts[id];\n info = {\n meta: resort,\n data: {\n id: id,\n name: resort.name,\n href: resort.url.host + resort.url.pathname,\n ll: resort.ll\n }\n };\n\n info.meta.counter = 0;\n info.meta.id = id;\n info.meta.fetchInProgress = {};\n info.data.timestamp = {};\n plugins.forEach(function(plugin) {\n info.meta.fetchInProgress[plugin] = false;\n info.data.timestamp[plugin] = 0;\n });\n cache[id] = info;\n });\n }\n\n function prefetch(fn) {\n db.onload(function(count) {\n debug('Found %d resorts in cache', count);\n Object.keys(cache).forEach(db.read);\n fetchStatusAll();\n setInterval(fetchStatusAll, 10 * 1000); // wake 6 times per minute\n fn();\n });\n }\n\n function getData(requestedNames, fn) {\n var names, result;\n names = checkNames(requestedNames, cache, my.names);\n result = names.map(function(id) {\n var resort = cache[id];\n if (requestedNames) {\n // only increment counter if resort specifically requested\n resort.meta.counter += 1;\n }\n return resort.data;\n });\n process.nextTick(function() {\n fn(null, result);\n });\n }\n\n function getMeta(fn) {\n var result = my.names.map(function(id) {\n var meta = cache[id].meta;\n return {\n id: meta.id,\n name: meta.name,\n ll: meta.ll\n };\n });\n process.nextTick(function() {\n fn(null, result);\n });\n }\n\n function getTags() {\n return my.tags;\n }\n\n function getAll(nofilter) {\n return nofilter ? my.all : my.names;\n }\n\n function getFiltered(fn) {\n return my.names.filter(function(id) {\n return fn(cache[id].data);\n });\n }\n\n function getStats(requestedNames) {\n var names = checkNames(requestedNames, cache, my.names);\n return stats.summary(names.map(function(id) {\n var lifts = cache[id].data.lifts;\n return lifts && lifts.stats;\n }));\n }\n\n function init(fn) {\n // all loaders\n loaders.load(function(err, data) {\n initCache(data);\n my.tags = tags(data);\n my.all = Object.keys(cache);\n my.names = my.all.filter(function(id) {\n return !(data[id].no && data[id].no.lifts);\n });\n prefetch(fn);\n });\n\n }\n\n return {\n init: init,\n all: getAll,\n tags: getTags,\n get: getData,\n meta: getMeta,\n filtered: getFiltered,\n stats: getStats\n };\n}", "fetchData() {\n this.setLoadingSuccessful();\n }", "serverPrefetch () {\n return this.fetchEntries() // works\n }", "updatePreFetch(data) {\n this.preFetch = data\n }", "makeQueryData () {\n\t\t// remove the parameter in question from the query data\n\t\tconst queryData = super.makeQueryData();\n\t\tdelete queryData[this.parameter];\n\t\treturn queryData;\n\t}", "request( method, endpoint, query = true, data = {}, loading = this.loading ) { \n\n // Validate the endpoint.\n if( this.utils().validate(method, endpoint) ) {\n\n // Save the endpoint and method.\n this.method = method;\n this.endpoint = endpoint;\n\n // Start loading.\n if( loading ) event.trigger('loading', true);\n \n // Generate a unique ID for the request.\n const pid = this.utils().pid();\n\n // Send the request.\n const request = $.ajax({\n dataType: 'json',\n url: this.utils().url(pid, query),\n method: method,\n data: data,\n context: this,\n cache: false\n }).always((response) => {\n \n // Capture response data.\n if( response.hasOwnProperty('paging') ) {\n \n const paging = {increments: this.paging.increments};\n \n this.$set(this, 'paging', $.extend(true, {}, paging, response.paging));\n \n }\n if( response.hasOwnProperty('filter') ) {\n \n this.$set(this, 'filter', $.extend(true, {}, response.filter));\n \n }\n if( response.hasOwnProperty('sort') ) {\n \n this.$set(this, 'sort', $.extend(true, {}, response.sort));\n \n }\n if( response.hasOwnProperty('index') ) {\n \n this.$set(this, 'indexing', $.extend(true, {}, response.index.data));\n this.index.order = response.index.order;\n \n }\n \n // Add the query string to the response data.\n response.query = query ? this.utils().query() : {};\n \n // End the loading animation.\n if( loading ) setTimeout(() => {\n \n event.trigger('loading', false);\n \n }, 250);\n\n });\n\n // Poll for request progress.\n this.progress(pid);\n \n // Return the request.\n return request;\n\n }\n\n }", "getMeteorData() {\n return {\n rolls: Rolls.find({}, {sort: {createdAt: -1}}).fetch()\n }\n }", "function refreshQueryData() {\n var user = keepUser.getUser();\n $http.get('/getQueryByUser/' + user).then(function (responce) {\n $scope.Data = responce.data;\n });\n }", "function loadData() {\n\tvar camlQuery = new SP.CamlQuery();\n\t\n\tvar query = '<View><Query><OrderBy><FieldRef Name=\"Created\" Ascending=\"False\"></FieldRef></OrderBy></Query>'+\n\t\t\t\t'<ViewFields><FieldRef Name=\"SprintProgress\"/></ViewFields><RowLimit>'+ sprintHistoryLimit +'</RowLimit></view>';\n\tcamlQuery.set_viewXml(query);\n\tcollListItem = listReference.getItems(camlQuery);\n\n\tclientContext.load(collListItem);\n\tclientContext.executeQueryAsync(\n\tFunction.createDelegate(this, this.pageInit),\n\tFunction.createDelegate(this, this.showDataError));\n}", "getPosts(config, clientId, id, slug, categorySlug, tagSlug, authorSlug, sortBy, sortAsc, limit, next, previous) {\n // get query object\n const queryObj = this.getQueryObject(clientId, slug, categorySlug, tagSlug, authorSlug, id);\n const match = { $match: queryObj };\n\n const aggregations = [\n addFields,\n {\n $addFields: { status: '$status.v', format: '$format.v', media: '$media.v' }\n },\n statusLookup,\n { $unwind: '$status' },\n formatLookup,\n { $unwind: '$format' },\n // Another type of lookup where we provide it it's own aggregate pipline to mutate and filter the returned results\n mediaLookup,\n // Media is nullable, let's not filter out records that don't have the media option\n { $unwind: { path: '$media', preserveNullAndEmptyArrays: true } },\n tagLookup,\n categoryLookup,\n degaUserLookup,\n postsProject,\n match,\n ];\n\n this.logger.info(`Query Object ${JSON.stringify(queryObj)}`);\n\n // get paging object\n const pagingObj = utils.getPagingObject(aggregations, sortBy, sortAsc, limit, next, previous, true);\n const database = config.get('databaseConfig:databases:core');\n const pagingNew = {};\n // return Q(MongoPaging.find(this.collection(config.get('databaseConfig:databases:core')), pagingObj))\n return Q(MongoPaging.aggregate(this.collection(database), pagingObj))\n .then((aggResult) => {\n const {results} = aggResult;\n this.logger.info('Retrieved the posts');\n const posts = {};\n pagingNew.next = aggResult.next;\n pagingNew.hasNext = aggResult.hasNext;\n pagingNew.previous = aggResult.previous;\n pagingNew.hasPrevious = aggResult.hasPrevious;\n posts.data = results;\n posts.paging = pagingNew;\n return posts;\n });\n }", "loadData() { \n //load data with get method (she use axios but you can use your own method if you want)\n this.get(this.state.offset, this.state.limit).then(data => {\n \n this.setState({ \n thread: this.state.thread.concat(data), //add the data to the thread\n offset: this.state.offset + this.state.limit, //update the offset point\n loadingData: false //warn that the loading is finished\n })\n \n if(data.length < this.state.limit){ //if we have loaded all the data\n //stop the scroll listener (it just for cleaning, but you can keep it if needed)\n window.removeEventListener('scroll', this.scrollFunction); \n //warn that all data was loaded\n this.setState({ allDataLoaded: true });\n }\n })\n }", "async function fetchData() {\n // set state to show spinner\n setIsLoading(true);\n\n // get filter query string\n const filterString = stringfyFilters(filters);\n\n // API call\n spotifyApi\n .get(\"browse/featured-playlists\" + filterString)\n .then((response) => {\n // save playlists to data\n setData(response.data.playlists);\n\n // set no error on fetching data\n setHasError(false);\n\n // finish loading\n setIsLoading(false);\n })\n .catch((error) => {\n // set error on fetching data\n setHasError(true);\n\n // finish loading\n setIsLoading(false);\n\n // user is not authorized: show alert and redirect\n if (error.response.status === 400) {\n // show alert\n alert.error(\n \"Authorization token not found, redirecting to homepage...\",\n {\n onClose: () => {\n // redirect to welcome page\n window.history.pushState({ urlPath: \"/\" }, \"\", \"/\");\n window.location.reload();\n },\n }\n );\n }\n\n // token is expired: show alert and redirect\n if (error.response.status === 401) {\n // show alert\n alert.error(\n \"Session expired. Redirecting to homepage.\",\n {\n onClose: () => {\n // redirect to welcome page\n window.history.pushState({ urlPath: \"/\" }, \"\", \"/\");\n window.location.reload();\n },\n }\n );\n }\n });\n }", "function fetchData() {\n\tshowLoader(); // invoke loader\n\tfetch('https://api.magicthegathering.io/v1/cards?random=true&pageSize=100&language=English')\n\t\t.then((response) => response.json())\n\t\t.then((data) => {\n\t\t\thideLoader(); // invoke hide loader func\n\t\t\tconsole.log(data);\n\t\t\tdataArr = data.cards.slice();\n\t\t\tconsole.log(dataArr); // test\n\t\t\tloadArr = dataArr.slice(0, n);\n\t\n\t\t\trenderCardList(loadArr);\n\t\t\tbtnLoadMore.style.display = 'block'; // show load more button\n\t\t});\n}", "function modifyFetchData (collection, url_data) {\n updateFilters()\n\n if (isFilteringActive) {\n url_data = _.extend(url_data, activeFilters)\n }\n }", "function initData(){\n container.prepend(progressInfo);\n jQuery.get(getPageURL(0, resource)).done(function(data) {\n records = processData(data, true);\n initView(new recline.Model.Dataset({records:records}));\n numReq = getRequestNumber(data.result.total, pageSize);\n for (var i = 1; i <= numReq; i++) {\n requestData(getPageURL(i, resource));\n };\n });\n }", "function loadData() {\n system.isLoading = true;\n\n $.ajax({\n url: system.apiURL,\n dataType: 'jsonp',\n success: onLoadData\n });\n\n }", "function Data(dataSource,query){this.initDataManager(dataSource,query);}" ]
[ "0.6080302", "0.5526544", "0.5449918", "0.54458183", "0.54458183", "0.5317702", "0.52776474", "0.51479936", "0.5062635", "0.50599736", "0.5033566", "0.5033566", "0.49833396", "0.4965042", "0.4958754", "0.4940883", "0.49134368", "0.4911669", "0.49067235", "0.49009195", "0.48841387", "0.48616207", "0.48587042", "0.48585546", "0.48554945", "0.4840632", "0.4833482", "0.4833482", "0.4812952", "0.47976378", "0.47933868", "0.47880942", "0.4786078", "0.477601", "0.47653025", "0.4754677", "0.4747869", "0.4738166", "0.4730306", "0.4723453", "0.47053963", "0.47048524", "0.46993983", "0.4691381", "0.4671154", "0.46687657", "0.46646357", "0.46627674", "0.46577936", "0.46527863", "0.46497816", "0.46488562", "0.46453893", "0.46414277", "0.46395487", "0.46377474", "0.46335506", "0.46295592", "0.4627413", "0.46190023", "0.4611464", "0.4611301", "0.46093613", "0.46069762", "0.46034804", "0.46008384", "0.45894262", "0.45790488", "0.4577368", "0.45700935", "0.4566551", "0.45646045", "0.45616725", "0.45594", "0.45534903", "0.45455006", "0.45429102", "0.4540744", "0.4539604", "0.45293885", "0.4528589", "0.4528523", "0.4525077", "0.4517302", "0.451309", "0.4511152", "0.4504009", "0.45038024", "0.44935608", "0.44881275", "0.44869137", "0.44866163", "0.44823006", "0.44817117", "0.44776177", "0.44759512", "0.44752216", "0.44680566", "0.44593343", "0.44592038" ]
0.59364706
1
Set or clear the hashkey for an object.
function setHashKey(obj, h) { if (h) { obj.$$hashKey = h; } else { delete obj.$$hashKey; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setHashKey(obj, h) {\n\t\tif (h) {\n\t\t\tobj.$$hashKey = h;\n\t\t} else {\n\t\t\tdelete obj.$$hashKey;\n\t\t}\n\t}", "function setHashKey(obj, h) {\n\t\tif (h) {\n\t\t\tobj.$$hashKey = h;\n\t\t} else {\n\t\t\tdelete obj.$$hashKey;\n\t\t}\n\t}", "function setHashKey(obj, h) {\n\t if (h) {\n\t obj.$$hashKey = h;\n\t } else {\n\t delete obj.$$hashKey;\n\t }\n\t}", "function setHashKey(obj, h) {\n\t if (h) {\n\t obj.$$hashKey = h;\n\t } else {\n\t delete obj.$$hashKey;\n\t }\n\t}", "function setHashKey(obj, h) {\n if (h) {\n obj.$$hashKey = h;\n } else {\n delete obj.$$hashKey;\n }\n }", "function setHashKey(obj, h) {\n if (h) {\n obj.$$hashKey = h;\n }\n else {\n delete obj.$$hashKey;\n }\n}", "function setHashKey(obj, h) {\n if (h) {\n obj.$$hashKey = h;\n }\n else {\n delete obj.$$hashKey;\n }\n}", "function setHashKey(obj, h) {\n if (h) {\n obj.$$hashKey = h;\n }\n else {\n delete obj.$$hashKey;\n }\n}", "function setHashKey(obj, h) {\n if (h) {\n obj.$$hashKey = h;\n }\n else {\n delete obj.$$hashKey;\n }\n}", "function setHashKey(obj, h) {\n if (h) {\n obj.$$hashKey = h;\n }\n else {\n delete obj.$$hashKey;\n }\n}", "function setHashKey(obj, h) {\n if (h) {\n obj.$$hashKey = h;\n }\n else {\n delete obj.$$hashKey;\n }\n}", "function setHashKey(obj, h) {\n if (h) {\n obj.$$hashKey = h;\n }\n else {\n delete obj.$$hashKey;\n }\n}", "function setHashKey(obj, h) {\n if (h) {\n obj.$$hashKey = h;\n }\n else {\n delete obj.$$hashKey;\n }\n}", "function setHashKey(obj,h){if(h){obj.$$hashKey=h;}else{delete obj.$$hashKey;}}", "function setHashKey(obj,h){if(h){obj.$$hashKey=h;}else{delete obj.$$hashKey;}}", "function setHashKey(obj, h) { // 407\n if (h) { // 408\n obj.$$hashKey = h; // 409\n } else { // 410\n delete obj.$$hashKey; // 411\n } // 412\n} // 413", "function setOrUnset(obj, key, value) {\n\t\t\t\tif (value === undefined)\n\t\t\t\t\tdelete obj[key];\n\t\t\t\telse\n\t\t\t\t\tobj[key] = value;\n\t\t\t}", "function setOrUnset(obj, key, value) {\n if (value === undefined)\n delete obj[key];\n else\n obj[key] = value;\n }", "function setOrUnset(obj, key, value) {\n if (value === undefined)\n delete obj[key];\n else\n obj[key] = value;\n }", "set(key, value){\n const loadRatio = (this.length + this._deleted + 1) / this._capacity;\n if (loadRatio > HashMap.MAX_LOAD_RATIO) {//keeps track of how full the hashmap is\n this._resize(this._capacity * HashMap.SIZE_RATIO);//reduce num of collisions\n }\n //Find the slot where this key should be in\n const index = this._findSlot(key);\n\n if(!this._hashTable[index]){\n this.length++;\n }\n this._hashTable[index] = {\n key,\n value,\n DELETED: false\n }; \n }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t }", "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t }", "function hashClear() {\n\t\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t\t }", "set (key, value) {\n let hashed = hash(key);\n this.buckets[hash % this.buckets.length].push({key : value});\n }", "function hashClear() {\n this.__data__ = _nativeCreate.default ? (0, _nativeCreate.default)(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = _nativeCreate.default ? (0, _nativeCreate.default)(null) : {};\n this.size = 0;\n}", "function hashClear() {\n\t\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t\t}", "function hashClear() {\n\t\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t\t}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = _nativeCreate ? _nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = _nativeCreate ? _nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = _nativeCreate ? _nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = _nativeCreate ? _nativeCreate(null) : {};\n this.size = 0;\n }", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}", "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}" ]
[ "0.80996466", "0.80996466", "0.8055644", "0.8055644", "0.8040005", "0.80145353", "0.80145353", "0.80145353", "0.80145353", "0.80145353", "0.80145353", "0.80145353", "0.80145353", "0.78651947", "0.78651947", "0.7531371", "0.60596126", "0.60143936", "0.60143936", "0.6010173", "0.5987567", "0.5987567", "0.5987567", "0.5987567", "0.5987567", "0.5987567", "0.5978829", "0.59720755", "0.5952307", "0.5952307", "0.5945466", "0.5945466", "0.59438777", "0.59438777", "0.59438777", "0.59438777", "0.5937875", "0.5937875", "0.5937875", "0.5937875", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515", "0.5936515" ]
0.8001386
37
Creates a shallow copy of an object, an array or a primitive. Assumes that there are no proto properties for objects.
function shallowCopy(src, dst) { if (isArray(src)) { dst = dst || []; for (var i = 0, ii = src.length; i < ii; i++) { dst[i] = src[i]; } } else if (isObject(src)) { dst = dst || {}; for (var key in src) { if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) { dst[key] = src[key]; } } } return dst || src; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shallowClone(obj) {\n return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));\n}", "function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n }", "function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n }", "function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n }", "function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n }", "function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n }", "function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n }", "function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n }", "function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n }", "function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n }", "function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n}", "function clone(obj) {\n var copy = Array.isArray(obj) ? [] : {};\n for (var i in obj) {\n if (Array.isArray(obj[i])) {\n copy[i] = obj[i].slice(0);\n } else if (obj[i] instanceof Buffer) {\n copy[i] = obj[i].slice(0);\n } else if (typeof obj[i] != 'function') {\n copy[i] = obj[i] instanceof Object ? clone(obj[i]) : obj[i];\n } else if (typeof obj[i] === 'function') {\n copy[i] = obj[i];\n }\n }\n return copy;\n}", "static clone(obj) {\r\n if (obj === null || obj === undefined || typeof (obj) !== 'object') {\r\n return obj;\r\n }\r\n // return Object.assign({}, obj);\r\n if (obj instanceof Array) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return [...obj];\r\n }\r\n return Object.assign({}, obj);\r\n }", "function deepCopy(obj) {\n const id = x => x;\n const dcTArray = a => a.map(id);\n const dcObject = x => Object.fromEntries(Object.entries(x).map(([k, d]) => [k, dcAny(d)]));\n const dcAny = x => (x instanceof Object ? (cf.get(x.constructor) || id)(x) : x);\n // don't map keys, probably this is what we would expect\n const dcMapCore = m => [...m.entries()].map(([k, v]) => [k, dcAny(v)]);\n\n const cf = new Map([\n [Int8Array, dcTArray],\n [Uint8Array, dcTArray],\n [Uint8ClampedArray, dcTArray],\n [Int16Array, dcTArray],\n [Uint16Array, dcTArray],\n [Int32Array, dcTArray],\n [Uint32Array, dcTArray],\n [Float32Array, dcTArray],\n [Float64Array, dcTArray],\n [BigInt64Array, dcTArray],\n [BigUint64Array, dcTArray],\n [Map, m => new Map(dcMapCore(m))],\n [WeakMap, m => new WeakMap(dcMapCore(m))],\n [Array, a => a.map(dcAny)],\n [Set, s => [...s.values()].map(dcAny)],\n [Date, d => new Date(d.getTime())],\n [Object, dcObject]\n // ... extend here to implement their custom deep copy\n ]);\n\n return dcAny(obj);\n}", "function shallowCopy(obj) {\n var orig = obj;\n var copy = Object.create(Object.getPrototypeOf(obj));\n for (var key in orig) {\n if (orig.hasOwnProperty(key)) {\n copy[key] = (orig)[key];\n }\n }\n return copy;\n }", "function deepClone(obj) {\n switch (typeof obj) {\n case 'object':\n return JSON.parse(JSON.stringify(obj)); //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case 'undefined':\n return null; //this is how JSON.stringify behaves for array items\n default:\n return obj; //no need to clone primitives\n }\n }", "function shallowCopy(src,dst){if(isArray(src)){dst=dst||[];for(var i=0,ii=src.length;i<ii;i++){dst[i]=src[i];}}else if(isObject(src)){dst=dst||{};for(var key in src){if(!(key.charAt(0)==='$'&&key.charAt(1)==='$')){dst[key]=src[key];}}}return dst||src;}", "function shallowCopy(src,dst){if(isArray(src)){dst=dst||[];for(var i=0,ii=src.length;i<ii;i++){dst[i]=src[i];}}else if(isObject(src)){dst=dst||{};for(var key in src){if(!(key.charAt(0)==='$'&&key.charAt(1)==='$')){dst[key]=src[key];}}}return dst||src;}", "function deepcopy(obj) {\n return Object.assign({}, obj);\n}", "function deepClone(obj) {\n switch (typeof obj) {\n case 'object':\n return JSON.parse(JSON.stringify(obj)); //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case 'undefined':\n return null; //this is how JSON.stringify behaves for array items\n default:\n return obj; //no need to clone primitives\n }\n }", "function shallow_copy(src) {\n if ((typeof src === 'undefined' ? 'undefined' : _typeof(src)) === 'object') {\n var dst = {};\n for (var k in src) {\n if (Object.prototype.hasOwnProperty.call(src, k)) {\n dst[k] = src[k];\n }\n }\n return dst;\n }\n return src;\n }", "function shallow_copy(src) {\n if ((typeof src === 'undefined' ? 'undefined' : _typeof(src)) === 'object') {\n var dst = {};\n for (var k in src) {\n if (Object.prototype.hasOwnProperty.call(src, k)) {\n dst[k] = src[k];\n }\n }\n return dst;\n }\n return src;\n }", "function copy(obj) {\n return JSON.parse(JSON.stringify(obj)); // deep copy but not methods, and not some other data structures\n}", "function deepCopy(obj){\n return JSON.parse(JSON.stringify(obj));\n}", "function deepCopy(obj) {\n var orig = obj;\n var copy = Array.isArray(obj)\n ? [] : Object.create(Object.getPrototypeOf(obj));\n for (var key in orig) {\n if (orig.hasOwnProperty(key)) {\n if (typeof orig[key] === 'object') {\n copy[key] = deepCopy(orig[key]);\n }\n else {\n copy[key] = orig[key];\n }\n }\n }\n return copy;\n }", "function objClone(a)\r\n{\r\n var ret = (a instanceof Array ? [] : {});\r\n\r\n for(x in a)\r\n if(typeof(a[x]) == \"object\")\r\n ret[x] = objClone(a[x]);\r\n else\r\n ret[x] = a[x];\r\n\r\n return ret;\r\n}", "function deepCopy(object) {\n // Opaque objects are not mutable, so safe to copy by assignment\n if (object === undefined || object === null || opaque[typeof (object)]) {\n return object;\n }\n // Arrays are mutable, so we need to create a copy\n if (Array.isArray(object)) {\n return Object.freeze(object.map(function (item) { return deepCopy(item); }));\n }\n if (typeof (object) === \"object\") {\n // Immutable objects are safe to just use\n if (Object.isFrozen(object)) {\n return object;\n }\n var result = {};\n for (var key in object) {\n var value = object[key];\n if (value === undefined) {\n continue;\n }\n defineReadOnly(result, key, deepCopy(value));\n }\n return result;\n }\n // The function type is also immutable, so safe to copy by assignment\n if (typeof (object) === \"function\") {\n return object;\n }\n throw new Error(\"Cannot deepCopy \" + typeof (object));\n}", "function clone(a) {if (!a) return a;var c, b = [Number, String, Boolean];if (b.forEach(function(b) { a instanceof b && (c = b(a)); }), \"undefined\" == typeof c) if (\"[object Array]\" === Object.prototype.toString.call(a)) c = [], a.forEach(function(a, b, d) { c[b] = clone(a); }); else if (\"object\" == typeof a) if (a.nodeType && \"function\" == typeof a.cloneNode) c = a.cloneNode(!0); else if (a.prototype) c = a; else if (a instanceof Date) c = new Date(a); else { c = {}; for (var d in a) c[d] = clone(a[d]); } else c = a; return c;}", "function flatClone(obj) {\n return Object.assign({}, obj);\n}", "function deepCopy( obj )\n{\n return JSON.parse( JSON.stringify( obj ) );\n}", "function deepCopy(value) {\r\n // Do nothing for primitive values.\r\n if (isPrimitive(value)) {\r\n return value;\r\n }\r\n // Deep copy an array.\r\n if (isArray(value)) {\r\n return deepArrayCopy(value);\r\n }\r\n // Deep copy an object.\r\n return deepObjectCopy(value);\r\n }", "function deepCopy(value) {\r\n // Do nothing for primitive values.\r\n if (isPrimitive(value)) {\r\n return value;\r\n }\r\n // Deep copy an array.\r\n if (isArray(value)) {\r\n return deepArrayCopy(value);\r\n }\r\n // Deep copy an object.\r\n return deepObjectCopy(value);\r\n }", "function deepCopy(value) {\n // Do nothing for primitive values.\n if (isPrimitive(value)) {\n return value;\n }\n // Deep copy an array.\n if (isArray(value)) {\n return deepArrayCopy(value);\n }\n // Deep copy an object.\n return deepObjectCopy(value);\n }", "function deepCopy(obj) {\n // copy object obj\n const keys = Object.keys(obj)\n \n const newObject = {}\n \n for (let i =0; i < keys.length; i++) {\n const key = keys[i]\n if(typeof obj[keys[i]] == 'object') {\n }\n }\n \n return Object.assign({}, obj)\n //arr.__proto__.__proto__\n}", "function deepCopy(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "function clone(obj) {\n if (Array.isArray(obj)) {\n return obj.map(function(x) {\n return clone(x);\n });\n }\n\n if (obj === null || obj === undefined) {\n return obj;\n }\n\n switch (typeof(obj)) {\n case 'number':\n case 'string':\n case 'boolean':\n return obj;\n default:\n var result = {};\n for (var k in obj) {\n result[k] = clone(obj[k]);\n }\n return result;\n }\n}", "function deepCopy(obj) {\n var out, i, len;\n // If it is an array, create a new array and copy elements one by one\n if (Object.prototype.toString.call(obj) === '[object Array]') {\n out = [];\n len = obj.length;\n for (i = 0; i < len; i++) {\n // If it is a multi dimensional array then obj[i] will be an array\n // So call the function again with obj[i];\n out[i] = deepCopy(obj[i]);\n }\n return out;\n } else if (typeof obj === 'object') {\n out = {};\n for (i in obj) {\n // If out[i] is an array or object, call the function again\n out[i] = deepCopy(obj[i]);\n }\n return out;\n }\n // If it is not an array or object, then it is a primitive type.\n // So just return that value\n return obj;\n}", "function clone(obj) {\n\t// Handle the 3 simple types, and null or undefined\n\tif (null == obj || \"object\" != typeof obj) return obj;\n\t// Handle Date\n\tif (obj instanceof Date) {\n\t\tvar copy = new Date();\n\t\tcopy.setTime(obj.getTime());\n\t\treturn copy;\n\t}\n\t// Handle Array\n\tif (obj instanceof Array) {\n\t\tvar copy = [];\n\t\tfor (var i = 0, len = obj.length; i < len; ++i) {\n\t\t\tcopy[i] = clone(obj[i]);\n\t\t}\n\t\treturn copy;\n\t}\n\t// Handle Object\n\tif (obj instanceof Object) {\n\t\tvar copy = {};\n\t\tfor (var attr in obj) {\n\t\t\tif (obj.hasOwnProperty(attr)) copy[attr] = clone(obj[attr]);\n\t\t}\n\t\treturn copy;\n\t}\n\tthrow new Error(\"Unable to copy obj! Its type isn't supported.\");\n}", "function clone(obj) {\n // Handle the 3 simple types, and null or undefined\n if (null == obj || \"object\" != typeof obj) return obj;\n\n // Handle Date\n if (obj instanceof Date) {\n var copy = new Date();\n copy.setTime(obj.getTime());\n return copy;\n }\n\n // Handle Array\n if (obj instanceof Array) {\n var copy = [];\n for (var i = 0, len = obj.length; i < len; i++) {\n copy[i] = clone(obj[i]);\n }\n return copy;\n }\n\n // Handle Object\n if (obj instanceof Object) {\n var copy = {};\n for (var attr in obj) {\n if (obj.hasOwnProperty(attr)) copy[attr] = clone(obj[attr]);\n }\n return copy;\n }\n\n throw new Error(\"Unable to copy obj! Its type isn't supported.\");\n}", "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "function deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}", "function clone(object) {\r\n var empty = function(){ };\r\n empty.prototype = object;\r\n return new empty();\r\n }", "function clone(object) {\r\n var empty = function(){ };\r\n empty.prototype = object;\r\n return new empty();\r\n }", "function copy(obj) {\n var F = function () {};\n F.prototype = obj.prototype || obj;\n return new F();\n }", "function copy(obj) {\n if (typeof obj !== 'object' || obj === null) return obj;\n var cpy = Array.isArray(obj) ? [] : {};\n for (var key in obj) cpy[key] = copy(obj[key]);\n return cpy;\n}", "function $copy(obj) {\r\n\t\tswitch($type(obj)) {\r\n\t\t\tcase \"object\":\r\n\t\t\t\tvar copyObj = new Object();\r\n\t\t\t\tfor (var prop in obj) copyObj[prop] = $copy(obj[prop]);\r\n\t\t\tbreak;\r\n\t\t\tcase \"array\":\r\n\t\t\t\tvar copyObj = new Array();\r\n\t\t\t\tfor (var i=0,l=obj.length; i<l; i++) copyObj[i] = $copy(obj[i]);\r\n\t\t\tbreak;\r\n\t\t\tdefault: var copyObj = obj;\r\n\t\t}\r\n\t\treturn copyObj;\r\n\t}", "function shallowCopy(src, dst) { // 986\n if (isArray(src)) { // 987\n dst = dst || []; // 988\n // 989\n for (var i = 0, ii = src.length; i < ii; i++) { // 990\n dst[i] = src[i]; // 991\n } // 992\n } else if (isObject(src)) { // 993\n dst = dst || {}; // 994\n // 995\n for (var key in src) { // 996\n if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) { // 997\n dst[key] = src[key]; // 998\n } // 999\n } // 1000\n } // 1001\n // 1002\n return dst || src; // 1003\n} // 1004", "function clone(object) { return JSON.parse(JSON.stringify(object))}", "function clone(obj) {\n var copy;\n\n // Handle the 3 simple types, and null or undefined\n if (null == obj || \"object\" != typeof obj) return obj;\n\n // Handle Date\n if (obj instanceof Date) {\n copy = new Date();\n copy.setTime(obj.getTime());\n return copy;\n }\n\n // Handle Array\n if (obj instanceof Array) {\n copy = [];\n for (var i = 0, len = obj.length; i < len; i++) {\n copy[i] = clone(obj[i]);\n }\n return copy;\n }\n\n // Handle Object\n if (obj instanceof Object) {\n copy = {};\n for (var attr in obj) {\n if (obj.hasOwnProperty(attr)) copy[attr] = clone(obj[attr]);\n }\n return copy;\n }\n\n throw new Error(\"Unable to copy obj! Its type isn't supported.\");\n}", "function clone(obj) {\n var copy;\n\n // Handle the 3 simple types, and null or undefined\n if (null == obj || \"object\" != typeof obj) return obj;\n\n // Handle Date\n if (obj instanceof Date) {\n copy = new Date();\n copy.setTime(obj.getTime());\n return copy;\n }\n\n // Handle Array\n if (obj instanceof Array) {\n copy = [];\n for (var i = 0, len = obj.length; i < len; i++) {\n copy[i] = clone(obj[i]);\n }\n return copy;\n }\n\n // Handle Object\n if (obj instanceof Object) {\n copy = {};\n for (var attr in obj) {\n if (obj.hasOwnProperty(attr)) copy[attr] = clone(obj[attr]);\n }\n return copy;\n }\n\n throw new Error(\"Unable to copy obj! Its type isn't supported.\");\n}", "function clone(a) {\n if (isArray$5(a)) {\n return map$2(a).call(a, function (value) {\n return clone(value);\n });\n } else if (_typeof_1(a) === \"object\" && a !== null) {\n return deepObjectAssignNonentry({}, a);\n } else {\n return a;\n }\n}", "function clone(a) {\n if (isArray$5(a)) {\n return map$2(a).call(a, function (value) {\n return clone(value);\n });\n } else if (_typeof_1(a) === \"object\" && a !== null) {\n return deepObjectAssignNonentry({}, a);\n } else {\n return a;\n }\n}", "function clone(obj) {\n var copy;\n // Handle the 3 simple types, and null or undefined\n if (null == obj || \"object\" != typeof obj) {\n return obj;\n }\n // Handle Date\n if (obj instanceof Date) {\n copy = new Date();\n copy.setTime(obj.getTime());\n return copy;\n }\n\n // Handle Array\n if (obj instanceof Array) {\n copy = [];\n for (var i = 0, len = obj.length; i < len; i++) {\n copy[i] = clone(obj[i]);\n }\n return copy;\n }\n\n // Handle Function\n if (obj instanceof Function) {\n copy = function() {\n return obj.apply(this, arguments);\n }\n return copy;\n }\n\n // Handle Object\n if (obj instanceof Object) {\n copy = {};\n for (var attr in obj) {\n if (obj.hasOwnProperty(attr)) copy[attr] = clone(obj[attr]);\n }\n return copy;\n }\n throw new Error(\"Unable to copy obj as type isn't supported \" + obj.constructor.name);\n}", "copy(obj){\n return JSON.parse(JSON.stringify(obj));\n }", "function clone(a) {\n if (isArray$3(a)) {\n return map$2(a).call(a, function (value) {\n return clone(value);\n });\n } else if (_typeof_1(a) === \"object\" && a !== null) {\n return deepObjectAssignNonentry({}, a);\n } else {\n return a;\n }\n}", "function deepCopy(obj) {\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker]) throw new Error('attempted deep copy of cyclic object');\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker) continue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete obj[marker];\n\t\treturn ret;\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++) {\n\t\t\tret.push(deepCopy(obj[key]));\n\t\t}delete obj[marker];\n\t\treturn ret;\n\t}\n\n\t/*\n * It must be a primitive type -- just return it.\n */\n\treturn obj;\n}", "function copy(o) {\n return utils.apply(o, {});\n}", "function deepCopy(obj) {\n if (typeof obj == \"object\") {\n } else if (typeof obj == \"array\") {\n return Object.keys(obj)\n .map((key) => ({ [key]: deepCopy(obj[key]) }))\n .reduce((acc, cur) => Object.assign(acc, cur), {});\n }\n return obj;\n}", "function copy(obj) {\n if (typeof obj !== 'object' || obj === null) return obj;\n var cpy = obj instanceof Array ? [] : {};\n for (var key in obj) cpy[key] = copy(obj[key]);\n return cpy;\n }", "function shallowClone (obj) {\n\t var target = {};\n\t for (var i in obj) {\n\t if (obj.hasOwnProperty(i)) {\n\t target[i] = obj[i];\n\t }\n\t }\n\t return target;\n\t}", "function clone (obj) {\r\n var cloned;\r\n\r\n if (isType(obj, 'Array')) {\r\n cloned = [];\r\n\r\n obj.forEach(function (value, index) {\r\n cloned[index] = clone(value);\r\n });\r\n } else if (isType(obj, 'Object')) {\r\n cloned = {};\r\n\r\n Object.keys(obj).forEach(function (key) {\r\n cloned[key] = clone(obj[key]);\r\n });\r\n } else {\r\n cloned = obj;\r\n }\r\n\r\n return cloned;\r\n}", "function clone(obj) {\n //return obj;\n // Handle the 3 simple types, and null or undefined\n if (null === obj || \"object\" != typeof obj) return obj;\n \n var copy;\n // Handle Date\n if (obj instanceof Date) {\n copy = new Date();\n copy.setTime(obj.getTime());\n return copy;\n }\n\n // Handle Array\n if (obj instanceof Array) {\n copy = [];\n for (var i = 0, len = obj.length; i < len; i++) {\n copy[i] = clone(obj[i]);\n }\n return copy;\n }\n\n // Handle Object\n if (obj instanceof Object) {\n copy = {};\n for (var attr in obj) {\n if (obj.hasOwnProperty(attr)) copy[attr] = clone(obj[attr]);\n }\n return copy;\n }\n\n throw new Error(\"Unable to copy obj! Its type isn't supported.\");\n}", "function copy(obj) {\n\t var sources = [];\n\t for (var _i = 1; _i < arguments.length; _i++) {\n\t sources[_i - 1] = arguments[_i];\n\t }\n\t return assign.apply(void 0, [{}, obj].concat(sources));\n\t}", "function clone(obj) {\n var copy;\n // Handle the 3 simple types, and null or undefined\n if (null == obj || \"object\" != typeof obj) return obj;\n // Handle moment\n if (moment.isMoment(obj)) {\n copy = moment(obj);\n return copy;\n }\n // Handle Date\n if (obj instanceof Date) {\n copy = new Date();\n copy.setTime(obj.getTime());\n return copy;\n }\n // Handle Array\n if (Array.isArray(obj)) {\n copy = [];\n for (var i = 0, len = obj.length; i < len; i++) {\n copy[i] = clone(obj[i]);\n }\n return copy;\n }\n // Handle Object\n if (obj instanceof Object) {\n copy = {};\n for (var attr in obj) {\n if (obj.hasOwnProperty(attr)) copy[attr] = clone(obj[attr]);\n }\n return copy;\n }\n throw new Error(\"Unable to copy obj! Its type isn't supported.\");\n }", "function shallowCopy(src, dst) {\n\t if (isArray(src)) {\n\t dst = dst || [];\n\n\t for (var i = 0, ii = src.length; i < ii; i++) {\n\t dst[i] = src[i];\n\t }\n\t } else if (isObject(src)) {\n\t dst = dst || {};\n\n\t for (var key in src) {\n\t if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n\t dst[key] = src[key];\n\t }\n\t }\n\t }\n\n\t return dst || src;\n\t }", "clone(obj) {\n return Object.assign({}, obj);\n }", "function _copy(obj) {\n var _type, _typeIn, _isNative, res;\n _type = _typeOf(obj);\n _isNative = /\\[native\\s{1}code\\]/g;\n\n switch (_type) {\n\n case \"Array\":\n res = [];\n for (var i = 0, len = obj.length; i < len; i++) {\n _typeIn = _typeOf(obj[i]);\n if (_typeIn === \"Array\" || _typeIn === \"Object\" || _typeIn === \"Function\") {\n _copy(obj[i]);\n } else {\n res.push(obj[i]);\n }\n }\n break;\n\n case \"Object\":\n res = {};\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n _typeIn = _typeOf(obj[i]);\n if (_typeIn === \"Array\" || _typeIn === \"Object\" || _typeIn === \"Function\") {\n _copy(obj[i]);\n } else {\n res[i] = obj[i];\n }\n }\n }\n break;\n\n case \"Function\":\n res = obj.toString();\n if (_isNative.test(res)) {\n res = new Function(\"return \" + res);\n } else {\n res = new Function(\"return \" + res);\n for (var i in obj) {\n res[i] = obj[i];\n }\n }\n break;\n\n default:\n res = obj;\n break;\n\n }\n return res;\n }", "function clone(obj) {\n return Object.assign({}, obj);\n}", "function deepCopy(object) {\n return JSON.parse(JSON.stringify(object));\n}", "function shallowClone(obj) {\n var target = {};\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n target[i] = obj[i];\n }\n }\n return target;\n}", "function shallowCopy(src, dst) {\n if (isArray(src)) {\n dst = dst || [];\n\n for ( var i = 0; i < src.length; i++) {\n dst[i] = src[i];\n }\n } else if (isObject(src)) {\n dst = dst || {};\n\n for (var key in src) {\n if (hasOwnProperty.call(src, key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst || src;\n}", "function shallowCopy(src, dst) {\n if (isArray(src)) {\n dst = dst || [];\n\n for ( var i = 0; i < src.length; i++) {\n dst[i] = src[i];\n }\n } else if (isObject(src)) {\n dst = dst || {};\n\n for (var key in src) {\n if (hasOwnProperty.call(src, key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst || src;\n}", "function shallowCopy(src, dst) {\n if (isArray(src)) {\n dst = dst || [];\n\n for ( var i = 0; i < src.length; i++) {\n dst[i] = src[i];\n }\n } else if (isObject(src)) {\n dst = dst || {};\n\n for (var key in src) {\n if (hasOwnProperty.call(src, key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst || src;\n}", "function shallowCopy(src, dst) {\n if (isArray(src)) {\n dst = dst || [];\n\n for ( var i = 0; i < src.length; i++) {\n dst[i] = src[i];\n }\n } else if (isObject(src)) {\n dst = dst || {};\n\n for (var key in src) {\n if (hasOwnProperty.call(src, key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst || src;\n}", "function shallowCopy(src, dst) {\n if (isArray(src)) {\n dst = dst || [];\n\n for ( var i = 0; i < src.length; i++) {\n dst[i] = src[i];\n }\n } else if (isObject(src)) {\n dst = dst || {};\n\n for (var key in src) {\n if (hasOwnProperty.call(src, key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst || src;\n}", "function shallowCopy(src, dst) {\n\t if (isArray(src)) {\n\t dst = dst || [];\n\n\t for (var i = 0, ii = src.length; i < ii; i++) {\n\t dst[i] = src[i];\n\t }\n\t } else if (isObject(src)) {\n\t dst = dst || {};\n\n\t for (var key in src) {\n\t if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n\t dst[key] = src[key];\n\t }\n\t }\n\t }\n\n\t return dst || src;\n\t}", "function shallowCopy(src, dst) {\n\t if (isArray(src)) {\n\t dst = dst || [];\n\n\t for (var i = 0, ii = src.length; i < ii; i++) {\n\t dst[i] = src[i];\n\t }\n\t } else if (isObject(src)) {\n\t dst = dst || {};\n\n\t for (var key in src) {\n\t if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n\t dst[key] = src[key];\n\t }\n\t }\n\t }\n\n\t return dst || src;\n\t}", "function shallowCopy(src, dst) {\n if (isArray(src)) {\n dst = dst || [];\n\n for (var i = 0, ii = src.length; i < ii; i++) {\n dst[i] = src[i];\n }\n } else if (isObject(src)) {\n dst = dst || {};\n\n for (var key in src) {\n if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst || src;\n }", "function copy_object(obj) {\n var copy, k, N;\n\n if (obj instanceof Array) {\n copy = [];\n for (k = 0, N = obj.length; k < N; ++k) {\n copy.push(copy_object(obj[k]));\n }\n return copy;\n } else if (obj instanceof Object) {\n copy = {};\n for (k in obj) {\n copy[k] = copy_object(obj[k]);\n }\n return copy;\n } else {\n return obj;\n }\n }", "function copy(obj)\n\t\t{\n\t\t\tif (typeof obj !== 'object' || obj === null)\n\t\t\t\treturn obj;\n\t\t\tvar cpy = Array.isArray(obj) ? [] : {};\n\t\t\tfor (var key in obj)\n\t\t\t\tcpy[key] = copy(obj[key]);\n\t\t\treturn cpy;\n\t\t}", "function copy(o) {\n // deep copy an array of objects\n let v;\n const output = Array.isArray(o) ? [] : {};\n Object.keys(o || {}).forEach(key => {\n v = o[key];\n output[key] = typeof v === 'object' ? copy(v) : v;\n });\n return output;\n }", "function shallowCopy(src, dst) {\n if (isArray(src)) {\n dst = dst || [];\n\n for (var i = 0; i < src.length; i++) {\n dst[i] = src[i];\n }\n } else if (isObject(src)) {\n dst = dst || {};\n\n for (var key in src) {\n if (hasOwnProperty.call(src, key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst || src;\n}" ]
[ "0.6925085", "0.6882797", "0.6882797", "0.6882797", "0.6882797", "0.6882797", "0.6882797", "0.6882797", "0.6882797", "0.6882797", "0.68234456", "0.67633325", "0.6738668", "0.66559726", "0.66541636", "0.66271985", "0.6589848", "0.6589848", "0.6579737", "0.65710026", "0.65581626", "0.65581626", "0.6537906", "0.644594", "0.64416814", "0.64392006", "0.6434265", "0.64234567", "0.6415209", "0.64141625", "0.6412168", "0.6412168", "0.6404597", "0.6402309", "0.63943636", "0.6390615", "0.63855904", "0.63771504", "0.6376015", "0.6374049", "0.6374049", "0.6374049", "0.6374049", "0.6374049", "0.6374049", "0.6374049", "0.6374049", "0.6374049", "0.6374049", "0.6374049", "0.6374049", "0.6374049", "0.63735986", "0.63735986", "0.6368767", "0.63652235", "0.63477504", "0.63431066", "0.6333351", "0.63280237", "0.63280237", "0.6323426", "0.6323426", "0.6310837", "0.6308823", "0.6301873", "0.6299785", "0.6283152", "0.6283061", "0.6282435", "0.6277812", "0.62736785", "0.62724817", "0.6261508", "0.62609625", "0.6258856", "0.62462515", "0.6228375", "0.6226624", "0.6225627", "0.62216204", "0.62127024", "0.62127024", "0.62127024", "0.62127024", "0.62127024", "0.62072057", "0.62072057", "0.6204123", "0.6202003", "0.62011534", "0.6197448", "0.61955005" ]
0.0
-1
We need our custom method because encodeURIComponent is too aggressive and doesn't follow with regards to the character set (pchar) allowed in path segments: segment = pchar
function encodeUriSegment(val) { return encodeUriQuery(val, true). replace(/%26/gi, '&'). replace(/%3D/gi, '='). replace(/%2B/gi, '+'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function encodePathSegment(segment) {\r\n return encodeURIComponent(segment).replace(/[!'()*]/g, function (c) {\r\n return '%' + c.charCodeAt(0).toString(16);\r\n });\r\n }", "function encodeUriSegment(val){return encodeUriQuery(val,true).replace(/%26/gi,'&').replace(/%3D/gi,'=').replace(/%2B/gi,'+');}", "function encodeUriSegment(val){return encodeUriQuery(val,true).replace(/%26/gi,'&').replace(/%3D/gi,'=').replace(/%2B/gi,'+');}", "function encodeUriSegment(s){return encodeUriString(s).replace(/\\(/g,'%28').replace(/\\)/g,'%29').replace(/%26/gi,'&');}", "function encodeUriSegment(val) {\n\t return encodeUriQuery(val, true).replace(/%26/gi, '&').replace(/%3D/gi, '=').replace(/%2B/gi, '+');\n\t }", "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).replace(/%26/gi, '&').replace(/%3D/gi, '=').replace(/%2B/gi, '+');\n }", "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).replace(/%26/gi, '&').replace(/%3D/gi, '=').replace(/%2B/gi, '+');\n }", "function encodeUriSegment(s) {\n return encodeUriString(s).replace(/\\(/g, '%28').replace(/\\)/g, '%29').replace(/%26/gi, '&');\n }", "function encodeUriSegment(val) {\n\t\treturn encodeUriQuery(val, true).\n\t\treplace(/%26/gi, '&').\n\t\treplace(/%3D/gi, '=').\n\t\treplace(/%2B/gi, '+');\n\t}", "function encodeUriSegment(val) {\n\t return encodeUriQuery(val, true).\n\t replace(/%26/gi, '&').\n\t replace(/%3D/gi, '=').\n\t replace(/%2B/gi, '+');\n\t}", "function encodeUriSegment(val) {\n\t return encodeUriQuery(val, true).\n\t replace(/%26/gi, '&').\n\t replace(/%3D/gi, '=').\n\t replace(/%2B/gi, '+');\n\t}", "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "function encodeUriSegment(val) {\n\t\treturn encodeUriQuery(val, true).\n\t\t\treplace(/%26/gi, '&').\n\t\t\treplace(/%3D/gi, '=').\n\t\t\treplace(/%2B/gi, '+');\n\t}", "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n}", "function encodeUriSegment(val) {\n return encodeUriQuery(val, true)\n .replace(/%26/gi, '&')\n .replace(/%3D/gi, '=')\n .replace(/%2B/gi, '+');\n}", "function encodeUriSegment(s) {\n return encodeUriString(s).replace(/\\(/g, '%28').replace(/\\)/g, '%29').replace(/%26/gi, '&');\n}", "function encodeUriSegment(s) {\n return encodeUriString(s).replace(/\\(/g, '%28').replace(/\\)/g, '%29').replace(/%26/gi, '&');\n}", "function encodeUriSegment(val) { // 1397\n return encodeUriQuery(val, true). // 1398\n replace(/%26/gi, '&'). // 1399\n replace(/%3D/gi, '='). // 1400\n replace(/%2B/gi, '+'); // 1401\n} // 1402", "function encodeUriSegment(s) {\n return encodeUriString(s).replace(/\\(/g, '%28').replace(/\\)/g, '%29').replace(/%26/gi, '&');\n}", "function encodeUriSegment(s) {\n return encodeUriString(s).replace(/\\(/g, '%28').replace(/\\)/g, '%29').replace(/%26/gi, '&');\n}", "function encodeUriSegment(s) {\n return encodeUriString(s).replace(/\\(/g, '%28').replace(/\\)/g, '%29').replace(/%26/gi, '&');\n}", "function encodeUriSegment(s) {\n return encodeUriString(s).replace(/\\(/g, '%28').replace(/\\)/g, '%29').replace(/%26/gi, '&');\n}", "function encodeUriSegment(s) {\n return encodeUriString(s).replace(/\\(/g, '%28').replace(/\\)/g, '%29').replace(/%26/gi, '&');\n}", "function encodeUriSegment(s) {\n return encodeUriString(s).replace(/\\(/g, '%28').replace(/\\)/g, '%29').replace(/%26/gi, '&');\n}", "function encodeUriSegment(s) {\n return encodeUriString(s).replace(/\\(/g, '%28').replace(/\\)/g, '%29').replace(/%26/gi, '&');\n}", "function encodeUriSegment(s) {\n return encodeUriString(s).replace(/\\(/g, '%28').replace(/\\)/g, '%29').replace(/%26/gi, '&');\n}", "function encodeUriSegment(s) {\n return encodeUriString(s).replace(/\\(/g, '%28').replace(/\\)/g, '%29').replace(/%26/gi, '&');\n}", "function encodeSegment(segment,resultBuf){var result=resultBuf;var length=segment.length;for(var i=0;i<length;i++){var c=segment.charAt(i);switch(c){case'\\0':result+=escapeChar+encodedNul;break;case escapeChar:result+=escapeChar+encodedEscape;break;default:result+=c;}}return result;}", "function encode(path) { return encodeURIComponent(path) }", "function encode(path) { return encodeURIComponent(path); }", "function encodeUriFragment(s){return encodeURI(s);}", "function encode(path){var result='';for(var i=0;i<path.length;i++){if(result.length>0){result=encodeSeparator(result);}result=encodeSegment(path.get(i),result);}return encodeSeparator(result);}", "function url_encode(fromStr) {\n\tvar toStr = escape(fromStr);\n\treturn toStr;\n} // end url_encode", "function __encodeURIComponentForReadable(_string)\n\t\t{\n\t\t\t//\tnone\n\t\t\tif (_string == '') { return 'none'; }\n\t\t\t\n\t\t\t//\tencode\n\t\t\treturn encodeURIComponent(_string)\n\t\t\t\t.replace(/!/g, '%21')\n\t\t\t\t.replace(/'/g, '%27')\n\t\t\t\t.replace(/\\(/g, '%28')\n\t\t\t\t.replace(/\\)/g, '%29')\n\t\t\t\t.replace(/\\*/g, '%2A')\n\t\t\t;\n\t\t}", "function __encodeURIComponentForReadable(_string)\n\t\t{\n\t\t\t//\tnone\n\t\t\tif (_string == '') { return 'none'; }\n\t\t\t\n\t\t\t//\tencode\n\t\t\treturn encodeURIComponent(_string)\n\t\t\t\t.replace(/!/g, '%21')\n\t\t\t\t.replace(/'/g, '%27')\n\t\t\t\t.replace(/\\(/g, '%28')\n\t\t\t\t.replace(/\\)/g, '%29')\n\t\t\t\t.replace(/\\*/g, '%2A')\n\t\t\t;\n\t\t}", "function __encodeURIComponentForReadable(_string)\n\t\t{\n\t\t\t//\tnone\n\t\t\tif (_string == '') { return 'none'; }\n\t\t\t\n\t\t\t//\tencode\n\t\t\treturn encodeURIComponent(_string)\n\t\t\t\t.replace(/!/g, '%21')\n\t\t\t\t.replace(/'/g, '%27')\n\t\t\t\t.replace(/\\(/g, '%28')\n\t\t\t\t.replace(/\\)/g, '%29')\n\t\t\t\t.replace(/\\*/g, '%2A')\n\t\t\t;\n\t\t}", "function __encodeURIComponentForReadable(_string)\n\t\t{\n\t\t\t//\tnone\n\t\t\tif (_string == '') { return 'none'; }\n\t\t\t\n\t\t\t//\tencode\n\t\t\treturn encodeURIComponent(_string)\n\t\t\t\t.replace(/!/g, '%21')\n\t\t\t\t.replace(/'/g, '%27')\n\t\t\t\t.replace(/\\(/g, '%28')\n\t\t\t\t.replace(/\\)/g, '%29')\n\t\t\t\t.replace(/\\*/g, '%2A')\n\t\t\t;\n\t\t}", "function encodeURIParameter( s )\n{\n\ts = encodeURIComponent( s );\n\ts = s.replace( /%2[fF]/g, '/' );\n\ts = s.replace( /%3[aA]/g, ':' );\n\ts = s.replace( /%20/g, '+' );\n\treturn s;\n}", "function encodeSegment(segment, resultBuf) {\n var result = resultBuf;\n var length = segment.length;\n\n for (var i = 0; i < length; i++) {\n var c = segment.charAt(i);\n\n switch (c) {\n case '\\0':\n result += escapeChar + encodedNul;\n break;\n\n case escapeChar:\n result += escapeChar + encodedEscape;\n break;\n\n default:\n result += c;\n }\n }\n\n return result;\n }", "function encodeSegment(segment, resultBuf) {\r\n var result = resultBuf;\r\n var length = segment.length;\r\n for (var i = 0; i < length; i++) {\r\n var c = segment.charAt(i);\r\n switch (c) {\r\n case '\\0':\r\n result += escapeChar + encodedNul;\r\n break;\r\n case escapeChar:\r\n result += escapeChar + encodedEscape;\r\n break;\r\n default:\r\n result += c;\r\n }\r\n }\r\n return result;\r\n}", "function encodeSegment(segment, resultBuf) {\r\n var result = resultBuf;\r\n var length = segment.length;\r\n for (var i = 0; i < length; i++) {\r\n var c = segment.charAt(i);\r\n switch (c) {\r\n case '\\0':\r\n result += escapeChar + encodedNul;\r\n break;\r\n case escapeChar:\r\n result += escapeChar + encodedEscape;\r\n break;\r\n default:\r\n result += c;\r\n }\r\n }\r\n return result;\r\n}", "function encodeSegment(segment, resultBuf) {\r\n var result = resultBuf;\r\n var length = segment.length;\r\n for (var i = 0; i < length; i++) {\r\n var c = segment.charAt(i);\r\n switch (c) {\r\n case '\\0':\r\n result += escapeChar + encodedNul;\r\n break;\r\n case escapeChar:\r\n result += escapeChar + encodedEscape;\r\n break;\r\n default:\r\n result += c;\r\n }\r\n }\r\n return result;\r\n}", "function escapePathDelimiters(segment) {\n return segment.replace(/[/#?]/g, char => encodeURIComponent(char));\n}", "function escapePathDelimiters(segment) {\n return segment.replace(/[/#?]/g, char => encodeURIComponent(char));\n}", "function escapePathDelimiters(segment) {\n return segment.replace(/[/#?]/g, char => encodeURIComponent(char));\n}", "function encodedURL(str){\n\t\t\treturn encodeURIComponent(input);\n\t\t\t\n\t\t}", "function encodeSegment(segment, resultBuf) {\n var result = resultBuf;\n var length = segment.length;\n for (var i = 0; i < length; i++) {\n var c = segment.charAt(i);\n switch (c) {\n case '\\0':\n result += escapeChar + encodedNul;\n break;\n case escapeChar:\n result += escapeChar + encodedEscape;\n break;\n default:\n result += c;\n }\n }\n return result;\n}", "function encodeSegment(segment, resultBuf) {\n var result = resultBuf;\n var length = segment.length;\n for (var i = 0; i < length; i++) {\n var c = segment.charAt(i);\n switch (c) {\n case '\\0':\n result += escapeChar + encodedNul;\n break;\n case escapeChar:\n result += escapeChar + encodedEscape;\n break;\n default:\n result += c;\n }\n }\n return result;\n}" ]
[ "0.77599055", "0.7683471", "0.7683471", "0.7538316", "0.7466263", "0.74190605", "0.74190605", "0.74190605", "0.74190605", "0.74190605", "0.74190605", "0.74190605", "0.7407124", "0.74042463", "0.7397316", "0.73801553", "0.7368011", "0.7368011", "0.7349139", "0.7349139", "0.7349139", "0.7349139", "0.7349139", "0.7349139", "0.7341404", "0.7328319", "0.73124516", "0.7299409", "0.72665054", "0.72665054", "0.7263307", "0.7259538", "0.7259538", "0.7259538", "0.7259538", "0.7259538", "0.7259538", "0.7259538", "0.7259538", "0.7259538", "0.70495635", "0.6967638", "0.69561845", "0.6720863", "0.66853416", "0.66246516", "0.6543556", "0.6543556", "0.6543556", "0.6543556", "0.6517154", "0.6413542", "0.6407951", "0.6407951", "0.6407951", "0.6382895", "0.6382895", "0.6382895", "0.6375967", "0.63745075", "0.63745075" ]
0.7343318
51
This method is intended for encoding key or value parts of query component. We need a custom method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be encoded per query = ( pchar / "/" / "?" )
function encodeUriQuery(val, pctEncodeSpaces) { return encodeURIComponent(val). replace(/%40/gi, '@'). replace(/%3A/gi, ':'). replace(/%24/g, '$'). replace(/%2C/gi, ','). replace(/%3B/gi, ';'). replace(/%20/g, (pctEncodeSpaces ? '%20' : '+')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function encode(char) {\n if (char == \"(\") {\n return \"%28\";\n }\n else if (char == \")\") {\n return \"%29\";\n }\n else if (char == \"=\") {\n return \"%3D\";\n }\n else {\n return encodeURIComponent(char);\n }\n}", "function encodeUriQuery(s){return encodeUriString(s).replace(/%3B/gi,';');}", "function encodeUriQuery(val,pctEncodeSpaces){return encodeURIComponent(val).replace(/%40/gi,'@').replace(/%3A/gi,':').replace(/%24/g,'$').replace(/%2C/gi,',').replace(/%3B/gi,';').replace(/%20/g,pctEncodeSpaces?'%20':'+');}", "function encodeUriQuery(val,pctEncodeSpaces){return encodeURIComponent(val).replace(/%40/gi,'@').replace(/%3A/gi,':').replace(/%24/g,'$').replace(/%2C/gi,',').replace(/%3B/gi,';').replace(/%20/g,pctEncodeSpaces?'%20':'+');}", "function encodeQueryValue(text) {\r\n return (commonEncode(text)\r\n // Encode the space as +, encode the + to differentiate it from the space\r\n .replace(PLUS_RE, '%2B')\r\n .replace(ENC_SPACE_RE, '+')\r\n .replace(HASH_RE, '%23')\r\n .replace(AMPERSAND_RE, '%26')\r\n .replace(ENC_BACKTICK_RE, '`')\r\n .replace(ENC_CURLY_OPEN_RE, '{')\r\n .replace(ENC_CURLY_CLOSE_RE, '}')\r\n .replace(ENC_CARET_RE, '^'));\r\n}", "function encodeQueryValue(text) {\r\n return (commonEncode(text)\r\n // Encode the space as +, encode the + to differentiate it from the space\r\n .replace(PLUS_RE, '%2B')\r\n .replace(ENC_SPACE_RE, '+')\r\n .replace(HASH_RE, '%23')\r\n .replace(AMPERSAND_RE, '%26')\r\n .replace(ENC_BACKTICK_RE, '`')\r\n .replace(ENC_CURLY_OPEN_RE, '{')\r\n .replace(ENC_CURLY_CLOSE_RE, '}')\r\n .replace(ENC_CARET_RE, '^'));\r\n}", "function encodeQueryValue(text) {\n return (commonEncode(text)\n // Encode the space as +, encode the + to differentiate it from the space\n .replace(PLUS_RE, '%2B')\n .replace(ENC_SPACE_RE, '+')\n .replace(HASH_RE, '%23')\n .replace(AMPERSAND_RE, '%26')\n .replace(ENC_BACKTICK_RE, '`')\n .replace(ENC_CURLY_OPEN_RE, '{')\n .replace(ENC_CURLY_CLOSE_RE, '}')\n .replace(ENC_CARET_RE, '^'));\n}", "getEncodedQuery() {}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).replace(/%40/gi, '@').replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%3B/gi, ';').replace(/%20/g, pctEncodeSpaces ? '%20' : '+');\n }", "function encodeQueryString(queryString) {\r\n var encodedQueryString = \"\";\r\n for (i = 0; i < queryString.length; ++i) {\r\n if (queryString.charAt(i) == ' ') {\r\n encodedQueryString += \"+\";\r\n } else {\r\n encodedQueryString += queryString.charAt(i);\r\n }\r\n }\r\n return encodedQueryString;\r\n}", "function toQueryString() {\n return this.inject([], function(results, pair) {\n var key = encodeURIComponent(pair.key), values = pair.value;\n \n if (values && typeof values == 'object') {\n if (Object.isArray(values))\n return results.concat(values.map(toQueryPair.curry(key)));\n } else results.push(toQueryPair(key, values));\n return results;\n }).join('&');\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n\t return encodeURIComponent(val).replace(/%40/gi, '@').replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, pctEncodeSpaces ? '%20' : '+');\n\t }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).replace(/%40/gi, '@').replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace((pctEncodeSpaces ? null : /%20/g), '+');\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace((pctEncodeSpaces ? null : /%20/g), '+');\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace((pctEncodeSpaces ? null : /%20/g), '+');\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) { // 1416\n return encodeURIComponent(val). // 1417\n replace(/%40/gi, '@'). // 1418\n replace(/%3A/gi, ':'). // 1419\n replace(/%24/g, '$'). // 1420\n replace(/%2C/gi, ','). // 1421\n replace(/%3B/gi, ';'). // 1422\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+')); // 1423\n} // 1424", "function encodeQuery(params) {\n let esc = encodeURIComponent;\n let query = Object.keys(params)\n .map(key => esc(key) + '/' + esc(params[key]))\n .join('/');\n return query;\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n }", "function rdfproxy_query_encode(str) {\n str = (str + '').toString();\n\n // Tilde should be allowed unescaped in future versions of PHP (as reflected below), but if you want to reflect current\n // PHP behavior, you would need to add \".replace(/~/g, '%7E');\" to the following.\n return encodeURIComponent(str)\n .replace(/!/g, '%21')\n .replace(/'/g, '%27')\n .replace(/\\(/g, '%28')\n .replace(/\\)/g, '%29')\n .replace(/\\*/g, '%2A')\n .replace(/%20/g, '+');\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n\t\treturn encodeURIComponent(val).\n\t\treplace(/%40/gi, '@').\n\t\treplace(/%3A/gi, ':').\n\t\treplace(/%24/g, '$').\n\t\treplace(/%2C/gi, ',').\n\t\treplace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n\t}", "function encodeUriQuery(val, pctEncodeSpaces) {\n\t\treturn encodeURIComponent(val).\n\t\t\treplace(/%40/gi, '@').\n\t\t\treplace(/%3A/gi, ':').\n\t\t\treplace(/%24/g, '$').\n\t\t\treplace(/%2C/gi, ',').\n\t\t\treplace(/%3B/gi, ';').\n\t\t\treplace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n\t}", "function encodeUriSegment(val){return encodeUriQuery(val,true).replace(/%26/gi,'&').replace(/%3D/gi,'=').replace(/%2B/gi,'+');}", "function encodeUriSegment(val){return encodeUriQuery(val,true).replace(/%26/gi,'&').replace(/%3D/gi,'=').replace(/%2B/gi,'+');}", "function encodeUriQuery(val, pctEncodeSpaces) {\n\t return encodeURIComponent(val).\n\t replace(/%40/gi, '@').\n\t replace(/%3A/gi, ':').\n\t replace(/%24/g, '$').\n\t replace(/%2C/gi, ',').\n\t replace(/%3B/gi, ';').\n\t replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n\t}", "function encodeUriQuery(val, pctEncodeSpaces) {\n\t return encodeURIComponent(val).\n\t replace(/%40/gi, '@').\n\t replace(/%3A/gi, ':').\n\t replace(/%24/g, '$').\n\t replace(/%2C/gi, ',').\n\t replace(/%3B/gi, ';').\n\t replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n\t}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n if (pctEncodeSpaces === void 0) { pctEncodeSpaces = false; }\n return encodeURIComponent(val)\n .replace(/%40/gi, '@')\n .replace(/%3A/gi, ':')\n .replace(/%24/g, '$')\n .replace(/%2C/gi, ',')\n .replace(/%3B/gi, ';')\n .replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function formencode() {\r\n filter.value = encodeURIComponent(encodeURIComponent(filter.value));\r\n filterex.value = encodeURIComponent(encodeURIComponent(filterex.value));\r\n }", "function encodeQueryString(params, prefixed = true) {\n // Filter out undefined values\n const cleanedParams = removeKeysWithUndefinedValues(params);\n // Determine if a prefixed \"?\" is appropreate\n const prefix = prefixed && Object.keys(cleanedParams).length > 0 ? '?' : '';\n\n // Transform keys and values to a query string\n return (\n prefix +\n Object.entries(cleanedParams)\n .map(([k, v]) => `${k}=${encodeURIComponent(v)}`)\n .join('&')\n );\n}", "function encodeUriQuery(val) {\n return encodeURIComponent(val).replace(/%20/g, '+');\n}", "function encodeURIParameter( s )\n{\n\ts = encodeURIComponent( s );\n\ts = s.replace( /%2[fF]/g, '/' );\n\ts = s.replace( /%3[aA]/g, ':' );\n\ts = s.replace( /%20/g, '+' );\n\treturn s;\n}", "_formatQueryString(query) {\n // TODO: Figure out how to fix the url encoding of the colons so I can\n // use this more specific search\n // const q = Object.entries(query)\n // .map(([key, val]) => {\n // if (key === 'title') {\n // key = 'track';\n // }\n // return encodeURIComponent(`${key}:${val}`);\n // })\n // .join('&');\n\n const q = Object.values(query)\n .map(val => encodeURIComponent(val))\n .join('%20');\n\n debug('Query String: %s', q);\n return q;\n }", "function encodeQueryKey(text) {\r\n return encodeQueryValue(text).replace(EQUAL_RE, '%3D');\r\n}", "function encodeQueryKey(text) {\r\n return encodeQueryValue(text).replace(EQUAL_RE, '%3D');\r\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}", "function encodeParam (param)\n{\n\tvar string = String(param);\n\tstring = escape(string);\n\tstring = string.replace(/\\+/g, encodeURIComponent(\"+\"));\n\treturn string;\n}", "function __encodeURIComponentForReadable(_string)\n\t\t{\n\t\t\t//\tnone\n\t\t\tif (_string == '') { return 'none'; }\n\t\t\t\n\t\t\t//\tencode\n\t\t\treturn encodeURIComponent(_string)\n\t\t\t\t.replace(/!/g, '%21')\n\t\t\t\t.replace(/'/g, '%27')\n\t\t\t\t.replace(/\\(/g, '%28')\n\t\t\t\t.replace(/\\)/g, '%29')\n\t\t\t\t.replace(/\\*/g, '%2A')\n\t\t\t;\n\t\t}", "function __encodeURIComponentForReadable(_string)\n\t\t{\n\t\t\t//\tnone\n\t\t\tif (_string == '') { return 'none'; }\n\t\t\t\n\t\t\t//\tencode\n\t\t\treturn encodeURIComponent(_string)\n\t\t\t\t.replace(/!/g, '%21')\n\t\t\t\t.replace(/'/g, '%27')\n\t\t\t\t.replace(/\\(/g, '%28')\n\t\t\t\t.replace(/\\)/g, '%29')\n\t\t\t\t.replace(/\\*/g, '%2A')\n\t\t\t;\n\t\t}", "function __encodeURIComponentForReadable(_string)\n\t\t{\n\t\t\t//\tnone\n\t\t\tif (_string == '') { return 'none'; }\n\t\t\t\n\t\t\t//\tencode\n\t\t\treturn encodeURIComponent(_string)\n\t\t\t\t.replace(/!/g, '%21')\n\t\t\t\t.replace(/'/g, '%27')\n\t\t\t\t.replace(/\\(/g, '%28')\n\t\t\t\t.replace(/\\)/g, '%29')\n\t\t\t\t.replace(/\\*/g, '%2A')\n\t\t\t;\n\t\t}" ]
[ "0.71562696", "0.70924747", "0.70437676", "0.70437676", "0.7008803", "0.7008803", "0.7006764", "0.69240695", "0.69197106", "0.69197106", "0.69197106", "0.69197106", "0.69197106", "0.69197106", "0.69197106", "0.6915449", "0.6904992", "0.6896082", "0.68950313", "0.6870669", "0.6870669", "0.6870669", "0.6870669", "0.6870669", "0.6870669", "0.6869124", "0.68596965", "0.68596965", "0.68596965", "0.6857969", "0.68449324", "0.6842603", "0.6840677", "0.6839098", "0.68366796", "0.68366796", "0.68366796", "0.68366796", "0.68366796", "0.68366796", "0.68343604", "0.68188095", "0.68182737", "0.68182737", "0.68146497", "0.68146497", "0.6807775", "0.68069464", "0.6803952", "0.677794", "0.6772432", "0.67694974", "0.67532283", "0.6717068", "0.6717068", "0.67067707", "0.67067707", "0.6699416", "0.6699416", "0.6699416", "0.6699416", "0.6699416", "0.6699416", "0.6699416", "0.6699416", "0.6699416", "0.6693874", "0.6692367", "0.6692367", "0.6692367" ]
0.68589634
58
throw error if the argument is falsy.
function assertArg(arg, name, reason) { if (!arg) { throw ngMinErr('areq', "Argument '{0}' is {1}", (name || '?'), (reason || "required")); } return arg; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function throwIfFalsy(value) {\n if (!value) {\n throw new Error('value must not be falsy');\n }\n return value;\n}", "function isFalsy(input){\n\n}", "function isFalsy(input){\n return 0;\n }", "function verify_required_arg(arg, errorMsg) {\n if ((_.isUndefined(arg) || _.isNull(arg))) {\n console.error(errorMsg);\n helpAndExit(1);\n }\n}", "function required(){\n throw new Error('argument is required');\n}", "function throwIfMissing() {\n throw new Error(\"Missing parameter\");\n}", "function argument(predicate, message) {\n if (!predicate) {\n fail(message);\n }\n}", "function is_null(arg_value)\n\t{\n\t\treturn arg_value == null || typeof arg_value === 'undefined';\n\t}", "function argument(predicate, message) {\n if (!predicate) {\n fail(message);\n }\n}", "notEmpty (value, msg) {\n assert(!lodash.isEmpty(value), msg || `params must be not empty, but got ${value}`);\n }", "function isEmpty(param) {\n if (!param || param.length === 0) {\n console.log('isEmpty');\n } else {\n console.log('isNotEmpty');\n }\n}", "function isUndefined( input )\n{\n\treturn !(typeof input != 'undefined');\n}", "function isEmpty(_param) {\n return (_param === 'undefined' || _param === undefined || _param === '' || _param === null);\n}", "function argument(predicate, message) {\n if (!predicate) {\n fail(message);\n }\n }", "function nothing_is_nothing() {\n return [...arguments].every(x => Boolean(x))\n }", "function none(val) {\n return empty(val) || (Number(val) != 0 && !val);\n}", "function isTruthy(input){\n return 0;\n }", "isEmpty (value, msg) {\n assert(lodash.isEmpty(value), msg || `params must be empty, but got ${value}`);\n }", "function isInputEmpty(input) {\n return (input === undefined || typeof (input) === \"boolean\");\n}", "function argument(predicate, message) {\r\n\t if (!predicate) {\r\n\t fail(message);\r\n\t }\r\n\t}", "function verifyArgumentIsDefined(value) {\n if (typeof value !== \"string\" || value.length === 0) {\n throw new Error(\"Invalid usage: node \" + path.basename(__filename) + \" {directory-to-copy} {dependency-name}\");\n }\n}", "function unless(b) {\n return unlessM(core.succeedWith(b));\n}", "function mandatory() {\n throw new Error('Missing parameter');\n}", "function isEmptyOrUndefined(param) {\n try {\n if(!param|| param === 'undefined' || param === 'null' || param === '') {\n return true;\n }\n else {\n return false;\n }\n }\n catch(err) {\n logException('isEmptyOrUndefined', err.message);\n }\n return true;\n}", "function invalidArg(message) {\n if(message) console.log(message); //Shows the specific error message about the invalid argument\n validArgs = false; //Sets the valid arguments flag to false\n}", "function checkInputExists(input) { // check parameter exists\n if (input == undefined) {\n throw 'input does not exist'\n }\n}", "function noOp(err) { if (err) { throw err; } }", "function throwIfUndefined(input, options = {}) {\n var _a;\n if (input === undefined) {\n throw new Error((_a = options.errorMessage) !== null && _a !== void 0 ? _a : \"undefined variable\");\n }\n return input;\n}", "function isEmpty(parameter) {\n if (parameter === undefined) return 'your parameter is empty';\n else return parameter;\n}", "function isFalsy(input) {\n return ((bool) || (!bool)) !== true;\n }", "function isUndefined(value) {\n\n}", "function foo() {\n\tvar a = arguments[0] !== (void 0) ? arguments[0] : 2;\n\tconsole.log( a );\n}", "isEmpty (param) {\n if (param == null || param === '') {\n return true\n }\n return false\n }", "function oreq () {\n var truthy = function truthy(v) {\n return v !== null && v !== undefined && v !== false;\n };\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var val = args.filter(truthy)[0];\n return truthy(val) ? val : undefined;\n}", "function isNully (value) {return isNull(value) || typeof value === 'undefined'}", "static noop(...args) {\n if (false) {\n console.log(args);\n }\n }", "isAbsent() {\n return \"undefined\" == typeof this.value || null == this.value;\n }", "function isValid(value) {\n return value || value === 0;\n}", "function isemptyornull(value)\n {\n return !(typeof value === \"string\" && value.length > 0);\n }", "function ensureNever(value) { }", "existAnyArguments() {\n const {supportingSituation, supportingActionGoal, notSupportingSituation, notSupportingActionGoal} = this.state;\n return (\n (supportingSituation !== undefined && supportingSituation.length > 0) ||\n (supportingActionGoal !== undefined && supportingActionGoal.length > 0) ||\n (notSupportingSituation !== undefined && notSupportingSituation.length > 0) ||\n (notSupportingActionGoal !== undefined && notSupportingActionGoal.length > 0)\n )\n }", "missingArgument(name) {\n console.error('error: missing required argument `%s`', name);\n process.exit(1);\n }", "isRequiredProvided(input) {\n if (this.isOptional === true) {\n return true;\n }\n if (input === '') {\n return false;\n }\n return true;\n }", "function foo(input,cb){\n\tif(input){ //if true\n\t\t//null the error, send the oke\n\t\tcb(null,'oke')\n\t}else{\n\t\t// send the error, null the msg\n\t\tcb('sorry error', null)\n\t}\n}", "function isNotNull(f,noalert) {\n if (f.value.length ==0) {\n return false;\n }\n return true;\n}", "function optional(arg, fallback) {\n return (arg !== void 0) ? arg : fallback;\n}", "function isBlank (thing) {\n return (!thing || thing.length === 0)\n}", "function falsy(x) {\n return !truthy(x);\n}", "static checkEmptyUserInput(userValue){\n return (userValue==0 ? true : false);\n }", "function isDefinedAndNotNull(input)\r\n{\r\n if (isDefined(input))\r\n return ((input != null) && !isNaN(input));\r\n else\r\n return false;\r\n}", "function validateUserInput(){\n if(arg2.length>0){\n return true\n }else {\n return false\n }\n }", "function validateInput(input){\n if(input == \"\" || input == undefined){\n message(\"Lén verður að vera strengur\");\n return false;\n }\n return true;\n }", "function isValid(v) {\n return v || v === 0;\n}", "function isFalsy(v) {\n return !v;\n}", "function isUndef(e){return void 0===e||null===e}", "function isUndef(e){return void 0===e||null===e}", "function isUndef(val) {\n\t return val === void 0;\n\t }", "function isUndef(v){return v===undefined||v===null;}", "function isUndef(v){return v===undefined||v===null;}", "function validate(input) {\n \"use strict\";\n if (input.length <= 0) {\n return false;\n } else {\n return true;\n }\n \n}", "function noInput(arg) {\n return res.status(400).send({\n error: `Must include ${arg}. Make sure capitalization is correct (${arg} not ${arg.toLowerCase()}).`\n })\n }", "isNotDefined(val) {\n return val === undefined;\n }", "isValueEmpty(input) {\n return input ? true : false\n }", "function truthyFalsy({ number, string }) {\n\n return number ? number : string;\n}", "function catchEmpty(input){\n\n if(input===\"\"){\n return \"Please enter required information.\"\n } \n else{ \n return true};\n\n}", "static noop() {\n if (false) {\n console.log(arguments);\n }\n }", "function falsy (x) {\n return !truthy(x);\n}", "function validateOptionalArgType(functionName,type,position,argument){if(argument!==undefined){validateArgType(functionName,type,position,argument);}}", "function f1(a,b,c){\n\tassert( !sanityjs.arguments_check(\"boolean\", options) );\n}", "beNaN() {\n this._processArguments(arguments);\n return this._assert(\n isNaN(this._actual),\n '${actual} is NaN.',\n '${actual} is not NaN but should be.');\n }", "function not(input) {\n return !(input);\n }", "function vacio(value) {\n if (value === '') return true;\n return false;\n}", "isOk() {\n return this.value !== void 0\n }", "function defined (arg) { return arg !== undefined}", "function missingArg(arg){\n console.log('\\n Error: command line argument ' + arg)\n process.exit()\n}", "function _(e){return null===e||void 0===e}", "function assert(mustBeTruthy) {}", "function checkIfNullIsFalsy(nuLL){\n if (nuLL){\n console.log('null is truthy'); \n}\nelse {\n console.log('null is falsy')\n}\n}", "function useless(test, then) {\n if (!test) then()\n}", "function validate() {\n\n if( _this.default ) return;\n\n if( !_this.args[0] ) {\n console.log('Error Name must be specified');\n return args.done();\n }\n }", "function oreqUndefined () {\n var truthy = function truthy(v) {\n return v !== undefined;\n };\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var val = args.filter(truthy)[0];\n return truthy(val) ? val : undefined;\n}", "function missingArg(arg){\n console.log('\\n Error: program option missing ' + arg)\n process.exit()\n}", "static isFailure(value) {\n return value == null || Flag_1.default.is(value, \"fail\");\n }", "function assertNotNullOrUndefined(value, message) {\n chrome.test.assertNe(null, value, message);\n chrome.test.assertNe(undefined, value, message);\n}", "function vacio(value) {\r\nif (value === '') return true;\r\n return false;\r\n}", "function isNotFalsy(value) {\n\t\t return Boolean(value);\n\t }", "function not(a){\r\n return (a === true) ? false :\r\n (a === false) ? true : error(not);\r\n}", "function emptyOrNot(input) {\n\n if (input) {\n return true\n } else {\n return false\n }\n \n }", "function a(e){return void 0===e||null===e}", "function a(e){return void 0===e||null===e}", "function a(e){return void 0===e||null===e}", "function unless(test, then){\n if(!test) then();\n}", "notBeNaN() {\n this._processArguments(arguments);\n return this._assert(\n !isNaN(this._actual),\n '${actual} is not NaN.',\n '${actual} is NaN but should not be.');\n }", "isUndefined(value) {\n return _isEmpty(value);\n }", "function isUndef(v){return v===undefined||v===null}", "function foo() {\n if (true) {\n throw 'error';\n }\n}", "function isValid(value) {\n return Boolean(value || value === 0);\n}", "function isValid(value) {\n return Boolean(value || value === 0);\n}", "function isValid(value) {\n return Boolean(value || value === 0);\n}", "function isValid(value) {\n return Boolean(value || value === 0);\n}", "function noError(e, cb) {\n if (e) {\n cb(e);\n return false;\n }\n return true;\n}" ]
[ "0.7172773", "0.687895", "0.6663923", "0.65720487", "0.6550899", "0.6380554", "0.6136963", "0.61253303", "0.60794896", "0.6073735", "0.5982409", "0.5960948", "0.5944493", "0.5942149", "0.5941711", "0.59356165", "0.59329516", "0.5916647", "0.5893195", "0.5872222", "0.5865924", "0.5863572", "0.5848897", "0.5845887", "0.5838011", "0.58248943", "0.5824291", "0.5820311", "0.5817273", "0.5806887", "0.57923365", "0.57899874", "0.57807535", "0.57745206", "0.5771943", "0.57714117", "0.5742342", "0.57258844", "0.5721783", "0.56909233", "0.56848276", "0.56590456", "0.5649917", "0.5649675", "0.5641926", "0.56370115", "0.55996287", "0.5596086", "0.55875915", "0.5580936", "0.5580722", "0.557033", "0.55670637", "0.5566791", "0.5564749", "0.5564749", "0.5563556", "0.55633664", "0.55633664", "0.5551792", "0.5547887", "0.5542289", "0.55422467", "0.5530276", "0.55275726", "0.55254257", "0.55248827", "0.5516514", "0.55111325", "0.55058426", "0.5499224", "0.5491131", "0.54910946", "0.54769456", "0.54754376", "0.54746187", "0.5474183", "0.54731315", "0.54707754", "0.5464498", "0.54616976", "0.54586864", "0.545809", "0.54565805", "0.5456574", "0.54560184", "0.5445064", "0.54417896", "0.54319096", "0.54319096", "0.54319096", "0.5430617", "0.54290193", "0.5425863", "0.541923", "0.54156077", "0.541404", "0.541404", "0.541404", "0.541404", "0.54123247" ]
0.0
-1
Converts snake_case to camelCase. Also there is special case for Moz prefix starting with upper case letter.
function camelCase(name) { return name. replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) { return offset ? letter.toUpperCase() : letter; }). replace(MOZ_HACK_REGEXP, 'Moz$1'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function snake_case(name) {\n\t\t\t\tvar regexp = /[A-Z]/g;\n\t\t\t\tvar separator = '-';\n\t\t\t\treturn name.replace(regexp, function(letter, pos) {\n\t\t\t\t\treturn (pos ? separator : '') + letter.toLowerCase();\n\t\t\t\t});\n\t\t\t}", "function snake_case(name){\n\t var regexp = /[A-Z]/g;\n\t var separator = '-';\n\t return name.replace(regexp, function(letter, pos) {\n\t return (pos ? separator : '') + letter.toLowerCase();\n\t });\n\t }", "function snake_case(name) {\n\t var regexp = /[A-Z]/g;\n\t var separator = '-';\n\t return name.replace(regexp, function(letter, pos) {\n\t return (pos ? separator : '') + letter.toLowerCase();\n\t });\n\t }", "function snake_case(name){\n\t\t\tvar regexp = /[A-Z]/g;\n\t\t\tvar separator = '-';\n\t\t\treturn name.replace(regexp, function(letter, pos) {\n\t\t\t\treturn (pos ? separator : '') + letter.toLowerCase();\n\t\t\t});\n\t\t}", "function camelCase(string){return string.replace(rmsPrefix,\"ms-\").replace(rdashAlpha,fcamelCase);}", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function (letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function (letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name){\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name){\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name){\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name){\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name){\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name){\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name){\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name){\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name){\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name){\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n\t var separator = '-';\n\t return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n\t return (pos ? separator : '') + letter.toLowerCase();\n\t });\n\t }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function camelCaseHelper(snakeObj) {\n\treturn _.mapKeys(snakeObj, function (value, key) {\n\t\treturn _.camelCase(key);\n\t});\n}", "function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snakeCaseToCamelCase(s) {\n return s.toLowerCase().replace(/(\\_\\w)/g, function(m) {return m[1].toUpperCase();});\n}", "function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function (letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function (letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function camelCase(name) { return name.replace(/-([a-z])/g,camelCase_replace); }", "function snake_case_to_camel_case(snake, lower_case_first_char, chars) {\n chars = chars || '_-';\n var _upper2ndchar = function (m) { return m[1].toUpperCase(); };\n var regex = new RegExp('[' + chars + ']([a-zA-Z])', 'g');\n var camel = snake.replace(regex, _upper2ndchar);\n camel.replace('_', '');\n if (lower_case_first_char) {\n camel = camel[0].toLowerCase() + camel.substr(1);\n }\n return camel;\n}", "function snakeCase(str) {\n return str.replace(/(?:([a-z])([A-Z]))|(?:((?!^)[A-Z])([a-z]))/g, \"$1_$3$2$4\").toLowerCase();\n}", "function camelCase() {\n utilitymanager_1.um.utilityManager({\n utilType: utilitymanager_1.um.TIXUtilityType.utInTransform,\n sp: utilitymanager_1.um.TIXSelPolicy.Word,\n pat: /\\b(_*\\w)/g, repl: function (_match, p1) { return p1.toLowerCase(); },\n });\n }", "function camelCase(name){return name.charAt(0).toUpperCase()+name.slice(1).replace(/-(\\w)/g,function(m,n){return n.toUpperCase();});}", "function fcamelCase(all,letter){return letter.toUpperCase();}// Convert dashed to camelCase; used by the css and data modules", "function camelCase(string) {\n return string.replace(rmsPrefix, \"ms-\").replace(rdashAlpha, fcamelCase);\n }", "function camelCase(string) {\n return string.replace(rmsPrefix, \"ms-\").replace(rdashAlpha, fcamelCase);\n }", "function camelCase(string) {\n return string.replace(rmsPrefix, \"ms-\").replace(rdashAlpha, fcamelCase);\n }", "function camelCase(string) {\n return string.replace(rmsPrefix, \"ms-\").replace(rdashAlpha, fcamelCase);\n }", "function camelCase(string) {\n return string.replace(rmsPrefix, \"ms-\").replace(rdashAlpha, fcamelCase);\n }", "function camelCase(string) {\n return string.replace(rmsPrefix, \"ms-\").replace(rdashAlpha, fcamelCase);\n }", "function camelCase(string) {\n return string.replace(rmsPrefix, \"ms-\").replace(rdashAlpha, fcamelCase);\n }", "function camelCase(string) {\n return string.replace(rmsPrefix, \"ms-\").replace(rdashAlpha, fcamelCase);\n }", "function camelCase( string ) {\n \treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n }", "function camelCase(string) {\n\t\treturn string.replace(rmsPrefix, \"ms-\").replace(rdashAlpha, fcamelCase);\n\t}", "function camelCase(string) {\n\t\treturn string.replace(rmsPrefix, \"ms-\").replace(rdashAlpha, fcamelCase);\n\t}", "function camelCase(name){return name.replace(SPECIAL_CHARS_REGEXP,function(_,separator,letter,offset){return offset?letter.toUpperCase():letter;}).replace(MOZ_HACK_REGEXP,'Moz$1');}", "function snakeToCamel(str) {\n return str.toLowerCase().replace(/_[a-z]/g, (letter) => `${letter.slice(1).toUpperCase()}`);\n}", "function camelCase(name) {\n\t return name.\n\t replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {\n\t return offset ? letter.toUpperCase() : letter;\n\t }).\n\t replace(MOZ_HACK_REGEXP, 'Moz$1');\n\t}", "function camelCase( string ) {\n return string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n }", "function snakeCase(str = '') {\n return str.replace(/([a-z])([A-Z])/g, \"$1_$2\") // get all lowercase letters that are near to uppercase ones\n .replace(/([A-Z])([A-Z])/g, '$1_$2')\n .replace(/\\s+/g, '_') // replace all spaces to low dash\n .toLowerCase(); // convert to lower case\n}", "function camelCase(name) {\n return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n }).replace(MOZ_HACK_REGEXP, 'Moz$1');\n }", "function camelCase(name) {\n\t\treturn name.\n\t\treplace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {\n\t\t\treturn offset ? letter.toUpperCase() : letter;\n\t\t}).\n\t\treplace(MOZ_HACK_REGEXP, 'Moz$1');\n\t}", "function camelCase() {\n function onProcessStyle(style) {\n if (Array.isArray(style)) {\n // Handle rules like @font-face, which can have multiple styles in an array\n for (var index = 0; index < style.length; index++) {\n style[index] = convertCase(style[index]);\n }\n\n return style;\n }\n\n return convertCase(style);\n }\n\n function onChangeValue(value, prop, rule) {\n if (prop.indexOf('--') === 0) {\n return value;\n }\n\n var hyphenatedProp = hyphenate_style_name(prop); // There was no camel case in place\n\n if (prop === hyphenatedProp) return value;\n rule.prop(hyphenatedProp, value); // Core will ignore that property value we set the proper one above.\n\n return null;\n }\n\n return {\n onProcessStyle: onProcessStyle,\n onChangeValue: onChangeValue\n };\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}", "function camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}" ]
[ "0.7714091", "0.7710414", "0.77022845", "0.76754946", "0.7601108", "0.757924", "0.757924", "0.755669", "0.755669", "0.755669", "0.755669", "0.755669", "0.755669", "0.755669", "0.755669", "0.755669", "0.755669", "0.75446856", "0.7523777", "0.7523777", "0.7523777", "0.7523777", "0.7523777", "0.7523777", "0.7523777", "0.7523777", "0.7523777", "0.7523777", "0.7523777", "0.7523777", "0.7523777", "0.7523777", "0.7523777", "0.7523777", "0.7523777", "0.7523777", "0.7523777", "0.75225866", "0.748019", "0.748019", "0.748019", "0.748019", "0.748019", "0.748019", "0.748019", "0.748019", "0.748019", "0.74641716", "0.74043024", "0.74043024", "0.73984724", "0.72867954", "0.72530204", "0.7250405", "0.72205293", "0.72124606", "0.7198177", "0.7198177", "0.7198177", "0.7198177", "0.7198177", "0.7198177", "0.7198177", "0.7198177", "0.7167898", "0.7166482", "0.7166482", "0.71595466", "0.7123745", "0.709672", "0.7070243", "0.7066577", "0.7052864", "0.7029687", "0.70274943", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085", "0.70235085" ]
0.0
-1
Provider for private $$jqLite service
function $$jqLiteProvider() { this.$get = function $$jqLite() { return extend(JQLite, { hasClass: function(node, classes) { if (node.attr) node = node[0]; return jqLiteHasClass(node, classes); }, addClass: function(node, classes) { if (node.attr) node = node[0]; return jqLiteAddClass(node, classes); }, removeClass: function(node, classes) { if (node.attr) node = node[0]; return jqLiteRemoveClass(node, classes); } }); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $$jqLiteProvider() {\n\t\tthis.$get = function $$jqLite() {\n\t\t\treturn extend(JQLite, {\n\t\t\t\thasClass: function(node, classes) {\n\t\t\t\t\tif (node.attr) node = node[0];\n\t\t\t\t\treturn jqLiteHasClass(node, classes);\n\t\t\t\t},\n\t\t\t\taddClass: function(node, classes) {\n\t\t\t\t\tif (node.attr) node = node[0];\n\t\t\t\t\treturn jqLiteAddClass(node, classes);\n\t\t\t\t},\n\t\t\t\tremoveClass: function(node, classes) {\n\t\t\t\t\tif (node.attr) node = node[0];\n\t\t\t\t\treturn jqLiteRemoveClass(node, classes);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t}", "function $$jqLiteProvider() {\n\t this.$get = function $$jqLite() {\n\t return extend(JQLite, {\n\t hasClass: function(node, classes) {\n\t if (node.attr) node = node[0];\n\t return jqLiteHasClass(node, classes);\n\t },\n\t addClass: function(node, classes) {\n\t if (node.attr) node = node[0];\n\t return jqLiteAddClass(node, classes);\n\t },\n\t removeClass: function(node, classes) {\n\t if (node.attr) node = node[0];\n\t return jqLiteRemoveClass(node, classes);\n\t }\n\t });\n\t };\n\t}", "function $$jqLiteProvider() {\n\t this.$get = function $$jqLite() {\n\t return extend(JQLite, {\n\t hasClass: function(node, classes) {\n\t if (node.attr) node = node[0];\n\t return jqLiteHasClass(node, classes);\n\t },\n\t addClass: function(node, classes) {\n\t if (node.attr) node = node[0];\n\t return jqLiteAddClass(node, classes);\n\t },\n\t removeClass: function(node, classes) {\n\t if (node.attr) node = node[0];\n\t return jqLiteRemoveClass(node, classes);\n\t }\n\t });\n\t };\n\t}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function (node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function (node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function (node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n }", "function $$jqLiteProvider() { // 3601\n this.$get = function $$jqLite() { // 3602\n return extend(JQLite, { // 3603\n hasClass: function(node, classes) { // 3604\n if (node.attr) node = node[0]; // 3605\n return jqLiteHasClass(node, classes); // 3606\n }, // 3607\n addClass: function(node, classes) { // 3608\n if (node.attr) node = node[0]; // 3609\n return jqLiteAddClass(node, classes); // 3610\n }, // 3611\n removeClass: function(node, classes) { // 3612\n if (node.attr) node = node[0]; // 3613\n return jqLiteRemoveClass(node, classes); // 3614\n } // 3615\n }); // 3616\n }; // 3617\n} // 3618", "function $$jqLiteProvider(){this.$get=function $$jqLite(){return extend(JQLite,{hasClass:function hasClass(node,classes){if(node.attr)node=node[0];return jqLiteHasClass(node,classes);},addClass:function addClass(node,classes){if(node.attr)node=node[0];return jqLiteAddClass(node,classes);},removeClass:function removeClass(node,classes){if(node.attr)node=node[0];return jqLiteRemoveClass(node,classes);}});};}", "function $$jqLiteProvider(){this.$get=function $$jqLite(){return extend(JQLite,{hasClass:function hasClass(node,classes){if(node.attr)node=node[0];return jqLiteHasClass(node,classes);},addClass:function addClass(node,classes){if(node.attr)node=node[0];return jqLiteAddClass(node,classes);},removeClass:function removeClass(node,classes){if(node.attr)node=node[0];return jqLiteRemoveClass(node,classes);}});};}", "function setJQuery$2(jq) {\n $$3 = jq;\n dataTable$3 = jq.fn.dataTable;\n }", "function gotjQ(){try{var jq=!!jQuery}catch(err){var jq=!1}return jq}", "function setJQuery(jq) {\n $$1 = jq;\n dataTable$1 = jq.fn.DataTable;\n }", "function setJQuery$1(jq) {\n $$2 = jq;\n dataTable$2 = jq.fn.dataTable;\n }", "function django$($sel) {\n if (typeof window.grp === \"undefined\") {\n return (0,_jquery_shim_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])($sel);\n }\n\n if (window.grp.jQuery.fn.init === _jquery_shim_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].fn.init) {\n return (0,_jquery_shim_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])($sel);\n }\n\n var $djangoSel = (0,_jquery_shim_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])($sel);\n\n if ($sel.prevObject) {\n $djangoSel.prevObject = django$($sel.prevObject);\n }\n\n return $djangoSel;\n}", "function $(arg)\n{\n\treturn new ZQuery(arg);\t\t\n}", "function JQLite(element) { // 2796\n if (element instanceof JQLite) { // 2797\n return element; // 2798\n } // 2799\n // 2800\n var argIsString; // 2801\n // 2802\n if (isString(element)) { // 2803\n element = trim(element); // 2804\n argIsString = true; // 2805\n } // 2806\n if (!(this instanceof JQLite)) { // 2807\n if (argIsString && element.charAt(0) != '<') { // 2808\n throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element');\n } // 2810\n return new JQLite(element); // 2811\n } // 2812\n // 2813\n if (argIsString) { // 2814\n jqLiteAddNodes(this, jqLiteParseHTML(element)); // 2815\n } else { // 2816\n jqLiteAddNodes(this, element); // 2817\n } // 2818\n} // 2819", "get __$() {\n return this._$;\n }", "function $(){\n\n }", "function $$(elem) {\n if (!(this instanceof $$)) {\n return new $$(elem);\n }else {\n this.elem = elem;\n }\n}", "function JQClass() {\n\t\t\t// All construction is actually done in the init method\n\t\t\tif (!initializing && this._init) {\n\t\t\t\tthis._init.apply(this, arguments);\n\t\t\t}\n\t\t}", "get $() {\n return this._$;\n }", "function JQClass() {\r\n\t\t\t// All construction is actually done in the init method\r\n\t\t\tif (!initializing && this._init) {\r\n\t\t\t\tthis._init.apply(this, arguments);\r\n\t\t\t}\r\n\t\t}", "get $(){\n var src = this._source;\n return src ? src._$ : undefined;\n }", "function jqOb(selector,refresh){\n\t\tif(!globOb[selector] || refresh){\n\t\t\t\tglobOb[selector] = $(selector);\n\t\t\t}\n\t\treturn \tglobOb[selector];\n\t}", "function createJQueryRestAdapter (){\n // use jQuery to contact the Jive server\n\n var ajaxPath = \"\"; // value replaced when template is rendered\n var osapi = $r(\"osapi\");\n\n var dataFilter = function(data, type) {\n return (type === 'json' && data) ? jQuery.trim(data.replace(/^throw [^;]*;/, '')) : data;\n };\n\n /**\n * @param options.method {String} one of \"GET\", \"PUT\", \"POST\" or \"DELETE\"\n * @param options.endpoint {String} the short REST path, e.g.: \"users/1234?\"\n * @param options.queryParams {Object} map of query params to their values\n * @param options.body {String} body content to send with PUT or POST\n * @constructor\n */\n osapi.Request = function(options) {\n this.options = {\n method: options.method,\n endpoint: options.endpoint,\n ext: options.ext,\n v: options.v\n };\n if (isObjectWithProperties(options.queryParams)) {\n this.options.queryParams = options.queryParams\n }\n if (options.body != null) {\n this.options.body = options.body\n }\n };\n osapi.Request.prototype.execute = function(callback) {\n executeImpl.call(this, null, callback);\n };\n osapi.Request.prototype.executeAs = function(personURI, callback) {\n executeImpl.call(this, \"uri \" + personURI, callback);\n };\n function executeImpl(runAs, callback) {\n callback = callback || function(){};\n var endpoint = this.options.endpoint + buildQueryParams(this.options.queryParams);\n if (endpoint.charAt(0) == '/') {\n endpoint = endpoint.substring(1);\n }\n var path = this.options.ext\n ? \"ext/\" + this.options.ext + \"/\" + (this.options.version || this.options.v)\n : \"v3\";\n var url = [ajaxPath, \"api/core\", path, endpoint].join(\"/\");\n jQuery.ajax({\n url: url,\n type: this.options.method,\n contentType: this.options.body == null ? $u : \"application/json; charset=utf-8\",\n data: this.options.body == null ? $u : this.options.body,\n dataType: \"json\",\n dataFilter: dataFilter,\n beforeSend: function(req) {\n if (runAs != null) {\n req.setRequestHeader(\"X-Jive-Run-As\", runAs);\n }\n },\n success: function(data, textStatus, jqXHR) {\n if(data === null) {\n data = { status : jqXHR.status };\n }\n callback(interceptData(data));\n },\n error: function(xhr) {\n callback(buildErr(500, xhr.status, \"An error occurred while contacting the server\"));\n }\n });\n }\n\n /**\n * Object that may contain several Request objects to be executed in a\n * single REST call.\n * @constructor\n */\n osapi.BatchRequest = function() {\n this._requests = [];\n };\n osapi.BatchRequest.prototype.add = function(key, request) {\n if (this._requests == null) {\n throw \"BatchRequest is no longer valid\";\n }\n this._requests.push({\n key: key,\n request: request.options\n });\n };\n osapi.BatchRequest.prototype.execute = function(callback) {\n executeBatchImpl.call(this, null, callback);\n };\n osapi.BatchRequest.prototype.executeAs = function(personURI, callback) {\n executeBatchImpl.call(this, \"uri \" + personURI, callback);\n };\n function executeBatchImpl(runAs, callback) {\n if (this._requests == null) {\n throw \"BatchRequest is no longer valid\";\n }\n var req = this._requests;\n this._requests = null;\n callback = callback || function(){};\n if (req.length == 0) {\n callback({});\n return;\n }\n var url = [ajaxPath, \"api/core/v3/executeBatch\"].join(\"/\");\n jQuery.ajax({\n url: url,\n type: \"POST\",\n contentType: \"application/json; charset=utf-8\",\n data: JSON.stringify(req),\n dataType: \"json\",\n dataFilter: dataFilter,\n beforeSend: function(req) {\n if (runAs != null) {\n req.setRequestHeader(\"X-Jive-Run-As\", runAs);\n }\n },\n success: function(res) {\n var data = {}, i;\n for (i = 0; i < res.length; i++) {\n if (res[i].data) {\n data[res[i].id] = interceptData(res[i].data);\n } else if (res[i].error) {\n data[res[i].id] = buildErr(res[i].error.code || 500, res[i].status || 500, res[i].error.message);\n }\n }\n for (i = 0; i < req.length; i++) {\n if (!(data.hasOwnProperty(req[i].id) && data[req[i].id])) {\n data[req[i].id] = buildErr(500, 500, \"No data was returned from the server\");\n }\n }\n callback(data);\n },\n error: function(xhr) {\n var res = {};\n try {\n res = JSON.parse(xhr.responseText) || {};\n } catch (e) { /* don't care */ }\n var data = {};\n var err = buildErr(res.code || 500, xhr.status, res.message || \"An error occurred while contacting the server\");\n for (var i = 0; i < req.length; i++) {\n data[req[i].key] = err;\n }\n callback(data);\n }\n });\n }\n\n /**\n * Creates a new, empty BatchRequest\n * @return {osapi.BatchRequest}\n */\n osapi.newBatch = function() {\n return new osapi.BatchRequest();\n };\n\n function buildErr(code, status, msg) {\n return {\n error: {\n code: code,\n status: status,\n message: msg\n }\n };\n }\n\n function buildRequest(method, hasBody, options) {\n var o = {\n method: method,\n endpoint: options.href,\n queryParams: options.params\n };\n if (hasBody) {\n o.body = options.body == null ? \"\" : JSON.stringify(options.body);\n }\n if (options.ext) {\n o.ext = options.ext;\n o.v = options.v;\n }\n return new osapi.Request(o);\n }\n\n $r(\"osapi.jive.core\", function() { return {\n \"get\": function(options) {\n return buildRequest(\"GET\", false, options);\n },\n \"post\": function(options) {\n return buildRequest(\"POST\", true, options);\n },\n \"put\": function(options) {\n return buildRequest(\"PUT\", true, options);\n },\n \"delete\": function(options) {\n return buildRequest(\"DELETE\", false, options);\n }\n }});\n\n osapi.jive.core[\"get\"]._intercepted = true;\n osapi.jive.core[\"put\"]._intercepted = true;\n osapi.jive.core[\"post\"]._intercepted = true;\n osapi.jive.core[\"delete\"]._intercepted = true;\n\n initIntercept = bootstrapRest;\n }", "function export_jqmdp($this, dpId){\n\t\tif ($this == null) throw new Error(NULL_OBJ_ERROR);\n\t\tif (!($this instanceof jQuery)) $this = $($this);\n\t\tif ($this[0] == window) throw new Error(WINDOW_OBJ_ERROR);\n\t\tvar $e = (dpId == null) ? $this : byId($this, dpId);\n\t\tif ($e == null) return null;\n\t\treturn $.extend($e, jqmdp_fn);\n\t}", "function subJQuery() {\n var tQuery = function (selector, context, namespace) {\n return new tQuery.prototype.init(selector, context, namespace || (this && this.namespace));\n };\n _.merge(tQuery, jQuery);\n // Do not like\n // probably needed in some special unique cases\n tQuery.jQuery = jQuery;\n // expose events for doing special events as required.\n tQuery.event = (jQuery).event;\n tQuery.fn = tQuery.prototype = extend({\n }, jQuery.fn);\n tQuery.fn.constructor = tQuery;\n tQuery.fn.init = function init(selector, context, namespace) {\n var ioDom = context instanceof tQuery;\n if(context && context instanceof jQuery && !(ioDom)) {\n context = tQuery(context);\n }\n var result = jQuery.fn.init.call(this, selector, context, tQueryRoot);\n if(namespace) {\n result.namespace = namespace;\n } else if(ioDom) {\n result.namespace = context.namespace;\n }\n return result;\n };\n tQuery.fn.init.prototype = tQuery.fn;\n var tQueryRoot = tQuery(document);\n // remove all not applicable methods off of fn.\n each(jQueryFnMethodBlackList, function (x) {\n if(tQuery.fn[x]) {\n tQuery.fn[x] = null;\n delete tQuery.fn[x];\n }\n });\n _.each([\n 'on', \n 'one', \n 'off'\n ], function (x) {\n tQuery.fn[x] = _.wrap(tQuery.fn[x], function (f) {\n var args = [];\n for (var _i = 0; _i < (arguments.length - 1); _i++) {\n args[_i] = arguments[_i + 1];\n }\n true && log.debug(format('tQuery[{0}]: Binding ' + x + ' events...', this.namespace));\n args[0] = normalizeEvents(args[0], this.namespace);\n return f.apply(this, args);\n });\n });\n tQuery.fn.query = tQuery.fn.$ = tQuery.fn.find;\n return tQuery;\n }", "function jQueryStub() {\n return this;\n}", "function setJqueryMap () {\n var\n $container = stateMap.$container;\n\n jqueryMap = {\n $container : $container,\n $list_box : $container.find( '.spa-todo-list-box' ),\n $form : $container.find( '.spa-todo-addtask-form' ),\n $input : $container.find( '.spa-todo-addtask-in input[type=text]')\n };\n }", "function createExtenderJQuery(params) {\n return createExtender(Object.assing({}, {\n declarations: [\n \"https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/types/sizzle/index.d.ts\",\n \"https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/types/jquery/JQuery.d.ts\",\n \"https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/types/jquery/JQueryStatic.d.ts\",\n \"https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/types/jquery/misc.d.ts\",\n \"https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/types/jquery/legacy.d.ts\",\n \"https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/types/jqueryui/index.d.ts\"\n ]\n }, params));\n}", "function $$() {\n // getting the query.\n var o = arguments.length == 1 && arguments[0].jquery != null ? arguments[0] : $.apply($, arguments);\n $A$(o, null);\n return o;\n}", "function jfactory(name, factoryFn) {\n return provider(name, {$get: factoryFn});\n}", "function $o(){}", "function django$($sel) {\n if (typeof window.grp === \"undefined\") {\n return $($sel);\n }\n if (window.grp.jQuery.fn.init === $.fn.init) {\n return $($sel);\n }\n const $djangoSel = $($sel);\n if ($sel.prevObject) {\n $djangoSel.prevObject = django$($sel.prevObject);\n }\n return $djangoSel;\n}", "static _jQueryInterface(config) {\n return this.each(function() {\n let $element = $(this);\n let data = $element.data(DATA_KEY);\n\n if (!data) {\n data = new Checkbox($element, config);\n $element.data(DATA_KEY, data);\n }\n });\n }", "setJqueryMap() {\n var $container = this.stateMap.$container;\n\n this.jqueryMap = {\n $container : $container,\n $menubar : $container.find('.spa-shell-menubar'),\n $imagelist : $container.find('.spa-shell-imagelist'),\n // $toolbox : $container.find('.spa-shell-toolbox'),\n $footer : $container.find('.spa-shell-footer')\n };\n }", "constructor($q, $http) {\n\t\tthis._$q = $q;\n\t\tthis.$http = $http;\n\t}", "function $(t,e){this.x=e,this.q=t}", "function fixReferences() {\n this.$ = this.jQuery = window.jQuery;\n }", "makeQueryData () {\n\t\treturn {\n\t\t\tpluginIDE: this.pluginName,\n\t\t\tpluginVersion: this.pluginVersion\n\t\t};\n\t}", "function getContext(){\n if (usePortalForContext()) {\n return top.jQuery;\n }\n else {\n return jq;\n }\n}", "function Adapter() {}", "function $(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if(\"object\"===typeof Reflect&&\"function\"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o}", "function __$(id){\n return document.getElementById(id);\n}", "$(selector) { \n\t\treturn this.$el.querySelector(selector);\n\t}", "noConflict(all){\n window.$ = compat;\n if(all){\n window.SmallQuery = compatSQ;\n }\n return SmallQuery.SQ;\n }", "get instanciable()\n {\n if(this._cache_instanciable) return this._cache_instanciable;\n return this._cache_instanciable = $$(this,_instanceOf);\n }", "function _$(id){return document.getElementById( id );}", "getElem(jqOrElem) {\n if (jqOrElem instanceof $) {\n return jqOrElem[0];\n } else {\n return jqOrElem;\n }\n }", "function $3gi(){\n var json$=new $3gi.$$;XMLHttpRequestResponseType(\"json\",json$);\n return json$;\n}", "function updateJQuery($) {\n if (!$ || ($ && $.bridget)) {\n return;\n }\n $.bridget = jQueryBridget;\n }", "function JQLitePatchJQueryRemove(name, dispatchThis) {\n var originalJqFn = jQuery.fn[name];\n originalJqFn = originalJqFn.$original || originalJqFn;\n removePatch.$original = originalJqFn;\n jQuery.fn[name] = removePatch;\n\n function removePatch() {\n var list = [this],\n fireEvent = dispatchThis,\n set, setIndex, setLength,\n element, childIndex, childLength, children,\n fns, events;\n\n while(list.length) {\n set = list.shift();\n for(setIndex = 0, setLength = set.length; setIndex < setLength; setIndex++) {\n element = jqLite(set[setIndex]);\n if (fireEvent) {\n events = element.data('events');\n if ( (fns = events && events.$destroy) ) {\n forEach(fns, function(fn){\n fn.handler();\n });\n }\n } else {\n fireEvent = !fireEvent;\n }\n for(childIndex = 0, childLength = (children = element.children()).length;\n childIndex < childLength;\n childIndex++) {\n list.push(jQuery(children[childIndex]));\n }\n }\n }\n return originalJqFn.apply(this, arguments);\n }\n}", "function SomewhatDummyPouchPlugin(PouchDB) {\n\n function SomewhatDummyPouchAdapter(opts,callback) {\n var api = this;\n\n api._close = function SomewhatDummyPouchAdapterClose(callback) {\n if (callback) {\n callback(null,null);\n } else {\n return Promise.resolve();\n }\n };\n api._info = function SomewhatDummyPouchAdapterInfo(callback) {\n if (callback) {\n callback(null,{dummy:true});\n } else {\n return Promise.resolve({dummy:true});\n }\n };\n\n if (callback) {\n callback(null,api);\n } else {\n return Promise.resolve(api);\n }\n }\n\n SomewhatDummyPouchAdapter.valid = function SomwehatDummyPouchAdapterValid() { return true; };\n\n PouchDB.adapter('somewhatdummy', SomewhatDummyPouchAdapter, false);\n}", "function updateJQuery($) {\n if (!$ || ($ && $.bridget)) {\n return;\n }\n $.bridget = jQueryBridget;\n }", "function SelectorCache( $scope ) {\n\t\tthis.collection = {};\n\t\tthis.$scope = $scope;\n\t}", "function ue(e,t,n,o,r,i){const a=new e.Query({},{},e,e.collection);i=e.$handleCallbackError(i),n=n instanceof s?n.toObject():H.clone(n);return ce(o,r=\"function\"==typeof r?r:H.clone(r),P(e,\"schema.options.versionKey\",null)),a[t](n,o,r,i)}", "function jqLitePatchJQueryRemove(name, dispatchThis, filterElems, getterIfNoArguments) {\n var originalJqFn = jQuery.fn[name];\n originalJqFn = originalJqFn.$original || originalJqFn;\n removePatch.$original = originalJqFn;\n jQuery.fn[name] = removePatch;\n\n function removePatch(param) {\n // jshint -W040\n var list = filterElems && param ? [this.filter(param)] : [this],\n fireEvent = dispatchThis,\n set, setIndex, setLength,\n element, childIndex, childLength, children;\n\n if (!getterIfNoArguments || param != null) {\n while(list.length) {\n set = list.shift();\n for(setIndex = 0, setLength = set.length; setIndex < setLength; setIndex++) {\n element = jqLite(set[setIndex]);\n if (fireEvent) {\n element.triggerHandler('$destroy');\n } else {\n fireEvent = !fireEvent;\n }\n for(childIndex = 0, childLength = (children = element.children()).length;\n childIndex < childLength;\n childIndex++) {\n list.push(jQuery(children[childIndex]));\n }\n }\n }\n }\n return originalJqFn.apply(this, arguments);\n }\n}", "function jqLitePatchJQueryRemove(name, dispatchThis, filterElems, getterIfNoArguments) {\n var originalJqFn = jQuery.fn[name];\n originalJqFn = originalJqFn.$original || originalJqFn;\n removePatch.$original = originalJqFn;\n jQuery.fn[name] = removePatch;\n\n function removePatch(param) {\n // jshint -W040\n var list = filterElems && param ? [this.filter(param)] : [this],\n fireEvent = dispatchThis,\n set, setIndex, setLength,\n element, childIndex, childLength, children;\n\n if (!getterIfNoArguments || param != null) {\n while(list.length) {\n set = list.shift();\n for(setIndex = 0, setLength = set.length; setIndex < setLength; setIndex++) {\n element = jqLite(set[setIndex]);\n if (fireEvent) {\n element.triggerHandler('$destroy');\n } else {\n fireEvent = !fireEvent;\n }\n for(childIndex = 0, childLength = (children = element.children()).length;\n childIndex < childLength;\n childIndex++) {\n list.push(jQuery(children[childIndex]));\n }\n }\n }\n }\n return originalJqFn.apply(this, arguments);\n }\n}", "function jqLitePatchJQueryRemove(name, dispatchThis, filterElems, getterIfNoArguments) {\n var originalJqFn = jQuery.fn[name];\n originalJqFn = originalJqFn.$original || originalJqFn;\n removePatch.$original = originalJqFn;\n jQuery.fn[name] = removePatch;\n\n function removePatch(param) {\n // jshint -W040\n var list = filterElems && param ? [this.filter(param)] : [this],\n fireEvent = dispatchThis,\n set, setIndex, setLength,\n element, childIndex, childLength, children;\n\n if (!getterIfNoArguments || param != null) {\n while(list.length) {\n set = list.shift();\n for(setIndex = 0, setLength = set.length; setIndex < setLength; setIndex++) {\n element = jqLite(set[setIndex]);\n if (fireEvent) {\n element.triggerHandler('$destroy');\n } else {\n fireEvent = !fireEvent;\n }\n for(childIndex = 0, childLength = (children = element.children()).length;\n childIndex < childLength;\n childIndex++) {\n list.push(jQuery(children[childIndex]));\n }\n }\n }\n }\n return originalJqFn.apply(this, arguments);\n }\n}", "function jqLitePatchJQueryRemove(name, dispatchThis, filterElems, getterIfNoArguments) {\n var originalJqFn = jQuery.fn[name];\n originalJqFn = originalJqFn.$original || originalJqFn;\n removePatch.$original = originalJqFn;\n jQuery.fn[name] = removePatch;\n\n function removePatch(param) {\n // jshint -W040\n var list = filterElems && param ? [this.filter(param)] : [this],\n fireEvent = dispatchThis,\n set, setIndex, setLength,\n element, childIndex, childLength, children;\n\n if (!getterIfNoArguments || param != null) {\n while(list.length) {\n set = list.shift();\n for(setIndex = 0, setLength = set.length; setIndex < setLength; setIndex++) {\n element = jqLite(set[setIndex]);\n if (fireEvent) {\n element.triggerHandler('$destroy');\n } else {\n fireEvent = !fireEvent;\n }\n for(childIndex = 0, childLength = (children = element.children()).length;\n childIndex < childLength;\n childIndex++) {\n list.push(jQuery(children[childIndex]));\n }\n }\n }\n }\n return originalJqFn.apply(this, arguments);\n }\n}", "function jqLitePatchJQueryRemove(name, dispatchThis, filterElems, getterIfNoArguments) {\n var originalJqFn = jQuery.fn[name];\n originalJqFn = originalJqFn.$original || originalJqFn;\n removePatch.$original = originalJqFn;\n jQuery.fn[name] = removePatch;\n\n function removePatch(param) {\n // jshint -W040\n var list = filterElems && param ? [this.filter(param)] : [this],\n fireEvent = dispatchThis,\n set, setIndex, setLength,\n element, childIndex, childLength, children;\n\n if (!getterIfNoArguments || param != null) {\n while(list.length) {\n set = list.shift();\n for(setIndex = 0, setLength = set.length; setIndex < setLength; setIndex++) {\n element = jqLite(set[setIndex]);\n if (fireEvent) {\n element.triggerHandler('$destroy');\n } else {\n fireEvent = !fireEvent;\n }\n for(childIndex = 0, childLength = (children = element.children()).length;\n childIndex < childLength;\n childIndex++) {\n list.push(jQuery(children[childIndex]));\n }\n }\n }\n }\n return originalJqFn.apply(this, arguments);\n }\n}", "function jqLitePatchJQueryRemove(name, dispatchThis, filterElems, getterIfNoArguments) {\n var originalJqFn = jQuery.fn[name];\n originalJqFn = originalJqFn.$original || originalJqFn;\n removePatch.$original = originalJqFn;\n jQuery.fn[name] = removePatch;\n\n function removePatch(param) {\n // jshint -W040\n var list = filterElems && param ? [this.filter(param)] : [this],\n fireEvent = dispatchThis,\n set, setIndex, setLength,\n element, childIndex, childLength, children;\n\n if (!getterIfNoArguments || param != null) {\n while(list.length) {\n set = list.shift();\n for(setIndex = 0, setLength = set.length; setIndex < setLength; setIndex++) {\n element = jqLite(set[setIndex]);\n if (fireEvent) {\n element.triggerHandler('$destroy');\n } else {\n fireEvent = !fireEvent;\n }\n for(childIndex = 0, childLength = (children = element.children()).length;\n childIndex < childLength;\n childIndex++) {\n list.push(jQuery(children[childIndex]));\n }\n }\n }\n }\n return originalJqFn.apply(this, arguments);\n }\n}", "function JQLitePatchJQueryRemove(name, dispatchThis) {\n var originalJqFn = jQuery.fn[name];\n originalJqFn = originalJqFn.$original || originalJqFn;\n removePatch.$original = originalJqFn;\n jQuery.fn[name] = removePatch;\n\n function removePatch() {\n var list = [this],\n fireEvent = dispatchThis,\n set, setIndex, setLength,\n element, childIndex, childLength, children,\n fns, data;\n\n while(list.length) {\n set = list.shift();\n for(setIndex = 0, setLength = set.length; setIndex < setLength; setIndex++) {\n element = jqLite(set[setIndex]);\n if (fireEvent) {\n data = element.data('events');\n if ( (fns = data && data.$destroy) ) {\n forEach(fns, function(fn){\n fn.handler();\n });\n }\n } else {\n fireEvent = !fireEvent;\n }\n for(childIndex = 0, childLength = (children = element.children()).length;\n childIndex < childLength;\n childIndex++) {\n list.push(jQuery(children[childIndex]));\n }\n }\n }\n return originalJqFn.apply(this, arguments);\n }\n}", "function JQLitePatchJQueryRemove(name, dispatchThis) {\n var originalJqFn = jQuery.fn[name];\n originalJqFn = originalJqFn.$original || originalJqFn;\n removePatch.$original = originalJqFn;\n jQuery.fn[name] = removePatch;\n\n function removePatch() {\n var list = [this],\n fireEvent = dispatchThis,\n set, setIndex, setLength,\n element, childIndex, childLength, children,\n fns, data;\n\n while(list.length) {\n set = list.shift();\n for(setIndex = 0, setLength = set.length; setIndex < setLength; setIndex++) {\n element = jqLite(set[setIndex]);\n if (fireEvent) {\n data = element.data('events');\n if ( (fns = data && data.$destroy) ) {\n forEach(fns, function(fn){\n fn.handler();\n });\n }\n } else {\n fireEvent = !fireEvent;\n }\n for(childIndex = 0, childLength = (children = element.children()).length;\n childIndex < childLength;\n childIndex++) {\n list.push(jQuery(children[childIndex]));\n }\n }\n }\n return originalJqFn.apply(this, arguments);\n }\n}", "function _DefineJqueryPlugins(){\r\n\t\r\n\t\tfunction __define(){\r\n\t\t\r\n\t\t\t_jQueryDetected = typeof window.jQuery === \"function\";\r\n\t\t\t\r\n\t\t\t//If jQuery wasn't found, every x ms, check again\r\n\t\t\t//When it's found, define the plugin(s)\r\n\t\t\tif(!_jQueryDetected){\r\n\t\t\t\twindow.setTimeout(__define, _Config.jQueryCheckTimeout *= 1.01);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\r\n\t\t\tjQuery.fn.extend({\r\n\t\t\t\tappendTemplates: function(){\r\n\r\n\t\t\t\t\tvar args = Array.prototype.slice.call(arguments);\r\n\r\n\t\t\t\t\tfor(var i=0,l=args.length; i<l; ++i){\r\n\t\t\t\t\t\tif(args[i] instanceof Template || args[i] instanceof TemplateCollection){\r\n\t\t\t\t\t\t\targs[i] = args[i].Node;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn this.append(args);\r\n\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t/*\r\n\t\t\tvar __append = jQuery.fn.append;\r\n\r\n\t\t\tjQuery.fn.append = function(){\r\n\r\n\t\t\t\tvar args = Array.prototype.slice.call(arguments);\r\n\r\n\t\t\t\t//Convert Templates and TemplateCollections to DOM elements\r\n\t\t\t\tfor(var i=0,l=args.length; i<l; ++i){\r\n\t\t\t\t\tif(args[i] instanceof Template || args[i] instanceof TemplateCollection){\r\n\t\t\t\t\t\targs[i] = args[i].Element;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn __append.apply(this, args);\r\n\r\n\t\t\t};\r\n\t\t\t*/\r\n\t\t\t\r\n\t\t};\r\n\t\r\n\t\t__define();\r\n\t\t\r\n\t}", "function jQuery(arg1, arg2) {}", "function $(element) {\n return new Hquery(element);//new Query(element);\n}", "function jQuerify() {\n if (typeof jQuery == 'undefined') {\n var s = document.createElement('script');\n s.setAttribute('src','http://code.jquery.com/jquery.js');\n document.getElementsByTagName('body')[0].appendChild(s);\n }\n}", "get searchBar() { return $('[name=\"q\"]') }", "function $$(id) { return document.getElementById(id); }", "_getJQueryElement()\n {\n return $(this.$el.find('#workflowjob-settings')[0])[0];\n }", "function OfficeService($q) {\n this.$q = $q;\n }", "function _interface () {\n\ttry {\n\t\t_jqr ['ui'] = {};\n\t\t_jqr ['ui']['sections'] = {};\n\t\ts = {name: 'Profile', div: '_profile', state:'on', more:{}};\n\t\t_jqr ['ui']['sections']['_profile'] = s;\n\t\ts = {name: 'Skills', div: '_skills', state:'on', more:{}};\n\t\t_jqr ['ui']['sections']['_skills'] = s;\n\t\ts = {name: 'Employment', div: '_employment', state:'on', more:{}};\n\t\t_jqr ['ui']['sections']['_employment'] = s;\n\t\ts = {name: 'Recommendations', div: '_recommendations', state:'on', more:{}};\n\t\t_jqr ['ui']['sections']['_recommendations'] = s;\n\t\ts = {name: 'Examples', div: '_examples', state:'on', more:{}};\n\t\t_jqr ['ui']['sections']['_examples'] = s;\n\t\ts = {name: 'Education', div: '_education', state:'on', more:{}};\n\t\t_jqr ['ui']['sections']['_education'] = s;\n\t\t//_title_toggle ('_education', false);\n\t\t//_title_toggle ('_examples', false);\n\t\t_title_toggle ('_recommendations', false);\n\t\t//_title_toggle ('_employment', false);\n\t\t//_title_toggle ('_skills', false);\n\t\t//_title_toggle ('_profile', false);\n\t\t$( \"._title_toggle\" ).click (function(){\n\t\t\ttry{\n\t\t\t\t_title_toggle ($(this).attr ('title'), true);\n\t\t\t}catch (err){\n\t\t\t\t//alert (err);\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t\t////////////////////////////////\n\t\tvar show_menu = false;\n\t\tif (show_menu){\n\t\t\t_jqr_css ($('#_jqr_a'), 'float', 'right');\n\t\t\t_jqr_css ($('#_jqr_b'), 'float', 'left');\n\t\t\t_jqr_css ($('#_jqr_b'), 'width', '20%');\n\t\t\t_jqr_css ($('#_jqr_a'), 'width', '75%');\n\t\t\t_jqr_css ($('#_jqr_b'), 'padding-top', '25px');\n\t\t\t$('#_jqr_b').show ();\n\t\t}else{\n\t\t\t_jqr_css ($('#_jqr_a'), 'float', 'left');\n\t\t\t_jqr_css ($('#_jqr_a'), 'width', '100%');\n\t\t\t$('#_jqr_b').hide ();\n\t\t}\n\t\t//_ui_buttons ();\n\t}catch (err){\n\t\talert ( '_interface\\n\\n'+err);\n\t}\n}" ]
[ "0.7766932", "0.7652262", "0.7652262", "0.7559215", "0.7539176", "0.74515456", "0.74515456", "0.6145816", "0.6014965", "0.5985696", "0.59837425", "0.56979644", "0.56369364", "0.5543092", "0.5484032", "0.54460794", "0.54453903", "0.54295963", "0.5397168", "0.53922856", "0.5386123", "0.53689927", "0.53337795", "0.53325754", "0.53223187", "0.5290027", "0.5287532", "0.52658427", "0.5238201", "0.5179647", "0.51793206", "0.51753694", "0.51107615", "0.50947875", "0.50940937", "0.506098", "0.5060369", "0.50527173", "0.5048701", "0.50436", "0.5042181", "0.49816987", "0.49778956", "0.49694926", "0.49610424", "0.49560422", "0.49525675", "0.49276623", "0.49276087", "0.49049306", "0.48980165", "0.48937193", "0.48901588", "0.48853442", "0.48837975", "0.48837975", "0.48837975", "0.48837975", "0.48837975", "0.48837975", "0.48763183", "0.48763183", "0.48752385", "0.48689574", "0.48466787", "0.48275122", "0.48260257", "0.48237103", "0.48224095", "0.48221835", "0.48148263" ]
0.73663604
30
HashMap which can use objects as keys
function HashMap(array, isolatedUid) { if (isolatedUid) { var uid = 0; this.nextUid = function() { return ++uid; }; } forEach(array, this.put, this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function HashMap(obj)\n{\n this.length = 0;\n this.items = {};\n for (var p in obj) {\n if (obj.hasOwnProperty(p)) {\n this.items[p] = obj[p];\n this.length++;\n }\n }\n\n\t/**\n\tPut an item in the hash tablle\n\t**/\n HashMap.prototype.put = function(key, value)\n {\n var previous = undefined;\n if (this.hasItem(key)) {\n previous = this.items[key];\n }\n else {\n this.length++;\n }\n this.items[key] = value;\n\t\tvar ky = this.hasItem(key) ? this.items[key] : undefined;\n return previous;\n }\n\n\t/**\n\tGet an item from the hash table.\n\t**/\n HashMap.prototype.get = function(key) {\n\t\tvar itm = this.items[key];\n var ky = this.hasItem(key) ? this.items[key] : undefined;\n\t return ky;\n }\n\n\t/**\n\tCheck if hash has item allready.\n\t**/\n HashMap.prototype.hasItem = function(key)\n {\n return this.items.hasOwnProperty(key);\n }\n \n /**\n Remove an item from the table.\n **/\n HashMap.prototype.remove = function(key)\n {\n if (this.hasItem(key)) {\n previous = this.items[key];\n this.length--;\n delete this.items[key];\n return previous;\n }\n else {\n return undefined;\n }\n }\n\n\t/**\n\tReturn the keys in an array.\n\t**/\n HashMap.prototype.keys = function()\n {\n var keys = [];\n for (var k in this.items) {\n if (this.hasItem(k)) {\n keys.push(k);\n }\n }\n return keys;\n }\n\n\t/**\n\tReturn the values in an array.\n\t**/\n HashMap.prototype.values = function()\n {\n var values = [];\n for (var k in this.items) {\n if (this.hasItem(k)) {\n values.push(this.items[k]);\n }\n }\n return values;\n }\n\n\t/**\n\tEach function allows the object to be used in a for each loop.\n\t**/\n HashMap.prototype.each = function(fn) {\n for (var k in this.items) {\n if (this.hasItem(k)) {\n fn(k, this.items[k]);\n }\n }\n }\n\n\t/**\n\tClears the contents of the HashMap table.\n\t**/\n HashMap.prototype.clear = function()\n {\n this.items = {}\n this.length = 0;\n }\n}//##############################################################", "function createIdMap(obj) {\n return new Map(generatePairs(obj));\n}", "function makeMap(objects, expectedKey){\n var myMap = new Map();\n\n // objects.keys().forEach(function(key){\n // myMap.set(objects[key][expectedKey], objects[key]);\n // })\n\n for (var key in objects){\n myMap.set(objects[key][expectedKey], objects[key]);\n }\n\n return myMap;\n}", "function RowHashMap() {}", "function RowHashMap() {}", "function HashMap(){\n return {\n get: function(k){\n return this.store[k];\n },\n set: function(k, v){\n this.store[k] = v;\n return this;\n },\n has: function(k){\n return this.store[k] !== undefined;\n },\n delete: function(k){\n if(this.store[k] !== undefined){\n delete this.store[k];\n return true;\n }\n return false;\n },\n entries: function(){\n var entries = [];\n for(key in this.store){\n entries.push([key, this.store[key]]);\n }\n return entries;\n },\n forEach: function(callback, thisArg){\n for(key in this.store){\n if(thisArg !== undefined){\n thisArg.callback(key, this.store[key]);\n }else{\n callback(key, this.store[key]);\n }\n }\n },\n keys: function(){\n var keys = [];\n for(key in this.store){\n keys.push(key);\n }\n return keys;\n },\n values: function(){\n var values = [];\n for(key in this.store){\n values.push(this.store[key]);\n }\n return values;\n },\n\n store: {}\n };\n }", "function toHashMap(obj, noConvert) {\n var hash = cljs.core.PersistentHashMap.EMPTY;\n _.each(obj, function(value, key) {\n if(!noConvert) {\n key = toKeyword(key);\n }\n hash = cljs.core.assoc(hash, key, value);\n });\n\n return hash;\n }", "function toLookupObject(o, key) {\n o[key] = 1\n return o\n}", "function ObjectMap ()\n\t{\n\t\t\n\t\t/**\n\t\t * Key value pairs\n\t\t * \n\t\t * @type {array of objects}\n\t\t */\n\t\tthis._keyValuePairs = [];\n\t}", "function HashMap() {\n var size = 0;\n var entry = new Object();\n\n this.put = function (key, value) {\n entry[key] = value;\n size++;\n };\n\n this.putAll = function (map) {\n if (typeof map == \"object\" && !map.sort) {\n for (var key in map) {\n this.put(key, map[key]);\n }\n } else {\n throw \"输入类型不正确,必须是HashMap类型!\";\n }\n };\n\n this.get = function (key) {\n return entry[key];\n };\n\n this.remove = function (key) {\n if (size == 0)\n return;\n delete entry[key];\n size--;\n };\n\n this.containsKey = function (key) {\n if (entry[key]) {\n return true;\n }\n return false;\n };\n\n this.containsValue = function (value) {\n for (var key in entry) {\n if (entry[key] == value) {\n return true;\n }\n }\n return false;\n };\n\n this.clear = function () {\n entry = new Object();\n size = 0;\n };\n\n this.isEmpty = function () {\n return size == 0;\n };\n\n this.size = function () {\n return size;\n };\n\n this.keySet = function () {\n var keys = new Array();\n for (var key in entry) {\n keys.push(key);\n }\n return keys;\n };\n\n this.entrySet = function () {\n var entrys = new Array();\n for (var key in entry) {\n var et = new Object();\n et[key] = entry[key];\n entrys.push(et);\n }\n return entrys;\n };\n\n this.values = function () {\n var values = new Array();\n for (var key in entry) {\n values.push(entry[key]);\n }\n return values;\n };\n\n this.each = function (cb) {\n for (var key in entry) {\n cb.call(this, key, entry[key]);\n }\n };\n\n this.toString = function () {\n return obj2str(entry);\n };\n\n function obj2str2(o) {\n var r = [];\n if (typeof o == \"string\")\n return \"\\\"\" + o.replace(/([\\'\\\"\\\\])/g, \"\\\\$1\").replace(/(\\n)/g, \"\\\\n\").replace(/(\\r)/g, \"\\\\r\").replace(/(\\t)/g, \"\\\\t\") + \"\\\"\";\n if (typeof o == \"object\") {\n for (var i in o)\n r.push(\"\\\"\" + i + \"\\\":\" + obj2str2(o[i]));\n if (!!document.all && !/^\\n?function\\s*toString\\(\\)\\s*\\{\\n?\\s*\\[native code\\]\\n?\\s*\\}\\n?\\s*$/.test(o.toString)) {\n r.push(\"toString:\" + o.toString.toString());\n }\n r = \"{\" + r.join() + \"}\";\n return r;\n }\n return o.toString();\n }\n}", "function HashMap(array,isolatedUid){if(isolatedUid){var uid=0;this.nextUid=function(){return++uid;};}forEach(array,this.put,this);}", "function HashMap(cap){\n this.cap = cap;\n this.hash = [];\n for(let i = 0; i < cap; i++){\n this.hash.push([]);\n }\n HashMap.prototype.add = function(key, val){\n index = mod(key.hashCode(), cap);\n var kvp_arr = this.hash[index];\n var key_exists = false;\n for(var i = 0; i < kvp_arr.length ; i++){\n var kvp = kvp_arr[i];\n if(kvp[0] == key){\n kvp[1] = val;\n key_exists = true;\n }\n }\n if( key_exists == false){\n kvp_arr.push([key,val])\n }\n }\n}", "function simpleHash (items, key) {\n var itemhash = {};\n var i = 0;\n for (var o in items) {\n var x = items[o][key];\n itemhash[x]=i;\n i = i + 1;\n }\n return itemhash;\n}", "function toMap(obj){\n var hm = new HashMap()\n for(k in obj){\n hm.put(k, toJava(obj[k]));\n }\n return hm;\n}", "objectify(key,value){\n \t return {\n [key]: value\n }\n }", "function objKey(nId, strTitle, boolIsCommon)\n{\n\tthis.id = nId;\n\tthis.title = strTitle;\n\tthis.isCommon = boolIsCommon\n}", "function main() {\n const lotr = new HashMap();\n lotr.MAX_LOAD_RATIO = 0.5;\n lotr.SIZE_RATIO = 3;\n\n lotr.set('Hobbit', 'Bilbo');\n lotr.set('Hobbit', 'Frodo');\n lotr.set('Wizard', 'Gandolf');\n lotr.set('Human', 'Aragorn');\n lotr.set('Elf', 'Legolas');\n lotr.set('Maiar', 'The Necromancer');\n lotr.set('Maiar', 'Sauron');\n lotr.set('RingBearer', 'Gollum');\n lotr.set('LadyOfLight', 'Galadriel');\n lotr.set('HalfElven', 'Arwen');\n lotr.set('Ent', 'Treebeard');\n console.log(lotr);\n console.log('Maiar key:', lotr.get('Maiar'));\n console.log('Hobbit key:', lotr.get('Hobbit'));\n\n return lotr;\n}", "function MyHash() {\n this.current = 0;\n this.keys = new Array();\n this.values = {};\n}", "function EneterHashMap()\r\n{\r\n var myLength = 0;\r\n var myItems = {};\r\n\r\n this.put = function(key, value)\r\n {\r\n if (!this.containsKey(key))\r\n {\r\n ++myLength;\r\n }\r\n myItems[key] = value;\r\n }\r\n\r\n this.get = function(key)\r\n {\r\n return this.containsKey(key) ? myItems[key] : null;\r\n }\r\n\r\n this.containsKey = function(key)\r\n {\r\n return myItems.hasOwnProperty(key);\r\n }\r\n \r\n this.remove = function(key)\r\n {\r\n if (this.containsKey(key))\r\n {\r\n var aRemovedItem = this.items[key];\r\n --myLength;\r\n \r\n delete myItems[key];\r\n \r\n return aRemovedItem;\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n this.keys = function()\r\n {\r\n var aKeys = [];\r\n for (var k in myItems)\r\n {\r\n if (this.containsKey(k))\r\n {\r\n aKeys.push(k);\r\n }\r\n }\r\n return aKeys;\r\n }\r\n\r\n this.values = function()\r\n {\r\n var aValues = [];\r\n for (var k in myItems)\r\n {\r\n if (this.containsKey(k))\r\n {\r\n aValues.push(myItems[k]);\r\n }\r\n }\r\n return aValues;\r\n }\r\n\r\n this.clear = function()\r\n {\r\n myItems = {}\r\n myLength = 0;\r\n }\r\n}", "function HashMap(array, isolatedUid) {\n\t if (isolatedUid) {\n\t var uid = 0;\n\t this.nextUid = function() {\n\t return ++uid;\n\t };\n\t }\n\t forEach(array, this.put, this);\n\t}", "function HashMap(array, isolatedUid) {\n if (isolatedUid) {\n var uid = 0;\n this.nextUid = function () {\n return ++uid;\n };\n }\n forEach(array, this.put, this);\n }", "function keyValueObject(key, value)\r\n{\r\n\tthis.key = key;\r\n\tthis.value = value;\r\n}", "function HashMap(array, isolatedUid) { // 3655\n if (isolatedUid) { // 3656\n var uid = 0; // 3657\n this.nextUid = function() { // 3658\n return ++uid; // 3659\n }; // 3660\n } // 3661\n forEach(array, this.put, this); // 3662\n} // 3663", "function makeKey() {\n var countryObjects = new Object();\n for (var i = 0; i < keys.length; i++) {\n var parsedCount = keys[i].split(\":\");\n if (direction == 1) {\n //direction of 1 meaning country:key\n countryObjects[parsedCount[0]] = parsedCount[1];\n } else {\n countryObjects[parsedCount[1]] = parsedCount[0];\n }\n }\n\n if (typeof countryId != \"undefined\") {\n return countryObjects[countryId];\n }\n\n return countryObjects;\n }", "function HashMap(array){\n forEach(array, this.put, this);\n}", "function HashMap(array){\n forEach(array, this.put, this);\n}", "function HashMap(array){\n forEach(array, this.put, this);\n}", "function HashMap(array){\n forEach(array, this.put, this);\n}", "function HashMap(array){\n forEach(array, this.put, this);\n}", "static from(schema, obj, ctx) {\n const { keepUndefined, replacer } = ctx;\n const map = new this(schema);\n const add = (key, value) => {\n if (typeof replacer === 'function')\n value = replacer.call(obj, key, value);\n else if (Array.isArray(replacer) && !replacer.includes(key))\n return;\n if (value !== undefined || keepUndefined)\n map.items.push(Pair.createPair(key, value, ctx));\n };\n if (obj instanceof Map) {\n for (const [key, value] of obj)\n add(key, value);\n }\n else if (obj && typeof obj === 'object') {\n for (const key of Object.keys(obj))\n add(key, obj[key]);\n }\n if (typeof schema.sortMapEntries === 'function') {\n map.items.sort(schema.sortMapEntries);\n }\n return map;\n }", "function getLabelMap() {\n var labelDictionary = {};\n for (const label in orig_labels) {\n labelDictionary[label] = {};\n\n for (var index = 0; index < orig_labels[label].length; index++) {\n var objProperty = orig_labels[label][index];\n labelDictionary[label][index + 1] = objProperty;\n }\n }\n return labelDictionary;\n}", "function _index(objects) {\n var index = {};\n for (var i=0; i < objects.length; i++) {\n var n = objects[i];\n n.uuid = \"a\" + uuid();\n index[n.id] = n;\n }\n return index;\n }", "for(ref, id) {\n const memo = keyed.get(ref) || keyed.set(ref, new MapSet);\n return memo.get(id) || memo.set(id, fixed(createCache$1()));\n }", "function getEntityNameKeyMap(structure) {\n const result = {};\n for (const kk in structure) {\n const vv = structure[kk];\n if (typeof vv === 'string') {\n if (types.isMap(vv)) {\n const info = types.getTypeInfo(vv);\n const entityName = info.entity;\n\n if (_entityNameType[entityName]) throw new Error(`Duplicate entity ${entityName}`);\n _entityNameType[entityName] = vv;\n\n result[entityName] = kk;\n delete structure[kk];\n }\n }\n }\n return result;\n }", "function Map() {\n var keys = [], values = [];\n\n return {\n contains: function (key) {\n var at = keys.indexOf(key);\n return at > -1;\n },\n get: function (key) {\n var at = keys.indexOf(key);\n if (at >= 0) {\n return values[at];\n }\n },\n put: function (key, value) {\n var at = keys.indexOf(key);\n if (at < 0) {\n at = keys.length;\n }\n keys[at] = key;\n values[at] = value;\n },\n remove: function (key) {\n var at = keys.indexOf(key);\n if (at >= 0) {\n keys.splice(at, 1);\n values.splice(at, 1);\n }\n }\n }\n}", "function Map(){\n\n\tthis.elements = new Array();\n\t\n\tthis.size = function(){\n\t\treturn this.elements.length;\n\t}\n\t\n\tthis.isEmpty = function(){\n\t\treturn (this.elements.length < 1);\n\t}\n\t\n\tthis.clear = function(){\n\t\tthis.elements = new Array();\n\t}\n\t\n\tthis.put = function(_key, _value){\n\t\tthis.remove(_key);\n\t\tthis.elements.push({key: _key, value: _value});\n\t}\n\t\n\tthis.remove = function(_key){\n\t\ttry {\n\t\t\tfor (i = 0; i < this.elements.length; i++) {\n\t\t\t\tif (this.elements[i].key == _key) {\n\t\t\t\t\tthis.elements.splice(i, 1);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}\n\t\n\tthis.get = function(_key){\n\t\ttry {\n\t\t\tfor (i = 0; i < this.elements.length; i++) {\n\t\t\t\tif (this.elements[i].key == _key) { return this.elements[i].value; }\n\t\t\t}\n\t\t} catch (e) {\n\t\t\treturn null;\n\t\t}\n\t}\n\t\n\tthis.element = function(_index){\n\t\tif (_index < 0 || _index >= this.elements.length) { return null; }\n\t\treturn this.elements[_index];\n\t}\n\t\n\tthis.containsKey = function(_key){\n\t\ttry {\n\t\t\tfor (i = 0; i < this.elements.length; i++) {\n\t\t\t\tif (this.elements[i].key == _key) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}\n\t\n\tthis.values = function(){\n\t\tvar arr = new Array();\n\t\tfor (i = 0; i < this.elements.length; i++) {\n\t\t\tarr.push(this.elements[i].value);\n\t\t}\n\t\treturn arr;\n\t}\n\t\n\tthis.keys = function(){\n\t\tvar arr = new Array();\n\t\tfor (i = 0; i < this.elements.length; i++) {\n\t\t\tarr.push(this.elements[i].key);\n\t\t}\n\t\treturn arr;\n\t}\n}", "function Map(){\r\n\r\n\tthis.elements = new Array();\r\n\t\r\n\tthis.size = function(){\r\n\t\treturn this.elements.length;\r\n\t};\r\n\t\r\n\tthis.isEmpty = function(){\r\n\t\treturn (this.elements.length < 1);\r\n\t};\r\n\t\r\n\tthis.clear = function(){\r\n\t\tthis.elements = new Array();\r\n\t};\r\n\t\r\n\tthis.put = function(_key, _value){\r\n\t\tthis.remove(_key);\r\n\t\tthis.elements.push({key: _key, value: _value});\r\n\t};\r\n\t\r\n\tthis.remove = function(_key){\r\n\t\ttry {\r\n\t\t\tfor (i = 0; i < this.elements.length; i++) {\r\n\t\t\t\tif (this.elements[i].key == _key) {\r\n\t\t\t\t\tthis.elements.splice(i, 1);\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\t\r\n\tthis.get = function(_key){\r\n\t\ttry {\r\n\t\t\tfor (i = 0; i < this.elements.length; i++) {\r\n\t\t\t\tif (this.elements[i].key == _key) { return this.elements[i].value; }\r\n\t\t\t}\r\n\t\t} catch (e) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t};\r\n\t\r\n\tthis.element = function(_index){\r\n\t\tif (_index < 0 || _index >= this.elements.length) { return null; }\r\n\t\treturn this.elements[_index];\r\n\t};\r\n\t\r\n\tthis.containsKey = function(_key){\r\n\t\ttry {\r\n\t\t\tfor (i = 0; i < this.elements.length; i++) {\r\n\t\t\t\tif (this.elements[i].key == _key) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\t\r\n\tthis.values = function(){\r\n\t\tvar arr = new Array();\r\n\t\tfor (i = 0; i < this.elements.length; i++) {\r\n\t\t\tarr.push(this.elements[i].value);\r\n\t\t}\r\n\t\treturn arr;\r\n\t};\r\n\t\r\n\tthis.keys = function(){\r\n\t\tvar arr = new Array();\r\n\t\tfor (i = 0; i < this.elements.length; i++) {\r\n\t\t\tarr.push(this.elements[i].key);\r\n\t\t}\r\n\t\treturn arr;\r\n\t};\r\n}", "insert(key, obj)\r\n {\r\n this.#table[int(this.#hash(key) & this.#divisor)].push(new HashEntry(key, obj));\r\n this.#count++;\r\n }", "function addKeyObjectsAndEvents() {\n\tfor (var i = 0; i < allDivs.length; i++) {\n\t\t\tvar newKey;\n\t\t\t\n\t\t\t\t\t if (types[i] == 'project') {\n\t\t\t\tnewKey = new ProjectKey(allDivs[i], slugs[i], rows[i], cols[i], keyBuffer, keyBuffer, zoomLevels)\n\t\t\t} else if (types[i] == 'category') {\n\t\t\t\tnewKey = new CategoryKey(allDivs[i], slugs[i], rows[i], cols[i], keyBuffer, keyBuffer, zoomLevels)\n\t\t\t} else if (types[i] == 'hidden') {\n\t\t\t\tnewKey = new HiddenKey(allDivs[i], slugs[i], rows[i], cols[i], keyBuffer, keyBuffer, zoomLevels)\n\t\t\t} else { //types[i] == 'blank'\n\t\t\t\tnewKey = new BlankKey(allDivs[i], slugs[i], rows[i], cols[i], keyBuffer, keyBuffer, zoomLevels)\n\t\t\t}\n\t\t\t\n\t\t\tallKeyObjects.push(newKey);\n\t\t\t\n\t\t\twindow.addEvent( 'keydown', function(e) {\n\t\t var evt = new Event(e);\n\t\t \tif(evt.key == this.toLowerCase()) {\n\t\t\t\t handleKeyPress(evt.key, (currentKey.letter == evt.key));\n\t\t \t}\n\t\t }.bind(allDivs[i].getProperty('id')));\n\t \t}\n}", "function storeSelectedKeysToMap(keyField, nmsp) {\r\n\tvar map = new Object();\r\n\tvar selectedObjects = nmsp.grid.getSelectedItems();\r\n\t$.each(selectedObjects, function (key, value) {\r\n\t\tvar pathId = value.objectPathId;\r\n\t\tvar key = $(value).attr(keyField);\r\n\t\tmap[key] = pathId;\r\n\t});\r\n\treturn map;\r\n}", "function HashMap(array, isolatedUid) {\n\t\tif (isolatedUid) {\n\t\t\tvar uid = 0;\n\t\t\tthis.nextUid = function() {\n\t\t\t\treturn ++uid;\n\t\t\t};\n\t\t}\n\t\tforEach(array, this.put, this);\n\t}", "function KeyValue() {}", "function KeyValue() {}", "function KeyValue() {}", "function myFunction(obj) {\n const ret = {};\n Object.keys(obj).forEach(key => {\n ret[obj[key]] = key;\n});\n return ret;\n}", "function getMapKey(value) {\n return value;\n}", "function getMapKey(value) {\n return value;\n}", "function getMapKey(value) {\n return value;\n}", "function getMapKey(value) {\n return value;\n}", "function getMapKey(value) {\n return value;\n}", "function getMapKey(value) {\n return value;\n}", "function getMapKey(value) {\n return value;\n}", "function getMapKey(value) {\n return value;\n}", "function getMapKey(value) {\n return value;\n}", "function getMapKey(value) {\n return value;\n}", "function functions(obj) {\n var key, result = new Iterable_1.XHashMap();\n for (key in obj) {\n if (typeof (obj[key]) === \"function\") {\n result.put(key, obj[key]);\n }\n }\n return result;\n}", "function h$Map() {\n this._pairsKeys = [];\n this._pairsValues = [];\n this._keys = [];\n this._size = 0;\n}", "function h$Map() {\n this._pairsKeys = [];\n this._pairsValues = [];\n this._keys = [];\n this._size = 0;\n}", "function h$Map() {\n this._pairsKeys = [];\n this._pairsValues = [];\n this._keys = [];\n this._size = 0;\n}", "function h$Map() {\n this._pairsKeys = [];\n this._pairsValues = [];\n this._keys = [];\n this._size = 0;\n}", "function KeyValue(){}", "function hashClasses() {\n for (i in classes) {\n nodeHash[classes[i].class] = classes[i]\n }\n for (i in relations) {\n relations[i].source = nodeHash[relations[i].source]\n relations[i].target = nodeHash[relations[i].target]\n }\n }", "function HashMap(array) {\n\t\tforEach(array, this.put, this);\n\t}", "put(key, value){\n /* WITHOUT SEPARATE CHAINING COLLISION HANDLING...\n var idx = this.hashFunction(key);\n console.log(idx + ' -> ' + key);\n this.table[idx] = value;\n */\n\n // WITH SEPARATE CHAINING...\n var position = this.hashFunction(key);\n\n if (this.table[position] == undefined){\n // if 1st element at the position (no collision yet) -> create a LL at that position...\n this.table[position] = new LinkedList();\n }\n // add the ValuePair instance to the LL using the LL-append method\n this.table[position].append(new ValuePair(key, value));\n\n\n }", "function taggedObject(obj, key) {\n var keys = objectKeys(obj);\n return keys.reduce(function (collection, k) {\n var _a;\n var inner = obj[k];\n collection[k] = __assign((_a = {}, _a[key] = k, _a), inner);\n return collection;\n }, {});\n}", "add(key, value) {\n let check = this.generalCheck(key);\n if (check.errMsg) return check;\n\n let hash = this.hashKeyFun(key);\n // console.log(hash);\n if (!this.map[hash]) {\n this.map[hash] = new LinkedList();\n }\n // console.log(this.map[hash]);\n let bucket = { [key]: value };\n this.map[hash].add(bucket);\n }", "function getHash(obj) {\n return objectHash(obj);\n }", "function FooKeys() {\n this.a = 1;\n this.b = 2;\n}", "function KeyValue() { }", "function KeyValue() { }", "function objToStrMap(obj) {\n let strMap = new Map();\n for (let k of Object.keys(obj)) {\n strMap.set(k, obj[k]);\n }\n return strMap;\n}", "function FakeHM(key){\n this.id = key?key:\"__AG__\"+(mapId++);\n this.containsKey = function(obj) {\n if(!obj)\n return false;\n return obj.hasOwnProperty(this.id);\n }\n this.put = function(obj, value) {\n if(!obj)\n return;\n obj[this.id] = value;\n }\n this.get = function(obj) {\n if(!obj)\n return;\n return obj[this.id];\n }\n this.remove = function(obj) {\n if(!obj)\n return;\n var ret = obj[this.id];\n delete obj[this.id];\n return ret;\n }\n this.size = function(){\n return 0;\n }\n this.clear = function(){\n }\n }", "set(key, value) {\n let index = this.hash(key);\n if (!this.keyMap[index]) {\n this.keyMap[index] = []; //[ , , ,[[ , ], [ , ]] , , ,]\n }\n this.keyMap[index].push([key, value]);\n }", "GetHashCode() {\n\n }" ]
[ "0.64886934", "0.6373294", "0.6243111", "0.6061329", "0.6061329", "0.6056442", "0.59866756", "0.5964041", "0.59105843", "0.5864004", "0.5854936", "0.5849777", "0.58458453", "0.57090086", "0.56927776", "0.567141", "0.5653496", "0.5610964", "0.5592916", "0.55725205", "0.55341214", "0.5523639", "0.551426", "0.54839283", "0.5467307", "0.5467307", "0.5467307", "0.5467307", "0.5467307", "0.54497516", "0.5436194", "0.54336566", "0.54268414", "0.5422038", "0.54177713", "0.540935", "0.5403151", "0.53875136", "0.5384122", "0.5380237", "0.5368354", "0.5366527", "0.5366527", "0.5366527", "0.53664076", "0.53604215", "0.53604215", "0.53604215", "0.53604215", "0.53604215", "0.53604215", "0.53604215", "0.53604215", "0.53604215", "0.53604215", "0.5356555", "0.5348958", "0.5348958", "0.5348958", "0.5348958", "0.5344125", "0.5338197", "0.5334093", "0.5294256", "0.52791786", "0.5275754", "0.52755183", "0.526044", "0.5249582", "0.5249582", "0.52493435", "0.5232248", "0.52274424", "0.5226589" ]
0.554264
45
Helper function to get first anchor from a NodeList (using `Arraysome()` instead of `angularforEach()` since it's more performant and working in all supported browsers.)
function getFirstAnchor(list) { var result = null; Array.prototype.some.call(list, function(element) { if (nodeName_(element) === 'a') { result = element; return true; } }); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFirstAnchor(list){var result=null;Array.prototype.some.call(list,function(element){if(nodeName_(element)==='a'){result=element;return true;}});return result;}", "function getFirstAnchor(list){var result=null;Array.prototype.some.call(list,function(element){if(nodeName_(element)==='a'){result=element;return true;}});return result;}", "function getFirstAnchor(list) { // 4726\n var result = null; // 4727\n Array.prototype.some.call(list, function(element) { // 4728\n if (nodeName_(element) === 'a') { // 4729\n result = element; // 4730\n return true; // 4731\n } // 4732\n }); // 4733\n return result; // 4734\n } // 4735", "function getFirstAnchor(list) {\n\t var result = null;\n\t Array.prototype.some.call(list, function(element) {\n\t if (nodeName_(element) === 'a') {\n\t result = element;\n\t return true;\n\t }\n\t });\n\t return result;\n\t }", "function getFirstAnchor(list) {\n\t var result = null;\n\t Array.prototype.some.call(list, function(element) {\n\t if (nodeName_(element) === 'a') {\n\t result = element;\n\t return true;\n\t }\n\t });\n\t return result;\n\t }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function (element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n\t\t\t\tvar result = null;\n\t\t\t\tArray.prototype.some.call(list, function(element) {\n\t\t\t\t\tif (nodeName_(element) === 'a') {\n\t\t\t\t\t\tresult = element;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn result;\n\t\t\t}", "function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && lowercase(element.nodeName) === 'a') result = element;\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && lowercase(element.nodeName) === 'a') result = element;\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && lowercase(element.nodeName) === 'a') result = element;\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && lowercase(element.nodeName) === 'a') result = element;\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && lowercase(element.nodeName) === 'a') result = element;\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && lowercase(element.nodeName) === 'a') result = element;\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && lowercase(element.nodeName) === 'a') result = element;\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && lowercase(element.nodeName) === 'a') result = element;\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && lowercase(element.nodeName) === 'a') result = element;\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && nodeName_(element) === 'a') result = element;\n });\n return result;\n }", "function getFirstAnchor(editor) {\n\t\tvar sel = document.getSelection();\n\t\tvar range = false;\n\t\tfor (var i = 0; i < sel.rangeCount; i++) {\n\t\t\trange = sel.getRangeAt(i);\n\t\t\tvar ancestor = range.commonAncestorContainer;\n\t\t\tif ($.contains(editor.get(0), ancestor) || editor.get(0) == ancestor)\n\t\t\t\tbreak;\n\t\t\trange = false;\n\t\t}\n\t\tif (!range)\n\t\t\treturn false;\n\t\tvar result = false;\n\t\t$(editor).find('a').each(function() {\n\t\t\tif (range.intersectsNode(this)) {\n\t\t\t\tresult = this;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\treturn result;\n\t}", "function getFirstMatchingEl(start, match_func)\n {\n function ssibs(n)\n {\n if (n)\n {\n if (match_func(n))\n return n;\n else\n return ssibs(nextSiblingEl(n));\n }\n return n;\n }\n\n function search(base)\n {\n var fchild = firstChildEl(base);\n var n = ssibs(fchild);\n if (!n)\n {\n var i = fchild;\n while (i && !(n=search(i)))\n i = nextSiblingEl(i);\n }\n return n;\n }\n\n return search(start);\n }", "function first(a, fn) {\n for (var i = 0, l = a.length; i < l; i++) {\n if (fn(a[i]))\n return a[i];\n }\n return;\n }", "function first(selector, context) {return (context || document).querySelector(selector);}", "function first(a, fn) {\n var i, l;\n for (i = 0, l = a.length; i < l; i++) {\n if (fn(a[i]))\n return a[i];\n }\n return;\n}", "function first(a){\n return (a[0]);\n }", "function findFirstFocusable(node) {\n const candidateSelectors = [\n 'input',\n 'select',\n 'a[href]',\n 'textarea',\n 'button',\n '[tabindex]'\n ].join(',');\n return node.querySelectorAll(candidateSelectors)[0];\n }", "function getFirstSelector(selector) {\n return document.querySelector(selector);\n}", "function getFirstBlockElement(rootNode) {\n return getFirstLastBlockElement(rootNode, true /*isFirst*/);\n}", "function getAnchorChildren(){\n let anchortag = document.querySelectorAll('a');\n for (let i = 0; i < anchortag.length; i++) {\n if(anchortag[i].getElementsByTagName('span').length == 1){\n console.log(anchortag[i].getElementsByTagName('span')[0].innerHTML)\n }\n }\n}", "function findFirst(predicate, array) {\n const pred = checkedPredicate('findFirst', predicate ? predicate : all);\n for (const el of array) {\n if (pred(el)) {\n return el;\n }\n }\n return null;\n }", "function first(a) { return (a instanceof Array) ? a[0] : a; }", "function getFirstVisiblePosition(el) {\r\n var firstVisibleTextChild = isTextNode(el) ? el : getFirstVisibleTextNode(el);\r\n var curDocument = findDocument(el);\r\n var range = curDocument.createRange();\r\n if (firstVisibleTextChild) {\r\n range.selectNodeContents(firstVisibleTextChild);\r\n return calculatePositionByNodeAndOffset(el, { node: firstVisibleTextChild, offset: range.startOffset });\r\n }\r\n return 0;\r\n }", "getAnchor(name) {\n const anchor = this.anchors.filter(function(anchor) {\n return anchor.name === name\n })\n if (anchor.length === 0) {\n return null\n } else {\n return anchor[0]\n }\n }", "function getFirstXPath(expr, node) {\r\n if (!node) node = document;\r\n var res = document.evaluate(expr, node, null,\r\n XPathResult.FIRST_ORDERED_NODE_TYPE, null);\r\n return res.singleNodeValue;\r\n}", "function getFirstInlineElement(rootNode) {\n // getFirstLeafNode can return null for empty container\n // do check null before passing on to get inline from the node\n var node = getLeafNode_1.getFirstLeafNode(rootNode);\n return node ? getInlineElementAtNode_1.default(rootNode, node) : null;\n}", "function getFirstChild(el){\n var firstChild = el.firstChild;\n while(firstChild != null && firstChild.nodeType == 3) {\n firstChild = firstChild.nextSibling;\n }\n return firstChild;\n}", "function findFirstNode (array) {\n let firstNode = [];\n array.forEach((e) => {\n let count = 0;\n let filteredArray = filterArr(e, array);\n filteredArray.forEach((p) => {\n if (p[1] === e[0]) {\n count++;\n }\n });\n if (count === 0) {\n firstNode = e;\n }\n });\n return firstNode;\n }", "function getFirstTag(parent, tag, predicate) {\n return findFirst(predicate, parent.getElementsByTagName(tag));\n }", "function get1stLinkWithURL(target, url, callback) {\r\n\t\tvar expr = url.replace(/\\//g,\"\\\\/\").replace(/\\./g,\"\\\\.\").replace(/\\?/g,\"\\\\?\").replace(/\\*/g,\".*\");\r\n\t\tre = new RegExp(\"^\"+expr+\"$\");\r\n\t\tvar a = target.getElementsByTagName(\"a\");\r\n\t\tfor (var i=0; i<a.length; i++) {\r\n\t\t\tvar node = a[i];\r\n\t\t\tif (node.hasAttribute(\"href\")) {\r\n\t\t\t\tvar m = node.getAttribute(\"href\").match(re);\r\n\t\t\t\tif (m) {\r\n\t\t\t\t\treturn (typeof(callback) == \"function\" ? callback(node, m) : node);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "first(func = (item) => item) {\n if (this.rootNode.length >= 1) {\n func(this.get(0), 0);\n return this.get(0);\n }\n return this;\n }", "first(func = (item) => item) {\n if (this.rootNode.length >= 1) {\n func(this.get(0), 0);\n return this.get(0);\n }\n return this;\n }", "function firstNode(source) {\n var node = null;\n if (source.firstChild.nodeName != \"#text\") {\n return source.firstChild;\n } else {\n source = source.firstChild;\n do {\n source = source.nextSibling;\n } while (source && source.nodeName == '#text');\n\n return source || null;\n }\n}", "function first(a, i) {\n\tif (i === undefined) { i = 0; }\n\treturn (a !== null && a.length > i) ? a[i] : null;\n}", "function findClosestLink( ele )\t{\n\t\twhile ( ele ) {\n\t\t\t// Look for the closest element with a nodeName of \"a\".\n\t\t\t// Note that we are checking if we have a valid nodeName\n\t\t\t// before attempting to access it. This is because the\n\t\t\t// node we get called with could have originated from within\n\t\t\t// an embedded SVG document where some symbol instance elements\n\t\t\t// don't have nodeName defined on them, or strings are of type\n\t\t\t// SVGAnimatedString.\n\t\t\tif ( ( typeof ele.nodeName === \"string\" ) && ele.nodeName.toLowerCase() === \"a\" ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tele = ele.parentNode;\n\t\t}\n\t\treturn ele;\n\t}", "function queryFrom(el) {\n if (!el) {\n return null;\n }\n if (el.assignedSlot) {\n el = el.assignedSlot;\n }\n const rootNode = getRootNode(el);\n const found = rootNode.querySelector(selector);\n const host = getHost(rootNode);\n return found ? found : host ? queryFrom(host) : null;\n }", "function findClosestLink( ele )\n\t{\n\t\twhile ( ele ) {\n\t\t\t// Look for the closest element with a nodeName of \"a\".\n\t\t\t// Note that we are checking if we have a valid nodeName\n\t\t\t// before attempting to access it. This is because the\n\t\t\t// node we get called with could have originated from within\n\t\t\t// an embedded SVG document where some symbol instance elements\n\t\t\t// don't have nodeName defined on them, or strings are of type\n\t\t\t// SVGAnimatedString.\n\t\t\tif ( ( typeof ele.nodeName === \"string\" ) && ele.nodeName.toLowerCase() === \"a\" ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tele = ele.parentNode;\n\t\t}\n\t\treturn ele;\n\t}", "function getAnchor(element) {\n if (!element) {\n return null;\n }\n\n var anchor = element.getAttribute('data-anchor');\n var elementIndex = index(element); //Slide without anchor link? We take the index instead.\n\n if (anchor == null) {\n anchor = elementIndex;\n }\n\n return anchor;\n }", "function xpathFirst(query, node) {\n if (!node) {\n\t\tnode = document;\n }\n\n var result = document.evaluate(query, node, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null );\n\n if (!result) {\n\t\treturn;\n }\n\n return result.singleNodeValue;\n}", "function getAnchor(element){\n var anchor = element.data('anchor');\n var index = element.index();\n\n //Slide without anchor link? We take the index instead.\n if(typeof anchor === 'undefined'){\n anchor = index;\n }\n\n return anchor;\n }", "function getAnchor(element){\n var anchor = element.data('anchor');\n var index = element.index();\n\n //Slide without anchor link? We take the index instead.\n if(typeof anchor === 'undefined'){\n anchor = index;\n }\n\n return anchor;\n }", "function getAnchor(element){\n var anchor = element.data('anchor');\n var index = element.index();\n\n //Slide without anchor link? We take the index instead.\n if(typeof anchor === 'undefined'){\n anchor = index;\n }\n\n return anchor;\n }", "function getAnchor(element){\n var anchor = element.data('anchor');\n var index = element.index();\n\n //Slide without anchor link? We take the index instead.\n if(typeof anchor === 'undefined'){\n anchor = index;\n }\n\n return anchor;\n }", "function firstListItem() {\n return $('ul li:first-child')\n}", "function getAnchor(element){\r\n var anchor = element.data('anchor');\r\n var index = element.index();\r\n\r\n //Slide without anchor link? We take the index instead.\r\n if(typeof anchor === 'undefined'){\r\n anchor = index;\r\n }\r\n\r\n return anchor;\r\n }", "function getAnchor(element){\r\n var anchor = element.data('anchor');\r\n var index = element.index();\r\n\r\n //Slide without anchor link? We take the index instead.\r\n if(typeof anchor === 'undefined'){\r\n anchor = index;\r\n }\r\n\r\n return anchor;\r\n }", "function getAnchor(element){\r\n var anchor = element.data('anchor');\r\n var index = element.index();\r\n\r\n //Slide without anchor link? We take the index instead.\r\n if(typeof anchor === 'undefined'){\r\n anchor = index;\r\n }\r\n\r\n return anchor;\r\n }", "first(returnNode) {\n let node = this[this._start][this._next];\n return returnNode ? node : node.data;\n }", "function scrollToAnchorID(){\n const anchors = document.querySelectorAll('a');\n const anchorsArr = Array.from(anchors);\n\n anchorsArr.forEach((el, i) => {\n el.addEventListener('click', event => {\n console.log(el);\n if(el.firstChild.nodeValue == \"Home\"){\n window.scrollTo(0,0);\n } else{\n el.href = '#section' + i;\n }\n });\n });\n}", "function getFirstElement(array) {\n\t// EDGE CASE\n\t// if the array's length is equal to zero\n\tif (array.length === 0) {\n\t\t// then return undefined\n\t\treturn undefined;\n\t}\n\t// iterate through the array\n\tfor (let i = 0; i < array.length; i++) {\n\t\t// return array at index of 0\n\t\treturn array[0];\n\t}\n}", "function getAnchor(element) {\n var anchor = element.data('anchor');\n var index = element.index();\n\n //Slide without anchor link? We take the index instead.\n if (typeof anchor === 'undefined') {\n anchor = index;\n }\n\n return anchor;\n }", "function findFirstFocusableElement(element) {\n if (isFocusable(element)) {\n return element;\n }\n\n var children = element.children;\n var length = children.length;\n var child;\n var focusableDescendant;\n\n for (var i = 0; i < length; i += 1) {\n child = children[i];\n\n focusableDescendant = findFirstFocusableElement(child);\n\n if (focusableDescendant) {\n return focusableDescendant;\n }\n }\n\n return null;\n }", "function getFirstXPathResult(expr){\r\n var node = (arguments[1])? arguments[1]: document;\r\n var res = document.evaluate(expr, node, null,\r\n XPathResult.FIRST_ORDERED_NODE_TYPE, null);\r\n return res.singleNodeValue;\r\n}", "function getEl(a) {\r\n const selection = document.querySelector('a');\r\n if (!selection) {\r\n console.log(`No existe ningún elemento con clase, id o tag llamado ${selection}`);\r\n } else {\r\n return selection;\r\n }\r\n}", "function xFirstChild(e,t)\r\n{\r\n e = xGetElementById(e);\r\n var c = e ? e.firstChild : null;\r\n while (c) {\r\n if (c.nodeType == 1 && (!t || c.nodeName.toLowerCase() == t.toLowerCase())){break;}\r\n c = c.nextSibling;\r\n }\r\n return c;\r\n}", "function getAnchorChildren() {\n var x = document.getElementsByTagName('a');\n //console.log(x);\n for(var i = 0; i < x.length; i++) {\n var y = x[i].firstElementChild;\n for (var j = 0; j < x[i].childElementCount; j++) {\n if (y.tagName === 'SPAN') {\n console.log(y.innerHTML);\n }\n }\n }\n}", "function firstTrue(array) {\n for (var element of array) {\n if (args[1](element)){\n return element;\n }\n }\n return undefined;\n }", "function BOT_first(list) {\r\n\tif(list.length>0) return list[0]\r\n\telse return (undefined);\r\n}", "function getAnchor(element){\n if(!element){\n return null;\n }\n var anchor = element.getAttribute('data-anchor');\n var elementIndex = index(element);\n\n //Slide without anchor link? We take the index instead.\n if(anchor == null){\n anchor = elementIndex;\n }\n\n return anchor;\n }", "function getAnchor(element){\n if(!element){\n return null;\n }\n var anchor = element.getAttribute('data-anchor');\n var elementIndex = index(element);\n\n //Slide without anchor link? We take the index instead.\n if(anchor == null){\n anchor = elementIndex;\n }\n\n return anchor;\n }", "function getAnchor(element){\n if(!element){\n return null;\n }\n var anchor = element.getAttribute('data-anchor');\n var elementIndex = index(element);\n\n //Slide without anchor link? We take the index instead.\n if(anchor == null){\n anchor = elementIndex;\n }\n\n return anchor;\n }", "function firstVisibleChild() {\n for (var i = 0; i < openMenuNode.children.length; ++i) {\n if (window.getComputedStyle(openMenuNode.children[i]).display !== 'none') {\n return openMenuNode.children[i];\n }\n }\n }", "function xpathFirst(p, c) { \r\n\t\treturn document.evaluate(p, c || document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;\r\n\t}", "function getFirstLastBlockElement(rootNode, isFirst) {\n var node = rootNode;\n do {\n node = node && (isFirst ? node.firstChild : node.lastChild);\n } while (node && node.firstChild);\n return node && getBlockElementAtNode_1.default(rootNode, node);\n}" ]
[ "0.8074974", "0.8074974", "0.79875964", "0.79025406", "0.79025406", "0.7894008", "0.7780491", "0.7762461", "0.7762461", "0.7762461", "0.7762461", "0.7762461", "0.7762461", "0.7762461", "0.7762461", "0.7762461", "0.776087", "0.6406035", "0.6292099", "0.5941218", "0.5932468", "0.5923678", "0.5875928", "0.58564913", "0.5767158", "0.57100624", "0.56649643", "0.5634261", "0.5613327", "0.559006", "0.5584577", "0.55792254", "0.5479296", "0.5451393", "0.5399561", "0.53424513", "0.53052425", "0.5300659", "0.5300659", "0.52913094", "0.52891076", "0.5285235", "0.5262736", "0.52561903", "0.5248257", "0.52478236", "0.52446973", "0.52446973", "0.52446973", "0.52446973", "0.5236623", "0.5225762", "0.5225762", "0.5225762", "0.52248377", "0.52086115", "0.52023876", "0.51926076", "0.5192159", "0.51837456", "0.5180126", "0.5177243", "0.5170215", "0.5153694", "0.51498723", "0.51481175", "0.51481175", "0.51481175", "0.5145865", "0.51392245", "0.51371795" ]
0.79404134
26
if any other type of options value besides an Object value is passed into the $animate.method() animation then this helper code will be run which will ignore it. While this patch is not the greatest solution to this, a lot of existing plugins depend on $animate to either call the callback (< 1.2) or return a promise that can be changed. This helper function ensures that the options are wiped clean incase a callback function is provided.
function prepareAnimateOptions(options) { return isObject(options) ? options : {}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prepareAnimateOptions(options){return isObject(options)?options:{};}", "function prepareAnimateOptions(options){return isObject(options)?options:{};}", "function prepareAnimateOptions(options) {\n return isObject(options) ? options : {};\n }", "function prepareAnimateOptions(options) {\n\t return isObject(options)\n\t ? options\n\t : {};\n\t}", "function prepareAnimateOptions(options) {\n\t return isObject(options)\n\t ? options\n\t : {};\n\t}", "function prepareAnimateOptions(options) { // 4868\n return isObject(options) // 4869\n ? options // 4870\n : {}; // 4871\n} // 4872", "function normalizeOptions(options) {\n if (typeof options == 'function') {\n options = { success: options };\n }\n return options;\n }", "function prepareOptions(options, callback) {\n\n // Checks if options variable is actually the callback function (for the case that no options were specified)\n if ($.isFunction(options)) {\n options = {callback: options};\n }\n\n // Add all default options\n options = $.extend({}, $.retinaApi.defaults, options);\n\n if ($.isFunction(callback)) {\n options.callback = callback;\n }\n\n return options;\n }", "function _normalizeArguments( effect, options, speed, callback ) {\n\n // short path for passing an effect options object:\n if ( $.isPlainObject( effect ) ) {\n return effect;\n }\n\n // convert to an object\n effect = { effect: effect };\n\n // catch (effect)\n if ( options === undefined ) {\n options = {};\n }\n\n // catch (effect, callback)\n if ( $.isFunction( options ) ) {\n callback = options;\n speed = null;\n options = {};\n }\n\n // catch (effect, speed, ?)\n if ( $.type( options ) === \"number\" || $.fx.speeds[ options ]) {\n callback = speed;\n speed = options;\n options = {};\n }\n\n // catch (effect, options, callback)\n if ( $.isFunction( speed ) ) {\n callback = speed;\n speed = null;\n }\n\n // add options to effect\n if ( options ) {\n $.extend( effect, options );\n }\n\n speed = speed || options.duration;\n effect.duration = $.fx.off ? 0 : typeof speed === \"number\"\n ? speed : speed in $.fx.speeds ? $.fx.speeds[ speed ] : $.fx.speeds._default;\n\n effect.complete = callback || options.complete;\n\n return effect;\n }", "function _normalizeArguments(effect, options, speed, callback) {\n // allow passing all options as the first parameter\n if ($.isPlainObject(effect)) {\n options = effect;\n effect = effect.effect;\n }\n // convert to an object\n effect = {\n effect: effect\n };\n // catch (effect, null, ...)\n if (options == null) {\n options = {};\n }\n // catch (effect, callback)\n if ($.isFunction(options)) {\n callback = options;\n speed = null;\n options = {};\n }\n // catch (effect, speed, ?)\n if (typeof options === \"number\" || $.fx.speeds[options]) {\n callback = speed;\n speed = options;\n options = {};\n }\n // catch (effect, options, callback)\n if ($.isFunction(speed)) {\n callback = speed;\n speed = null;\n }\n // add options to effect\n if (options) {\n $.extend(effect, options);\n }\n speed = speed || options.duration;\n effect.duration = $.fx.off ? 0 : typeof speed === \"number\" ? speed : speed in $.fx.speeds ? $.fx.speeds[speed] : $.fx.speeds._default;\n effect.complete = callback || options.complete;\n return effect;\n }", "function unwrapPromise() {\n $q.when($scope.options, function (options) {\n $scope.options = options;\n });\n }", "function _normalizeArguments(effect, options, speed, callback) {\n\n\t\t\t// allow passing all options as the first parameter\n\t\t\tif ($.isPlainObject(effect)) {\n\t\t\t\toptions = effect;\n\t\t\t\teffect = effect.effect;\n\t\t\t}\n\n\t\t\t// convert to an object\n\t\t\teffect = { effect: effect };\n\n\t\t\t// catch (effect, null, ...)\n\t\t\tif (options == null) {\n\t\t\t\toptions = {};\n\t\t\t}\n\n\t\t\t// catch (effect, callback)\n\t\t\tif ($.isFunction(options)) {\n\t\t\t\tcallback = options;\n\t\t\t\tspeed = null;\n\t\t\t\toptions = {};\n\t\t\t}\n\n\t\t\t// catch (effect, speed, ?)\n\t\t\tif (typeof options === \"number\" || $.fx.speeds[options]) {\n\t\t\t\tcallback = speed;\n\t\t\t\tspeed = options;\n\t\t\t\toptions = {};\n\t\t\t}\n\n\t\t\t// catch (effect, options, callback)\n\t\t\tif ($.isFunction(speed)) {\n\t\t\t\tcallback = speed;\n\t\t\t\tspeed = null;\n\t\t\t}\n\n\t\t\t// add options to effect\n\t\t\tif (options) {\n\t\t\t\t$.extend(effect, options);\n\t\t\t}\n\n\t\t\tspeed = speed || options.duration;\n\t\t\teffect.duration = $.fx.off ? 0 :\n\t\t\t\ttypeof speed === \"number\" ? speed :\n\t\t\t\t\tspeed in $.fx.speeds ? $.fx.speeds[speed] :\n\t\t\t\t\t\t$.fx.speeds._default;\n\n\t\t\teffect.complete = callback || options.complete;\n\n\t\t\treturn effect;\n\t\t}", "function _normalizeArguments( effect, options, speed, callback ) {\r\n\r\n // allow passing all options as the first parameter\r\n if ( $.isPlainObject( effect ) ) {\r\n options = effect;\r\n effect = effect.effect;\r\n }\r\n\r\n // convert to an object\r\n effect = { effect: effect };\r\n\r\n // catch (effect, null, ...)\r\n if ( options == null ) {\r\n options = {};\r\n }\r\n\r\n // catch (effect, callback)\r\n if ( $.isFunction( options ) ) {\r\n callback = options;\r\n speed = null;\r\n options = {};\r\n }\r\n\r\n // catch (effect, speed, ?)\r\n if ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\r\n callback = speed;\r\n speed = options;\r\n options = {};\r\n }\r\n\r\n // catch (effect, options, callback)\r\n if ( $.isFunction( speed ) ) {\r\n callback = speed;\r\n speed = null;\r\n }\r\n\r\n // add options to effect\r\n if ( options ) {\r\n $.extend( effect, options );\r\n }\r\n\r\n speed = speed || options.duration;\r\n effect.duration = $.fx.off ? 0 :\r\n typeof speed === \"number\" ? speed :\r\n speed in $.fx.speeds ? $.fx.speeds[ speed ] :\r\n $.fx.speeds._default;\r\n\r\n effect.complete = callback || options.complete;\r\n\r\n return effect;\r\n }", "function _normalizeArguments(effect,options,speed,callback){ // Allow passing all options as the first parameter\nif($.isPlainObject(effect)){options = effect;effect = effect.effect;} // Convert to an object\neffect = {effect:effect}; // Catch (effect, null, ...)\nif(options == null){options = {};} // Catch (effect, callback)\nif($.isFunction(options)){callback = options;speed = null;options = {};} // Catch (effect, speed, ?)\nif(typeof options === \"number\" || $.fx.speeds[options]){callback = speed;speed = options;options = {};} // Catch (effect, options, callback)\nif($.isFunction(speed)){callback = speed;speed = null;} // Add options to effect\nif(options){$.extend(effect,options);}speed = speed || options.duration;effect.duration = $.fx.off?0:typeof speed === \"number\"?speed:speed in $.fx.speeds?$.fx.speeds[speed]:$.fx.speeds._default;effect.complete = callback || options.complete;return effect;}", "applyOptions(options) {\n Object.assign(this[$options], options);\n // Re-evaluates clamping based on potentially new values for min/max\n // polar, azimuth and radius:\n this.setOrbit();\n // Prevent interpolation in the case that any target spherical values\n // changed (preserving OrbitalControls behavior):\n this[$spherical].copy(this[$targetSpherical]);\n }", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t\t// short path for passing an effect options object:\n\t\tif ( $.isPlainObject( effect ) ) {\n\t\t\t\treturn effect;\n\t\t}\n\n\t\t// convert to an object\n\t\teffect = { effect: effect };\n\n\t\t// catch (effect)\n\t\tif ( options === undefined ) {\n\t\t\t\toptions = {};\n\t\t}\n\n\t\t// catch (effect, callback)\n\t\tif ( $.isFunction( options ) ) {\n\t\t\t\tcallback = options;\n\t\t\t\tspeed = null;\n\t\t\t\toptions = {};\n\t\t}\n\n\t\t// catch (effect, speed, ?)\n\t\tif ( $.type( options ) === \"number\" || $.fx.speeds[ options ]) {\n\t\t\t\tcallback = speed;\n\t\t\t\tspeed = options;\n\t\t\t\toptions = {};\n\t\t}\n\n\t\t// catch (effect, options, callback)\n\t\tif ( $.isFunction( speed ) ) {\n\t\t\t\tcallback = speed;\n\t\t\t\tspeed = null;\n\t\t}\n\n\t\t// add options to effect\n\t\tif ( options ) {\n\t\t\t\t$.extend( effect, options );\n\t\t}\n\n\t\tspeed = speed || options.duration;\n\t\teffect.duration = $.fx.off ? 0 : typeof speed === \"number\"\n\t\t\t\t? speed : speed in $.fx.speeds ? $.fx.speeds[ speed ] : $.fx.speeds._default;\n\n\t\teffect.complete = callback || options.complete;\n\n\t\treturn effect;\n}", "function _normalizeArguments(effect,options,speed,callback){ // allow passing all options as the first parameter\nif($.isPlainObject(effect)){options = effect;effect = effect.effect;} // convert to an object\neffect = {effect:effect}; // catch (effect, null, ...)\nif(options == null){options = {};} // catch (effect, callback)\nif($.isFunction(options)){callback = options;speed = null;options = {};} // catch (effect, speed, ?)\nif(typeof options === \"number\" || $.fx.speeds[options]){callback = speed;speed = options;options = {};} // catch (effect, options, callback)\nif($.isFunction(speed)){callback = speed;speed = null;} // add options to effect\nif(options){$.extend(effect,options);}speed = speed || options.duration;effect.duration = $.fx.off?0:typeof speed === \"number\"?speed:speed in $.fx.speeds?$.fx.speeds[speed]:$.fx.speeds._default;effect.complete = callback || options.complete;return effect;}", "function _normalizeArguments(effect,options,speed,callback){// Allow passing all options as the first parameter\nif($.isPlainObject(effect)){options=effect;effect=effect.effect;}// Convert to an object\neffect={effect:effect};// Catch (effect, null, ...)\nif(options==null){options={};}// Catch (effect, callback)\nif($.isFunction(options)){callback=options;speed=null;options={};}// Catch (effect, speed, ?)\nif(typeof options===\"number\"||$.fx.speeds[options]){callback=speed;speed=options;options={};}// Catch (effect, options, callback)\nif($.isFunction(speed)){callback=speed;speed=null;}// Add options to effect\nif(options){$.extend(effect,options);}speed=speed||options.duration;effect.duration=$.fx.off?0:typeof speed===\"number\"?speed:speed in $.fx.speeds?$.fx.speeds[speed]:$.fx.speeds._default;effect.complete=callback||options.complete;return effect;}", "function _normalizeArguments(effect,options,speed,callback){// Allow passing all options as the first parameter\nif($.isPlainObject(effect)){options=effect;effect=effect.effect;}// Convert to an object\neffect={effect:effect};// Catch (effect, null, ...)\nif(options==null){options={};}// Catch (effect, callback)\nif($.isFunction(options)){callback=options;speed=null;options={};}// Catch (effect, speed, ?)\nif(typeof options===\"number\"||$.fx.speeds[options]){callback=speed;speed=options;options={};}// Catch (effect, options, callback)\nif($.isFunction(speed)){callback=speed;speed=null;}// Add options to effect\nif(options){$.extend(effect,options);}speed=speed||options.duration;effect.duration=$.fx.off?0:typeof speed===\"number\"?speed:speed in $.fx.speeds?$.fx.speeds[speed]:$.fx.speeds._default;effect.complete=callback||options.complete;return effect;}", "function _normalizeArguments(effect,options,speed,callback){// Allow passing all options as the first parameter\nif($.isPlainObject(effect)){options=effect;effect=effect.effect;}// Convert to an object\neffect={effect:effect};// Catch (effect, null, ...)\nif(options==null){options={};}// Catch (effect, callback)\nif($.isFunction(options)){callback=options;speed=null;options={};}// Catch (effect, speed, ?)\nif(typeof options===\"number\"||$.fx.speeds[options]){callback=speed;speed=options;options={};}// Catch (effect, options, callback)\nif($.isFunction(speed)){callback=speed;speed=null;}// Add options to effect\nif(options){$.extend(effect,options);}speed=speed||options.duration;effect.duration=$.fx.off?0:typeof speed===\"number\"?speed:speed in $.fx.speeds?$.fx.speeds[speed]:$.fx.speeds._default;effect.complete=callback||options.complete;return effect;}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// convert to an object\n\teffect = { effect: effect };\n\n\t// catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\r\n\r\n\t// allow passing all options as the first parameter\r\n\tif ( $.isPlainObject( effect ) ) {\r\n\t\toptions = effect;\r\n\t\teffect = effect.effect;\r\n\t}\r\n\r\n\t// convert to an object\r\n\teffect = { effect: effect };\r\n\r\n\t// catch (effect, null, ...)\r\n\tif ( options == null ) {\r\n\t\toptions = {};\r\n\t}\r\n\r\n\t// catch (effect, callback)\r\n\tif ( $.isFunction( options ) ) {\r\n\t\tcallback = options;\r\n\t\tspeed = null;\r\n\t\toptions = {};\r\n\t}\r\n\r\n\t// catch (effect, speed, ?)\r\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\r\n\t\tcallback = speed;\r\n\t\tspeed = options;\r\n\t\toptions = {};\r\n\t}\r\n\r\n\t// catch (effect, options, callback)\r\n\tif ( $.isFunction( speed ) ) {\r\n\t\tcallback = speed;\r\n\t\tspeed = null;\r\n\t}\r\n\r\n\t// add options to effect\r\n\tif ( options ) {\r\n\t\t$.extend( effect, options );\r\n\t}\r\n\r\n\tspeed = speed || options.duration;\r\n\teffect.duration = $.fx.off ? 0 :\r\n\t\ttypeof speed === \"number\" ? speed :\r\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\r\n\t\t$.fx.speeds._default;\r\n\r\n\teffect.complete = callback || options.complete;\r\n\r\n\treturn effect;\r\n}", "updateOptions(options, ...args) { return args; }", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// Allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// Convert to an object\n\teffect = { effect: effect };\n\n\t// Catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// Add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// Allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// Convert to an object\n\teffect = { effect: effect };\n\n\t// Catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// Add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// Allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// Convert to an object\n\teffect = { effect: effect };\n\n\t// Catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// Add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// Allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// Convert to an object\n\teffect = { effect: effect };\n\n\t// Catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// Add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// Allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// Convert to an object\n\teffect = { effect: effect };\n\n\t// Catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// Add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// Allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// Convert to an object\n\teffect = { effect: effect };\n\n\t// Catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// Add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// Allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// Convert to an object\n\teffect = { effect: effect };\n\n\t// Catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// Add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// Allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// Convert to an object\n\teffect = { effect: effect };\n\n\t// Catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// Add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// Allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// Convert to an object\n\teffect = { effect: effect };\n\n\t// Catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// Add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// Allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// Convert to an object\n\teffect = { effect: effect };\n\n\t// Catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// Add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// Allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// Convert to an object\n\teffect = { effect: effect };\n\n\t// Catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// Add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// Allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// Convert to an object\n\teffect = { effect: effect };\n\n\t// Catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// Add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// Allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// Convert to an object\n\teffect = { effect: effect };\n\n\t// Catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// Add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// Allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// Convert to an object\n\teffect = { effect: effect };\n\n\t// Catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// Add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// Allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// Convert to an object\n\teffect = { effect: effect };\n\n\t// Catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// Add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\n\n\t// Allow passing all options as the first parameter\n\tif ( $.isPlainObject( effect ) ) {\n\t\toptions = effect;\n\t\teffect = effect.effect;\n\t}\n\n\t// Convert to an object\n\teffect = { effect: effect };\n\n\t// Catch (effect, null, ...)\n\tif ( options == null ) {\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, callback)\n\tif ( $.isFunction( options ) ) {\n\t\tcallback = options;\n\t\tspeed = null;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, speed, ?)\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\n\t\tcallback = speed;\n\t\tspeed = options;\n\t\toptions = {};\n\t}\n\n\t// Catch (effect, options, callback)\n\tif ( $.isFunction( speed ) ) {\n\t\tcallback = speed;\n\t\tspeed = null;\n\t}\n\n\t// Add options to effect\n\tif ( options ) {\n\t\t$.extend( effect, options );\n\t}\n\n\tspeed = speed || options.duration;\n\teffect.duration = $.fx.off ? 0 :\n\t\ttypeof speed === \"number\" ? speed :\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\n\t\t$.fx.speeds._default;\n\n\teffect.complete = callback || options.complete;\n\n\treturn effect;\n}", "function _normalizeArguments( effect, options, speed, callback ) {\r\n\r\n\t// Allow passing all options as the first parameter\r\n\tif ( $.isPlainObject( effect ) ) {\r\n\t\toptions = effect;\r\n\t\teffect = effect.effect;\r\n\t}\r\n\r\n\t// Convert to an object\r\n\teffect = { effect: effect };\r\n\r\n\t// Catch (effect, null, ...)\r\n\tif ( options == null ) {\r\n\t\toptions = {};\r\n\t}\r\n\r\n\t// Catch (effect, callback)\r\n\tif ( $.isFunction( options ) ) {\r\n\t\tcallback = options;\r\n\t\tspeed = null;\r\n\t\toptions = {};\r\n\t}\r\n\r\n\t// Catch (effect, speed, ?)\r\n\tif ( typeof options === \"number\" || $.fx.speeds[ options ] ) {\r\n\t\tcallback = speed;\r\n\t\tspeed = options;\r\n\t\toptions = {};\r\n\t}\r\n\r\n\t// Catch (effect, options, callback)\r\n\tif ( $.isFunction( speed ) ) {\r\n\t\tcallback = speed;\r\n\t\tspeed = null;\r\n\t}\r\n\r\n\t// Add options to effect\r\n\tif ( options ) {\r\n\t\t$.extend( effect, options );\r\n\t}\r\n\r\n\tspeed = speed || options.duration;\r\n\teffect.duration = $.fx.off ? 0 :\r\n\t\ttypeof speed === \"number\" ? speed :\r\n\t\tspeed in $.fx.speeds ? $.fx.speeds[ speed ] :\r\n\t\t$.fx.speeds._default;\r\n\r\n\teffect.complete = callback || options.complete;\r\n\r\n\treturn effect;\r\n}", "function _parseZoneOptions(options, callback) {\n if (callback === undefined && typeof options === 'function') {\n callback = options;\n options = undefined;\n }\n\n if (callback && typeof callback !== 'function') {\n throw new TypeError('callback is not a function');\n }\n\n if (!options) {\n options = {callback: callback};\n }\n\n return options;\n}", "mergeOptions (options, notMerge, lazyUpdate) {\n this.delegateMethod('setOption', options, notMerge, lazyUpdate)\n }", "function normalizeOptions(options) {\n options = options || {};\n return {\n concatMessages: options.concatMessages === undefined ? true : Boolean(options.concatMessages),\n format: options.format === undefined ? format$3\n : (typeof options.format === \"function\" ? options.format : false),\n };\n}" ]
[ "0.72095895", "0.72095895", "0.7097127", "0.702213", "0.702213", "0.70051366", "0.59957355", "0.5965593", "0.5466371", "0.5462958", "0.5460963", "0.54504734", "0.5422483", "0.5380346", "0.5377667", "0.5352834", "0.534169", "0.5335676", "0.5335676", "0.5335676", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.53210515", "0.5319881", "0.52841264", "0.5251929", "0.5251929", "0.5251929", "0.5251929", "0.5251929", "0.5251929", "0.5251929", "0.5251929", "0.5251929", "0.5251929", "0.5251929", "0.5251929", "0.5251929", "0.5251929", "0.5251929", "0.5251929", "0.5250013", "0.51663357", "0.514968", "0.51219267" ]
0.69853365
25
Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks` counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.
function completeOutstandingRequest(fn) { try { fn.apply(null, sliceArgs(arguments, 1)); } finally { outstandingRequestCount--; if (outstandingRequestCount === 0) { while (outstandingRequestCallbacks.length) { try { outstandingRequestCallbacks.pop()(); } catch (e) { $log.error(e); } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function completeOutstandingRequest(fn) {\n try {\n fn.apply(null, sliceArgs(arguments, 1));\n } finally {\n outstandingRequestCount--;\n if (outstandingRequestCount === 0) {\n while(outstandingRequestCallbacks.length) {\n try {\n outstandingRequestCallbacks.pop()();\n } catch (e) {\n $log.error(e);\n }\n }\n }\n }\n }", "function completeOutstandingRequest(fn) {\n try {\n fn.apply(null, sliceArgs(arguments, 1));\n } finally {\n outstandingRequestCount--;\n if (outstandingRequestCount === 0) {\n while(outstandingRequestCallbacks.length) {\n try {\n outstandingRequestCallbacks.pop()();\n } catch (e) {\n $log.error(e);\n }\n }\n }\n }\n }", "function completeOutstandingRequest(fn) {\n try {\n fn.apply(null, sliceArgs(arguments, 1));\n } finally {\n outstandingRequestCount--;\n if (outstandingRequestCount === 0) {\n while(outstandingRequestCallbacks.length) {\n try {\n outstandingRequestCallbacks.pop()();\n } catch (e) {\n $log.error(e);\n }\n }\n }\n }\n }", "function completeOutstandingRequest(fn) {\n try {\n fn.apply(null, sliceArgs(arguments, 1));\n } finally {\n outstandingRequestCount--;\n if (outstandingRequestCount === 0) {\n while(outstandingRequestCallbacks.length) {\n try {\n outstandingRequestCallbacks.pop()();\n } catch (e) {\n $log.error(e);\n }\n }\n }\n }\n }", "function completeOutstandingRequest(fn) {\n try {\n fn.apply(null, sliceArgs(arguments, 1));\n } finally {\n outstandingRequestCount--;\n if (outstandingRequestCount === 0) {\n while(outstandingRequestCallbacks.length) {\n try {\n outstandingRequestCallbacks.pop()();\n } catch (e) {\n $log.error(e);\n }\n }\n }\n }\n }", "function completeOutstandingRequest(fn) {\n try {\n fn.apply(null, sliceArgs(arguments, 1));\n } finally {\n outstandingRequestCount--;\n if (outstandingRequestCount === 0) {\n while(outstandingRequestCallbacks.length) {\n try {\n outstandingRequestCallbacks.pop()();\n } catch (e) {\n $log.error(e);\n }\n }\n }\n }\n }", "function completeOutstandingRequest(fn) {\n try {\n fn.apply(null, sliceArgs(arguments, 1));\n } finally {\n outstandingRequestCount--;\n if (outstandingRequestCount === 0) {\n while(outstandingRequestCallbacks.length) {\n try {\n outstandingRequestCallbacks.pop()();\n } catch (e) {\n $log.error(e);\n }\n }\n }\n }\n }", "function completeOutstandingRequest(fn) {\n try {\n fn.apply(null, sliceArgs(arguments, 1));\n } finally {\n outstandingRequestCount--;\n if (outstandingRequestCount === 0) {\n while(outstandingRequestCallbacks.length) {\n try {\n outstandingRequestCallbacks.pop()();\n } catch (e) {\n $log.error(e);\n }\n }\n }\n }\n }", "function completeOutstandingRequest(fn) {\n try {\n fn.apply(null, sliceArgs(arguments, 1));\n } finally {\n outstandingRequestCount--;\n if (outstandingRequestCount === 0) {\n while(outstandingRequestCallbacks.length) {\n try {\n outstandingRequestCallbacks.pop()();\n } catch (e) {\n $log.error(e);\n }\n }\n }\n }\n }", "function completeOutstandingRequest(fn) {\n try {\n fn.apply(null, sliceArgs(arguments, 1));\n } finally {\n outstandingRequestCount--;\n if (outstandingRequestCount === 0) {\n while(outstandingRequestCallbacks.length) {\n try {\n outstandingRequestCallbacks.pop()();\n } catch (e) {\n $log.error(e);\n }\n }\n }\n }\n }", "function completeOutstandingRequest(fn) {\n\t\t\ttry {\n\t\t\t\tfn.apply(null, sliceArgs(arguments, 1));\n\t\t\t} finally {\n\t\t\t\toutstandingRequestCount--;\n\t\t\t\tif (outstandingRequestCount === 0) {\n\t\t\t\t\twhile (outstandingRequestCallbacks.length) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\toutstandingRequestCallbacks.pop()();\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t$log.error(e);\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}", "function completeOutstandingRequest(fn) {\n\t\t\ttry {\n\t\t\t\tfn.apply(null, sliceArgs(arguments, 1));\n\t\t\t} finally {\n\t\t\t\toutstandingRequestCount--;\n\t\t\t\tif (outstandingRequestCount === 0) {\n\t\t\t\t\twhile (outstandingRequestCallbacks.length) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\toutstandingRequestCallbacks.pop()();\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t$log.error(e);\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}", "function completeOutstandingRequest(fn) {\n try {\n fn.apply(null, sliceArgs(arguments, 1));\n } finally {\n outstandingRequestCount--;\n if (outstandingRequestCount === 0) {\n while (outstandingRequestCallbacks.length) {\n try {\n outstandingRequestCallbacks.pop()();\n } catch (e) {\n $log.error(e);\n }\n }\n }\n }\n }", "function completeOutstandingRequest(fn) {\n\t try {\n\t fn.apply(null, sliceArgs(arguments, 1));\n\t } finally {\n\t outstandingRequestCount--;\n\t if (outstandingRequestCount === 0) {\n\t while (outstandingRequestCallbacks.length) {\n\t try {\n\t outstandingRequestCallbacks.pop()();\n\t } catch (e) {\n\t $log.error(e);\n\t }\n\t }\n\t }\n\t }\n\t }", "function completeOutstandingRequest(fn) {\n\t try {\n\t fn.apply(null, sliceArgs(arguments, 1));\n\t } finally {\n\t outstandingRequestCount--;\n\t if (outstandingRequestCount === 0) {\n\t while (outstandingRequestCallbacks.length) {\n\t try {\n\t outstandingRequestCallbacks.pop()();\n\t } catch (e) {\n\t $log.error(e);\n\t }\n\t }\n\t }\n\t }\n\t }", "function completeOutstandingRequest(fn) { // 5550\n try { // 5551\n fn.apply(null, sliceArgs(arguments, 1)); // 5552\n } finally { // 5553\n outstandingRequestCount--; // 5554\n if (outstandingRequestCount === 0) { // 5555\n while (outstandingRequestCallbacks.length) { // 5556\n try { // 5557\n outstandingRequestCallbacks.pop()(); // 5558\n } catch (e) { // 5559\n $log.error(e); // 5560\n } // 5561\n } // 5562\n } // 5563\n } // 5564\n } // 5565", "function completeOutstandingRequest(fn){try{fn.apply(null,sliceArgs(arguments,1));}finally{outstandingRequestCount--;if(outstandingRequestCount===0){while(outstandingRequestCallbacks.length){try{outstandingRequestCallbacks.pop()();}catch(e){$log.error(e);}}}}}", "function completeOutstandingRequest(fn){try{fn.apply(null,sliceArgs(arguments,1));}finally{outstandingRequestCount--;if(outstandingRequestCount===0){while(outstandingRequestCallbacks.length){try{outstandingRequestCallbacks.pop()();}catch(e){$log.error(e);}}}}}", "function defer(fn) {\n setTimeout(() => {\n fn();\n numDeferred -= 1;\n }, numDeferred * epsilon);\n numDeferred += 1;\n }", "function thunkify1(fn) {\n\treturn function () {\n\t\tvar args = [].slice.call(arguments);\n\t\tvar results;\n\t\tvar called;\n\t\tvar cb;\n\n\t\targs.splice(1, 0, function () {\n\t\t\tresults = arguments;\n\n\t\t\tif (cb && !called) {\n\t\t\t\tcalled = true;\n\t\t\t\tcb.apply(this, results);\n\t\t\t}\n\t\t});\n\n\t\tfn.apply(this, args);\n\n\t\treturn function (fn) {\n\t\t\tcb = fn;\n\n\t\t\tif (results && !called) {\n\t\t\t\tcalled = true;\n\t\t\t\tfn.apply(this, results);\n\t\t\t}\n\t\t}\n\t}\n}", "function limit(fn, opt_callLimit, opt_throwError) {\r\n opt_callLimit = opt_callLimit == undefined ? 1 : opt_callLimit;\r\n return function() {\r\n if (0 < opt_callLimit--) {\r\n return fn.apply(this, arguments);\r\n }\r\n if (opt_throwError) {\r\n throw new Error('Limited function called too many times.');\r\n }\r\n }\r\n }", "function curryXHR(fn, param) {\n return function() {fn(param)};\n}", "decreasePendingRequestCount() {\n this._pendingCount -= 1;\n if (this._pendingCount < 0) {\n throw new Error('pending async requests below zero');\n }\n this._runCallbacksIfReady();\n return this._pendingCount;\n }", "decreasePendingRequestCount() {\n this._pendingCount -= 1;\n if (this._pendingCount < 0) {\n throw new Error('pending async requests below zero');\n }\n this._runCallbacksIfReady();\n return this._pendingCount;\n }", "decreasePendingRequestCount() {\n this._pendingCount -= 1;\n if (this._pendingCount < 0) {\n throw new Error('pending async requests below zero');\n }\n this._runCallbacksIfReady();\n return this._pendingCount;\n }", "decreasePendingRequestCount() {\n this._pendingCount -= 1;\n if (this._pendingCount < 0) {\n throw new Error('pending async requests below zero');\n }\n this._runCallbacksIfReady();\n return this._pendingCount;\n }", "decreasePendingRequestCount() {\n this._pendingCount -= 1;\n if (this._pendingCount < 0) {\n throw new Error('pending async requests below zero');\n }\n this._runCallbacksIfReady();\n return this._pendingCount;\n }", "decreasePendingRequestCount() {\n this._pendingCount -= 1;\n if (this._pendingCount < 0) {\n throw new Error('pending async requests below zero');\n }\n this._runCallbacksIfReady();\n return this._pendingCount;\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = !0;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = !1;\n }\n }\n return fn();\n }", "function RateLimit(fn, delay, context) {\n let latestCall = null;\n let timer = null;\n\n function processLatestCall() {\n if (latestCall) {\n fn.apply(latestCall.context, latestCall.arguments);\n clearInterval(timer);\n timer = null;\n }\n }\n\n return function limited(...args) {\n latestCall = {\n context: context || this,\n arguments: [].slice.call(args),\n };\n if (timer) {\n clearInterval(timer);\n }\n timer = setInterval(processLatestCall, delay);\n };\n}", "function callback(err) {\n if (err) {\n error = err;\n }\n --count || fn(error);\n }", "function callback(err) {\n if (err) {\n error = err;\n }\n --count || fn(error);\n }", "function callback(err) {\n if (err) {\n error = err;\n }\n --count || fn(error);\n }", "function runAtMostOncePerRequest(fn) {\n var value;\n var randomNumber = Math.random();\n return function (root, args, ctx, info) {\n if (!info.operation['__runAtMostOnce']) {\n info.operation['__runAtMostOnce'] = {};\n }\n if (!info.operation['__runAtMostOnce'][randomNumber]) {\n info.operation['__runAtMostOnce'][randomNumber] = true;\n value = fn(root, args, ctx, info);\n }\n return value;\n };\n}", "function runAtMostOncePerRequest(fn) {\n var value;\n var randomNumber = Math.random();\n return function (root, args, ctx, info) {\n if (!info.operation['__runAtMostOnce']) {\n info.operation['__runAtMostOnce'] = {};\n }\n if (!info.operation['__runAtMostOnce'][randomNumber]) {\n info.operation['__runAtMostOnce'][randomNumber] = true;\n value = fn(root, args, ctx, info);\n }\n return value;\n };\n}", "function thunkify(fn, opts) {\n\treturn function () {\n\t\tlet cb, timer;\n\t\tif (opts && opts.timeout && opts.error)\n\t\t\ttimer = setTimeout(cb1, opts.timeout, opts.error);\n\n\t\targuments[arguments.length++] = cb1;\n\t\tfn.apply(this, arguments);\n\n\t\treturn function thunk(cb2) { cb = cb2; };\n\n\t\tfunction cb1() {\n\t\t\tif (timer) timer = clearTimeout(timer);\n\t\t\tcb.apply(this, arguments);\n\t\t}\n\t};\n}", "function after(count, func) {\n // let funcOut;\n let callCount = count;\n return function () {\n if (callCount === 1) {\n return func();\n } else {\n callCount -= 1;\n }\n }\n}", "function dummy(fn) {\n\t\t\treturn function() {\n\t\t\t\t// The dummy function just store the arguments received\n\t\t\t\t// These arguments will be passed on release time\n\t\t\t\tqueue.push({ fn: fn, args: arguments });\n\n\t\t\t\t// Return the release function to continue the (fake) chaining\n\t\t\t\treturn this;\n\t\t\t};\n\t\t}", "function liftFunction(fn, numOutputs, mask) {\n if (numOutputs === void 0) { numOutputs = 1; }\n if (mask === void 0) { mask = null; }\n return function () {\n var parameters = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n parameters[_i - 0] = arguments[_i];\n }\n var pack = new ParameterPack(parameters, mask);\n var fnCall = new SingleFunctionCall(fn, pack.promise, numOutputs);\n return (fnCall.outputPromises.length <= 1) ?\n fnCall.outputPromises[0] : fnCall.outputPromises;\n };\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }", "function tracker(fn){\n let numTimesCalled = 0;\n return function(){\n numTimesCalled++;\n console.log('I was called', numTimesCalled);\n return fn();\n }\n}", "function after(count, func) {\n let counter = 0;\n return function() {\n counter++;\n if (counter == count) return func();\n }\n}", "function throttle(fn, wait) {\n var time = Date.now();\n return function() {\n if ((time + wait - Date.now()) < 0) {\n fn();\n time = Date.now();\n }\n }\n }", "function limitFunctionCallCount(cb, n) {\n let limit=0;\n function checklimit(){\n if (limit<n){\n limit+=1;\n cb();\n }else{\n return null\n }\n }\n return checklimit; \n\n}", "function unbatchedUpdates(fn) {\n if (isBatchingUpdates && !isUnbatchingUpdates) {\n isUnbatchingUpdates = true;\n try {\n return fn();\n } finally {\n isUnbatchingUpdates = false;\n }\n }\n return fn();\n }" ]
[ "0.7159645", "0.7159645", "0.7159645", "0.7159645", "0.7159645", "0.7159645", "0.7159645", "0.7159645", "0.7159645", "0.7159645", "0.7126252", "0.7126252", "0.7088254", "0.69648546", "0.69648546", "0.6795259", "0.6785734", "0.6785734", "0.5357326", "0.52063054", "0.51221895", "0.50483", "0.49689102", "0.49689102", "0.49689102", "0.49689102", "0.49689102", "0.49689102", "0.49651408", "0.49571577", "0.49530604", "0.49530604", "0.49530604", "0.49443114", "0.49443114", "0.49276406", "0.4924593", "0.49167734", "0.4840677", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.4832473", "0.48231545", "0.48120785", "0.48056257", "0.47869736", "0.47813812" ]
0.7173945
20
makes the `entry` the freshEnd of the LRU linked list
function refresh(entry) { if (entry != freshEnd) { if (!staleEnd) { staleEnd = entry; } else if (staleEnd == entry) { staleEnd = entry.n; } link(entry.n, entry.p); link(entry, freshEnd); freshEnd = entry; freshEnd.n = null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refresh(entry) { // 6153\n if (entry != freshEnd) { // 6154\n if (!staleEnd) { // 6155\n staleEnd = entry; // 6156\n } else if (staleEnd == entry) { // 6157\n staleEnd = entry.n; // 6158\n } // 6159\n // 6160\n link(entry.n, entry.p); // 6161\n link(entry, freshEnd); // 6162\n freshEnd = entry; // 6163\n freshEnd.n = null; // 6164\n } // 6165\n } // 6166", "function refresh(entry) {\n\t if (entry != freshEnd) {\n\t if (!staleEnd) {\n\t staleEnd = entry;\n\t } else if (staleEnd == entry) {\n\t staleEnd = entry.n;\n\t }\n\n\t link(entry.n, entry.p);\n\t link(entry, freshEnd);\n\t freshEnd = entry;\n\t freshEnd.n = null;\n\t }\n\t }", "function refresh(entry) {\n\t if (entry !== freshEnd) {\n\t if (!staleEnd) {\n\t staleEnd = entry;\n\t } else if (staleEnd === entry) {\n\t staleEnd = entry.n;\n\t }\n\n\t link(entry.n, entry.p);\n\t link(entry, freshEnd);\n\t freshEnd = entry;\n\t freshEnd.n = null;\n\t }\n\t }", "function refresh(entry) {\n\t\t\t\t\tif (entry != freshEnd) {\n\t\t\t\t\t\tif (!staleEnd) {\n\t\t\t\t\t\t\tstaleEnd = entry;\n\t\t\t\t\t\t} else if (staleEnd == entry) {\n\t\t\t\t\t\t\tstaleEnd = entry.n;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlink(entry.n, entry.p);\n\t\t\t\t\t\tlink(entry, freshEnd);\n\t\t\t\t\t\tfreshEnd = entry;\n\t\t\t\t\t\tfreshEnd.n = null;\n\t\t\t\t\t}\n\t\t\t\t}", "function refresh(entry) {\n\t\t\t\t\tif (entry != freshEnd) {\n\t\t\t\t\t\tif (!staleEnd) {\n\t\t\t\t\t\t\tstaleEnd = entry;\n\t\t\t\t\t\t} else if (staleEnd == entry) {\n\t\t\t\t\t\t\tstaleEnd = entry.n;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlink(entry.n, entry.p);\n\t\t\t\t\t\tlink(entry, freshEnd);\n\t\t\t\t\t\tfreshEnd = entry;\n\t\t\t\t\t\tfreshEnd.n = null;\n\t\t\t\t\t}\n\t\t\t\t}", "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "function refresh(entry) {\n if (entry !== freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd === entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "function refresh(entry) {\n if (entry !== freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd === entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "function refresh(entry) {\n if (entry !== freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd === entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "function refresh(entry) {\n if (entry !== freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd === entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "function refresh(entry) {\n if (entry !== freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd === entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "function refresh(entry) {\n if (entry !== freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd === entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "function refresh(entry) {\n if (entry !== freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd === entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "function refresh(entry) {\n if (entry !== freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd === entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "function refresh(entry){if(entry!==freshEnd){if(!staleEnd){staleEnd=entry;}else if(staleEnd===entry){staleEnd=entry.n;}link(entry.n,entry.p);link(entry,freshEnd);freshEnd=entry;freshEnd.n=null;}}", "function refresh(entry){if(entry!==freshEnd){if(!staleEnd){staleEnd=entry;}else if(staleEnd===entry){staleEnd=entry.n;}link(entry.n,entry.p);link(entry,freshEnd);freshEnd=entry;freshEnd.n=null;}}", "function LRUCache() {\n var limit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;\n\n _classCallCheck(this, LRUCache);\n\n this.size = 0;\n this.limit = limit;\n this.head = null;\n this.tail = null;\n this.cache = {};\n } // Write Node to head of LinkedList", "function LRUCache() {\n var limit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;\n\n LRUCache_classCallCheck(this, LRUCache);\n\n this.size = 0;\n this.limit = limit;\n this.head = null;\n this.tail = null;\n this.cache = {};\n } // Write Node to head of LinkedList", "function EntryCache() {}", "function LRUCache() {\n var limit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;\n\n _classCallCheck(this, LRUCache);\n\n this.size = 0;\n this.limit = limit;\n this.head = null;\n this.tail = null;\n this.cache = {};\n }", "function LRU (size = 10) {\n this.size = size\n this.cache = []\n this.cacheMap = new Map()\n}", "function LRUCache(limit) {\n\t this.size = 0;\n\t this.limit = limit;\n\t this._keymap = {};\n\t}", "function LRUCache(limit) {\n this.size = 0;\n this.limit = limit;\n this._keymap = {};\n }", "push(entry) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.getCurrent() instanceof HistoryEntry_1.default && this.getCurrent().uri === entry.uri) {\n this.entries[this.currentIndex] = entry;\n }\n else {\n this.entries.splice(0, this.currentIndex);\n this.entries.unshift(entry);\n this.currentIndex = 0;\n }\n });\n }", "push(entry) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.getCurrent() instanceof HistoryEntry_1.default && this.getCurrent().uri === entry.uri) {\n this.entries[this.currentIndex] = entry;\n }\n else {\n this.entries.splice(0, this.currentIndex);\n this.entries.unshift(entry);\n this.currentIndex = 0;\n }\n });\n }", "function DLLTouch(node) {\n\t\t\tif(LRU[node.path] == null) {\n\t\t\t\tnode.prev = tail;\n\t\t\t\ttail = node;\n\t\t\t\tif(node.prev != null) {\n\t\t\t\t\tnode.prev.next = node;\n\t\t\t\t}\n\n\t\t\t\tLRU[node.path] = node;\n\t\t\t\tLRUcount++;\n\n\t\t\t\tif(head == null) {\n\t\t\t\t\thead = node;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar item = LRU[node.path];\n\t\t\t\tif(node.prev == null) {\n\t\t\t\t\tif(node.next != null) {\n\t\t\t\t\t\thead = node.next;\n\t\t\t\t\t\thead.prev = null;\n\t\t\t\t\t\tnode.prev = tail;\n\t\t\t\t\t\tnode.next = null;\n\t\t\t\t\t\ttail = node;\n\t\t\t\t\t\tnode.prev.next = node;\n\t\t\t\t\t}\n\t\t\t\t\telse if(node.next == null) {}\n\t\t\t\t\telse {\n\t\t\t\t\t\tnode.prev.next = node.next;\n\t\t\t\t\t\tnode.next.prev = node.prev;\n\t\t\t\t\t\tnode.prev = tail;\n\t\t\t\t\t\tnode.next = null;\n\t\t\t\t\t\ttail = node;\n\t\t\t\t\t\tnode.prev.next = node;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "addToTail(value) {\n const newNode = { value, next: null };\n if (this.head === null) {\n this.head = newNode;\n this.tail = newNode;\n }\n const holder = this.tail;\n holder.next = newNode;\n this.tail = newNode;\n }", "function clearEntry () {\n\n nextValue = null;\n}", "function Entry (key, value, lu, length, now) {\n\t this.key = key\n\t this.value = value\n\t this.lu = lu\n\t this.length = length\n\t this.now = now\n\t}", "addRecent(category) {\n\t\t// Put the item into the LRU cache\n\t\tthis.recent = this.lruCache.put(category);\n\n\t\t// Update local storage with the new list\n\t\tthis.$window.localStorage.setItem(this.LRU_LOCAL_STORAGE_KEY, JSON.stringify(this.lruCache.dump()));\n\t}", "_onTempWrite(entry) {\n this._markEntryAsRead(entry)\n this._updateEntries([entry])\n }", "function Entry (key, value, lu, length, now) {\n this.key = key\n this.value = value\n this.lu = lu\n this.length = length\n this.now = now\n}", "function Entry (key, value, lu, length, now) {\n this.key = key\n this.value = value\n this.lu = lu\n this.length = length\n this.now = now\n }", "function Entry (key, value, lu, length, now, maxAge) {\n this.key = key;\n this.value = value;\n this.lu = lu;\n this.length = length;\n this.now = now;\n if (maxAge) this.maxAge = maxAge;\n}", "push(value) {\n const newEntry = new Entry(value);\n if (this.last === null) {\n this.last = newEntry;\n } else {\n newEntry.prev = this.last;\n this.last = newEntry;\n }\n\n this.size += 1;\n return this.size;\n }", "addToTheEnd(value) {\n let node = new Node(value);\n\n if (this.length === 0) {\n this.head = node;\n } else {\n let current = this.head;\n\n while (current.next) {\n current = current.next;\n }\n\n current.next = new Node(value);\n }\n\n this.length++;\n }", "function Cache () {\n this.lru = new LRU({\n max: 500,\n maxAge: 1000 * 60 * 60 * 24\n })\n}", "addToTail(val) {\n const node = new Node(val);\n\n if (!this.head) {\n this.head = node;\n this.tail = node;\n } else {\n this.tail.next = node;\n this.tail = node;\n }\n }", "addToTail(value) {\n // declare newNode with value and next property.\n const newNode = {\n value: value,\n next: null,\n }\n //if no head, create both a head and tail.\n if (this.head === null) {\n this.head = newNode;\n this.tail = newNode;\n return;\n }\n //update next pointer for the 'old' tail node to point to the new node and then add new node to the tail. \n this.tail.next = newNode;\n this.tail = newNode;\n }", "function LruCache(maxSize, lowWaterMark, onRemoveFn) {\n \n this.entryDict = {};\n\n this.put = function(key, value) {\n this.reduceIfNeeded();\n this.entryDict[key] = value;\n };\n \n this.get = function(key) {\n if (!(key in this.entryDict)) return undefined;\n return this.entryDict[key];\n };\n\n this.reduceIfNeeded = function() {\n var entryDictKeys = Object.keys(this.entryDict);\n if (entryDictKeys.length < maxSize) return;\n var toRemove = maxSize - lowWaterMark;\n for (var k in this.entryDict) {\n if (toRemove <= 0) break;\n toRemove--;\n var v = this.entryDict[k];\n if (onRemoveFn !== undefined) onRemoveFn(k, v);\n delete this.entryDict[k];\n }\n };\n}", "function Entry (key, value, length, now, maxAge) {\n\t this.key = key\n\t this.value = value\n\t this.length = length\n\t this.now = now\n\t this.maxAge = maxAge || 0\n\t}", "evict_() {\n if (this.size_ <= this.capacity_) {\n return;\n }\n\n dev().warn(TAG, 'Trimming LRU cache');\n const cache = this.cache_;\n let oldest = this.access_ + 1;\n let oldestKey;\n for (const key in cache) {\n const {access} = cache[key];\n if (access < oldest) {\n oldest = access;\n oldestKey = key;\n }\n }\n\n if (oldestKey !== undefined) {\n delete cache[oldestKey];\n this.size_--;\n }\n }", "addToTail(val) {\n this.length++\n let newNode = new Node(val);\n if( this.length === 1 ){\n this.head = newNode\n this.head.next = null\n }\n let oldTail = this.tail\n this.tail = newNode\n if(this.length >= 2) {\n oldTail.next = this.tail\n }\n return this\n }", "replaceEntry(window, url = window.location.href, pushState = undefined) {\n const entry = new Entry(window, url, pushState);\n if (this.current === this.first) {\n if (this.current) this.current.destroy(window);\n this.first = entry;\n this.current = entry;\n } else {\n this.current.prev.append(entry, window);\n this.current = entry;\n }\n this.focus(window);\n }", "miss(k, v) {\n if (this._isFull()) {\n this._removeLRU();\n }\n this._update(k, v);\n }", "write(key, value){\n this.ensureLimit();\n\n if(!this.head){\n this.head = this.tail = new Node(key, value);\n }else{\n const node = new Node(key, value, this.head.next);\n this.head.prev = node;\n this.head = node;\n }\n\n //Update the cache map\n this.cache[key] = this.head;\n this.size++;\n }", "function Entry (key, value, mru, len, age) {\n this.key = key\n this.value = value\n this.lu = mru\n this.length = len\n this.now = age\n}", "function Entry (key, value, mru, len, age) {\n this.key = key\n this.value = value\n this.lu = mru\n this.length = len\n this.now = age\n}", "function Entry (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n}", "function Entry (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n}", "function Entry (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n}", "function Entry (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n}", "function Entry (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n}", "function Entry (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n}", "function Entry (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n}", "function Entry (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n}", "function Entry (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n}", "addEntry(window, url = window.location.href, pushState = undefined) {\n const entry = new Entry(window, url, pushState);\n if (this.current) {\n this.current.append(entry);\n this.current = entry;\n } else {\n this.first = entry;\n this.current = entry;\n }\n this.focus(window);\n }", "function Entry (key, value, length, now, maxAge) {\n this.key = key;\n this.value = value;\n this.length = length;\n this.now = now;\n this.maxAge = maxAge || 0;\n}", "addToTail(val) {\n const node = new Node(val, null);\n\n if (!this.tail) {\n this.tail = node;\n this.head = node;\n } else {\n this.tail.next = node;\n this.tail = node;\n }\n\n this.length += 1;\n\n return this;\n }", "addToTail(val) {\n const newNode = new Node(val)\n if(this.length === 0){\n this.head = newNode\n this.tail = newNode\n } else {\n this.tail.next = newNode\n this.tail = newNode\n }\n this.length++\n return this\n }", "function LRUCache (options) {\n if (typeof options === 'number') { options = { max: options } }\n\n if (!options) { options = {} }\n\n if (options.max && (typeof options.max !== 'number' || options.max < 0)) { throw new TypeError('max must be a non-negative number') }\n // Kind of weird to have a default max of Infinity, but oh well.\n this[MAX] = options.max || Infinity\n\n this.reset()\n}", "addToTail(val) {\n if (this.head === null) {\n let newNode = new Node(val);\n this.head = newNode;\n this.tail = newNode;\n } else {\n let newNode = new Node(val);\n this.tail.next = newNode;\n this.tail = newNode;\n }\n\n this.length += 1;\n return this;\n }", "function lruPromote(model, object) {\n\t var root = model._root;\n\t var head = root[__head];\n\t if (head === object) {\n\t return;\n\t }\n\n\t // The item always exist in the cache since to get anything in the\n\t // cache it first must go through set.\n\t var prev = object[__prev];\n\t var next = object[__next];\n\t if (next) {\n\t next[__prev] = prev;\n\t }\n\t if (prev) {\n\t prev[__next] = next;\n\t }\n\t object[__prev] = void 0;\n\n\t // Insert into head position\n\t root[__head] = object;\n\t object[__next] = head;\n\t head[__prev] = object;\n\t}", "function addTestEntry() {\n //random variable generation section\n let min = Math.floor(Math.random() * 9);\n let sec = Math.floor(Math.random() * 60);\n let paceEntry = min + \":\" + sec;\n\n let dateEntry = new Date();\n dateEntry.setDate(dateEntry.getDate() - Math.floor(Math.random() * 364) + 1);\n //same as in addEntry function\n // entries.push(new Entry('5:57', '2020-02-09', true));\n let entry = new Entry(paceEntry, dateEntry, false);\n entries.push(entry);\n //sorts entries array by date\n sortEntries();\n //save to local storage\n localStorage['entries-local'] = JSON.stringify(entries);\n createList();\n ctx.clearRect(0, 0, canvas.width, canvas.height); //clear existing canvas\n drawAxis();\n drawChart();\n}", "function LRUCache (options) {\n if (!(this instanceof LRUCache)) {\n return new LRUCache(options)\n }\n\n if (typeof options === 'number') {\n options = { max: options }\n }\n\n if (!options) {\n options = {}\n }\n\n var max = priv(this, 'max', options.max)\n // Kind of weird to have a default max of Infinity, but oh well.\n if (!max ||\n !(typeof max === 'number') ||\n max <= 0) {\n priv(this, 'max', Infinity)\n }\n\n var lc = options.length || naiveLength\n if (typeof lc !== 'function') {\n lc = naiveLength\n }\n priv(this, 'lengthCalculator', lc)\n\n priv(this, 'allowStale', options.stale || false)\n priv(this, 'maxAge', options.maxAge || 0)\n priv(this, 'dispose', options.dispose)\n this.reset()\n}", "function LRUCache (options) {\n if (!(this instanceof LRUCache)) {\n return new LRUCache(options)\n }\n\n if (typeof options === 'number') {\n options = { max: options }\n }\n\n if (!options) {\n options = {}\n }\n\n var max = priv(this, 'max', options.max)\n // Kind of weird to have a default max of Infinity, but oh well.\n if (!max ||\n !(typeof max === 'number') ||\n max <= 0) {\n priv(this, 'max', Infinity)\n }\n\n var lc = options.length || naiveLength\n if (typeof lc !== 'function') {\n lc = naiveLength\n }\n priv(this, 'lengthCalculator', lc)\n\n priv(this, 'allowStale', options.stale || false)\n priv(this, 'maxAge', options.maxAge || 0)\n priv(this, 'dispose', options.dispose)\n this.reset()\n}", "insertKeyValuePair(key, value) {\r\n if (!(key in this.cache)) {\r\n if (this.currentSize === this.maxSize) {\r\n this.evictLeastRecent();\r\n } else {\r\n this.currentSize++;\r\n }\r\n this.cache[key] = new DoublyLinkedListNode(key, value);\r\n } else {\r\n this.replaceKey(key, value);\r\n }\r\n this.updateMostRecent(this.cache[key]);\r\n }", "addEntry(entry) {\n if (this.getFileId(entry.name) == null) {\n this.entries.push(entry);\n this.content += entry.text;\n\n Net.updateFile(this.id, btoa(this.content));\n\n return true;\n } else {\n return false;\n }\n }" ]
[ "0.71337277", "0.7053727", "0.7050213", "0.70393115", "0.70393115", "0.70255274", "0.7007672", "0.7007672", "0.7007672", "0.7007672", "0.7007672", "0.7007672", "0.7007672", "0.7007672", "0.68700457", "0.68700457", "0.6222058", "0.6215561", "0.5898322", "0.5846858", "0.58463967", "0.570872", "0.567379", "0.56622", "0.56622", "0.55807567", "0.5567931", "0.5498993", "0.5444995", "0.5347362", "0.5345957", "0.5340308", "0.53185415", "0.5304602", "0.53008807", "0.5272807", "0.52691394", "0.5264988", "0.5242668", "0.5220397", "0.5198473", "0.5197602", "0.5154996", "0.5130818", "0.5126854", "0.51195306", "0.51138574", "0.51138574", "0.51020783", "0.51020783", "0.51020783", "0.51020783", "0.51020783", "0.51020783", "0.51020783", "0.51020783", "0.51020783", "0.50709045", "0.5066013", "0.5060299", "0.505753", "0.50436944", "0.50253016", "0.50250226", "0.49992406", "0.49976912", "0.49976912", "0.4995828", "0.4995599" ]
0.7014544
29
bidirectionally links two entries of the LRU linked list
function link(nextEntry, prevEntry) { if (nextEntry != prevEntry) { if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function link(nextEntry,prevEntry){if(nextEntry!==prevEntry){if(nextEntry)nextEntry.p=prevEntry;//p stands for previous, 'prev' didn't minify\nif(prevEntry)prevEntry.n=nextEntry;//n stands for next, 'next' didn't minify\n}}", "function link(nextEntry, prevEntry) {\n\t if (nextEntry !== prevEntry) {\n\t if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n\t if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n\t }\n\t }", "function link(nextEntry, prevEntry) {\n\t if (nextEntry != prevEntry) {\n\t if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n\t if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n\t }\n\t }", "function link(nextEntry, prevEntry) { // 6172\n if (nextEntry != prevEntry) { // 6173\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify // 6174\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify // 6175\n } // 6176\n }", "link(l2){\n if (l2 instanceof LinkItem){\n this.next = l2;\n l2.last = this\n }\n }", "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "function link(nextEntry, prevEntry) {\n if (nextEntry != prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "function link(nextEntry, prevEntry) {\n\t\t\t\t\tif (nextEntry != prevEntry) {\n\t\t\t\t\t\tif (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n\t\t\t\t\t\tif (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n\t\t\t\t\t}\n\t\t\t\t}", "function link(nextEntry, prevEntry) {\n\t\t\t\t\tif (nextEntry != prevEntry) {\n\t\t\t\t\t\tif (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n\t\t\t\t\t\tif (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n\t\t\t\t\t}\n\t\t\t\t}", "function link(nextEntry,prevEntry){if(nextEntry!==prevEntry){if(nextEntry)nextEntry.p=prevEntry;//p stands for previous, 'prev' didn't minify\n\tif(prevEntry)prevEntry.n=nextEntry;//n stands for next, 'next' didn't minify\n\t}}", "function reverseDoubleLinkList(head) {\n\n}", "function DLLTouch(node) {\n\t\t\tif(LRU[node.path] == null) {\n\t\t\t\tnode.prev = tail;\n\t\t\t\ttail = node;\n\t\t\t\tif(node.prev != null) {\n\t\t\t\t\tnode.prev.next = node;\n\t\t\t\t}\n\n\t\t\t\tLRU[node.path] = node;\n\t\t\t\tLRUcount++;\n\n\t\t\t\tif(head == null) {\n\t\t\t\t\thead = node;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar item = LRU[node.path];\n\t\t\t\tif(node.prev == null) {\n\t\t\t\t\tif(node.next != null) {\n\t\t\t\t\t\thead = node.next;\n\t\t\t\t\t\thead.prev = null;\n\t\t\t\t\t\tnode.prev = tail;\n\t\t\t\t\t\tnode.next = null;\n\t\t\t\t\t\ttail = node;\n\t\t\t\t\t\tnode.prev.next = node;\n\t\t\t\t\t}\n\t\t\t\t\telse if(node.next == null) {}\n\t\t\t\t\telse {\n\t\t\t\t\t\tnode.prev.next = node.next;\n\t\t\t\t\t\tnode.next.prev = node.prev;\n\t\t\t\t\t\tnode.prev = tail;\n\t\t\t\t\t\tnode.next = null;\n\t\t\t\t\t\ttail = node;\n\t\t\t\t\t\tnode.prev.next = node;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function LRUCache() {\n var limit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;\n\n _classCallCheck(this, LRUCache);\n\n this.size = 0;\n this.limit = limit;\n this.head = null;\n this.tail = null;\n this.cache = {};\n } // Write Node to head of LinkedList", "function LRUCache() {\n var limit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;\n\n LRUCache_classCallCheck(this, LRUCache);\n\n this.size = 0;\n this.limit = limit;\n this.head = null;\n this.tail = null;\n this.cache = {};\n } // Write Node to head of LinkedList", "function linkNodes(node1, node2) {\n\tnode1.next = node2;\n\tnode2.prev = node1; \n}", "function lruPromote(model, object) {\n\t var root = model._root;\n\t var head = root[__head];\n\t if (head === object) {\n\t return;\n\t }\n\n\t // The item always exist in the cache since to get anything in the\n\t // cache it first must go through set.\n\t var prev = object[__prev];\n\t var next = object[__next];\n\t if (next) {\n\t next[__prev] = prev;\n\t }\n\t if (prev) {\n\t prev[__next] = next;\n\t }\n\t object[__prev] = void 0;\n\n\t // Insert into head position\n\t root[__head] = object;\n\t object[__next] = head;\n\t head[__prev] = object;\n\t}", "function refresh(entry) { // 6153\n if (entry != freshEnd) { // 6154\n if (!staleEnd) { // 6155\n staleEnd = entry; // 6156\n } else if (staleEnd == entry) { // 6157\n staleEnd = entry.n; // 6158\n } // 6159\n // 6160\n link(entry.n, entry.p); // 6161\n link(entry, freshEnd); // 6162\n freshEnd = entry; // 6163\n freshEnd.n = null; // 6164\n } // 6165\n } // 6166", "function concat(list1, list2) {\n last(list1).next = list2\n}", "addToTail(val) {\n this.length++\n let newNode = new Node(val);\n if( this.length === 1 ){\n this.head = newNode\n this.head.next = null\n }\n let oldTail = this.tail\n this.tail = newNode\n if(this.length >= 2) {\n oldTail.next = this.tail\n }\n return this\n }", "moveDown(node) {\n\n let previousNode = null;\n let currentNode = this.head;\n\n // TODO need to be setting node.val.next too\n\n while (currentNode !== null) {\n\n if (currentNode.val.id === node.val.id) {\n\n let nextNodeCopy = currentNode.next;\n\n // currentNode is the first item\n if (previousNode === null) {\n\n currentNode.next = currentNode.next.next;\n currentNode.val.next = currentNode.next.val.id; // DB next\n\n nextNodeCopy.next = currentNode;\n nextNodeCopy.val.next = nextNodeCopy.next.val.id; // DB next\n\n this.head = nextNodeCopy;\n this.head.val.next = this.head.next.val.id; // DB next\n\n return;\n }\n\n // currentNode is the last item\n if (currentNode.next === null) {\n return;\n }\n\n // currentNode is somewhere in the middle\n currentNode.next = currentNode.next.next;\n currentNode.val.next = currentNode.next.val.id; // DB next\n\n nextNodeCopy.next = currentNode;\n nextNodeCopy.val.next = nextNodeCopy.next.val.id; // DB next\n\n previousNode.next = nextNodeCopy;\n previousNode.val.next = previousNode.next.val.id; // DB next\n\n return;\n }\n\n previousNode = currentNode;\n currentNode = currentNode.next;\n }\n }", "function LinkList(){\nthis.head = null;\nthis.tail = null;\n}", "addToBack(nodes){ // does not return anything\n var runner=this.head\n while(runner){\n if(runner.next==null){\n runner.next=nodes;\n }\n else runner=runner.next;\n }\n }", "function hashNode(key,value,next)\n{\n this.key = key;\n this.value = value;\n this.next = next || null;\n}", "addToTail(value) {\n const newNode = { value, next: null };\n if (this.head === null) {\n this.head = newNode;\n this.tail = newNode;\n }\n const holder = this.tail;\n holder.next = newNode;\n this.tail = newNode;\n }", "function nodeSwap(head) {\n const tempNode = new LinkedList(0);\n tempNode.next = head;\n\n let prevNode = tempNode;\n while(prevNode.next !== null && prevNode.next.next !== null) {\n const firstNode = prevNode.next;\n const secondNode = prevNode.next.next;\n // prevNode -> firstNode -> secondNode -> x\n\n firstNode.next = secondNode.next;\n secondNode.next = firstNode;\n prevNode.next = secondNode;\n // prevNode -> secondNode -> firstNode -> x\n\n prevNode = firstNode;\n }\n return tempNode.next; \n}", "put(key, value) {\n if (this.hashMap.get(key) === undefined) {\n let node = this.doublyLinkedList.addToHead({ key: key, val: value });\n this.hashMap.set(key, node);\n this.checkLLCapacity();\n } else {\n let node = this.hashMap.get(key);\n node.storage.val = value;\n this.doublyLinkedList.moveToHead(node);\n }\n }", "function formal_dynamiclist_swap_entries(list_cssid, upper_node, lower_node) {\n if (upper_node == null && lower_node == null) {\n return;\n }\n \n var lst = document.getElementById(list_cssid);\n check_valid_ref(lst);\n\n // if indices same, nop\n if (upper_node == lower_node) {\n return;\n }\n\n var cont = __formal_dynamiclist_locate_list_contents(lst);\n var before = lower_node.nextSibling;\n\n // remove upper and lower nodes.\n cont.removeChild(upper_node);\n cont.removeChild(lower_node);\n\n // insert initial lower node first (-> becomes upper)\n if (before == null) { // IE workaround\n cont.appendChild(lower_node);\n } else {\n cont.insertBefore(lower_node, before);\n }\n\n // insert initial upper node.\n if (before == null) { // IE workaround\n cont.appendChild(upper_node);\n } else {\n cont.insertBefore(upper_node, before);\n }\n\n}", "function append(list, item) {\n remove(item);\n item._idleNext = list._idleNext;\n list._idleNext._idlePrev = item;\n item._idlePrev = list;\n list._idleNext = item;\n }", "function LRUCache(limit) {\n\t this.size = 0;\n\t this.limit = limit;\n\t this._keymap = {};\n\t}", "function append(head, item, key) {\n key = key || 0;\n var headLinks = head[_LINKS];\n var itemLinks = item[_LINKS];\n \n //printItem('append: before head ===', head, key);\n //printItem('append: before item ===', item, key);\n \n remove(item, key);\n itemLinks[key+1] = headLinks[key+1];\n headLinks[key+1][_LINKS][key] = item;\n itemLinks[key] = head;\n headLinks[key+1] = item;\n \n //printItem('append: after head ===', head, key);\n //printItem('append: after item ===', item, key);\n //printNewLine();\n \n return item;\n}", "insertAfter(key, value) {\n if(this.head === null) {\n this.head = new _Node(value, this.head)\n }\n let currNode = this.head\n while(currNode !== null & currNode.value !== key) {\n currNode = currNode.next\n }\n currNode.next = new _Node(value, currNode.next)\n }", "function mergeLinkedLists() {\n while (ll1t && llt2) {\n c1.next = c2;\n c2.next = ll1t;\n c1 = ll1t;\n c2 = ll2t;\n ll1t = c1.next;\n ll2t = c2.next;\n\n }\n\n}", "function HashNode(key, value, next) {\n this.key = key\n this.value = value\n this.next = next || null // in case we have collision\n}", "constructor() {\n this._head = null\n this._tail = this._head \n }", "function removeDups2(head) {\n // if no head, return undefined\n if (!head) {\n return undefined;\n }\n \n // create two pointers\n let point1 = head;\n let point2 = head;\n\n // iterate through linked list\n while (point1 !== null) {\n while (point2.next !== null) {\n // if point2.val === curr.val, remove it from linked list\n if (point2.next.val === point1.val) {\n point2.next = point2.next.next;\n } else {\n // else move to the next node in the list\n point2 = point2.next;\n }\n }\n // once you exit the inner loop, move point1 to the next node\n point1 = point1.next;\n\n // have point2 equal point1\n point2 = point1;\n }\n\n return head;\n}", "function sortEntriesLRU(entries){\n\t// Comparison function for sort\n\tvar date_sort_asc = function (entry1, entry2) {\n\t\tvar date1 = entry1.dateAccessed;\n\t\tvar date2 = entry2.dateAccessed;\n\t\tif (date1 > date2) return 1;\n\t\tif (date1 < date2) return -1;\n\t\treturn 0;\n\t};\n\n\tentries.sort(date_sort_asc);\t\n}", "addEdge(node1, node2) {\n let list = this.lists[node1];\n\n // we create the list lazily\n if (list == null) {\n list = new DynamicArray(4);\n this.lists[node1] = list; // /!\\ this is sensitive to duplicates\n }\n\n return list.add(list.getSize(), node2);\n }", "function LRUCache(limit) {\n this.size = 0;\n this.limit = limit;\n this._keymap = {};\n }", "function merge(l1, l2) {\n const head = new ListNode();\n let current = head;\n\n while (l1 !== null && l2 !== null) {\n if (l1.value < l2.value) {\n current.next = l1;\n l1 = l1.next;\n } else {\n current.next = l2;\n l2 = l2.next;\n }\n\n current = current.next;\n }\n\n current.next = l1 === null ? l2 : l1;\n\n return head.next;\n}", "function scanLinks() {\r\n\t\tvar links = getLinks();\r\n\r\n\t\tfor (var i=0; i < links.length; i++){\r\n\t\t\tvar link = links[i];\r\n\t\t\tif (match(link.href)) {\r\n\t\t\t\t// do private link first so it appears after normal link\r\n\t\t\t\tif (wtorrent_showprivatelinks == true && wtorrent_alwaysdownloadprivate == false) {\r\n\t\t\t\t\tvar wTorrentPrivateLink = makeWTorrentLink(link,true);\r\n\t\t\t\t\tlink.parentNode.insertBefore(wTorrentPrivateLink, link.nextSibling);\r\n\t\t\t\t\t}\r\n\t\t\t\t// normal wTorrent link\r\n\t\t\t\tvar wTorrentLink = makeWTorrentLink(link,false);\r\n\t\t\t\tlink.parentNode.insertBefore(wTorrentLink, link.nextSibling);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "function removeDupsLinearSpace(head) {\n\tlet node = head;\n\tlet buff = {};\n\tlet prev = null;\n\n\twhile(node) {\n\t\tif(buff[node.data]) {\n\t\t\t\tprev.next = prev.next ? prev.next.next : null;\n\t\t\t\tnode = prev.next;\n\t\t}\n\t\telse {\n\t\t\tbuff[node.data] = node;\n\t\t\tprev = node;\n\t\t\tnode = node.next;\n\t\t}\n\t}\n\n\treturn head;\n}", "function swapNode(ll, x, y) {\n var node1 = ll.head;\n var node2 = ll.head;\n var prev1, prev2;\n\n // find node1\n if (node1.data == x) {\n // prev1 = .\n } else {\n while (node1 != null && node1.data != x) {\n prev1 = node1;\n node1 = node1.next;\n }\n }\n\n // find node2\n if (node2.data == y) {\n // prev2 = .\n } else {\n while (node2 != null && node2.data != y) {\n prev2 = node2;\n node2 = node2.next;\n }\n }\n\n if (node1 == null || node2 == null)\n return;\n //swap node1 and node2\n // 1->2->3->4\n // node1.data = 2\n // node1.next = Node(3)\n // node2.data = 4\n // node2.next = null\n // node1.next = node2.next;\n // prev2.next = node1;\n // node2.next = node1.next;\n // prev1.next = node2;\n // not head\n if (prev1 == null) {\n node2.next = node1.next;\n ll.head = node2;\n prev2.next = node1;\n node1.next = node2.next;\n } else if (prev2 == null) {\n node1.next = node2.next;\n ll.head = node1;\n node2.next = node1.next;\n prev1.next = node2;\n } else {\n prev1.next = node2;\n node2.next = node1.next;\n prev2.next = node1;\n node1.next = node2.next;\n }\n\n\n return;\n}", "function refresh(entry){if(entry!==freshEnd){if(!staleEnd){staleEnd=entry;}else if(staleEnd===entry){staleEnd=entry.n;}link(entry.n,entry.p);link(entry,freshEnd);freshEnd=entry;freshEnd.n=null;}}", "function refresh(entry){if(entry!==freshEnd){if(!staleEnd){staleEnd=entry;}else if(staleEnd===entry){staleEnd=entry.n;}link(entry.n,entry.p);link(entry,freshEnd);freshEnd=entry;freshEnd.n=null;}}", "function HashNode(key, value, next) {\r\n this.key = key;\r\n this.value = value;\r\n this.next = next || null;\r\n}", "function LRU (size = 10) {\n this.size = size\n this.cache = []\n this.cacheMap = new Map()\n}", "insertAfter(value, newValue) {\n let link = this.head;\n while (link !== this.tail && link.value !== value) { // 1 2 3\n link = link.next;\n }\n if (!link || link.value !== value) {\n throw `No element exists with value: ${value}`;\n }\n const newLink = new Link(newValue);\n newLink.next = link.next;\n link.next = newLink;\n if (link === this.tail) {\n this.tail === newLink;\n }\n this.size++;\n return this;\n }", "function HashNode(key,value,next){\n\tthis.key = key;\n\tthis.value = value;\n\tthis.next = next || null;\n}", "addToTail(value) {\n // declare newNode with value and next property.\n const newNode = {\n value: value,\n next: null,\n }\n //if no head, create both a head and tail.\n if (this.head === null) {\n this.head = newNode;\n this.tail = newNode;\n return;\n }\n //update next pointer for the 'old' tail node to point to the new node and then add new node to the tail. \n this.tail.next = newNode;\n this.tail = newNode;\n }", "insertKeyValuePair(key, value) {\r\n if (!(key in this.cache)) {\r\n if (this.currentSize === this.maxSize) {\r\n this.evictLeastRecent();\r\n } else {\r\n this.currentSize++;\r\n }\r\n this.cache[key] = new DoublyLinkedListNode(key, value);\r\n } else {\r\n this.replaceKey(key, value);\r\n }\r\n this.updateMostRecent(this.cache[key]);\r\n }", "shift() {\n if (!this.head || !this.head.next){\n return undefined;\n \n }\n var current = this.head;\n current = current.next;\n this.head = current;\n }", "function refresh(entry) {\n\t\t\t\t\tif (entry != freshEnd) {\n\t\t\t\t\t\tif (!staleEnd) {\n\t\t\t\t\t\t\tstaleEnd = entry;\n\t\t\t\t\t\t} else if (staleEnd == entry) {\n\t\t\t\t\t\t\tstaleEnd = entry.n;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlink(entry.n, entry.p);\n\t\t\t\t\t\tlink(entry, freshEnd);\n\t\t\t\t\t\tfreshEnd = entry;\n\t\t\t\t\t\tfreshEnd.n = null;\n\t\t\t\t\t}\n\t\t\t\t}", "function refresh(entry) {\n\t\t\t\t\tif (entry != freshEnd) {\n\t\t\t\t\t\tif (!staleEnd) {\n\t\t\t\t\t\t\tstaleEnd = entry;\n\t\t\t\t\t\t} else if (staleEnd == entry) {\n\t\t\t\t\t\t\tstaleEnd = entry.n;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlink(entry.n, entry.p);\n\t\t\t\t\t\tlink(entry, freshEnd);\n\t\t\t\t\t\tfreshEnd = entry;\n\t\t\t\t\t\tfreshEnd.n = null;\n\t\t\t\t\t}\n\t\t\t\t}", "function HashNode(key, value, next) {\n this.key = key\n this.value = value\n this.next = next || null\n}", "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "function LRUCache() {\n var limit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;\n\n _classCallCheck(this, LRUCache);\n\n this.size = 0;\n this.limit = limit;\n this.head = null;\n this.tail = null;\n this.cache = {};\n }", "function mergeLinkedLists2(l1, l2) {\n p1 = l1;\n p1Prev = null;\n p2 = l2;\n // create loop to iterate\n while (p1 && p2) {\n if (p1.val < p2.val) {\n // if the value in p1 is less than value in p2, then continue\n p1Prev = p1;\n p1 = p1.next;\n } else {\n // insert before\n if (p1Prev !== null) p1Prev.next = p2; // if p1Prev is not null\n p1Prev = p2; // when setting this, does not change l1 only changes the p1Prev\n p2 = p2.next;\n p1Prev.next = p1;\n }\n }\n if (p1 === null) p1Prev.next = p2;\n return l1.value < l2.value ? l1 : l2; // return one of them\n}", "function mergeLists(head1, head2) {\n let node1 = head1;\n let node2 = head2;\n\n while (node1 && node2) {\n if (node1.value < node2.value) {\n if (node1.next) {\n if (node1.next.value > node2.value) {\n const temp0 = node1.next;\n node1.next = new Node(node2.value);\n const temp1 = node1.next;\n temp1.next = temp0;\n node1 = temp1.next;\n node2 = node2.next;\n } else {\n node1 = node1.next; // skip\n }\n } else {\n node1.next = new Node(node2.value);\n node1 = node1.next;\n node2 = node2.next;\n break;\n }\n } else if (node1.value > node2.value) {\n const temp0 = node1.next;\n const temp1Data = node1.value;\n node1.value = node2.value;\n node1.next = new Node(temp1Data);\n const temp1 = node1.next;\n node1 = temp1;\n node1.next = temp0;\n node2 = node2.next;\n } else if (node1.value === node2.value) {\n const temp0 = node1.next;\n node1.next = new Node(node2.value);\n const tempNew = node1.next;\n tempNew.next = temp0;\n if (temp0) {\n node1 = tempNew.next;\n } else {\n node1 = tempNew;\n }\n node2 = node2.next;\n }\n }\n while (node2) {\n node1.next = new Node(node2.value);\n node1 = node1.next;\n node2 = node2.next;\n }\n\n return head1;\n}", "function kthToLastNode2(k, head) {\n let lengthOfList = 0;\n let headOfList = head;\n\n while (head) {\n lengthOfList++;\n head = head.next\n }\n\n if (k > lengthOfList || k === 0) {\n throw new Error;\n }\n\n for (let i = 0; i < lengthOfList - k; i++) {\n headOfList = headOfList.next;\n }\n \n return headOfList;\n}", "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }" ]
[ "0.6564833", "0.65521955", "0.65102094", "0.6485858", "0.6485449", "0.64773166", "0.64773166", "0.64773166", "0.64773166", "0.64773166", "0.64773166", "0.64773166", "0.64773166", "0.64638793", "0.64043784", "0.64043784", "0.6399113", "0.62930155", "0.5959393", "0.56078535", "0.55836904", "0.55108356", "0.5482839", "0.5385095", "0.536437", "0.53520226", "0.5337289", "0.5269648", "0.5263482", "0.52380747", "0.5222434", "0.5202876", "0.5167721", "0.5162649", "0.51619893", "0.51557153", "0.5141562", "0.5138176", "0.5131645", "0.5123566", "0.5099782", "0.50978106", "0.5079869", "0.5058093", "0.5053034", "0.5043007", "0.5033716", "0.50325954", "0.50119686", "0.49882933", "0.49882933", "0.4950538", "0.4949782", "0.4943441", "0.49298012", "0.4910716", "0.49059847", "0.490099", "0.4889143", "0.4889143", "0.4876119", "0.48696136", "0.48688203", "0.48654592", "0.48562253", "0.4854762", "0.4853006", "0.4853006", "0.4853006" ]
0.6447052
36
This function is called in a $$postDigest to trigger all the onChanges hooks in a single digest
function flushOnChangesQueue() { try { if (!(--onChangesTtl)) { // We have hit the TTL limit so reset everything onChangesQueue = undefined; throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\n', TTL); } // We must run this hook in an apply since the $$postDigest runs outside apply $rootScope.$apply(function() { for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) { onChangesQueue[i](); } // Reset the queue to trigger a new schedule next time there is a change onChangesQueue = undefined; }); } finally { onChangesTtl++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "$onChanges(change){}", "function rememberChangeHistoryAndInvokeOnChangesHook() {\n var simpleChangesStore = getSimpleChangesStore(this);\n var current = simpleChangesStore === null || simpleChangesStore === void 0 ? void 0 : simpleChangesStore.current;\n\n if (current) {\n var previous = simpleChangesStore.previous;\n\n if (previous === EMPTY_OBJ) {\n simpleChangesStore.previous = current;\n } else {\n // New changes are copied to the previous store, so that we don't lose history for inputs\n // which were not changed this time\n for (var key in current) {\n previous[key] = current[key];\n }\n }\n\n simpleChangesStore.current = null;\n this.ngOnChanges(current);\n }\n }", "_setOnChanges(){\n\t\tthis.inputs.forEach(i => i.addEventListener('change', this._onChange.bind(this)));\t\n\t}", "function rememberChangeHistoryAndInvokeOnChangesHook() {\n var simpleChangesStore = getSimpleChangesStore(this);\n var current = simpleChangesStore === null || simpleChangesStore === void 0 ? void 0 : simpleChangesStore.current;\n\n if (current) {\n var previous = simpleChangesStore.previous;\n\n if (previous === EMPTY_OBJ) {\n simpleChangesStore.previous = current;\n } else {\n // New changes are copied to the previous store, so that we don't lose history for inputs\n // which were not changed this time\n for (var key in current) {\n previous[key] = current[key];\n }\n }\n\n simpleChangesStore.current = null;\n this.ngOnChanges(current);\n }\n}", "function rememberChangeHistoryAndInvokeOnChangesHook() {\n const simpleChangesStore = getSimpleChangesStore(this);\n const current = simpleChangesStore === null || simpleChangesStore === void 0 ? void 0 : simpleChangesStore.current;\n if (current) {\n const previous = simpleChangesStore.previous;\n if (previous === EMPTY_OBJ) {\n simpleChangesStore.previous = current;\n }\n else {\n // New changes are copied to the previous store, so that we don't lose history for inputs\n // which were not changed this time\n for (let key in current) {\n previous[key] = current[key];\n }\n }\n simpleChangesStore.current = null;\n this.ngOnChanges(current);\n }\n}", "function rememberChangeHistoryAndInvokeOnChangesHook() {\n const simpleChangesStore = getSimpleChangesStore(this);\n const current = simpleChangesStore === null || simpleChangesStore === void 0 ? void 0 : simpleChangesStore.current;\n if (current) {\n const previous = simpleChangesStore.previous;\n if (previous === EMPTY_OBJ) {\n simpleChangesStore.previous = current;\n }\n else {\n // New changes are copied to the previous store, so that we don't lose history for inputs\n // which were not changed this time\n for (let key in current) {\n previous[key] = current[key];\n }\n }\n simpleChangesStore.current = null;\n this.ngOnChanges(current);\n }\n}", "function rememberChangeHistoryAndInvokeOnChangesHook() {\n const simpleChangesStore = getSimpleChangesStore(this);\n const current = simpleChangesStore === null || simpleChangesStore === void 0 ? void 0 : simpleChangesStore.current;\n if (current) {\n const previous = simpleChangesStore.previous;\n if (previous === EMPTY_OBJ) {\n simpleChangesStore.previous = current;\n }\n else {\n // New changes are copied to the previous store, so that we don't lose history for inputs\n // which were not changed this time\n for (let key in current) {\n previous[key] = current[key];\n }\n }\n simpleChangesStore.current = null;\n this.ngOnChanges(current);\n }\n}", "function rememberChangeHistoryAndInvokeOnChangesHook() {\n const simpleChangesStore = getSimpleChangesStore(this);\n const current = simpleChangesStore === null || simpleChangesStore === void 0 ? void 0 : simpleChangesStore.current;\n if (current) {\n const previous = simpleChangesStore.previous;\n if (previous === EMPTY_OBJ) {\n simpleChangesStore.previous = current;\n }\n else {\n // New changes are copied to the previous store, so that we don't lose history for inputs\n // which were not changed this time\n for (let key in current) {\n previous[key] = current[key];\n }\n }\n simpleChangesStore.current = null;\n this.ngOnChanges(current);\n }\n}", "function rememberChangeHistoryAndInvokeOnChangesHook() {\n const simpleChangesStore = getSimpleChangesStore(this);\n const current = simpleChangesStore === null || simpleChangesStore === void 0 ? void 0 : simpleChangesStore.current;\n if (current) {\n const previous = simpleChangesStore.previous;\n if (previous === EMPTY_OBJ) {\n simpleChangesStore.previous = current;\n }\n else {\n // New changes are copied to the previous store, so that we don't lose history for inputs\n // which were not changed this time\n for (let key in current) {\n previous[key] = current[key];\n }\n }\n simpleChangesStore.current = null;\n this.ngOnChanges(current);\n }\n}", "function rememberChangeHistoryAndInvokeOnChangesHook() {\n const simpleChangesStore = getSimpleChangesStore(this);\n const current = simpleChangesStore === null || simpleChangesStore === void 0 ? void 0 : simpleChangesStore.current;\n if (current) {\n const previous = simpleChangesStore.previous;\n if (previous === EMPTY_OBJ) {\n simpleChangesStore.previous = current;\n }\n else {\n // New changes are copied to the previous store, so that we don't lose history for inputs\n // which were not changed this time\n for (let key in current) {\n previous[key] = current[key];\n }\n }\n simpleChangesStore.current = null;\n this.ngOnChanges(current);\n }\n}", "onEventCommit({ changes }) {\n [...changes.added, ...changes.modified].forEach((eventRecord) => this.repaintEvent(eventRecord));\n }", "firstUpdated(_changedProperties){}", "firstUpdated(_changedProperties){}", "[PRIVATE.$onChanges] (changes) {\n this[PRIVATE.callSymbols](PRIVATE.onChangesSymbols, [changes]);\n }", "reTriggerChanges() {\n for (const attr in this.attributes) {\n this.trigger(`change:${attr}`, this, this.get(attr), {});\n }\n this.trigger(\"change\", this, {});\n }", "function hookDigestRateCounter() {\n resetDigestRateCounter();\n unhookDigestRateCounter = scope.$watch(function () { digestRateCount++; });\n }", "function flushOnChangesQueue(){try{if(! --onChangesTtl){// We have hit the TTL limit so reset everything\nonChangesQueue=undefined;throw $compileMinErr('infchng','{0} $onChanges() iterations reached. Aborting!\\n',TTL);}// We must run this hook in an apply since the $$postDigest runs outside apply\n$rootScope.$apply(function(){var errors=[];for(var i=0,ii=onChangesQueue.length;i<ii;++i){try{onChangesQueue[i]();}catch(e){errors.push(e);}}// Reset the queue to trigger a new schedule next time there is a change\nonChangesQueue=undefined;if(errors.length){throw errors;}});}finally{onChangesTtl++;}}", "firstUpdated(_changedProperties) { }", "firstUpdated(_changedProperties) {\n }", "firstUpdated(_changedProperties) {\n }", "firstUpdated(_changedProperties) {\n }", "function flushOnChangesQueue() {\n\t try {\n\t if (!(--onChangesTtl)) {\n\t // We have hit the TTL limit so reset everything\n\t onChangesQueue = undefined;\n\t throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n\t }\n\t // We must run this hook in an apply since the $$postDigest runs outside apply\n\t $rootScope.$apply(function() {\n\t for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n\t onChangesQueue[i]();\n\t }\n\t // Reset the queue to trigger a new schedule next time there is a change\n\t onChangesQueue = undefined;\n\t });\n\t } finally {\n\t onChangesTtl++;\n\t }\n\t }", "function flushOnChangesQueue(){try{if(! --onChangesTtl){// We have hit the TTL limit so reset everything\n\tonChangesQueue=undefined;throw $compileMinErr('infchng','{0} $onChanges() iterations reached. Aborting!\\n',TTL);}// We must run this hook in an apply since the $$postDigest runs outside apply\n\t$rootScope.$apply(function(){var errors=[];for(var i=0,ii=onChangesQueue.length;i<ii;++i){try{onChangesQueue[i]();}catch(e){errors.push(e);}}// Reset the queue to trigger a new schedule next time there is a change\n\tonChangesQueue=undefined;if(errors.length){throw errors;}});}finally{onChangesTtl++;}}", "ngOnChanges(changes) {\n //=> For each changed @Input that matches a SweetAlert2 option, mark as touched so we can\n // send it with the next fire() or update() calls.\n Object.keys(changes)\n //=> If the filtering logic becomes more complex here, we can use Swal.isValidParameter\n .filter((prop) => !prop.startsWith('swal'))\n .forEach(this.markTouched);\n //=> Eventually trigger re-render if the modal is open.\n void this.update();\n }", "function flushOnChangesQueue() {\n\t try {\n\t if (!(--onChangesTtl)) {\n\t // We have hit the TTL limit so reset everything\n\t onChangesQueue = undefined;\n\t throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n\t }\n\t // We must run this hook in an apply since the $$postDigest runs outside apply\n\t $rootScope.$apply(function() {\n\t for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n\t try {\n\t onChangesQueue[i]();\n\t } catch (e) {\n\t $exceptionHandler(e);\n\t }\n\t }\n\t // Reset the queue to trigger a new schedule next time there is a change\n\t onChangesQueue = undefined;\n\t });\n\t } finally {\n\t onChangesTtl++;\n\t }\n\t }", "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n });\n } finally {\n onChangesTtl++;\n }\n }", "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n });\n } finally {\n onChangesTtl++;\n }\n }", "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n });\n } finally {\n onChangesTtl++;\n }\n }", "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n });\n } finally {\n onChangesTtl++;\n }\n }", "async InvokeChanged(){\n\t\tawait Promise.all(this._onChanged.map(func => func(this._value)))\n\t}", "function flushOnChangesQueue() {\n try {\n if (! --onChangesTtl) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function () {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }", "registerOnChange(fn) {\n this.propagateChanges = fn;\n }", "handleChangeEvent() {\n this.cacheHasChanged = true;\n }", "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }", "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }", "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }", "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }", "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }", "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }", "function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }", "onBufferChange(args) {\n // We can have multiple ranges if the user has multiple insert points,\n // such as using alt-shift to insert across multiple lines. We need to\n // deal with each one.\n this.changesSeen++;\n for (const change of args.changes) {\n this.processChange(change);\n }\n }", "firstUpdated(changedProperties) {\n console.log('first updated', changedProperties);\n }", "_handleChildValueChange() {\n this.stateChanges.next(undefined);\n this._changeDetectorRef.markForCheck();\n }", "_handleChildValueChange() {\n this.stateChanges.next(undefined);\n this._changeDetectorRef.markForCheck();\n }", "_propagateChanges() {\n const valueToEmit = this._chips.length ? this._chips.toArray().map(chip => chip.value) : [];\n this._value = valueToEmit;\n this.change.emit(new MatChipGridChange(this, valueToEmit));\n this.valueChange.emit(valueToEmit);\n this._onChange(valueToEmit);\n this._changeDetectorRef.markForCheck();\n }", "function referenceOnChange() {\n MicroReferenceAPI.onStatusChange(criteriaId);\n }", "markEverythingDirty() {\n this.versionHash++;\n }", "function propagate_changes() {\n\tfor (const waiter of to_update.values()) {\n\t\twaiter();\n\t}\n\tto_update = false;\n\tupdate_roots = new Set();\n}", "callNgOnChanges(componentRef) {\n if (!this.implementsOnChanges || this.inputChanges === null) {\n return;\n }\n // Cache the changes and set inputChanges to null to capture any changes that might occur\n // during ngOnChanges.\n const inputChanges = this.inputChanges;\n this.inputChanges = null;\n componentRef.instance.ngOnChanges(inputChanges);\n }", "ngOnChanges(changes) {\n super.ngOnChanges(changes);\n }", "ngOnChanges(changes) {\n super.ngOnChanges(changes);\n }", "onMasterDataChanged({ action, changes }) {\n const me = this;\n\n if (action === 'update') {\n // if a field not defined in chainedFields is changed, ignore the change.\n // there is no need to refilter the store in such cases, the change will be available anyhow since data is\n // shared\n const refilter = me.chainedFields && me.chainedFields.some((field) => field in changes);\n\n if (!refilter) return;\n }\n\n me.fillFromMaster();\n }", "_onChange () {\n this.forceUpdate()\n }", "_onDirtyChanged() {\n /** @protectedEvent dirty-changed */\n this.dispatchEvent(new Event('dirty-changed', { bubbles: true, composed: true }));\n }", "firstUpdated(changedProperties) {\n if (super.firstUpdated) {\n super.firstUpdated(changedProperties);\n }\n }", "updateChanges() {\n for (let i = 0; i < this._size; i++) {\n this._markActive(i);\n }\n\n // get the position changes for each object in collision\n for (let i = 0; i < this._size; i++) {\n this._updatePosition(i);\n }\n\n // get the velocity changes for each object in collision\n for (let i = 0; i < this._size; i++) {\n this._updateVelocity(i);\n }\n\n // call onCollided() for every object\n for (let i = 0; i < this._size; i++) {\n this._callCollided(i);\n }\n }", "_environmentsChanged() {}", "updated(_changedProperties) { }", "firstUpdated(changedProperties) {\n super.firstUpdated(changedProperties);\n this._isFirstUpdated = true;\n Providers.onProviderUpdated(this.handleProviderUpdates);\n Providers.onActiveAccountChanged(this.handleActiveAccountUpdates);\n this.requestStateUpdate();\n }", "_runProcessChanges() {\n // Don't run this functionality if the element has disconnected.\n if (!this.isConnected) return;\n\n store.dispatch(ui.reportDirtyForm(this.formName, this.isDirty));\n this.dispatchEvent(new CustomEvent('change', {\n detail: {\n delta: this.delta,\n commentContent: this.getCommentContent(),\n },\n }));\n }", "function notifyProperty(changes) {\n $.each(changes._watchers, function() {\n notifyCall(this);\n });\n }", "async determineChanges () {\n\t\tthis.changes = {};\n\t\tObject.keys(this.attributes).forEach(attribute => {\n\t\t\tif (attribute === 'id' || attribute === '_id') { return; }\n\t\t\tif (!this.attributesAreEqual(\n\t\t\t\tthis.existingModel.get(attribute),\n\t\t\t\tthis.attributes[attribute])\n\t\t\t) {\n\t\t\t\tthis.changes[attribute] = this.attributes[attribute];\n\t\t\t}\n\t\t});\n\t}", "function setHasChanges() {\n if (!HasChanges)\n HasChanges = true;\n}", "onInvalidation(changeInfo) {}", "markChanged() { \n if (this._lastChangeId >= Number.MAX_SAFE_INTEGER) {\n this._lastChangeId = 1;\n }\n else {\n ++this._lastChangeId; \n }\n }", "updated(_changedProperties) {\n }", "updated(_changedProperties) {\n }", "updated(_changedProperties) {\n }", "__applyModelChanges() {\n this.buildLookupTable();\n this._applyDefaultSelection();\n }", "_triggerUpdatedData(e){// get fresh data if not published\nif(this.editorBuilder&&\"published\"!==this.editorBuilder.getContext()&&\"demo\"!==this.editorBuilder.getContext()){this.__timeStamp=\"?\"+Math.floor(Date.now()/1e3)}this.$.manifest.generateRequest()}", "_stateChanged() {\n this._changeDetectorRef.markForCheck();\n }", "firstUpdated(e){}", "function onChange() {\n console.log(\"something changed...\");\n \n }", "updated(_changedProperties){}", "updated(_changedProperties){}", "_onChange() {\n void this._debouncer.invoke();\n }", "afterChange(toSet, wasSet, silent, fromRelationUpdate, skipAccessors) {\n this.stores.forEach(store => {\n store.onModelChange(this, toSet, wasSet, silent, fromRelationUpdate);\n });\n }", "onEventBeforeCommit({ changes }) {\n // Committing sets a flag in meta that during eventrendering applies a CSS class. But to not mess up drag and\n // drop between resources no redraw is performed before committing, so class is never applied to the element(s).\n // Applying here instead\n [...changes.added, ...changes.modified].forEach((eventRecord) =>\n this.getElementsFromEventRecord(eventRecord).forEach((element) => element.classList.add(this.committingCls))\n );\n }", "updated(changedProperties) {\n }", "function afterDigest(callback) {\n if (me.scope.$$destroyed) { return; }\n\n // Setup a watch to run once\n _cancelDigestUpdate = me.scope.$watch(function() {\n _cancelDigestUpdate();\n $timeout(function() {\n callback();\n afterDigest(callback);\n }, 0, false);\n });\n }", "function IterableChanges() { }", "function IterableChanges() { }", "function digest() {\n // var start = (new Date()).getTime();\n for (var i = 0; i < CACHE.length; i++) {\n var cache = CACHE[i];\n // If the models are different, then we should re-bind\n if (cache.modelRep != JSON.stringify(cache.model)) {\n // console.log(\"ABOUT TO RE-RENDER, MODEL: \"+JSON.stringify(cache.model));\n bind(cache.elem, cache.model, cache.mapper);\n }\n }\n }", "_onChange ()\n {\n this._dbRef.on('value', (snapshot) =>\n {\n if (snapshot.exists() === false)\n {\n return;\n }\n\n let data = snapshot.val();\n this._key = snapshot.key;\n this._name = data.name;\n this._owner = data.owner;\n this._players = data.players || {};\n this._map = data.map;\n this._gameType = data.gameType;\n\n if (this._eventsStorage['change']) this._eventsStorage['change'].forEach((event) => event(data));\n });\n }", "function monitorChanges(changes, namespace) {\n\tif (changes.disabled) {\n\t\tupdateIcon();\n\n\t\tif (changes.disabled.newValue == true) {\n\t\t\tlog('Disabling Quoor, removing listener');\n\t\t\tchrome.webRequest.onBeforeRequest.removeListener(checkQuotes);\n\t\t} else {\n\t\t\tlog('Enabling Quoor, setting up listener');\n\t\t\tsetUpQuoListener();\n\t\t}\n\t}\n\n\tif (changes.quotes) {\n\t\tlog('Quotes have changed, setting up listener again');\n\t\tsetUpQuoListener();\n }\n\n if (changes.logging) {\n log('Logging settings have changed, updating...');\n updateLogging();\n\t}\n\tif (changes.enableNotifications){\n\t\tlog('notifications setting changed');\n\t\tenableNotifications=changes.enableNotifications.newValue;\n\t}\n}", "onMasterDataChanged({\n action,\n changes\n }) {\n const me = this;\n\n if (action === 'update') {\n // if a field not defined in chainedFields is changed, ignore the change.\n // there is no need to refilter the store in such cases, the change will be available anyhow since data is\n // shared\n const refilter = me.chainedFields && me.chainedFields.some(field => field in changes);\n if (!refilter) return;\n }\n\n me.fillFromMaster();\n }", "function onChange() {\n\t\t__debug_429( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "notifyListeners(changes) {\n for ( var i = 0; i < this.listeners.length; i++ ) {\n this.listeners[i](this,changes);\n }\n }", "afterValidChange() { }", "updated(_changedProperties) {\n }", "function onChange() {\n\t\t/* eslint-disable no-underscore-dangle */\n\t\t__debug_730( 'Received a change event.' );\n\t\tif ( self._autoRender ) {\n\t\t\tself.render();\n\t\t}\n\t}", "updated(changedProperties) {\n changedProperties.forEach((oldValue, propName) => {\n //console.log('changedProperties',propName,oldValue,this[propName]);\n if (propName === \"schema\") this._schemaChanged(this.schema, oldValue);\n if (propName === \"value\") this._valueChanged(this.value, oldValue);\n });\n }", "applyChanges() {\n this._applyClipChanges();\n\n this._applyPathChanges();\n }", "function onChange() {\n\t\t__debug_412( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "function flushChanges() {\n self.changes = [];\n }", "function flushChanges() {\n self.changes = [];\n }", "function waitForChangeEvents() {\n clock.tick(Field.DELAYED_CHANGE_FREQUENCY + Field.CHANGE_FREQUENCY);\n}", "function onChange() {\n\t\t__debug_475( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}" ]
[ "0.66514355", "0.6629411", "0.64711004", "0.64095384", "0.6363313", "0.6363313", "0.6363313", "0.6363313", "0.6363313", "0.6363313", "0.622852", "0.6181225", "0.6181225", "0.6176537", "0.61595833", "0.61113364", "0.6068259", "0.60500216", "0.6046954", "0.6046954", "0.6046954", "0.60116524", "0.5995733", "0.59860647", "0.59796107", "0.59594816", "0.59594816", "0.59594816", "0.59594816", "0.59432566", "0.5927836", "0.59086263", "0.59083813", "0.58789754", "0.58789754", "0.58789754", "0.58789754", "0.58789754", "0.58789754", "0.58789754", "0.5848437", "0.5811584", "0.57928526", "0.57928526", "0.57779527", "0.5776666", "0.5769499", "0.5752608", "0.5742845", "0.57360643", "0.57360643", "0.5723081", "0.57085294", "0.56863415", "0.56821674", "0.565801", "0.565015", "0.56495243", "0.56413823", "0.56273705", "0.56194174", "0.561779", "0.5611463", "0.55995715", "0.55894005", "0.55887115", "0.55887115", "0.55887115", "0.5584027", "0.55711126", "0.5559613", "0.55530024", "0.55387765", "0.5534293", "0.5534293", "0.5533099", "0.55189794", "0.5514221", "0.55128115", "0.5492717", "0.54926676", "0.54926676", "0.5473997", "0.5473832", "0.54705495", "0.54676867", "0.54669476", "0.54663926", "0.5465535", "0.5455405", "0.5454996", "0.5454831", "0.5450027", "0.544106", "0.5437943", "0.5437943", "0.54359555", "0.5430042" ]
0.5999934
24
This is the function that is injected as `$transclude`. Note: all arguments are optional!
function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement, slotName) { var transcludeControllers; // No scope passed in: if (!isScope(scope)) { slotName = futureParentElement; futureParentElement = cloneAttachFn; cloneAttachFn = scope; scope = undefined; } if (hasElementTranscludeDirective) { transcludeControllers = elementControllers; } if (!futureParentElement) { futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element; } if (slotName) { // slotTranscludeFn can be one of three things: // * a transclude function - a filled slot // * `null` - an optional slot that was not filled // * `undefined` - a slot that was not declared (i.e. invalid) var slotTranscludeFn = boundTranscludeFn.$$slots[slotName]; if (slotTranscludeFn) { return slotTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild); } else if (isUndefined(slotTranscludeFn)) { throw $compileMinErr('noslot', 'No parent directive that requires a transclusion with slot name "{0}". ' + 'Element: {1}', slotName, startingTag($element)); } } else { return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "transclude (element) {\n if (this.dom_parser.elements.length === 0) { return; }\n const body = this.dom_parser.document.body.cloneNode(true);\n\n while (element.firstChild) {\n const child = element.removeChild(element.firstChild);\n let transcluder;\n if (child.nodeType === Node.ELEMENT_NODE) {\n transcluder = this.transcluders.find(t => {\n return t.tag_name === child.tagName;\n });\n }\n if (transcluder) {\n transcluder.elements.push(child);\n } else if (this.default_transcluder) {\n this.default_transcluder.elements.push(child);\n } else {\n throw new Error(\"Transcluder is not found\");\n }\n }\n\n for (const t of this.transcluders) t.set_placeholder(body);\n if (this.default_transcluder) {\n this.default_transcluder.set_placeholder(body);\n }\n\n for (const t of this.transcluders) t.transclude();\n this.default_transcluder && this.default_transcluder.transclude();\n\n while (body.firstChild) element.appendChild(body.firstChild);\n }", "function link( scope, element, attributes, _c, transclude ) {\n\t\t\t\t\t\t\t\t\t\t console.log( \"Container at link (html):\", element.html() );\n\t\t\t\t\t\t\t\t\t\t // Clone and inject the transcluded content.\n\t\t\t\t\t\t\t\t\t\t transclude(\n\t\t\t\t\t\t\t\t\t\t function injectLinkedClone( clone ) {\n\t\t\t\t\t\t\t\t\t\t element.append( clone );\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t\t\t\t }", "function transcludeHeaderItems() {\n $transclude( function (content) {\n var header = findNode('.tabs-header-items', element);\n var parent = angular.element(element[0]);\n\n angular.forEach(content, function (node) {\n var intoHeader = isNodeType(node, 'material-tab') || isNgRepeat(node);\n\n if (intoHeader) {\n header.append(node);\n } else {\n parent.prepend(node);\n }\n });\n });\n }", "function controllersBoundTransclude(scope,cloneAttachFn,futureParentElement,slotName){var transcludeControllers;// No scope passed in:\nif(!isScope(scope)){slotName=futureParentElement;futureParentElement=cloneAttachFn;cloneAttachFn=scope;scope=undefined;}if(hasElementTranscludeDirective){transcludeControllers=elementControllers;}if(!futureParentElement){futureParentElement=hasElementTranscludeDirective?$element.parent():$element;}if(slotName){// slotTranscludeFn can be one of three things:\n// * a transclude function - a filled slot\n// * `null` - an optional slot that was not filled\n// * `undefined` - a slot that was not declared (i.e. invalid)\nvar slotTranscludeFn=boundTranscludeFn.$$slots[slotName];if(slotTranscludeFn){return slotTranscludeFn(scope,cloneAttachFn,transcludeControllers,futureParentElement,scopeToChild);}else if(isUndefined(slotTranscludeFn)){throw $compileMinErr('noslot','No parent directive that requires a transclusion with slot name \"{0}\". '+'Element: {1}',slotName,startingTag($element));}}else{return boundTranscludeFn(scope,cloneAttachFn,transcludeControllers,futureParentElement,scopeToChild);}}", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) { // 8346\n var transcludeControllers; // 8347\n // 8348\n // No scope passed in: // 8349\n if (!isScope(scope)) { // 8350\n futureParentElement = cloneAttachFn; // 8351\n cloneAttachFn = scope; // 8352\n scope = undefined; // 8353\n } // 8354\n // 8355\n if (hasElementTranscludeDirective) { // 8356\n transcludeControllers = elementControllers; // 8357\n } // 8358\n if (!futureParentElement) { // 8359\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element; // 8360\n } // 8361\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild); // 8362\n }", "function accordionGroupMod() {\n return {\n restrict: \"E\",\n transclude: true,\n scope: {\n heading: \"@\",\n isOpen: \"=?\"\n },\n template: '<accordion-group is-open=\"isOpen\"><accordion-heading>' +\n '<i class=\"glyphicon\" ng-class=\"{\\'glyphicon-minus\\': isOpen, \\'glyphicon-plus\\': !isOpen}\"'+\n 'style=\"font-size: 60%; vertical-align: 2px; padding-right: 10px;\"></i>{{heading}}' +\n '</accordion-heading><div ng-transclude></div></accordion-group>'\n };\n}", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n\t\t\t\t\t\t\tvar transcludeControllers;\n\n\t\t\t\t\t\t\t// No scope passed in:\n\t\t\t\t\t\t\tif (!isScope(scope)) {\n\t\t\t\t\t\t\t\tfutureParentElement = cloneAttachFn;\n\t\t\t\t\t\t\t\tcloneAttachFn = scope;\n\t\t\t\t\t\t\t\tscope = undefined;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (hasElementTranscludeDirective) {\n\t\t\t\t\t\t\t\ttranscludeControllers = elementControllers;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!futureParentElement) {\n\t\t\t\t\t\t\t\tfutureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n\t\t\t\t\t\t}", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn) {\n var transcludeControllers;\n\n // no scope passed\n if (arguments.length < 2) {\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers);\n }", "function controllersBoundTransclude(scope, cloneAttachFn) {\n var transcludeControllers;\n\n // no scope passed\n if (arguments.length < 2) {\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers);\n }", "function controllersBoundTransclude(scope, cloneAttachFn) {\n var transcludeControllers;\n\n // no scope passed\n if (arguments.length < 2) {\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers);\n }", "function controllersBoundTransclude(scope, cloneAttachFn) {\n var transcludeControllers;\n\n // no scope passed\n if (arguments.length < 2) {\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers);\n }", "function controllersBoundTransclude(scope, cloneAttachFn) {\n var transcludeControllers;\n\n // no scope passed\n if (arguments.length < 2) {\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers);\n }", "function controllersBoundTransclude(scope, cloneAttachFn) {\n var transcludeControllers;\n\n // no scope passed\n if (arguments.length < 2) {\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement);\n }", "function controllersBoundTransclude(scope,cloneAttachFn,futureParentElement,slotName){var transcludeControllers;// No scope passed in:\n\tif(!isScope(scope)){slotName=futureParentElement;futureParentElement=cloneAttachFn;cloneAttachFn=scope;scope=undefined;}if(hasElementTranscludeDirective){transcludeControllers=elementControllers;}if(!futureParentElement){futureParentElement=hasElementTranscludeDirective?$element.parent():$element;}if(slotName){// slotTranscludeFn can be one of three things:\n\t// * a transclude function - a filled slot\n\t// * `null` - an optional slot that was not filled\n\t// * `undefined` - a slot that was not declared (i.e. invalid)\n\tvar slotTranscludeFn=boundTranscludeFn.$$slots[slotName];if(slotTranscludeFn){return slotTranscludeFn(scope,cloneAttachFn,transcludeControllers,futureParentElement,scopeToChild);}else if(isUndefined(slotTranscludeFn)){throw $compileMinErr('noslot','No parent directive that requires a transclusion with slot name \"{0}\". '+'Element: {1}',slotName,startingTag($element));}}else{return boundTranscludeFn(scope,cloneAttachFn,transcludeControllers,futureParentElement,scopeToChild);}}", "function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, // 7538\n previousCompileContext) { // 7539\n if (!($compileNodes instanceof jqLite)) { // 7540\n // jquery always rewraps, whereas we need to preserve the original selector so that we can // 7541\n // modify it. // 7542\n $compileNodes = jqLite($compileNodes); // 7543\n } // 7544\n // We can not compile top level text elements since text nodes can be merged and we will // 7545\n // not be able to attach scope data to them, so we will wrap them in <span> // 7546\n forEach($compileNodes, function(node, index) { // 7547\n if (node.nodeType == NODE_TYPE_TEXT && node.nodeValue.match(/\\S+/) /* non-empty */ ) { // 7548\n $compileNodes[index] = jqLite(node).wrap('<span></span>').parent()[0]; // 7549\n } // 7550\n }); // 7551\n var compositeLinkFn = // 7552\n compileNodes($compileNodes, transcludeFn, $compileNodes, // 7553\n maxPriority, ignoreDirective, previousCompileContext); // 7554\n compile.$$addScopeClass($compileNodes); // 7555\n var namespace = null; // 7556\n return function publicLinkFn(scope, cloneConnectFn, options) { // 7557\n assertArg(scope, 'scope'); // 7558\n // 7559\n if (previousCompileContext && previousCompileContext.needsNewScope) { // 7560\n // A parent directive did a replace and a directive on this element asked // 7561\n // for transclusion, which caused us to lose a layer of element on which // 7562\n // we could hold the new transclusion scope, so we will create it manually // 7563\n // here. // 7564\n scope = scope.$parent.$new(); // 7565\n } // 7566\n // 7567\n options = options || {}; // 7568\n var parentBoundTranscludeFn = options.parentBoundTranscludeFn, // 7569\n transcludeControllers = options.transcludeControllers, // 7570\n futureParentElement = options.futureParentElement; // 7571\n // 7572\n // When `parentBoundTranscludeFn` is passed, it is a // 7573\n // `controllersBoundTransclude` function (it was previously passed // 7574\n // as `transclude` to directive.link) so we must unwrap it to get // 7575\n // its `boundTranscludeFn` // 7576\n if (parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude) { // 7577\n parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude; // 7578\n } // 7579\n // 7580\n if (!namespace) { // 7581\n namespace = detectNamespaceForChildElements(futureParentElement); // 7582\n } // 7583\n var $linkNode; // 7584\n if (namespace !== 'html') { // 7585\n // When using a directive with replace:true and templateUrl the $compileNodes // 7586\n // (or a child element inside of them) // 7587\n // might change, so we need to recreate the namespace adapted compileNodes // 7588\n // for call to the link function. // 7589\n // Note: This will already clone the nodes... // 7590\n $linkNode = jqLite( // 7591\n wrapTemplate(namespace, jqLite('<div>').append($compileNodes).html()) // 7592\n ); // 7593\n } else if (cloneConnectFn) { // 7594\n // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart // 7595\n // and sometimes changes the structure of the DOM. // 7596\n $linkNode = JQLitePrototype.clone.call($compileNodes); // 7597\n } else { // 7598\n $linkNode = $compileNodes; // 7599\n } // 7600\n // 7601\n if (transcludeControllers) { // 7602\n for (var controllerName in transcludeControllers) { // 7603\n $linkNode.data('$' + controllerName + 'Controller', transcludeControllers[controllerName].instance); // 7604\n } // 7605\n } // 7606\n // 7607\n compile.$$addScopeInfo($linkNode, scope); // 7608\n // 7609\n if (cloneConnectFn) cloneConnectFn($linkNode, scope); // 7610\n if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn); // 7611\n return $linkNode; // 7612\n }; // 7613\n } // 7614", "function link(scope, element, attrs, ctrl, transclude) {\n var urlTemplate = '';\n urlTemplate = urlPath + reload_name + '.dir.html'\n $templateRequest(urlTemplate).then(\n function onCreateDomElements(html) {\n var $scope = scope;\n\n element.on('$destroy', function () {\n //alert('qf destroyed');\n })\n scope.id = Math.random();\n //alert('created ' + scope.id);\n\n //var utilsParentDict = utils.dictTemplates;\n var tH2 = transcludeHelper2.create(this);\n console.log('issue', tH2)\n tH2.setupTransclution(reload_name, scope, $compile, element, html, attrs);\n scope.render(tH2);\n\n return;\n utils.dictTemplates = utilsParent.dictTemplates; //copy over dictionary of templates\n utils.$compile = $compile;\n\n utilsParent.destroyDuplicateScopes(element, scope);\n utils.loadTemplate(html, element, attrs);\n utils.setupTransclution(scope, $compile, element)\n //console.error('qf', 'pre-', scope.vm)\n scope.render(utils, attrs, element);\n\n }\n )\n\n }", "function nodesetLinkingFn(\n /* angular.Scope */ scope,\n /* NodeList */ nodeList,\n /* Element */ rootElement,\n /* function(Function) */ boundTranscludeFn\n){}", "function nodesetLinkingFn(\n /* angular.Scope */ scope,\n /* NodeList */ nodeList,\n /* Element */ rootElement,\n /* function(Function) */ boundTranscludeFn\n){}", "function BrandBannerDirective() {\n return {\n restrict: 'E',\n transclude: true,\n controller: BrandBannerController,\n templateUrl: require('./brand-banner.html'),\n link: function (scope, element, attrs, controller) {\n\n }\n };\n}", "function ContentChildDecorator() {}", "function ContentChildDecorator() {}", "function ContentChildDecorator() {}", "function ContentChildDecorator(){}", "function navTreeLink(scope, element, $attrs) {\n }", "function compile(element, attributes, transclude) {\n\t\t// Parse any content that was included in this directive to pull out\n\t\t// an input field \n\t\ttransclude($rootScope.$new(true), function(clone) {\n\t\t\tvar transcluded = angular.element('<div></div>').append(clone);\n\t\t\tvar transcludedInput = transcluded.find('input');\n\n\t\t\tif ('customFields' in attributes) {\n\t\t\t\tvar form = element.find('ng-form');\n\n\t\t\t\tform.empty().append(transcluded.contents());\n\n\t\t\t\tform.children().removeAttr('ng-non-bindable');\n\n\t\t\t\tform.removeAttr('ng-class');\n\n\t\t\t\t// Ensure that everything is updated on blur and empty fields are\n\t\t\t\t// removed\n\t\t\t\ttranscludedInput.eq(transcludedInput.length - 1).attr('ng-blur', 'updateItems()');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// The transcluded content did not have an input, so create one.\n\t\t\t\tif (transcludedInput.length === 0) {\n\t\t\t\t\ttranscludedInput = angular.element('<input name=\"listItem\" type=\"text\" class=\"form-control\" />');\n\t\t\t\t}\n\n\t\t\t\t// Enforce a name for validation\n\t\t\t\ttranscludedInput.attr('name', 'listItem');\n\n\t\t\t\t// Enforce a model based on repeating over the cloned items\n\t\t\t\ttranscludedInput.attr('ng-model', 'items[$index]');\n\n\t\t\t\t// There should be an <input /> placeholder in the template\n\t\t\t\telement.find('input').replaceWith(transcludedInput);\n\n\t\t\t\t// Ensure that everything is updated on blur and empty fields are\n\t\t\t\t// removed\n\t\t\t\ttranscludedInput.attr('ng-blur', 'didBlurFieldAtIndex($index);updateItems()');\n\t\t\t}\n\t\t});\n\n\t\treturn link;\n\t}", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement, slotName) {\n\t var transcludeControllers;\n\t // No scope passed in:\n\t if (!isScope(scope)) {\n\t slotName = futureParentElement;\n\t futureParentElement = cloneAttachFn;\n\t cloneAttachFn = scope;\n\t scope = undefined;\n\t }\n\n\t if (hasElementTranscludeDirective) {\n\t transcludeControllers = elementControllers;\n\t }\n\t if (!futureParentElement) {\n\t futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n\t }\n\t if (slotName) {\n\t // slotTranscludeFn can be one of three things:\n\t // * a transclude function - a filled slot\n\t // * `null` - an optional slot that was not filled\n\t // * `undefined` - a slot that was not declared (i.e. invalid)\n\t var slotTranscludeFn = boundTranscludeFn.$$slots[slotName];\n\t if (slotTranscludeFn) {\n\t return slotTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n\t } else if (isUndefined(slotTranscludeFn)) {\n\t throw $compileMinErr('noslot',\n\t 'No parent directive that requires a transclusion with slot name \"{0}\". ' +\n\t 'Element: {1}',\n\t slotName, startingTag($element));\n\t }\n\t } else {\n\t return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n\t }\n\t }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement, slotName) {\n\t var transcludeControllers;\n\t // No scope passed in:\n\t if (!isScope(scope)) {\n\t slotName = futureParentElement;\n\t futureParentElement = cloneAttachFn;\n\t cloneAttachFn = scope;\n\t scope = undefined;\n\t }\n\n\t if (hasElementTranscludeDirective) {\n\t transcludeControllers = elementControllers;\n\t }\n\t if (!futureParentElement) {\n\t futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n\t }\n\t if (slotName) {\n\t // slotTranscludeFn can be one of three things:\n\t // * a transclude function - a filled slot\n\t // * `null` - an optional slot that was not filled\n\t // * `undefined` - a slot that was not declared (i.e. invalid)\n\t var slotTranscludeFn = boundTranscludeFn.$$slots[slotName];\n\t if (slotTranscludeFn) {\n\t return slotTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n\t } else if (isUndefined(slotTranscludeFn)) {\n\t throw $compileMinErr('noslot',\n\t 'No parent directive that requires a transclusion with slot name \"{0}\". ' +\n\t 'Element: {1}',\n\t slotName, startingTag($element));\n\t }\n\t } else {\n\t return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n\t }\n\t }", "function ContentChildDecorator() { }", "function ContentChildDecorator() { }", "enterDirective(ctx) {\n\t}", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement, slotName) {\n var transcludeControllers;\n // No scope passed in:\n if (!isScope(scope)) {\n slotName = futureParentElement;\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n if (slotName) {\n // slotTranscludeFn can be one of three things:\n // * a transclude function - a filled slot\n // * `null` - an optional slot that was not filled\n // * `undefined` - a slot that was not declared (i.e. invalid)\n var slotTranscludeFn = boundTranscludeFn.$$slots[slotName];\n if (slotTranscludeFn) {\n return slotTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n } else if (isUndefined(slotTranscludeFn)) {\n throw $compileMinErr('noslot', 'No parent directive that requires a transclusion with slot name \"{0}\". ' + 'Element: {1}', slotName, startingTag($element));\n }\n } else {\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }\n }", "function ViewChildDecorator() {}", "function ViewChildDecorator() {}", "function ViewChildDecorator() {}", "function ViewChildDecorator() { }", "function ViewChildDecorator() { }", "function ViewChildDecorator(){}", "function directive(name, templateFileName, transclude) {\n\ttemplateFileName = templateFileName || name;\n\tapp.directive(name, function () {\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\ttransclude: transclude,\n\t\t\ttemplateUrl: templateFileName + '.html'\n\t\t};\n\t});\n}", "constructor ($compile, $mdUtil) {\n this.$compile= $compile;\n this.$mdUtil = $mdUtil;\n this.restrict='A';\n\n this.require = '^cdvyLearnMore';\n\n this.scope = {\n template: '=cdvyLearnMoreTemplate',\n compileScope: '=cdvyScope'\n };\n }", "function _RecompileHtmlLinkFn() {\n return function(scope, elt, attrs, Ctrls, transclude_fn) {\n var RecompileCtrl = null,\n\n // We keep track if our transclude fn was deregistered\n deregistered = false,\n child_scope = null;\n\n var current_elt = elt;\n while (current_elt.length > 0) {\n // Let's look on elt for the right attributes\n angular.forEach(recompile_triggers, function(recompile_trigger, i) {\n var html_name = _HtmlName(recompile_trigger.name);\n\n if (typeof current_elt.attr(html_name) !== 'undefined') {\n // We keep this loop going to make sure that two recompile\n // triggers are not on the same elt\n if (RecompileCtrl) {\n throw Error('Two recompile triggers on the same elt');\n }\n\n RecompileCtrl = Ctrls[i];\n }\n });\n\n if (RecompileCtrl) break;\n current_elt = current_elt.parent();\n }\n\n if (!RecompileCtrl) throw Error('Cannot find recompile trigger');\n\n var until_angular_name = _AngularName('until');\n if (attrs[until_angular_name]) {\n var until_watch_remover = scope.$watch(attrs[until_angular_name],\n function UntilWatch(new_val) {\n if (new_val) {\n _Deregister();\n until_watch_remover();\n until_watch_remover = null;\n }\n }\n );\n }\n\n // Initialize the elt\n _TranscludeElt();\n RecompileCtrl.RegisterFn(_TranscludeElt);\n\n scope.$on('$destroy', function() {\n _Deregister();\n });\n\n return;\n\n function _TranscludeElt() {\n if (child_scope) child_scope.$destroy();\n child_scope = scope.$new();\n\n transclude_fn(child_scope, function(clone) {\n elt.empty().append(clone);\n });\n }\n\n function _Deregister() {\n if (!deregistered) {\n deregistered = true;\n\n // Clean up variables\n RecompileCtrl.DeregisterFn(_TranscludeElt);\n RecompileCtrl = null;\n child_scope = null;\n }\n }\n }; // End link array.\n }", "function ViewChildrenDecorator() { }", "function ViewChildrenDecorator() { }", "function ViewChildrenDecorator(){}", "function ViewChildrenDecorator() {}", "function ViewChildrenDecorator() {}", "function ViewChildrenDecorator() {}", "function SubElementController($scope, $location, applicationState, Choko) {\n $scope.subElement.template = $scope.subElement.template || 'templates/' + $scope.subElement.type + '.html';\n}", "function ContentChildrenDecorator(){}", "function ContentChildrenDecorator() { }", "function ContentChildrenDecorator() { }", "function NewsDirective() {\n return {\n restrict: 'E',\n replace: true,\n templateUrl: 'js/directives/news.dir.html',\n scope: {\n id: '=',\n title: '=',\n subtext: '=',\n date: '=',\n thumbnail: '=',\n url: '='\n },\n link: function(scope, element, attrs) {\n var subText = angular.element(element.find('p')[0]);\n subText.html(scope.subtext); // Find and convert trail text to html (Text comes with tags)\n }\n };\n}", "function ContentChildrenDecorator() {}", "function ContentChildrenDecorator() {}", "function ContentChildrenDecorator() {}", "function DetailDirective() {\n\n return {\n templateUrl: 'detail.template.html',\n restrict: 'A',\n scope: {\n foo: '=bar',\n panelClose: '&closeDetail'\n },\n transclude: true\n };\n\n }", "function AddTransformer() {}", "visitTemplate(template) { }", "function navListLink(scope, element, $attrs) {\n }", "function templateFn() {\n return '<li init-widget class=\"app-listtemplate app-list-item-action-panel\" ng-class=\"position === \\'right\\' ? \\'app-list-item-right-action-panel\\' : \\'app-list-item-left-action-panel\\'\" wmtransclude></li>';\n }", "function compileTemplate(){var template=$attrs.$mdTabsTemplate,element=angular.element($element[0].querySelector('md-tab-data'));element.html(template);$compile(element.contents())(ctrl.parent);delete $attrs.$mdTabsTemplate;}", "element(element){\r\n element.setInnerContent(this.content);\r\n}", "function ngTableSorterRow() {\n var directive = {\n restrict: 'E',\n replace: true,\n templateUrl: templateUrl,\n scope: true,\n controller: 'ngTableSorterRowController',\n controllerAs: '$ctrl'\n };\n return directive;\n}", "function ngTableSorterRow() {\n var directive = {\n restrict: 'E',\n replace: true,\n templateUrl: templateUrl,\n scope: true,\n controller: 'ngTableSorterRowController'\n };\n return directive;\n}", "function postFn(scope, element, attr) {\n\n }", "function TemplateCtrl() {\n var ctrl = this;\n\n angular.extend(ctrl, {\n });\n }", "onApplyTemplate() {\r\n this.i.ac();\r\n }", "function fxTranPageScopeChanged($scope) {\n return \" Deposit Buy Amount: \" + $scope.buyAmount +\n \t \" Display Sell Amount: \" + $scope.sellAmount;\n}", "function listener(eventName,listenerFn,useCapture){if(useCapture===void 0){useCapture=false;}var lView=getLView();var tNode=getPreviousOrParentTNode();var tView=lView[TVIEW];var firstTemplatePass=tView.firstTemplatePass;var tCleanup=firstTemplatePass&&(tView.cleanup||(tView.cleanup=[]));ngDevMode&&assertNodeOfPossibleTypes(tNode,3/* Element */,0/* Container */,4/* ElementContainer */);// add native event listener - applicable to elements only\nif(tNode.type===3/* Element */){var _native14=getNativeByTNode(tNode,lView);ngDevMode&&ngDevMode.rendererAddEventListener++;var renderer=lView[RENDERER];var lCleanup=getCleanup(lView);var lCleanupIndex=lCleanup.length;var useCaptureOrSubIdx=useCapture;// In order to match current behavior, native DOM event listeners must be added for all\n// events (including outputs).\nif(isProceduralRenderer(renderer)){var cleanupFn=renderer.listen(_native14,eventName,listenerFn);lCleanup.push(listenerFn,cleanupFn);useCaptureOrSubIdx=lCleanupIndex+1;}else{var wrappedListener=wrapListenerWithPreventDefault(listenerFn);_native14.addEventListener(eventName,wrappedListener,useCapture);lCleanup.push(wrappedListener);}tCleanup&&tCleanup.push(eventName,tNode.index,lCleanupIndex,useCaptureOrSubIdx);}// subscribe to directive outputs\nif(tNode.outputs===undefined){// if we create TNode here, inputs must be undefined so we know they still need to be\n// checked\ntNode.outputs=generatePropertyAliases(tNode,1/* Output */);}var outputs=tNode.outputs;var props;if(outputs&&(props=outputs[eventName])){var propsLength=props.length;if(propsLength){var lCleanup=getCleanup(lView);for(var i=0;i<propsLength;i+=2){ngDevMode&&assertDataInRange(lView,props[i]);var subscription=lView[props[i]][props[i+1]].subscribe(listenerFn);var idx=lCleanup.length;lCleanup.push(listenerFn,subscription);tCleanup&&tCleanup.push(eventName,tNode.index,idx,-(idx+1));}}}}", "function getCompiledElement(){\n let compiledDirective = compile(angular.element(\n `<add-sub-item \n parent-id=\"parentId\"\n factory-name=\"MockFactory\" \n >\n <div>\n transcludedContent\n </div>\n </add-sub-item>`\n ))(scope);\n scope.$digest();\n return compiledDirective;\n }", "function postProcessBaseDirective(lView,previousOrParentTNode,directive,def){var _native15=getNativeByTNode(previousOrParentTNode,lView);ngDevMode&&assertEqual(lView[BINDING_INDEX],lView[TVIEW].bindingStartIndex,'directives should be created before any bindings');ngDevMode&&assertPreviousIsParent(getIsParent());attachPatchData(directive,lView);if(_native15){attachPatchData(_native15,lView);}// TODO(misko): setUpAttributes should be a feature for better treeshakability.\nif(def.attributes!=null&&previousOrParentTNode.type==3/* Element */){setUpAttributes(_native15,def.attributes);}}" ]
[ "0.678941", "0.6067335", "0.5712613", "0.5516517", "0.54899067", "0.5466133", "0.53546095", "0.53239113", "0.53239113", "0.53239113", "0.53239113", "0.53239113", "0.53239113", "0.53239113", "0.53239113", "0.53239113", "0.53239113", "0.53239113", "0.53239113", "0.53239113", "0.53239113", "0.53239113", "0.53239113", "0.53046316", "0.53046316", "0.53046316", "0.53046316", "0.53046316", "0.53046316", "0.5303774", "0.5279016", "0.52355397", "0.5235037", "0.5108869", "0.5108869", "0.5050477", "0.5029687", "0.5029687", "0.5029687", "0.50196975", "0.50167215", "0.49847296", "0.49520555", "0.49520555", "0.49271744", "0.49271744", "0.49229202", "0.4918521", "0.48900616", "0.48900616", "0.48900616", "0.48684758", "0.48684758", "0.48351496", "0.4807042", "0.47997978", "0.47657835", "0.47056717", "0.47056717", "0.46623003", "0.46506584", "0.46506584", "0.46506584", "0.4637806", "0.46278104", "0.46206343", "0.46206343", "0.4611876", "0.4611025", "0.4611025", "0.4611025", "0.46016204", "0.45487076", "0.45126507", "0.44948432", "0.4491222", "0.44806176", "0.4472193", "0.44613874", "0.44450942", "0.44221818", "0.44166037", "0.44050667", "0.44004482", "0.4397126", "0.43952933", "0.43929294" ]
0.5008915
54
Depending upon the context in which a directive finds itself it might need to have a new isolated or child scope created. For instance: if the directive has been pulled into a template because another directive with a higher priority asked for element transclusion if the directive itself asks for transclusion but it is at the root of a template and the original element was replaced. See
function markDirectiveScope(directives, isolateScope, newScope) { for (var j = 0, jj = directives.length; j < jj; j++) { directives[j] = inherit(directives[j], {$$isolateScope: isolateScope, $$newScope: newScope}); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function markDirectiveScope(directives, isolateScope, newScope) { // 8373\n for (var j = 0, jj = directives.length; j < jj; j++) { // 8374\n directives[j] = inherit(directives[j], {$$isolateScope: isolateScope, $$newScope: newScope}); // 8375\n } // 8376\n } // 8377", "function markDirectiveScope(directives,isolateScope,newScope){for(var j=0,jj=directives.length;j<jj;j++){directives[j]=inherit(directives[j],{$$isolateScope:isolateScope,$$newScope:newScope});}}", "function markDirectiveScope(directives,isolateScope,newScope){for(var j=0,jj=directives.length;j<jj;j++){directives[j]=inherit(directives[j],{$$isolateScope:isolateScope,$$newScope:newScope});}}", "function markDirectiveScope(directives, isolateScope, newScope) {\n\t for (var j = 0, jj = directives.length; j < jj; j++) {\n\t directives[j] = inherit(directives[j], {$$isolateScope: isolateScope, $$newScope: newScope});\n\t }\n\t }", "function markDirectiveScope(directives, isolateScope, newScope) {\n\t for (var j = 0, jj = directives.length; j < jj; j++) {\n\t directives[j] = inherit(directives[j], {$$isolateScope: isolateScope, $$newScope: newScope});\n\t }\n\t }", "function markDirectiveScope(directives, isolateScope, newScope) {\n for (var j = 0, jj = directives.length; j < jj; j++) {\n directives[j] = inherit(directives[j], { $$isolateScope: isolateScope, $$newScope: newScope });\n }\n }", "function postProcessBaseDirective(lView,previousOrParentTNode,directive,def){var _native15=getNativeByTNode(previousOrParentTNode,lView);ngDevMode&&assertEqual(lView[BINDING_INDEX],lView[TVIEW].bindingStartIndex,'directives should be created before any bindings');ngDevMode&&assertPreviousIsParent(getIsParent());attachPatchData(directive,lView);if(_native15){attachPatchData(_native15,lView);}// TODO(misko): setUpAttributes should be a feature for better treeshakability.\nif(def.attributes!=null&&previousOrParentTNode.type==3/* Element */){setUpAttributes(_native15,def.attributes);}}", "function instantiateDirectivesDirectly() {\n ngDevMode && assertEqual(firstTemplatePass, false, \"Directives should only be instantiated directly after first template pass\");\n var count = previousOrParentTNode.flags & 4095 /* DirectiveCountMask */;\n if (isContentQueryHost(previousOrParentTNode) && currentQueries) {\n currentQueries = currentQueries.clone();\n }\n if (count > 0) {\n var start = previousOrParentTNode.flags >> 15 /* DirectiveStartingIndexShift */;\n var end = start + count;\n for (var i = start; i < end; i++) {\n var def = tView.data[i];\n // Component view must be set on node before the factory is created so\n // ChangeDetectorRefs have a way to store component view on creation.\n if (def.template) {\n addComponentLogic(def);\n }\n directiveCreate(i, def.factory(), def);\n }\n }\n}", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) { // 8346\n var transcludeControllers; // 8347\n // 8348\n // No scope passed in: // 8349\n if (!isScope(scope)) { // 8350\n futureParentElement = cloneAttachFn; // 8351\n cloneAttachFn = scope; // 8352\n scope = undefined; // 8353\n } // 8354\n // 8355\n if (hasElementTranscludeDirective) { // 8356\n transcludeControllers = elementControllers; // 8357\n } // 8358\n if (!futureParentElement) { // 8359\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element; // 8360\n } // 8361\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild); // 8362\n }", "function allocStylingContext(element,templateStyleContext){// each instance gets a copy\nvar context=templateStyleContext.slice();context[5/* ElementPosition */]=element;// this will prevent any other directives from extending the context\ncontext[0/* MasterFlagPosition */]|=32/* BindingAllocationLocked */;return context;}", "function link( scope, element, attributes, _c, transclude ) {\n\t\t\t\t\t\t\t\t\t\t console.log( \"Container at link (html):\", element.html() );\n\t\t\t\t\t\t\t\t\t\t // Clone and inject the transcluded content.\n\t\t\t\t\t\t\t\t\t\t transclude(\n\t\t\t\t\t\t\t\t\t\t function injectLinkedClone( clone ) {\n\t\t\t\t\t\t\t\t\t\t element.append( clone );\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t\t\t\t }", "function controllersBoundTransclude(scope,cloneAttachFn,futureParentElement,slotName){var transcludeControllers;// No scope passed in:\nif(!isScope(scope)){slotName=futureParentElement;futureParentElement=cloneAttachFn;cloneAttachFn=scope;scope=undefined;}if(hasElementTranscludeDirective){transcludeControllers=elementControllers;}if(!futureParentElement){futureParentElement=hasElementTranscludeDirective?$element.parent():$element;}if(slotName){// slotTranscludeFn can be one of three things:\n// * a transclude function - a filled slot\n// * `null` - an optional slot that was not filled\n// * `undefined` - a slot that was not declared (i.e. invalid)\nvar slotTranscludeFn=boundTranscludeFn.$$slots[slotName];if(slotTranscludeFn){return slotTranscludeFn(scope,cloneAttachFn,transcludeControllers,futureParentElement,scopeToChild);}else if(isUndefined(slotTranscludeFn)){throw $compileMinErr('noslot','No parent directive that requires a transclusion with slot name \"{0}\". '+'Element: {1}',slotName,startingTag($element));}}else{return boundTranscludeFn(scope,cloneAttachFn,transcludeControllers,futureParentElement,scopeToChild);}}", "function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, // 7538\n previousCompileContext) { // 7539\n if (!($compileNodes instanceof jqLite)) { // 7540\n // jquery always rewraps, whereas we need to preserve the original selector so that we can // 7541\n // modify it. // 7542\n $compileNodes = jqLite($compileNodes); // 7543\n } // 7544\n // We can not compile top level text elements since text nodes can be merged and we will // 7545\n // not be able to attach scope data to them, so we will wrap them in <span> // 7546\n forEach($compileNodes, function(node, index) { // 7547\n if (node.nodeType == NODE_TYPE_TEXT && node.nodeValue.match(/\\S+/) /* non-empty */ ) { // 7548\n $compileNodes[index] = jqLite(node).wrap('<span></span>').parent()[0]; // 7549\n } // 7550\n }); // 7551\n var compositeLinkFn = // 7552\n compileNodes($compileNodes, transcludeFn, $compileNodes, // 7553\n maxPriority, ignoreDirective, previousCompileContext); // 7554\n compile.$$addScopeClass($compileNodes); // 7555\n var namespace = null; // 7556\n return function publicLinkFn(scope, cloneConnectFn, options) { // 7557\n assertArg(scope, 'scope'); // 7558\n // 7559\n if (previousCompileContext && previousCompileContext.needsNewScope) { // 7560\n // A parent directive did a replace and a directive on this element asked // 7561\n // for transclusion, which caused us to lose a layer of element on which // 7562\n // we could hold the new transclusion scope, so we will create it manually // 7563\n // here. // 7564\n scope = scope.$parent.$new(); // 7565\n } // 7566\n // 7567\n options = options || {}; // 7568\n var parentBoundTranscludeFn = options.parentBoundTranscludeFn, // 7569\n transcludeControllers = options.transcludeControllers, // 7570\n futureParentElement = options.futureParentElement; // 7571\n // 7572\n // When `parentBoundTranscludeFn` is passed, it is a // 7573\n // `controllersBoundTransclude` function (it was previously passed // 7574\n // as `transclude` to directive.link) so we must unwrap it to get // 7575\n // its `boundTranscludeFn` // 7576\n if (parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude) { // 7577\n parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude; // 7578\n } // 7579\n // 7580\n if (!namespace) { // 7581\n namespace = detectNamespaceForChildElements(futureParentElement); // 7582\n } // 7583\n var $linkNode; // 7584\n if (namespace !== 'html') { // 7585\n // When using a directive with replace:true and templateUrl the $compileNodes // 7586\n // (or a child element inside of them) // 7587\n // might change, so we need to recreate the namespace adapted compileNodes // 7588\n // for call to the link function. // 7589\n // Note: This will already clone the nodes... // 7590\n $linkNode = jqLite( // 7591\n wrapTemplate(namespace, jqLite('<div>').append($compileNodes).html()) // 7592\n ); // 7593\n } else if (cloneConnectFn) { // 7594\n // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart // 7595\n // and sometimes changes the structure of the DOM. // 7596\n $linkNode = JQLitePrototype.clone.call($compileNodes); // 7597\n } else { // 7598\n $linkNode = $compileNodes; // 7599\n } // 7600\n // 7601\n if (transcludeControllers) { // 7602\n for (var controllerName in transcludeControllers) { // 7603\n $linkNode.data('$' + controllerName + 'Controller', transcludeControllers[controllerName].instance); // 7604\n } // 7605\n } // 7606\n // 7607\n compile.$$addScopeInfo($linkNode, scope); // 7608\n // 7609\n if (cloneConnectFn) cloneConnectFn($linkNode, scope); // 7610\n if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn); // 7611\n return $linkNode; // 7612\n }; // 7613\n } // 7614", "function postProcessBaseDirective(lView, previousOrParentTNode, directive) {\n var native = getNativeByTNode(previousOrParentTNode, lView);\n ngDevMode && assertEqual(lView[BINDING_INDEX], lView[TVIEW].bindingStartIndex, 'directives should be created before any bindings');\n ngDevMode && assertPreviousIsParent(getIsParent());\n attachPatchData(directive, lView);\n if (native) {\n attachPatchData(native, lView);\n }\n}", "function baseDirectiveCreate(index, directive, directiveDef, native) {\n ngDevMode && assertEqual(viewData[BINDING_INDEX], tView.bindingStartIndex, 'directives should be created before any bindings');\n ngDevMode && assertPreviousIsParent();\n attachPatchData(directive, viewData);\n if (native) {\n attachPatchData(native, viewData);\n }\n viewData[index] = directive;\n if (firstTemplatePass) {\n var flags = previousOrParentTNode.flags;\n if (flags === 0) {\n // When the first directive is created:\n // - save the index,\n // - set the number of directives to 1\n previousOrParentTNode.flags =\n index << 15 /* DirectiveStartingIndexShift */ | flags & 4096 /* isComponent */ | 1;\n }\n else {\n // Only need to bump the size when subsequent directives are created\n ngDevMode && assertNotEqual(flags & 4095 /* DirectiveCountMask */, 4095 /* DirectiveCountMask */, 'Reached the max number of directives');\n previousOrParentTNode.flags++;\n }\n tView.data.push(directiveDef);\n tView.blueprint.push(null);\n if (directiveDef.hostBindings)\n queueHostBindingForCheck(index, directiveDef);\n }\n else {\n var diPublic = directiveDef.diPublic;\n if (diPublic)\n diPublic(directiveDef);\n }\n if (directiveDef.attributes != null && previousOrParentTNode.type == 3 /* Element */) {\n setUpAttributes(native, directiveDef.attributes);\n }\n return directive;\n}", "function setScope(vnode){var i;if(isDef(i=vnode.context)&&isDef(i=i.$options._scopeId)){nodeOps.setAttribute(vnode.elm,i,'');}if(isDef(i=activeInstance)&&i!==vnode.context&&isDef(i=i.$options._scopeId)){nodeOps.setAttribute(vnode.elm,i,'');}}", "function applyScope() {\n\t\t\t\tif (!scope.$$phase) {\n\t\t\t\t\tscope.$apply();\n\t\t\t\t}\n\t\t\t}", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n\t\t\t\t\t\t\tvar transcludeControllers;\n\n\t\t\t\t\t\t\t// No scope passed in:\n\t\t\t\t\t\t\tif (!isScope(scope)) {\n\t\t\t\t\t\t\t\tfutureParentElement = cloneAttachFn;\n\t\t\t\t\t\t\t\tcloneAttachFn = scope;\n\t\t\t\t\t\t\t\tscope = undefined;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (hasElementTranscludeDirective) {\n\t\t\t\t\t\t\t\ttranscludeControllers = elementControllers;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!futureParentElement) {\n\t\t\t\t\t\t\t\tfutureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n\t\t\t\t\t\t}", "function controllersBoundTransclude(scope,cloneAttachFn,futureParentElement,slotName){var transcludeControllers;// No scope passed in:\n\tif(!isScope(scope)){slotName=futureParentElement;futureParentElement=cloneAttachFn;cloneAttachFn=scope;scope=undefined;}if(hasElementTranscludeDirective){transcludeControllers=elementControllers;}if(!futureParentElement){futureParentElement=hasElementTranscludeDirective?$element.parent():$element;}if(slotName){// slotTranscludeFn can be one of three things:\n\t// * a transclude function - a filled slot\n\t// * `null` - an optional slot that was not filled\n\t// * `undefined` - a slot that was not declared (i.e. invalid)\n\tvar slotTranscludeFn=boundTranscludeFn.$$slots[slotName];if(slotTranscludeFn){return slotTranscludeFn(scope,cloneAttachFn,transcludeControllers,futureParentElement,scopeToChild);}else if(isUndefined(slotTranscludeFn)){throw $compileMinErr('noslot','No parent directive that requires a transclusion with slot name \"{0}\". '+'Element: {1}',slotName,startingTag($element));}}else{return boundTranscludeFn(scope,cloneAttachFn,transcludeControllers,futureParentElement,scopeToChild);}}", "function setScope (vnode) {\n\t var i\n\t if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {\n\t nodeOps.setAttribute(vnode.elm, i, '')\n\t }\n\t if (isDef(i = activeInstance) &&\n\t i !== vnode.context &&\n\t isDef(i = i.$options._scopeId)) {\n\t nodeOps.setAttribute(vnode.elm, i, '')\n\t }\n\t }", "function link(scope, element, attrs, ctrl, transclude) {\n var urlTemplate = '';\n urlTemplate = urlPath + reload_name + '.dir.html'\n $templateRequest(urlTemplate).then(\n function onCreateDomElements(html) {\n var $scope = scope;\n\n element.on('$destroy', function () {\n //alert('qf destroyed');\n })\n scope.id = Math.random();\n //alert('created ' + scope.id);\n\n //var utilsParentDict = utils.dictTemplates;\n var tH2 = transcludeHelper2.create(this);\n console.log('issue', tH2)\n tH2.setupTransclution(reload_name, scope, $compile, element, html, attrs);\n scope.render(tH2);\n\n return;\n utils.dictTemplates = utilsParent.dictTemplates; //copy over dictionary of templates\n utils.$compile = $compile;\n\n utilsParent.destroyDuplicateScopes(element, scope);\n utils.loadTemplate(html, element, attrs);\n utils.setupTransclution(scope, $compile, element)\n //console.error('qf', 'pre-', scope.vm)\n scope.render(utils, attrs, element);\n\n }\n )\n\n }", "function setScope (vnode) {\n let i\n let ancestor = vnode\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '')\n }\n ancestor = ancestor.parent\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)\n ) {\n nodeOps.setAttribute(vnode.elm, i, '')\n }\n }", "function setScope(vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) && i !== vnode.context && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope(vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) && i !== vnode.context && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope(vnode) {\n\t var i;\n\t var ancestor = vnode;\n\t while (ancestor) {\n\t if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n\t nodeOps.setAttribute(vnode.elm, i, '');\n\t }\n\t ancestor = ancestor.parent;\n\t }\n\t // for slot content they should also get the scopeId from the host instance.\n\t if (isDef(i = activeInstance) && i !== vnode.context && isDef(i = i.$options._scopeId)) {\n\t nodeOps.setAttribute(vnode.elm, i, '');\n\t }\n\t }", "function setScope(vnode) {\n\t var i;\n\t var ancestor = vnode;\n\t while (ancestor) {\n\t if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n\t nodeOps.setAttribute(vnode.elm, i, '');\n\t }\n\t ancestor = ancestor.parent;\n\t }\n\t // for slot content they should also get the scopeId from the host instance.\n\t if (isDef(i = activeInstance) && i !== vnode.context && isDef(i = i.$options._scopeId)) {\n\t nodeOps.setAttribute(vnode.elm, i, '');\n\t }\n\t }", "function setScope(vnode) {\n\t var i;\n\t if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {\n\t nodeOps.setAttribute(vnode.elm, i, '');\n\t }\n\t if (isDef(i = activeInstance) && i !== vnode.context && isDef(i = i.$options._scopeId)) {\n\t nodeOps.setAttribute(vnode.elm, i, '');\n\t }\n\t }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }", "function postProcessBaseDirective(lView, previousOrParentTNode, directive, def) {\n var native = getNativeByTNode(previousOrParentTNode, lView);\n ngDevMode && assertEqual(lView[BINDING_INDEX], lView[TVIEW].bindingStartIndex, 'directives should be created before any bindings');\n ngDevMode && assertPreviousIsParent(getIsParent());\n attachPatchData(directive, lView);\n if (native) {\n attachPatchData(native, lView);\n }\n // TODO(misko): setUpAttributes should be a feature for better treeshakability.\n if (def.attributes != null && previousOrParentTNode.type == 3 /* Element */) {\n setUpAttributes(native, def.attributes);\n }\n}", "function postProcessBaseDirective(lView, previousOrParentTNode, directive, def) {\n var native = getNativeByTNode(previousOrParentTNode, lView);\n ngDevMode && assertEqual(lView[BINDING_INDEX], lView[TVIEW].bindingStartIndex, 'directives should be created before any bindings');\n ngDevMode && assertPreviousIsParent(getIsParent());\n attachPatchData(directive, lView);\n if (native) {\n attachPatchData(native, lView);\n }\n // TODO(misko): setUpAttributes should be a feature for better treeshakability.\n if (def.attributes != null && previousOrParentTNode.type == 3 /* Element */) {\n setUpAttributes(native, def.attributes);\n }\n}", "function setScope (vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n\t var i;\n\t if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {\n\t nodeOps.setAttribute(vnode.elm, i, '');\n\t }\n\t if (isDef(i = activeInstance) &&\n\t i !== vnode.context &&\n\t isDef(i = i.$options._scopeId)) {\n\t nodeOps.setAttribute(vnode.elm, i, '');\n\t }\n\t }", "function setScope (vnode) {\n\t var i;\n\t if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {\n\t nodeOps.setAttribute(vnode.elm, i, '');\n\t }\n\t if (isDef(i = activeInstance) &&\n\t i !== vnode.context &&\n\t isDef(i = i.$options._scopeId)) {\n\t nodeOps.setAttribute(vnode.elm, i, '');\n\t }\n\t }", "function setScope (vnode) {\n\t var i;\n\t if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {\n\t nodeOps.setAttribute(vnode.elm, i, '');\n\t }\n\t if (isDef(i = activeInstance) &&\n\t i !== vnode.context &&\n\t isDef(i = i.$options._scopeId)) {\n\t nodeOps.setAttribute(vnode.elm, i, '');\n\t }\n\t }", "function initializeDirectiveBindings(scope, attrs, destination, bindings,\n directive, newScope) {\n var onNewScopeDestroyed;\n forEach(bindings, function(definition, scopeName) {\n var attrName = definition.attrName,\n optional = definition.optional,\n mode = definition.mode, // @, =, or &\n lastValue,\n parentGet, parentSet, compare;\n\n switch (mode) {\n\n case '@':\n attrs.$observe(attrName, function(value) {\n destination[scopeName] = value;\n });\n attrs.$$observers[attrName].$$scope = scope;\n if (attrs[attrName]) {\n // If the attribute has been provided then we trigger an interpolation to ensure\n // the value is there for use in the link fn\n destination[scopeName] = $interpolate(attrs[attrName])(scope);\n }\n break;\n\n case '=':\n if (optional && !attrs[attrName]) {\n return;\n }\n parentGet = $parse(attrs[attrName]);\n if (parentGet.literal) {\n compare = equals;\n } else {\n compare = function(a, b) { return a === b || (a !== a && b !== b); };\n }\n parentSet = parentGet.assign || function() {\n // reset the change, or we will throw this exception on every $digest\n lastValue = destination[scopeName] = parentGet(scope);\n throw $compileMinErr('nonassign',\n \"Expression '{0}' used with directive '{1}' is non-assignable!\",\n attrs[attrName], directive.name);\n };\n lastValue = destination[scopeName] = parentGet(scope);\n var parentValueWatch = function parentValueWatch(parentValue) {\n if (!compare(parentValue, destination[scopeName])) {\n // we are out of sync and need to copy\n if (!compare(parentValue, lastValue)) {\n // parent changed and it has precedence\n destination[scopeName] = parentValue;\n } else {\n // if the parent can be assigned then do so\n parentSet(scope, parentValue = destination[scopeName]);\n }\n }\n return lastValue = parentValue;\n };\n parentValueWatch.$stateful = true;\n var unwatch;\n if (definition.collection) {\n unwatch = scope.$watchCollection(attrs[attrName], parentValueWatch);\n } else {\n unwatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal);\n }\n onNewScopeDestroyed = (onNewScopeDestroyed || []);\n onNewScopeDestroyed.push(unwatch);\n break;\n\n case '&':\n // Don't assign Object.prototype method to scope\n if (!attrs.hasOwnProperty(attrName) && optional) break;\n\n parentGet = $parse(attrs[attrName]);\n\n // Don't assign noop to destination if expression is not valid\n if (parentGet === noop && optional) break;\n\n destination[scopeName] = function(locals) {\n return parentGet(scope, locals);\n };\n break;\n }\n });\n var destroyBindings = onNewScopeDestroyed ? function destroyBindings() {\n for (var i = 0, ii = onNewScopeDestroyed.length; i < ii; ++i) {\n onNewScopeDestroyed[i]();\n }\n } : noop;\n if (newScope && destroyBindings !== noop) {\n newScope.$on('$destroy', destroyBindings);\n return noop;\n }\n return destroyBindings;\n }", "function initializeDirectiveBindings(scope, attrs, destination, bindings,\n directive, newScope) {\n var onNewScopeDestroyed;\n forEach(bindings, function(definition, scopeName) {\n var attrName = definition.attrName,\n optional = definition.optional,\n mode = definition.mode, // @, =, or &\n lastValue,\n parentGet, parentSet, compare;\n\n switch (mode) {\n\n case '@':\n attrs.$observe(attrName, function(value) {\n destination[scopeName] = value;\n });\n attrs.$$observers[attrName].$$scope = scope;\n if (attrs[attrName]) {\n // If the attribute has been provided then we trigger an interpolation to ensure\n // the value is there for use in the link fn\n destination[scopeName] = $interpolate(attrs[attrName])(scope);\n }\n break;\n\n case '=':\n if (optional && !attrs[attrName]) {\n return;\n }\n parentGet = $parse(attrs[attrName]);\n if (parentGet.literal) {\n compare = equals;\n } else {\n compare = function(a, b) { return a === b || (a !== a && b !== b); };\n }\n parentSet = parentGet.assign || function() {\n // reset the change, or we will throw this exception on every $digest\n lastValue = destination[scopeName] = parentGet(scope);\n throw $compileMinErr('nonassign',\n \"Expression '{0}' used with directive '{1}' is non-assignable!\",\n attrs[attrName], directive.name);\n };\n lastValue = destination[scopeName] = parentGet(scope);\n var parentValueWatch = function parentValueWatch(parentValue) {\n if (!compare(parentValue, destination[scopeName])) {\n // we are out of sync and need to copy\n if (!compare(parentValue, lastValue)) {\n // parent changed and it has precedence\n destination[scopeName] = parentValue;\n } else {\n // if the parent can be assigned then do so\n parentSet(scope, parentValue = destination[scopeName]);\n }\n }\n return lastValue = parentValue;\n };\n parentValueWatch.$stateful = true;\n var unwatch;\n if (definition.collection) {\n unwatch = scope.$watchCollection(attrs[attrName], parentValueWatch);\n } else {\n unwatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal);\n }\n onNewScopeDestroyed = (onNewScopeDestroyed || []);\n onNewScopeDestroyed.push(unwatch);\n break;\n\n case '&':\n // Don't assign Object.prototype method to scope\n if (!attrs.hasOwnProperty(attrName) && optional) break;\n\n parentGet = $parse(attrs[attrName]);\n\n // Don't assign noop to destination if expression is not valid\n if (parentGet === noop && optional) break;\n\n destination[scopeName] = function(locals) {\n return parentGet(scope, locals);\n };\n break;\n }\n });\n var destroyBindings = onNewScopeDestroyed ? function destroyBindings() {\n for (var i = 0, ii = onNewScopeDestroyed.length; i < ii; ++i) {\n onNewScopeDestroyed[i]();\n }\n } : noop;\n if (newScope && destroyBindings !== noop) {\n newScope.$on('$destroy', destroyBindings);\n return noop;\n }\n return destroyBindings;\n }", "function setScope (vnode) {\n var i;\n if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n\t var i;\n\t var ancestor = vnode;\n\t while (ancestor) {\n\t if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n\t nodeOps.setAttribute(vnode.elm, i, '');\n\t }\n\t ancestor = ancestor.parent;\n\t }\n\t // for slot content they should also get the scopeId from the host instance.\n\t if (isDef(i = activeInstance) &&\n\t i !== vnode.context &&\n\t isDef(i = i.$options._scopeId)) {\n\t nodeOps.setAttribute(vnode.elm, i, '');\n\t }\n\t }", "function setScope (vnode) {\n\t var i;\n\t var ancestor = vnode;\n\t while (ancestor) {\n\t if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n\t nodeOps.setAttribute(vnode.elm, i, '');\n\t }\n\t ancestor = ancestor.parent;\n\t }\n\t // for slot content they should also get the scopeId from the host instance.\n\t if (isDef(i = activeInstance) &&\n\t i !== vnode.context &&\n\t isDef(i = i.$options._scopeId)) {\n\t nodeOps.setAttribute(vnode.elm, i, '');\n\t }\n\t }", "function setScope (vnode) {\n\t var i;\n\t var ancestor = vnode;\n\t while (ancestor) {\n\t if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n\t nodeOps.setAttribute(vnode.elm, i, '');\n\t }\n\t ancestor = ancestor.parent;\n\t }\n\t // for slot content they should also get the scopeId from the host instance.\n\t if (isDef(i = activeInstance) &&\n\t i !== vnode.context &&\n\t isDef(i = i.$options._scopeId)) {\n\t nodeOps.setAttribute(vnode.elm, i, '');\n\t }\n\t }", "function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n var transcludeControllers;\n\n // No scope passed in:\n if (!isScope(scope)) {\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement);\n }", "enterDirective(ctx) {\n\t}", "function setScope (vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)\n ) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)\n ) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)\n ) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)\n ) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)\n ) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)\n ) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)\n ) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)\n ) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)\n ) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)\n ) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)\n ) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)\n ) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)\n ) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)\n ) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n var i;\n var ancestor = vnode;\n while (ancestor) {\n if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n ancestor = ancestor.parent;\n }\n // for slot content they should also get the scopeId from the host instance.\n if (isDef(i = activeInstance) &&\n i !== vnode.context &&\n isDef(i = i.$options._scopeId)\n ) {\n nodeOps.setAttribute(vnode.elm, i, '');\n }\n }", "function setScope (vnode) {\n\t var i;\n\t var ancestor = vnode;\n\t while (ancestor) {\n\t if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n\t nodeOps.setAttribute(vnode.elm, i, '');\n\t }\n\t ancestor = ancestor.parent;\n\t }\n\t // for slot content they should also get the scopeId from the host instance.\n\t if (isDef(i = activeInstance) &&\n\t i !== vnode.context &&\n\t isDef(i = i.$options._scopeId)\n\t ) {\n\t nodeOps.setAttribute(vnode.elm, i, '');\n\t }\n\t }", "link(scope, element) {\n var compileScope = scope.compileScope;\n element.html(scope.template);\n this.$compile(element.contents())(compileScope);\n }", "function initializeDirectiveBindings(scope, attrs, destination, bindings,\n directive, newScope) {\n var onNewScopeDestroyed;\n forEach(bindings, function(definition, scopeName) {\n var attrName = definition.attrName,\n optional = definition.optional,\n mode = definition.mode, // @, =, or &\n lastValue,\n parentGet, parentSet, compare;\n\n switch (mode) {\n\n case '@':\n if (!optional && !hasOwnProperty.call(attrs, attrName)) {\n destination[scopeName] = attrs[attrName] = void 0;\n }\n attrs.$observe(attrName, function(value) {\n if (isString(value)) {\n destination[scopeName] = value;\n }\n });\n attrs.$$observers[attrName].$$scope = scope;\n if (isString(attrs[attrName])) {\n // If the attribute has been provided then we trigger an interpolation to ensure\n // the value is there for use in the link fn\n destination[scopeName] = $interpolate(attrs[attrName])(scope);\n }\n break;\n\n case '=':\n if (!hasOwnProperty.call(attrs, attrName)) {\n if (optional) break;\n attrs[attrName] = void 0;\n }\n if (optional && !attrs[attrName]) break;\n\n parentGet = $parse(attrs[attrName]);\n if (parentGet.literal) {\n compare = equals;\n } else {\n compare = function(a, b) { return a === b || (a !== a && b !== b); };\n }\n parentSet = parentGet.assign || function() {\n // reset the change, or we will throw this exception on every $digest\n lastValue = destination[scopeName] = parentGet(scope);\n throw $compileMinErr('nonassign',\n \"Expression '{0}' used with directive '{1}' is non-assignable!\",\n attrs[attrName], directive.name);\n };\n lastValue = destination[scopeName] = parentGet(scope);\n var parentValueWatch = function parentValueWatch(parentValue) {\n if (!compare(parentValue, destination[scopeName])) {\n // we are out of sync and need to copy\n if (!compare(parentValue, lastValue)) {\n // parent changed and it has precedence\n destination[scopeName] = parentValue;\n } else {\n // if the parent can be assigned then do so\n parentSet(scope, parentValue = destination[scopeName]);\n }\n }\n return lastValue = parentValue;\n };\n parentValueWatch.$stateful = true;\n var unwatch;\n if (definition.collection) {\n unwatch = scope.$watchCollection(attrs[attrName], parentValueWatch);\n } else {\n unwatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal);\n }\n onNewScopeDestroyed = (onNewScopeDestroyed || []);\n onNewScopeDestroyed.push(unwatch);\n break;\n\n case '&':\n // Don't assign Object.prototype method to scope\n parentGet = attrs.hasOwnProperty(attrName) ? $parse(attrs[attrName]) : noop;\n\n // Don't assign noop to destination if expression is not valid\n if (parentGet === noop && optional) break;\n\n destination[scopeName] = function(locals) {\n return parentGet(scope, locals);\n };\n break;\n }\n });\n var destroyBindings = onNewScopeDestroyed ? function destroyBindings() {\n for (var i = 0, ii = onNewScopeDestroyed.length; i < ii; ++i) {\n onNewScopeDestroyed[i]();\n }\n } : noop;\n if (newScope && destroyBindings !== noop) {\n newScope.$on('$destroy', destroyBindings);\n return noop;\n }\n return destroyBindings;\n }" ]
[ "0.68247783", "0.6678569", "0.6678569", "0.65664953", "0.65664953", "0.6523584", "0.57680047", "0.5705015", "0.5687778", "0.54711646", "0.5420667", "0.5418919", "0.5405146", "0.54000497", "0.53214085", "0.5305129", "0.52657515", "0.52651584", "0.5262802", "0.51999086", "0.5199858", "0.5194297", "0.51850396", "0.51850396", "0.5170197", "0.5170197", "0.51669425", "0.51638687", "0.51638687", "0.51638687", "0.51638687", "0.51638687", "0.51638687", "0.51638687", "0.51638687", "0.51638687", "0.51638687", "0.51638687", "0.51638687", "0.51638687", "0.51638687", "0.51638687", "0.51638687", "0.5163256", "0.5163256", "0.5162841", "0.5162841", "0.5162841", "0.5162841", "0.5162841", "0.5162794", "0.5162794", "0.5162794", "0.5160131", "0.5160131", "0.5156457", "0.5156457", "0.5156457", "0.5156457", "0.5156457", "0.51507795", "0.51507795", "0.51507795", "0.51441115", "0.51406556", "0.5134915", "0.5134915", "0.5134915", "0.5134915", "0.5134915", "0.5134915", "0.5134915", "0.5134915", "0.5134915", "0.5134915", "0.5134915", "0.5134915", "0.5134915", "0.5134915", "0.5134915", "0.51178455", "0.5096616", "0.5080394" ]
0.6426887
20
Sorting function for bound directives.
function byPriority(a, b) { var diff = b.priority - a.priority; if (diff !== 0) return diff; if (a.name !== b.name) return (a.name < b.name) ? -1 : 1; return a.index - b.index; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get sortingOrder() {}", "sort() {\r\n\t\treturn this.data.sort((a,b) => {\r\n\t\t\tfor(var i=0; i < this.definition.length; i++) {\r\n\t\t\t\tconst [code, key] = this.definition[i];\r\n\t\t\t\tswitch(code) {\r\n\t\t\t\t\tcase 'asc':\r\n\t\t\t\t\tcase 'desc':\r\n\t\t\t\t\t\tif (a[key] > b[key])\r\n\t\t\t\t\t\t\treturn code == 'asc' ? 1 : -1;\r\n\t\t\t\t\t\tif (a[key] < b[key])\r\n\t\t\t\t\t\t\treturn code == 'asc' ? -1 : 1;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'fn':\r\n\t\t\t\t\t\tlet result = key(a, b);\r\n\t\t\t\t\t\tif (result != 0) // If it's zero the sort wasn't decided.\r\n\t\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn 0;\r\n\t\t});\r\n\t}", "sort() {\n\t}", "sort() {\n\t}", "function Sort() {}", "get overrideSorting() {}", "function sort() {\n index++;\n var func;\n predicate = ng.isFunction(getter(scope)) || ng.isArray(getter(scope)) ? getter(scope) : attr.ltSort;\n if (index % 3 === 0 && !!skipNatural !== true) {\n //manual reset\n index = 0;\n ctrl.tableState().sort = {};\n ctrl.tableState().pagination.start = 0;\n func = ctrl.pipe.bind(ctrl);\n } else {\n func = ctrl.sortBy.bind(ctrl, predicate, index % 2 === 0);\n }\n if (promise !== null) {\n $timeout.cancel(promise);\n }\n if (throttle < 0) {\n scope.$apply(func);\n } else {\n promise = $timeout(func, throttle);\n }\n }", "sort(){\n\n }", "function parseSortDirective_(filterElement, backwards) {\n var match = /^sort:(.*)$/.exec(filterElement);\n if (!match)\n return null;\n return {method: match[1], backwards: backwards};\n }", "function sort () {\n if (descendingFirst) {\n index = index === 0 ? 2 : index - 1;\n } else {\n index++;\n }\n\n var func;\n predicate = ng.isFunction(getter(scope)) || ng.isArray(getter(scope)) ? getter(scope) : attr.stSort;\n if (index % 3 === 0 && !!skipNatural !== true) {\n //manual reset\n index = 0;\n ctrl.tableState().sort = {};\n ctrl.tableState().pagination.start = 0;\n func = ctrl.pipe.bind(ctrl);\n } else {\n func = ctrl.sortBy.bind(ctrl, predicate, index % 2 === 0);\n }\n if (promise !== null) {\n $timeout.cancel(promise);\n }\n if (throttle < 0) {\n func();\n } else {\n promise = $timeout(func, throttle);\n }\n }", "function sortRenderOrder() {\n \n var sortBy = function(field, reverse, primer){\n var key = primer ? function(x) {return primer(x[field])} : function(x) {return x[field]};\n reverse = [-1, 1][+!!reverse];\n return function (a, b) {\n\treturn a = key(a), b = key(b), reverse * ((a > b) - (b > a));\n } \n }\n \n gadgetRenderOrder.sort(sortBy(\"tabPos\", true, parseInt));\n gadgetRenderOrder.sort(sortBy(\"paneId\", true, parseInt));\n gadgetRenderOrder.sort(sortBy(\"parentColumnId\", true, parseInt));\n }", "repeaterOnSort() {\n }", "sort () {\r\n this._data.sort((a, b) => a.sortOrder !== b.sortOrder ? b.sortOrder - a.sortOrder : a.value.localeCompare(b.value))\r\n }", "Sort() {\n\n }", "function sorte ( i ){\n return function(){\n if(scope.sorting.obj){\n //var index = _.findIndex(scope.viewer, scope.sorting.obj);\n }\n var key = scope.headers[i].field;\n if(scope.sorting.field === key){\n scope.sorting.direction = scope.sorting.direction * -1;\n }else{\n scope.sorting.field = key;\n scope.sorting.direction = 1;\n }\n sorter(key,scope.sorting.direction);\n scope.sorting.obj = scope.headers[i];\n scope.buildTable();\n\n };\n }", "function sorte ( i ){\n return function(){\n if(scope.sorting.obj){\n //var index = _.findIndex(scope.viewer, scope.sorting.obj);\n }\n var key = scope.headers[i].field;\n if(scope.sorting.field === key){\n scope.sorting.direction = scope.sorting.direction * -1;\n }else{\n scope.sorting.field = key;\n scope.sorting.direction = 1;\n }\n sorter(key,scope.sorting.direction);\n scope.sorting.obj = scope.headers[i];\n scope.buildTable();\n\n };\n }", "sortBy() {\n // YOUR CODE HERE\n }", "function sort () {\n index++;\n predicate = ng.isFunction(getter(scope)) ? getter(scope) : attr.stSort;\n if (index % 3 === 0 && attr.stSkipNatural === undefined) {\n //manual reset\n index = 0;\n ctrl.tableState().sort = {};\n ctrl.tableState().pagination.start = 0;\n ctrl.pipe();\n } else {\n ctrl.sortBy(predicate, index % 2 === 0);\n }\n }", "sortingFunction() {\n let records = this.get('content');\n if (isArray(records) && records.length > 1) {\n let sorting = this.get('sorting') || [];\n if (sorting.length === 0) {\n sorting = [{ propName: 'id', direction: 'asc' }];\n }\n\n for (let i = 0; i < sorting.length; i++) {\n let sort = sorting[i];\n if (i === 0) {\n records = this.sortRecords(records, sort, 0, records.length - 1);\n } else {\n let index = 0;\n for (let j = 1; j < records.length; j++) {\n for (let sortIndex = 0; sortIndex < i; sortIndex++) {\n if (records.objectAt(j).get(sorting[sortIndex].propName) !== records.objectAt(j - 1).get(sorting[sortIndex].propName)) {\n records = this.sortRecords(records, sort, index, j - 1);\n index = j;\n break;\n }\n }\n }\n\n records = this.sortRecords(records, sort, index, records.length - 1);\n }\n }\n\n this.set('content', records);\n }\n\n let componentName = this.get('componentName');\n this.get('_groupEditEventsService').geSortApplyTrigger(componentName, this.get('sorting'));\n }", "getOrderBy() {}", "_dynamicSort(property) {\n let sortOrder = 1;\n\n if (property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function (a,b) {\n let result = (a['attributes'][property] < b['attributes'][property]) ? -1 :\n (a['attributes'][property] > b['attributes'][property]) ? 1 : 0;\n return result * sortOrder;\n };\n }", "set sortingOrder(value) {}", "function sortByProcName(a, b) {//sort by name(display_as) ascending only\n\t\tif (a.DISPLAY_AS.toUpperCase() > b.DISPLAY_AS.toUpperCase()) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (a.DISPLAY_AS.toUpperCase() < b.DISPLAY_AS.toUpperCase()) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn 0;\n\t}", "function sort(modifier){visited.add(modifier.name);var requires=[].concat(modifier.requires||[],modifier.requiresIfExists||[]);requires.forEach(function(dep){if(!visited.has(dep)){var depModifier=map.get(dep);if(depModifier){sort(depModifier);}}});result.push(modifier);}", "function sort(modifier){visited.add(modifier.name);var requires=[].concat(modifier.requires||[],modifier.requiresIfExists||[]);requires.forEach(function(dep){if(!visited.has(dep)){var depModifier=map.get(dep);if(depModifier){sort(depModifier);}}});result.push(modifier);}", "function sort(modifier){visited.add(modifier.name);var requires=[].concat(modifier.requires||[],modifier.requiresIfExists||[]);requires.forEach(function(dep){if(!visited.has(dep)){var depModifier=map.get(dep);if(depModifier){sort(depModifier);}}});result.push(modifier);}", "_sortedByChanged(sorted) {\n const headerColumns = this.shadowRoot.querySelectorAll('.th');\n this._resetOldSorting();\n headerColumns.forEach((el) => {\n if (el.getAttribute('sortable') === sorted) {\n el.setAttribute('sorted', '');\n this.set('sortDirection', 'ASC');\n }\n });\n }", "genSortAscendingByField(field) {\n return (a, b) => {\n const valA = a[field].toUpperCase()\n const valB = b[field].toUpperCase()\n let order = 0\n if (valA < valB) order = -1\n if (valA > valB) order = 1\n return order\n }\n }", "sort(comparator) {\n }", "function updateSortFunction() {\n switch(sortBy.value) {\n case '0': // receiverId increasing\n sortFunction = function(tr1, tr2) {\n if(tr1.getElementsByTagName('td')[0].textContent <\n tr2.getElementsByTagName('td')[0].textContent) {\n return -1;\n };\n return 1;\n }\n break;\n case '1': // receiverId decreasing\n sortFunction = function(tr1, tr2) {\n if(tr1.getElementsByTagName('td')[0].textContent >\n tr2.getElementsByTagName('td')[0].textContent) {\n return -1;\n };\n return 1;\n }\n break;\n }\n sortReceiversAndHighlight();\n}", "onSorted(){\n if(this.column.sortable){\n this.column.sort = NextSortDirection(this.sortType, this.column.sort);\n\n this.onSort({\n column: this.column\n });\n }\n }", "function sortMethod(a, b) {\n var x = a.name.toLowerCase();\n var y = b.name.toLowerCase();\n return ((x < y) ? -1 : ((x > y) ? 1 : 0));\n }", "nameSort() {\n orders.sort( \n function(a,b) {\n return (a[0] < b[0]) ? -1 : (a[0] > b[0]) ? 1 : 0; \n }\n ); \n }", "function makeSortby(attribute) {\n\treturn function(a, b) {\n\t\tif (a[attribute] != undefined && b[attribute] != undefined) {\n\t\t\ta = a[attribute].toLowerCase();\n\t\t\tb = b[attribute].toLowerCase();\n\t\t\tif (a < b) return -1;\n\t\t\tif (a > b) return 1;\n\t\t\treturn 0;\n\t\t}\n\t}\n}", "function makeSortby(attribute) {\n\treturn function(a, b) {\n\t\tif (a[attribute] != undefined && b[attribute] != undefined) {\n\t\t\ta = a[attribute].toLowerCase();\n\t\t\tb = b[attribute].toLowerCase();\n\t\t\tif (a < b) return -1;\n\t\t\tif (a > b) return 1;\n\t\t\treturn 0;\n\t\t}\n\t}\n}", "function makeSortby(attribute) {\n\treturn function(a, b) {\n\t\tif (a[attribute] != undefined && b[attribute] != undefined) {\n\t\t\ta = a[attribute].toLowerCase();\n\t\t\tb = b[attribute].toLowerCase();\n\t\t\tif (a < b) return -1;\n\t\t\tif (a > b) return 1;\n\t\t\treturn 0;\n\t\t}\n\t}\n}", "function makeSortby(attribute) {\n return function(a, b) {\n if (a[attribute] != undefined && b[attribute] != undefined) {\n a = a[attribute].toLowerCase();\n b = b[attribute].toLowerCase();\n if (a < b) return -1;\n if (a > b) return 1;\n return 0;\n }\n }\n}", "function sortByFunc() {\n switch (sortBy.field) {\n case 'name':\n case 'ticker':\n if (sortBy.desc === 0) {\n return (a, b) => a[sortBy.field].localeCompare(b[sortBy.field])\n }\n return (a, b) => b[sortBy.field].localeCompare(a[sortBy.field])\n case 'price':\n case 'changes':\n case 'marketCapitalization':\n default:\n if (sortBy.desc === 0) {\n return (a, b) => (a[sortBy.field] - b[sortBy.field])\n }\n return (a, b) => (b[sortBy.field] - a[sortBy.field])\n }\n }", "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "function sort() {\n\t\t\tvar self = this;\n\t\t\tthis._items.sort(function (a, b) {\n\t\t\t\tvar aCompare = self._comparator(a),\n\t\t\t\t\tbCompare = self._comparator(b);\n\t\t\t\t\n\t\t\t\tif (angular.isString(aCompare)) {\n\t\t\t\t\treturn self._direction * aCompare.localeCompare(bCompare);\n\t\t\t\t} else {\n\t\t\t\t\tif (aCompare > bCompare) {\n\t\t\t\t\t\treturn self._direction;\n\t\t\t\t\t} else if (aCompare == bCompare) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t\treturn -self._direction;\n\t\t\t\t}\n\t\t\t});\n\t\t}", "sortBy({ value }) {\n\n }", "function resort(){\n if(scope.sorting && scope.sorting.obj){\n var sortKey = scope.sorting.obj.field;\n sorter(sortKey,scope.sorting.direction);\n }\n }", "function resort(){\n if(scope.sorting && scope.sorting.obj){\n var sortKey = scope.sorting.obj.field;\n sorter(sortKey,scope.sorting.direction);\n }\n }", "genSortDescendingByField(field) {\n return (a, b) => {\n const valA = a[field].toUpperCase()\n const valB = b[field].toUpperCase()\n let order = 0\n if (valA < valB) order = 1\n if (valA > valB) order = -1\n return order\n }\n }", "function onSortChanged() {\n\n //Update the style values\n Object.keys($scope.sort)\n .forEach(updateValue);\n\n function updateValue(name) {\n var val = $scope.sort[name],\n field,\n desc;\n switch (val) {\n case true:\n field = name;\n desc = '';\n $scope.style.sort[name] = iconDown;\n break;\n case false:\n field = name;\n field += ' desc';\n $scope.style.sort[name] = iconUp;\n break;\n default:\n $scope.style.sort[name] = '';\n break;\n }\n\n if (field) {\n $scope.sortValue = field;\n }\n }\n }", "function sortFunction(val){\n return val.sort();\n}", "function sortedHandler(e, args) {\n\t// TODO: Implement sort handler\n}", "_orderSort(l, r) {\n return l.order - r.order;\n }", "orderBy(fn){\n let sorts = this.sorts\n let orderBy = []\n\n sorts.forEach((sortOpts,key)=>{\n \n let desc = sortOpts.desc && sortOpts.desc != 'false' ? 'DESC' : 'ASC'\n\n let sort = fn && fn(key, sortOpts)\n\n if( !sort && sort !== false )\n sort = `${this.db.escapeId(key)} ${desc}`\n \n if( sort )\n orderBy.push(sort)\n })\n\n return orderBy.length > 0 ? 'ORDER BY '+orderBy.join(', ') : ''\n }", "function smartSort(a, b) {\n switch (typeof(a)) {\n case \"string\": return d3.ascending(a, b);\n case \"number\": return a - b; //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort\n default: return d3.ascending(a, b);\n }\n }", "sortData() {\n this.data.sort(($val1, $val2 ) => {\n const a = JSON.stringify($val1[this.sortBy]);\n const b = JSON.stringify($val2[this.sortBy]);\n if ( a < b ){\n return -this.sortDir;\n }\n if ( a > b ){\n return this.sortDir;\n }\n return 0;\n });\n }", "sort(attribute, sortMethod) {\n return function(value1, value2) {\n if (attribute) {\n return (sortMethod == 'ASC' ? value1[attribute] - value2[attribute] :\n value2[attribute] - value1[attribute]) || value1[attribute] - value2[attribute];\n } else {\n return (sortMethod == 'ASC' ? value1 - value2 : value2 - value1) || value1 - value2;\n }\n }\n }", "function bindEventsForSort(){$(EventManager).bind(\"set-added\",function(event,data){UpSetState.logicGroups.forEach(function(lg){lg.orClauses.forEach(function(orClause){orClause[data.set.id]={state:ctx.logicStates.DONTCARE};});});UpSetState.logicGroupChanged=true;});$(EventManager).bind(\"set-removed\",function(event,data){UpSetState.logicGroups.forEach(function(lg){lg.orClauses.forEach(function(orClause){delete orClause[data.set.id];});});UpSetState.logicGroupChanged=true;});}", "function _providerSort(a, b) {\n return b.priority - a.priority;\n }", "function sortArrayAscByItem(){\r\n return function(obj1, obj2){\r\n if (obj1.itemText > obj2.itemText) return 1;\r\n if (obj1.itemText < obj2.itemText) return -1;\r\n return 0;\r\n }\r\n}", "_resort() {\n // Ensure there's something to do.\n if (!this.orderComponents) return;\n\n // Define the comparator for the sort.\n /**\n * Return a comparison result for the two given models, honouring each\n * comparitor in order of their inclusion in the component list. \n */\n const compareModels = (a, b) => {\n for (let i = 0; i < this.orderComponents.length; i++) {\n // Comprehend this order component.\n const {\n identity: {attribute, type}, value: direction\n } = this.orderComponents[i];\n\n // Use the type comparator to retrieve and integer result of\n // the comparison.\n let value = type.compareValues(a[attribute], b[attribute]);\n // Modify based on order.\n if (direction == 'desc') value *= -1;\n // If this comparator found a difference between the two,\n // return it. Note that if it didn't, the next gets a chance\n // to.\n if (value > 0 || value < 0) return value;\n }\n\n return 0;\n };\n\n // Perform the sort.\n this._value.sort(compareModels);\n }", "sort(comments, comparatorFn) {\n return comments.sort(comparatorFn);\n }", "Sort() {\n var i, ln;\n\n if (!tp.IsEmpty(this.SortInfoList) && this.SortInfoList.Count > 0) {\n tp.ListSort(this.fRows, this.SortInfoList.List);\n\n if (!this.BindingSuspended) {\n for (i = 0, ln = this.fListeners.length; i < ln; i++) {\n this.fListeners[i].DataSourceSorted();\n }\n\n this.OnSorted();\n }\n\n\n }\n\n }", "function GetSortOrder(prop) { \n return function(a, b) { \n if (a[prop] > b[prop]) { \n return 1; \n } else if (a[prop] < b[prop]) { \n return -1; \n } \n return 0; \n } \n }", "sorted(x) {\n super.sorted(0, x);\n }", "function sortFunction(){\r\n // parse arguments into an array\r\n var args = [].slice.call(arguments);\r\n return args.sort();\r\n}", "get sort() { return this._sort; }", "get sort() { return this._sort; }", "get sort() { return this._sort; }", "function GetSortOrder(prop) {\n return function (a, b) {\n if (a.district[prop] > b.district[prop]) {\n return -1;\n } else if (a.district[prop] < b.district[prop]) {\n return 1;\n }\n return 0;\n }\n }", "onSorted(){\n if(!this.rows) return;\n\n var sorts = this.options.columns.filter((c) => {\n return c.sort;\n });\n\n if(sorts.length){\n this.onSort({ sorts: sorts });\n\n var clientSorts = [];\n for(var i=0, len=sorts.length; i < len; i++) {\n var c = sorts[i];\n if(c.comparator !== false){\n var dir = c.sort === 'asc' ? '' : '-';\n clientSorts.push(dir + c.prop);\n }\n }\n\n if(clientSorts.length){\n // todo: more ideal to just resort vs splice and repush\n // but wasn't responding to this change ...\n var sortedValues = this.$filter('orderBy')(this.rows, clientSorts);\n this.rows.splice(0, this.rows.length);\n this.rows.push(...sortedValues);\n }\n }\n\n this.options.internal.setYOffset(0);\n }", "function makeSortWithCaseSensitiveBy(attribute) {\n\treturn function(a, b) {\n\t\tif (a[attribute] != undefined && b[attribute] != undefined) {\n\t\t\ta = a[attribute];\n\t\t\tb = b[attribute];\n\t\t\tif (a < b) return -1;\n\t\t\tif (a > b) return 1;\n\t\t\treturn 0;\n\t\t}\n\t}\n}", "sortAlpha(rev) {\n this.allBoxes = this.allBoxes.sort(compare);\n function compare(a, b) {\n let val;\n rev ? val = -1 : val = 1; \n let nameA = a.dataset.name;\n let nameB = b.dataset.name;\n if (nameA < nameB) {\n return -(val);\n }\n if (nameA >= nameB) {\n return val;\n }\n }\n this.allBoxes.forEach(function(el, i) {el.style.order = i});\n }", "function orderAlphabetically() {}", "sorting(addressData) {\n console.log(addressData.Person.sort(this.compare1));\n }", "sortBy(collection, functionOrKey) {\n return collection.sort((a, b) => {\n if (typeof functionOrKey === \"function\") {\n return functionOrKey(a) < functionOrKey(b) ? -1 : 1;\n }\n return a[functionOrKey] < b[functionOrKey] ? -1 : 1;\n });\n }", "function getDefaultSorter(colName) {\n\t\treturn function(a, b, dir){\n\n\t\t\tvar \n\t\t\t\tfirstRec = dir == 'asc' ? a : b,\n\t\t\t\tsecondRec = dir == 'asc' ? b : a,\n\n\t\t\t\tfA = firstRec[colName].toLowerCase(),\n\t\t\t\tfB = secondRec[colName].toLowerCase();\n\n\t\t\t// Handle numbers\n\t\t\tif (fA<fB) return -1\n\t\t\tif (fA>fB) return +1\n\t\t\treturn 0\n\t\t};\n\t}", "sortVariable() {\n this.setSortingRule('Variable');\n this.updateContent();\n }", "function sort() {\n elementArray.sort(function (x, y) {\n return x.elem - y.elem;\n });\n render(elementArray);\n }", "function CdkDragSortEvent() {}", "function CdkDragSortEvent() {}", "sort (sort = {}) {\n let obj = Helpers.is(sort, 'Object') ? sort : { default: sort };\n Object.keys(obj).forEach((key, idx) => {\n Array.prototype.sort.call(this, (a, b) => {\n let vals = (Helpers.is(a.value, 'Object') && Helpers.is(b.value, 'Object')) ? Helpers.dotNotation(key, [a.value, b.value]) : [a, b];\n return (vals[0] < vals[1]) ? -1 : ((vals[0] > vals[1]) ? 1 : 0);\n })[obj[key] === -1 ? 'reverse' : 'valueOf']().forEach((val, idx2) => {\n return this[idx2] = val;\n });\n });\n return this;\n }", "_sortFilters() {\n this.$filterSelects.each(function() {\n const $select = $(this);\n const $toSort = $select.find('option');\n const sortingFunction = sortingFunctions[$select.data('filters-type')];\n\n if (sortingFunction) {\n $toSort.sort((a, b) => {\n return sortingFunction($(a).val(), $(b).val());\n });\n }\n });\n }", "function sortData (data) {\n ...\n}", "function sortByName(c1,c2) {\n var c1Label = data.maps.columnIdToLabel[c1],\n c2Label = data.maps.columnIdToLabel[c2];\n\n return d3.ascending(c1Label, c2Label);\n //return d3.ascending(data.labels.columns[c1],data.labels.columns[c2]);\n }", "function dynamicSort( sortDict ) {\n var key = sortDict.key,\n sortOrder = sortDict.ascending ? 1 : -1;\n\n return function (a,b) {\n var result = (a[key] < b[key]) ? -1 : (a[key] > b[key]) ? 1 : 0;\n return result * sortOrder;\n }\n }", "function getSorter(){\n return $(\".active\").attr(\"sortAttr\");\n }", "function sorter(a,b) {\n return a - b;\n}", "_sortBy(array, selectors) {\n return array.concat().sort((a, b) => {\n for (let selector of selectors) {\n let reverse = selector.order ? -1 : 1;\n\n a = selector.value ? JP.query(a, selector.value)[0] : JP.query(a,selector)[0];\n b = selector.value ? JP.query(b, selector.value)[0] : JP.query(b,selector)[0];\n\n if (a.toUpperCase() > b.toUpperCase()) {\n return reverse;\n }\n if (a.toUpperCase() < b.toUpperCase()) {\n return -1 * reverse;\n }\n }\n return 0;\n });\n }", "function defaultOrderFn (a, b) {\n return a - b; // asc order\n}", "function sortByIndex(a, b){\n\t var aIndex = a.d.index;\n\t var bIndex = b.d.index; \n\t return ((aIndex < bIndex) ? -1 : ((aIndex > bIndex) ? 1 : 0));\n\t}", "function sortBy(field, reverse, primer) {\r\n reverse = (reverse) ? -1 : 1;\r\n return function(a,b) {\r\n a = a[field];\r\n b = b[field];\r\n if (typeof(primer) != 'undefined'){\r\n a = primer(a);\r\n b = primer(b);\r\n }\r\n if (a<b) return reverse * -1;\r\n if (a>b) return reverse * 1;\r\n return 0;\r\n }\r\n}", "function getSortMethod(){\n var _args = Array.prototype.slice.call(arguments);\n return function(a, b){\n for(var x in _args){\n var ax = a[_args[x].substring(1)];\n var bx = b[_args[x].substring(1)];\n var cx;\n\n ax = typeof ax == \"string\" ? ax.toLowerCase() : ax / 1;\n bx = typeof bx == \"string\" ? bx.toLowerCase() : bx / 1;\n\n if(_args[x].substring(0,1) == \"-\"){cx = ax; ax = bx; bx = cx;}\n if(ax != bx){return ax < bx ? -1 : 1;}\n }\n }\n}", "function sortFunction ( a, b ) { \n\t\t if (a[0] - b[0] != 0) {\n\t\t return (a[0] - b[0]);\n\t\t } else if (a[1] - b[1] != 0) { \n\t\t return (a[1] - b[1]);\n\t\t } else { \n\t\t return (a[2] - b[2]);\n\t\t }\n\t\t }", "dynamicSort(property) {\n var sortOrder = 1;\n //check for \"-\" operator and sort asc/desc depending on that\n if (property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function (a, b) {\n var result =\n a[property] < b[property] ? -1 : a[property] > b[property] ? 1 : 0;\n return result * sortOrder;\n };\n }", "sortFunctionDesc(field) {\n const compare = (a, b) => {\n var aField = a[field]\n var bField = b[field]\n if (typeof a[field] === 'string') {\n aField = a[field].toLowerCase()\n }\n if (typeof b[field] === 'string') {\n bField = b[field].toLowerCase()\n }\n if (aField < bField) { return 1 }\n if (aField > bField) { return -1 }\n return 0\n }\n return compare\n }", "sort () {\n\n\t\tthis.Dudes.sort((a, b) => {\n\t\t\treturn b.amIToughEnough(this.fitnessFunction) - a.amIToughEnough(this.fitnessFunction);\n\t\t});\n\n\t}", "sortedItems() {\n if (!this.sortField) return this.itemsToSort;\n return orderBy(this.itemsToSort, [this.sortField], [this.sortOrder]);\n }", "function localSorter(property, dir) {\n if (dir == 'desc') {\n return function(a, b) {\n return (a[property] > b[property]) ? -1 : (a[property] < b[property]) ? 1 : 0;\n }\n } else {\n return function(a, b) {\n return (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;\n }\n }\n}", "function sortNumericallyAscending() {\n utilitymanager_1.um.utilityManager({\n utilType: utilitymanager_1.um.TIXUtilityType.utLinesUtility,\n }, function (up) {\n var keylines = up.inlines.map((function (line) {\n var match = line.match(/(\\d+)/);\n var key = match ? parseInt(match[0]) : 0;\n return [key, line];\n }));\n keylines.sort(function (a, b) { return a[0] - b[0]; });\n return keylines.map(function (keypair) { return keypair[1]; });\n });\n }", "function sortThings( order,asc ){\r\n var things = $('#siteTable .thing').sort(function(a,b){\r\n (asc)?(A=a,B=b):(A=b,B=a);\r\n\r\n switch( order )\r\n {\r\n case 'age':\r\n var timeA = new Date( $(A).find('time:first').attr('datetime') ).getTime(),\r\n timeB = new Date( $(B).find('time:first').attr('datetime') ).getTime();\r\n return timeA - timeB;\r\n case 'score':\r\n var scoreA = $(A).find('.score:visible' ).text().match( numberRX ),\r\n scoreB = $(B).find('.score:visible' ).text().match( numberRX );\r\n return scoreA - scoreB;\r\n case 'reports':\r\n var reportsA = $(A).find('.reported-stamp').text().match( numberRX ),\r\n reportsB = $(B).find('.reported-stamp').text().match( numberRX );\r\n return reportsA - reportsB;\r\n };\r\n });\r\n $('#siteTable').empty().append( things );\r\n }", "function sortInns(prop, asc) {\n $scope.inns = $scope.inns.sort(function(a, b) {\n if (asc) {\n return (a[prop] > b[prop]) ? -1 : ((a[prop] < b[prop]) ? 1 : 0);\n } else {\n return (b[prop] > a[prop]) ? -1 : ((b[prop] < a[prop]) ? 1 : 0);\n }\n });\n }", "function ageSort(){\n return function(people){\n people.sort(function(a,b){\n return a.age - b.age;\n });\n console.log(people);\n };\n }" ]
[ "0.68072623", "0.6693703", "0.65714747", "0.65714747", "0.6565047", "0.6443474", "0.6425113", "0.64110106", "0.6385268", "0.6384523", "0.6344307", "0.63266206", "0.63036287", "0.62926674", "0.62613416", "0.62613416", "0.62593174", "0.6239815", "0.62019855", "0.6200376", "0.6177707", "0.616141", "0.6131906", "0.60662645", "0.60662645", "0.60662645", "0.6061192", "0.60507554", "0.6025611", "0.6012987", "0.6010387", "0.59997416", "0.5999236", "0.59970695", "0.59970695", "0.59970695", "0.5993537", "0.5990427", "0.5959877", "0.5959877", "0.5959877", "0.5959877", "0.5956435", "0.5954162", "0.5947158", "0.5947158", "0.5943586", "0.59381336", "0.59345055", "0.5922801", "0.58927166", "0.58759534", "0.5873057", "0.58710814", "0.5859512", "0.58530337", "0.58426255", "0.5839693", "0.583752", "0.5836024", "0.58311677", "0.5822101", "0.58192706", "0.5811711", "0.5794888", "0.5794888", "0.5794888", "0.57937235", "0.5791136", "0.57700974", "0.5768723", "0.57612866", "0.5753555", "0.57522583", "0.57390153", "0.57362705", "0.5734513", "0.57325", "0.57325", "0.572812", "0.5727391", "0.57203454", "0.571918", "0.5706163", "0.56807446", "0.5671695", "0.5659924", "0.5659432", "0.5658847", "0.56485677", "0.56450623", "0.5643858", "0.5640493", "0.5635995", "0.5633173", "0.5623084", "0.56207144", "0.5616231", "0.56090873", "0.56040704", "0.55996495" ]
0.0
-1
Set up $watches for isolate scope and controller bindings. This process only occurs for isolate scopes and new scopes with controllerAs.
function initializeDirectiveBindings(scope, attrs, destination, bindings, directive) { var removeWatchCollection = []; var initialChanges = {}; var changes; forEach(bindings, function initializeBinding(definition, scopeName) { var attrName = definition.attrName, optional = definition.optional, mode = definition.mode, // @, =, or & lastValue, parentGet, parentSet, compare, removeWatch; switch (mode) { case '@': if (!optional && !hasOwnProperty.call(attrs, attrName)) { destination[scopeName] = attrs[attrName] = void 0; } attrs.$observe(attrName, function(value) { if (isString(value) || isBoolean(value)) { var oldValue = destination[scopeName]; recordChanges(scopeName, value, oldValue); destination[scopeName] = value; } }); attrs.$$observers[attrName].$$scope = scope; lastValue = attrs[attrName]; if (isString(lastValue)) { // If the attribute has been provided then we trigger an interpolation to ensure // the value is there for use in the link fn destination[scopeName] = $interpolate(lastValue)(scope); } else if (isBoolean(lastValue)) { // If the attributes is one of the BOOLEAN_ATTR then Angular will have converted // the value to boolean rather than a string, so we special case this situation destination[scopeName] = lastValue; } initialChanges[scopeName] = new SimpleChange(_UNINITIALIZED_VALUE, destination[scopeName]); break; case '=': if (!hasOwnProperty.call(attrs, attrName)) { if (optional) break; attrs[attrName] = void 0; } if (optional && !attrs[attrName]) break; parentGet = $parse(attrs[attrName]); if (parentGet.literal) { compare = equals; } else { compare = function simpleCompare(a, b) { return a === b || (a !== a && b !== b); }; } parentSet = parentGet.assign || function() { // reset the change, or we will throw this exception on every $digest lastValue = destination[scopeName] = parentGet(scope); throw $compileMinErr('nonassign', "Expression '{0}' in attribute '{1}' used with directive '{2}' is non-assignable!", attrs[attrName], attrName, directive.name); }; lastValue = destination[scopeName] = parentGet(scope); var parentValueWatch = function parentValueWatch(parentValue) { if (!compare(parentValue, destination[scopeName])) { // we are out of sync and need to copy if (!compare(parentValue, lastValue)) { // parent changed and it has precedence destination[scopeName] = parentValue; } else { // if the parent can be assigned then do so parentSet(scope, parentValue = destination[scopeName]); } } return lastValue = parentValue; }; parentValueWatch.$stateful = true; if (definition.collection) { removeWatch = scope.$watchCollection(attrs[attrName], parentValueWatch); } else { removeWatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal); } removeWatchCollection.push(removeWatch); break; case '<': if (!hasOwnProperty.call(attrs, attrName)) { if (optional) break; attrs[attrName] = void 0; } if (optional && !attrs[attrName]) break; parentGet = $parse(attrs[attrName]); destination[scopeName] = parentGet(scope); initialChanges[scopeName] = new SimpleChange(_UNINITIALIZED_VALUE, destination[scopeName]); removeWatch = scope.$watch(parentGet, function parentValueWatchAction(newValue, oldValue) { if (newValue === oldValue) { // If the new and old values are identical then this is the first time the watch has been triggered // So instead we use the current value on the destination as the old value oldValue = destination[scopeName]; } recordChanges(scopeName, newValue, oldValue); destination[scopeName] = newValue; }, parentGet.literal); removeWatchCollection.push(removeWatch); break; case '&': // Don't assign Object.prototype method to scope parentGet = attrs.hasOwnProperty(attrName) ? $parse(attrs[attrName]) : noop; // Don't assign noop to destination if expression is not valid if (parentGet === noop && optional) break; destination[scopeName] = function(locals) { return parentGet(scope, locals); }; break; } }); function recordChanges(key, currentValue, previousValue) { if (isFunction(destination.$onChanges) && currentValue !== previousValue) { // If we have not already scheduled the top level onChangesQueue handler then do so now if (!onChangesQueue) { scope.$$postDigest(flushOnChangesQueue); onChangesQueue = []; } // If we have not already queued a trigger of onChanges for this controller then do so now if (!changes) { changes = {}; onChangesQueue.push(triggerOnChangesHook); } // If the has been a change on this property already then we need to reuse the previous value if (changes[key]) { previousValue = changes[key].previousValue; } // Store this change changes[key] = new SimpleChange(previousValue, currentValue); } } function triggerOnChangesHook() { destination.$onChanges(changes); // Now clear the changes so that we schedule onChanges when more changes arrive changes = undefined; } return { initialChanges: initialChanges, removeWatches: removeWatchCollection.length && function removeWatches() { for (var i = 0, ii = removeWatchCollection.length; i < ii; ++i) { removeWatchCollection[i](); } } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addWatches() {\n scope.watcher = watchClass();\n }", "function configureWatchers() {\n var unwatch = scope.$watch('disabled', function (isDisabled) {\n if (scope.active && isDisabled) {\n tabsCtrl.next(scope);\n }\n });\n\n scope.$watch('active', function (isActive) {\n\n $aria.update( element, {\n 'aria-selected' : isActive,\n 'tabIndex' : isActive === true ? 0 : -1\n });\n\n });\n\n scope.$on(\"$destroy\", function () {\n unwatch();\n tabsCtrl.remove(scope);\n });\n }", "function configureWatchers () {\n var wait = parseInt($scope.delay, 10) || 0;\n\n $attrs.$observe('disabled', function (value) { ctrl.isDisabled = $mdUtil.parseAttributeBoolean(value, false); });\n $attrs.$observe('required', function (value) { ctrl.isRequired = $mdUtil.parseAttributeBoolean(value, false); });\n $attrs.$observe('readonly', function (value) { ctrl.isReadonly = $mdUtil.parseAttributeBoolean(value, false); });\n\n $scope.$watch('searchText', wait ? $mdUtil.debounce(handleSearchText, wait) : handleSearchText);\n $scope.$watch('selectedItem', selectedItemChange);\n\n angular.element($window).on('resize', debouncedOnResize);\n\n $scope.$on('$destroy', cleanup);\n }", "function configureWatchers () {\n $scope.$watch('$mdTabsCtrl.selectedIndex', handleSelectedIndexChange);\n }", "function configureWatchers () {\n $scope.$watch('$mdTabsCtrl.selectedIndex', handleSelectedIndexChange);\n }", "function configureWatchers () {\n $scope.$watch('$mdTabsCtrl.selectedIndex', handleSelectedIndexChange);\n }", "function configureWatchers () {\n $scope.$watch('$mdTabsCtrl.selectedIndex', handleSelectedIndexChange);\n }", "function configureWatchers () {\n var wait = parseInt($scope.delay, 10) || 0;\n $attrs.$observe('disabled', function (value) { ctrl.isDisabled = $mdUtil.parseAttributeBoolean(value, false); });\n $attrs.$observe('required', function (value) { ctrl.isRequired = $mdUtil.parseAttributeBoolean(value, false); });\n $attrs.$observe('readonly', function (value) { ctrl.isReadonly = $mdUtil.parseAttributeBoolean(value, false); });\n $scope.$watch('searchText', wait ? $mdUtil.debounce(handleSearchText, wait) : handleSearchText);\n $scope.$watch('selectedItem', selectedItemChange);\n angular.element($window).on('resize', positionDropdown);\n $scope.$on('$destroy', cleanup);\n }", "function configureWatchers () {\n var wait = parseInt($scope.delay, 10) || 0;\n $attrs.$observe('disabled', function (value) { ctrl.isDisabled = $mdUtil.parseAttributeBoolean(value, false); });\n $attrs.$observe('required', function (value) { ctrl.isRequired = $mdUtil.parseAttributeBoolean(value, false); });\n $attrs.$observe('readonly', function (value) { ctrl.isReadonly = $mdUtil.parseAttributeBoolean(value, false); });\n $scope.$watch('searchText', wait ? $mdUtil.debounce(handleSearchText, wait) : handleSearchText);\n $scope.$watch('selectedItem', selectedItemChange);\n angular.element($window).on('resize', positionDropdown);\n $scope.$on('$destroy', cleanup);\n }", "function configureWatchers () {\n var wait = parseInt($scope.delay, 10) || 0;\n $attrs.$observe('disabled', function (value) { ctrl.isDisabled = value; });\n $attrs.$observe('required', function (value) { ctrl.isRequired = value !== null; });\n $scope.$watch('searchText', wait ? $mdUtil.debounce(handleSearchText, wait) : handleSearchText);\n $scope.$watch('selectedItem', selectedItemChange);\n angular.element($window).on('resize', positionDropdown);\n $scope.$on('$destroy', cleanup);\n }", "function setupWatch(elementToWatch) {\n watchers.push(scope.$watch(function () {\n // We are watching both the value of the element, the value of form.submitted, the validity of the element and the $dirty property of the element\n // We need to watch $dirty becuase angular will somtimes run $dirty checking after the watch functions have fired the first time.\n // Adding the four items together is a bit of a trick\n return elementToWatch.value +\n scopeForm.submitted +\n checkElementValidity(elementToWatch) +\n checkElementRequired(elementToWatch) +\n getDirtyValue(scopeForm[elementToWatch.name]) +\n getModelValue(scopeForm[elementToWatch.name]) +\n getValidValue(scopeForm[elementToWatch.name]);\n },\n function () {\n updateValidationMessage(elementToWatch);\n updateValidationClass(elementToWatch);\n })\n );\n }", "function connectScopes(){var scopeDigesting=false;var newScopeDigesting=false;scope.$watch(function(){if(newScopeDigesting||scopeDigesting){return;}scopeDigesting=true;scope.$$postDigest(function(){if(!newScopeDigesting){newScope.$digest();}scopeDigesting=newScopeDigesting=false;});});newScope.$watch(function(){newScopeDigesting=true;});}", "function configureWatchers(){$scope.$watch('$mdTabsCtrl.selectedIndex',handleSelectedIndexChange);}", "function configureWatchers(){var wait=parseInt($scope.delay,10)||0;$attrs.$observe('disabled',function(value){ctrl.isDisabled=$mdUtil.parseAttributeBoolean(value,false);});$attrs.$observe('required',function(value){ctrl.isRequired=$mdUtil.parseAttributeBoolean(value,false);});$attrs.$observe('readonly',function(value){ctrl.isReadonly=$mdUtil.parseAttributeBoolean(value,false);});$scope.$watch('searchText',wait?$mdUtil.debounce(handleSearchText,wait):handleSearchText);$scope.$watch('selectedItem',selectedItemChange);angular.element($window).on('resize',positionDropdown);$scope.$on('$destroy',cleanup);}", "function generateWatchers() {\n\t\tvar uiR = $rootScope.ressources.ui;\n\t\tfor (var key in uiR) {\n\t\t\tfor (var type in uiR[key]) {\n\t\t\t\tif (type == \"variables\") {\n\t\t\t\t\tfor (var vari in uiR[key][type]) {\n\t\t\t\t\t\tui.variables[vari] = uiR[key][type][vari];\n\t\t\t\t\t\trootVar[vari] = uiR[key][type][vari];\n\t\t\t\t\t\trootfn.varChanged(vari, uiR[key][type][vari], uiR[key][type][vari]);\n\t\t\t\t\t\t\n\t\t\t\t\t\tui.variables.watch(vari, function (prop, oldval, newval) {\n\t\t\t\t\t\t\trootfn.varChanged(prop, oldval, newval);\n\t\t\t\t\t\t\treturn newval;\n\t\t\t\t\t\t});\n\t\t\t\t\t\trootVar.watch(vari, function (prop, oldval, newval) {\n\t\t\t\t\t\t\trootfn.varChanged(prop, oldval, newval);\n\t\t\t\t\t\t\treturn newval;\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}", "_watch() {\n\t\tconst watchHandler = this._createBootstrapper.bind(this);\n\t\tthis._componentFinder.watch();\n\t\tthis._componentFinder\n\t\t\t.on('add', watchHandler)\n\t\t\t.on('unlink', watchHandler)\n\t\t\t.on('changeTemplates', watchHandler);\n\n\t\tthis._storeFinder.watch();\n\t\tthis._storeFinder\n\t\t\t.on('add', watchHandler)\n\t\t\t.on('unlink', watchHandler);\n\t}", "function filterScopeWatchers(scope, type) {\n if (!scope || scopeIds[scope.$id]) {\n return [];\n }\n\n scopeIds[scope.$id] = true;\n if (type === scopeType.isolateScope) {\n iScopeCount++;\n } else {\n scopeCount++;\n }\n return scope.$$watchers || [];\n }", "function setupWatches(formElement) {\n for (var i = 0; i < formElement.length; i++) {\n // This ensures we are only watching form fields\n if (i in formElement) {\n setupWatch(formElement[i]);\n }\n }\n }", "function connectScopes() {\n var scopeDigesting = false;\n var newScopeDigesting = false;\n\n scope.$watch(function() {\n if (newScopeDigesting || scopeDigesting) {\n return;\n }\n\n scopeDigesting = true;\n scope.$$postDigest(function() {\n if (!newScopeDigesting) {\n newScope.$digest();\n }\n\n scopeDigesting = newScopeDigesting = false;\n });\n });\n\n newScope.$watch(function() {\n newScopeDigesting = true;\n });\n }", "function connectScopes() {\n var scopeDigesting = false;\n var newScopeDigesting = false;\n\n scope.$watch(function() {\n if (newScopeDigesting || scopeDigesting) {\n return;\n }\n\n scopeDigesting = true;\n scope.$$postDigest(function() {\n if (!newScopeDigesting) {\n newScope.$digest();\n }\n\n scopeDigesting = newScopeDigesting = false;\n });\n });\n\n newScope.$watch(function() {\n newScopeDigesting = true;\n });\n }", "function connectScopes() {\n var scopeDigesting = false;\n var newScopeDigesting = false;\n\n scope.$watch(function() {\n if (newScopeDigesting || scopeDigesting) {\n return;\n }\n\n scopeDigesting = true;\n scope.$$postDigest(function() {\n if (!newScopeDigesting) {\n newScope.$digest();\n }\n\n scopeDigesting = newScopeDigesting = false;\n });\n });\n\n newScope.$watch(function() {\n newScopeDigesting = true;\n });\n }", "function addWatch($vm) {\n const autoStorage = $vm.$options.autoStorage;\n for (const key of autoStorage) {\n if (parseObjectByKeyPath($vm, key) === undefined) continue;\n $vm.$autoStorage.watch(key);\n }\n}", "function addWatchers() {\n\t\t\t\tif (addWatchers.hasRun) { return; }\n\t\t\t\taddWatchers.hasRun = true;\n\n\t\t\t\tKEYS.forEach(function(key) {\n\t\t\t\t\tenquire.register(CONFIG[key].query, {\n\t\t\t\t\t\tmatch: _.throttle(function() {\n\t\t\t\t\t\t\tpublishChange(new BreakpointChangeEvent(key, previousBP));\n\t\t\t\t\t\t\tpreviousBP = key;\n\t\t\t\t\t\t}, 20)\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}", "function $onInit() {\n // Define one-way bindings\n defineOneWayBinding('stretchTabs', handleStretchTabs);\n\n // Define public properties with change handlers\n defineProperty('focusIndex', handleFocusIndexChange, ctrl.selectedIndex || 0);\n defineProperty('offsetLeft', handleOffsetChange, 0);\n defineProperty('hasContent', handleHasContent, false);\n defineProperty('maxTabWidth', handleMaxTabWidth, getMaxTabWidth());\n defineProperty('shouldPaginate', handleShouldPaginate, false);\n\n // Define boolean attributes\n defineBooleanAttribute('noInkBar', handleInkBar);\n defineBooleanAttribute('dynamicHeight', handleDynamicHeight);\n defineBooleanAttribute('noPagination');\n defineBooleanAttribute('swipeContent');\n defineBooleanAttribute('noDisconnect');\n defineBooleanAttribute('autoselect');\n defineBooleanAttribute('noSelectClick');\n defineBooleanAttribute('centerTabs', handleCenterTabs, false);\n defineBooleanAttribute('enableDisconnect');\n\n // Define public properties\n ctrl.scope = $scope;\n ctrl.parent = $scope.$parent;\n ctrl.tabs = [];\n ctrl.lastSelectedIndex = null;\n ctrl.hasFocus = false;\n ctrl.styleTabItemFocus = false;\n ctrl.shouldCenterTabs = shouldCenterTabs();\n ctrl.tabContentPrefix = 'tab-content-';\n ctrl.navigationHint = 'Use the left and right arrow keys to navigate between tabs';\n\n // Setup the tabs controller after all bindings are available.\n setupTabsController();\n }", "_initializeControllers()\n {\n this._controllerContextMenu = new ControllerContextMenu();\n this._controllerModal = new ControllerModal();\n this._controllerProject = new ControllerProject();\n this._controllerResource = new ControllerResource();\n this._controllerRunJob = new ControllerRunJob();\n this._controllerWorkflow = new ControllerWorkflow();\n this._controllerWorkflowBuilder = new ControllerWorkflowBuilder();\n this._controllerWorkflowRun = new ControllerWorkflowRun();\n\n }", "_watch() {\n\t\tconst watchHandler = this._createAppDefinitions.bind(this);\n\t\tthis._componentFinder.watch();\n\t\tthis._componentFinder\n\t\t\t.on('add', watchHandler)\n\t\t\t.on('unlink', watchHandler)\n\t\t\t.on('changeTemplates', watchHandler);\n\n\t\tthis._storeFinder.watch();\n\t\tthis._storeFinder\n\t\t\t.on('add', watchHandler)\n\t\t\t.on('unlink', watchHandler);\n\t}", "function startWatch() {\r\n //if there's not already a watch\r\n if (!watcher) {\r\n watcher = scope.$watch(function () {\r\n return modelCtrl.$modelValue;\r\n }, function (newValue, oldValue) {\r\n\r\n if (!newValue || angular.equals(newValue, oldValue)) {\r\n return;\r\n }\r\n\r\n if (modelCtrl.$invalid) {\r\n modelCtrl.$setValidity('valServer', true);\r\n stopWatch();\r\n }\r\n }, true);\r\n }\r\n }", "function LfBind(){\n\tvar $watchModels = []; //models to watch for\n\tvar $watchBinds = []; //binds to watch for\n\tvar that = this;\n\n\tthis.$registerWatcher = function(){ \t\n\t\t$watchModels = $main.$rootElement.querySelectorAll('[lf-model]'); \n\t\t$watchBinds = $main.$rootElement.querySelectorAll('[lf-bind]');\n\t}\n\n\tthis.$observeObject = function(){\n\t\t//observe changes in $scope object, if any change is detected it updates respective models and bind\n\t\tObject.observe($main.$scope, function(changes){\n\t\t changes.forEach(function(change) {\n\t\t \t// console.log(change.type, ' : ',change.name,' : ', change.oldValue);\n\t\t \tthat.$updateView(change.name);\n\t\t \t }); //end of change.foreach\n\t\t}); //end of object.observe\n\t}\n\n\tthis.$addListener = function(){ \n\t\tfor(var i = 0, len = $watchModels.length; i < len; i++){\n\t\t\t$watchModels[i].count = i;\n\t\t\t$watchModels[i].addEventListener('keyup', function(evt)\n\t\t\t{ \n\t\t\t\tvar index = evt.target.count;\n\t\t\t\tvar key = $watchModels[index].getAttribute('lf-model');\n\t\t\t\tvar value = $watchModels[index].value;\n\t\t\t\t$main.$scope[key] = value;\n\t\t\t});\n\t\t}\n\t}\n\t\n\t//updates the model and binds with data if initially present in scope object\n\tthis.$initializeFirstView = function(){ \t\n\t\tfor(var i = 0, len = $watchModels.length; i < len; i++){\n\t\t\tvar $tag = $watchModels[i].getAttribute('lf-model'); \t\n\t\t\tif($main.$scope.hasOwnProperty($tag))\n\t\t\t\t$watchModels[i].value = $main.$scope[$tag];\n\t\t\t\t$watchModels[i].innerHTML = $main.$scope[$tag];\n\t\t}\n\n\t\tfor(var i = 0, len = $watchBinds.length; i < len; i++){\n\t\t\tvar $tag = $watchBinds[i].getAttribute('lf-bind'); \t\n\t\t\tif($main.$scope.hasOwnProperty($tag))\n\t\t\t\t$watchBinds[i].value = $main.$scope[$tag];\n\t\t\t\t$watchBinds[i].innerHTML = $main.$scope[$tag];\n\t\t}\n\t}\t\n\n\t//search and update all bind and models of changed variable\n\tthis.$updateView = function($tag){\n\t \tfor(var j = 0, len = $watchModels.length; j < len; j++){\n\t\t\tif($tag === $watchModels[j].getAttribute('lf-model')){\n\t\t\t\t$watchModels[j].value = $main.$scope[$tag];\n\t\t\t\t$watchModels[j].innerHTML = $main.$scope[$tag];\n\t\t\t}\n \t} \n\n \tfor(var j = 0, len = $watchBinds.length; j < len; j++){\n\t\t\tif($tag === $watchBinds[j].getAttribute('lf-bind')){\n\t\t\t\t$watchBinds[j].value = $main.$scope[$tag];\n\t\t\t\t$watchBinds[j].innerHTML = $main.$scope[$tag];\n\t\t\t}\n \t} \t\n\t}\n} //end of LfBind", "function markDirectiveScope(directives,isolateScope,newScope){for(var j=0,jj=directives.length;j<jj;j++){directives[j]=inherit(directives[j],{$$isolateScope:isolateScope,$$newScope:newScope});}}", "function markDirectiveScope(directives,isolateScope,newScope){for(var j=0,jj=directives.length;j<jj;j++){directives[j]=inherit(directives[j],{$$isolateScope:isolateScope,$$newScope:newScope});}}", "function setup() {\n // Bind to window resize events\n angular.element($window).on('resize', gridResize);\n\n // Unbind from window resize events when the grid is destroyed\n $elm.on('$destroy', function () {\n angular.element($window).off('resize', gridResize);\n });\n\n // If we add a left container after render, we need to watch and react\n $scope.$watch(function () { return grid.hasLeftContainer();}, function (newValue, oldValue) {\n if (newValue === oldValue) {\n return;\n }\n grid.refreshCanvas(true);\n });\n\n // If we add a right container after render, we need to watch and react\n $scope.$watch(function () { return grid.hasRightContainer();}, function (newValue, oldValue) {\n if (newValue === oldValue) {\n return;\n }\n grid.refreshCanvas(true);\n });\n }", "_setup (model) {\n this.watch(model)\n this._insertActionsInjector(model)\n }", "function setBindings() {\n // we're using normal DOM elements\n\n /**\n * Start event\n * @param {object} elem\n * @param {string} rf\n * @param {object} [ptr]\n */\n var bindSwipeStart = function(elem, rf, ptr) {\n\n // make sure the element has all the methods and properties we'll need\n elem = angularize(elem);\n\n // if no pointer reference is supplied, reference the element given\n if(angular.isUndefined(ptr)) {\n ptr = elem;\n } else {\n ptr = angularize(ptr);\n }\n\n // bind the swipe start event to the element\n $swipe.bind(elem, {\n start: function(coords, ev) {\n onStart(ev, ptr, rf);\n }\n });\n };\n\n /**\n * Move event\n * @param {object} elem\n */\n var bindSwipe = function(elem) {\n\n // make sure the element has all the methods and properties we'll need\n elem = angularize(elem);\n\n // bind the swipe move, end, and cancel events\n $swipe.bind(elem, {\n move : function(coords, ev) {\n onMove(ev);\n },\n end : function(coords, ev) {\n onMove(ev);\n onEnd();\n },\n cancel: function(coords, ev) {\n onEnd(ev);\n }\n });\n };\n\n // bind the common events to the various common elements\n bindSwipe($document);\n bindSwipeStart(refs.currPtr, refSelected);\n bindSwipeStart(refs.currBub, refSelected);\n bindSwipeStart(refs.minBub, refSelected, refs.currPtr);\n\n // bind the single knob specific events to the single knob specific elements\n bindSwipeStart(refs.maxBub, refSelected, refs.currPtr);\n bindSwipeStart(refs.fullBar, refSelected, refs.currPtr);\n\n\n }", "setup() {\n this.projectController.setup();\n this.filterController.setup();\n }", "function addWatchers() {\n let directories = atom.project.getDirectories();\n directories.forEach((element) => {\n initWatcher(element.path);\n }, this);\n}", "function Scope() {\n this.$$watchers = [];\n this.$$lastDirtyWatch = null;\n this.$$asyncQueue = [];\n this.$$applyAsyncQueue = [];\n this.$$applyAsyncId = null;\n this.$$postDigestQueue = [];\n this.$$phase = null;\n}", "function markDirectiveScope(directives, isolateScope, newScope) { // 8373\n for (var j = 0, jj = directives.length; j < jj; j++) { // 8374\n directives[j] = inherit(directives[j], {$$isolateScope: isolateScope, $$newScope: newScope}); // 8375\n } // 8376\n } // 8377", "watchOnScope($scope, propName){\n\t\t// for init watching\n\t\tif(curr !== undefined){\n\t\t\t// compare current with this collection to determine the change\n\t\t\tif(curr !== collection){\n\t\t\t\t$scope.$apply(() => {\n\t\t\t\t\t$scope[propName] = this\n\t\t\t\t})\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t$scope[propName] = this;\n\t\tlet connector = this.getConfig('connector');\n\t\tif(!connector){\n\t\t\tthrow new Error('Connector is not configured for this model')\n\t\t}\n\t\tvar model = this;\n\t\tvar unsubscribe = connector.$subscribe(() => {\n\t\t\tconnector.$isChanged(model).then((isChanged) => {\n\t\t\t\tif(isChanged){\n\t\t\t\t\t$scope.$apply(() => {\n\t\t\t\t\t\t$scope[propName] = isChanged\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\n\t\t// unsubscribe on $scope destroy event\n\t\t$scope.$on(\"$destroy\", unsubscribe);\n\t\treturn unsubscribe;\n\t}", "function $onInit() {\n // Angular will try to bind any 'bindings' properties after its instantiate the controller.\n // Therefore, I seal the controller after its ready / $onInit.\n\n Object.seal(ctrl);\n }", "function initializeDirectiveBindings(scope, attrs, destination, bindings, directive) { // 8850\n var removeWatchCollection = []; // 8851\n forEach(bindings, function(definition, scopeName) { // 8852\n var attrName = definition.attrName, // 8853\n optional = definition.optional, // 8854\n mode = definition.mode, // @, =, or & // 8855\n lastValue, // 8856\n parentGet, parentSet, compare; // 8857\n // 8858\n switch (mode) { // 8859\n // 8860\n case '@': // 8861\n if (!optional && !hasOwnProperty.call(attrs, attrName)) { // 8862\n destination[scopeName] = attrs[attrName] = void 0; // 8863\n } // 8864\n attrs.$observe(attrName, function(value) { // 8865\n if (isString(value)) { // 8866\n destination[scopeName] = value; // 8867\n } // 8868\n }); // 8869\n attrs.$$observers[attrName].$$scope = scope; // 8870\n if (isString(attrs[attrName])) { // 8871\n // If the attribute has been provided then we trigger an interpolation to ensure // 8872\n // the value is there for use in the link fn // 8873\n destination[scopeName] = $interpolate(attrs[attrName])(scope); // 8874\n } // 8875\n break; // 8876\n // 8877\n case '=': // 8878\n if (!hasOwnProperty.call(attrs, attrName)) { // 8879\n if (optional) break; // 8880\n attrs[attrName] = void 0; // 8881\n } // 8882\n if (optional && !attrs[attrName]) break; // 8883\n // 8884\n parentGet = $parse(attrs[attrName]); // 8885\n if (parentGet.literal) { // 8886\n compare = equals; // 8887\n } else { // 8888\n compare = function(a, b) { return a === b || (a !== a && b !== b); }; // 8889\n } // 8890\n parentSet = parentGet.assign || function() { // 8891\n // reset the change, or we will throw this exception on every $digest // 8892\n lastValue = destination[scopeName] = parentGet(scope); // 8893\n throw $compileMinErr('nonassign', // 8894\n \"Expression '{0}' used with directive '{1}' is non-assignable!\", // 8895\n attrs[attrName], directive.name); // 8896\n }; // 8897\n lastValue = destination[scopeName] = parentGet(scope); // 8898\n var parentValueWatch = function parentValueWatch(parentValue) { // 8899\n if (!compare(parentValue, destination[scopeName])) { // 8900\n // we are out of sync and need to copy // 8901\n if (!compare(parentValue, lastValue)) { // 8902\n // parent changed and it has precedence // 8903\n destination[scopeName] = parentValue; // 8904\n } else { // 8905\n // if the parent can be assigned then do so // 8906\n parentSet(scope, parentValue = destination[scopeName]); // 8907\n } // 8908\n } // 8909\n return lastValue = parentValue; // 8910\n }; // 8911\n parentValueWatch.$stateful = true; // 8912\n var removeWatch; // 8913\n if (definition.collection) { // 8914\n removeWatch = scope.$watchCollection(attrs[attrName], parentValueWatch); // 8915\n } else { // 8916\n removeWatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal); // 8917\n } // 8918\n removeWatchCollection.push(removeWatch); // 8919\n break; // 8920\n // 8921\n case '&': // 8922\n // Don't assign Object.prototype method to scope // 8923\n parentGet = attrs.hasOwnProperty(attrName) ? $parse(attrs[attrName]) : noop; // 8924\n // 8925\n // Don't assign noop to destination if expression is not valid // 8926\n if (parentGet === noop && optional) break; // 8927\n // 8928\n destination[scopeName] = function(locals) { // 8929\n return parentGet(scope, locals); // 8930\n }; // 8931\n break; // 8932\n } // 8933\n }); // 8934\n // 8935\n return removeWatchCollection.length && function removeWatches() { // 8936\n for (var i = 0, ii = removeWatchCollection.length; i < ii; ++i) { // 8937\n removeWatchCollection[i](); // 8938\n } // 8939\n }; // 8940\n }", "function setupTabsController () {\n ctrl.selectedIndex = ctrl.selectedIndex || 0;\n compileTemplate();\n configureWatchers();\n bindEvents();\n $mdTheming($element);\n $mdUtil.nextTick(function () {\n updateHeightFromContent();\n adjustOffset();\n updateInkBarStyles();\n ctrl.tabs[ ctrl.selectedIndex ] && ctrl.tabs[ ctrl.selectedIndex ].scope.select();\n loaded = true;\n updatePagination();\n });\n }", "function getCount() {\n var watcherCount = 0,\n scopeCount = 0,\n iScopeCount = 0,\n scopeIds = {};\n\n /*\n * loop dom from body\n */\n function loopDom(element) {\n if (!element.length) {\n return watcherCount;\n }\n\n var scope = element.data(),\n iSolateWatchers = filterScopeWatchers(scope.$isolateScope, scopeType.isolateScope),\n scopeWatchers = filterScopeWatchers(scope.$scope, scopeType.scope),\n watcher = scopeWatchers.concat(iSolateWatchers);\n watcherCount += watcher.length;\n\n angular.forEach(element.children(), function (child) {\n loopDom(angular.element(child));\n });\n }\n\n /*\n * use hash table to filter the scope and get the watchers\n */\n function filterScopeWatchers(scope, type) {\n if (!scope || scopeIds[scope.$id]) {\n return [];\n }\n\n scopeIds[scope.$id] = true;\n if (type === scopeType.isolateScope) {\n iScopeCount++;\n } else {\n scopeCount++;\n }\n return scope.$$watchers || [];\n }\n\n //begin loop\n loopDom(angular.element('body'));\n\n return {\n watcherCount: watcherCount,\n scopeCount: scopeCount,\n iScopeCount: iScopeCount\n }\n\n }", "_setupScopeListener() {\n const hubScope = core_1.getCurrentHub().getScope();\n if (hubScope) {\n hubScope.addScopeListener(updatedScope => {\n const cloned = core_1.Scope.clone(updatedScope);\n cloned._eventProcessors = [];\n cloned._scopeListeners = [];\n // tslint:disable-next-line:no-object-literal-type-assertion\n this._scopeStore.update((current) => (Object.assign(Object.assign({}, current), cloned)));\n });\n }\n }", "function setWatchlist() {\n\twatchlist = new Watchlist();\n}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal(){}", "function initWatchVal(){}", "function markDirectiveScope(directives, isolateScope, newScope) {\n\t for (var j = 0, jj = directives.length; j < jj; j++) {\n\t directives[j] = inherit(directives[j], {$$isolateScope: isolateScope, $$newScope: newScope});\n\t }\n\t }", "function markDirectiveScope(directives, isolateScope, newScope) {\n\t for (var j = 0, jj = directives.length; j < jj; j++) {\n\t directives[j] = inherit(directives[j], {$$isolateScope: isolateScope, $$newScope: newScope});\n\t }\n\t }", "function addWatches($scope) {\n // Ensure pool names are unique for the pool names we know about.\n // It's still possible for a duplicate named pool to be created\n // by another user which will cause this pool creation to fail,\n // just highly unlikely.\n $scope.$watch('pool.name', function(newValue) {\n if (_.find($scope.poolNames, function(name) {\n return name === newValue;\n })) {\n $scope.poolForm.name.$setValidity('duplicate', false);\n return;\n }\n $scope.poolForm.name.$setValidity('duplicate', true);\n\n //Clear the server error if user changes the name\n $scope.poolForm.name.$setValidity('server', true);\n });\n /* jshint camelcase: false */\n // Validate the pool size is a number and re-calculate the pgnum\n // if the replication size changes.\n $scope.$watch('pool.size', function(newValue /*, oldValue*/ ) {\n if (!_.isNumber(newValue)) {\n $scope.poolForm.size.$error.number = true;\n return;\n }\n\n if (!$scope.isEdit) {\n var ruleset = $scope.crushrulesets[$scope.pool.crush_ruleset];\n var limits = getActiveRule(ruleset, $scope.defaults.mon_max_pool_pg_num, newValue);\n $scope.limits = limits;\n if (validateMaxMin.call($scope.pool, 'size', newValue, limits.min_size, limits.max_size)) {\n $scope.pool.pg_num = calculatePGNum(limits.osd_count, newValue, $scope.defaults.mon_max_pool_pg_num);\n $scope.crushrulesets[$scope.pool.crush_ruleset].active_sub_rule = limits.active_rule;\n }\n }\n\n //Clear the server error if user changes the name\n $scope.poolForm.size.$setValidity('server', true);\n });\n // Validate the pg_num is a number and that it is within the\n // min/max for this cluster.\n $scope.$watch('pool.pg_num', function(newValue /*, oldValue*/ ) {\n if (!_.isNumber(newValue)) {\n $scope.poolForm.pg_num.$error.number = true;\n return;\n }\n $scope.poolForm.pg_num.$error.number = false;\n $scope.poolForm.pg_num.$pristine = true;\n validateMaxMin.call($scope.pool, 'pg_num', newValue, 1, $scope.defaults.mon_max_pool_pg_num);\n\n //Clear the server error if user changes the name\n $scope.poolForm.pg_num.$setValidity('server', true);\n });\n // If the crushset changes reset the pool size and the active crush rule sub rule\n // value to default.\n $scope.$watch('pool.crush_ruleset', function(newValue, oldValue) {\n $scope.pool.size = $scope.defaults.size;\n $scope.crushrulesets[newValue].active_sub_rule = 0;\n $scope.crushrulesets[oldValue].active_sub_rule = 0;\n\n //Clear the server error if user changes the name\n $scope.poolForm.crush_ruleset.$setValidity('server', true);\n });\n }", "function markDirectiveScope(directives, isolateScope, newScope) {\n for (var j = 0, jj = directives.length; j < jj; j++) {\n directives[j] = inherit(directives[j], { $$isolateScope: isolateScope, $$newScope: newScope });\n }\n }", "function markDirectiveScope(directives, isolateScope, newScope) {\n for (var j = 0, jj = directives.length; j < jj; j++) {\n directives[j] = inherit(directives[j], {$$isolateScope: isolateScope, $$newScope: newScope});\n }\n }", "function markDirectiveScope(directives, isolateScope, newScope) {\n for (var j = 0, jj = directives.length; j < jj; j++) {\n directives[j] = inherit(directives[j], {$$isolateScope: isolateScope, $$newScope: newScope});\n }\n }", "function markDirectiveScope(directives, isolateScope, newScope) {\n for (var j = 0, jj = directives.length; j < jj; j++) {\n directives[j] = inherit(directives[j], {$$isolateScope: isolateScope, $$newScope: newScope});\n }\n }", "function markDirectiveScope(directives, isolateScope, newScope) {\n for (var j = 0, jj = directives.length; j < jj; j++) {\n directives[j] = inherit(directives[j], {$$isolateScope: isolateScope, $$newScope: newScope});\n }\n }", "function markDirectiveScope(directives, isolateScope, newScope) {\n for (var j = 0, jj = directives.length; j < jj; j++) {\n directives[j] = inherit(directives[j], {$$isolateScope: isolateScope, $$newScope: newScope});\n }\n }", "function markDirectiveScope(directives, isolateScope, newScope) {\n for (var j = 0, jj = directives.length; j < jj; j++) {\n directives[j] = inherit(directives[j], {$$isolateScope: isolateScope, $$newScope: newScope});\n }\n }" ]
[ "0.70716393", "0.663641", "0.64076275", "0.6359493", "0.6359493", "0.6359493", "0.6359493", "0.63455623", "0.63455623", "0.6259326", "0.61234754", "0.58771425", "0.58537793", "0.58415467", "0.58415025", "0.57979065", "0.5657267", "0.5647832", "0.56475717", "0.56475717", "0.56475717", "0.5641952", "0.5456813", "0.5438152", "0.5433366", "0.5426905", "0.54226226", "0.53747326", "0.53735894", "0.53735894", "0.53512865", "0.52933574", "0.52619964", "0.52542144", "0.520018", "0.51990396", "0.5194361", "0.5190628", "0.51716053", "0.51697564", "0.51449406", "0.51025814", "0.5089215", "0.5079365", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50732404", "0.50508857", "0.50508857", "0.5026902", "0.5026902", "0.50170034", "0.50169635", "0.5000428", "0.5000428", "0.5000428", "0.5000428", "0.5000428", "0.5000428" ]
0.0
-1
Converts all accepted directives format into proper directive name.
function directiveNormalize(name) { return camelCase(name.replace(PREFIX_REGEXP, '')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function directiveNormalize(name){return camelCase(name.replace(PREFIX_REGEXP,''));}", "function directiveNormalize(name){return name.replace(PREFIX_REGEXP,'').replace(SPECIAL_CHARS_REGEXP,fnCamelCaseReplace);}", "function directiveNormalize(name){return name.replace(PREFIX_REGEXP,'').replace(SPECIAL_CHARS_REGEXP,function(_,separator,letter,offset){return offset?letter.toUpperCase():letter;});}", "function directiveNormalize(name) { // 8950\n return camelCase(name.replace(PREFIX_REGEXP, '')); // 8951\n} // 8952", "function directiveNormalize(name) {\n\t return camelCase(name.replace(PREFIX_REGEXP, ''));\n\t}", "function directiveNormalize(name) {\n\t\treturn camelCase(name.replace(PREFIX_REGEXP, ''));\n\t}", "function directiveNormalize(name) {\n\t\treturn camelCase(name.replace(PREFIX_REGEXP, ''));\n\t}", "function directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n }", "function directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n }", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n });\n }", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n });\n }", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n });\n }", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n });\n }", "function normalizeDirectives (options) {\n\t\tvar dirs = options.directives;\n\t\tif (dirs) {\n\t\t\tfor (var key in dirs) {\n\t\t\t\tvar def$$1 = dirs[key];\n\t\t\t\tif (typrof def$$1 === 'function') {\n\t\t\t\t\tdirs[key] = { bind: def$$1, undate: def$$1 };\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function directiveNormalize(name) {\n\t return name\n\t .replace(PREFIX_REGEXP, '')\n\t .replace(SPECIAL_CHARS_REGEXP, function(_, letter, offset) {\n\t return offset ? letter.toUpperCase() : letter;\n\t });\n\t}", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, fnCamelCaseReplace);\n}", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, fnCamelCaseReplace);\n}", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, fnCamelCaseReplace);\n}", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, fnCamelCaseReplace);\n}", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, function(_, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n });\n}", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, function(_, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n });\n}", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, function(_, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n });\n}", "function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, function(_, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n });\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n }", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n }", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n }", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n }", "function normalizeDirectives(options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === \"function\") {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n }", "function normalizeDirectives(options){var dirs=options.directives;if(dirs){for(var key in dirs){var def=dirs[key];if(typeof def==='function'){dirs[key]={bind:def,update:def};}}}}", "function normalizeDirectives(options){var dirs=options.directives;if(dirs){for(var key in dirs){var def=dirs[key];if(typeof def==='function'){dirs[key]={bind:def,update:def};}}}}", "function normalizeDirectives(options){var dirs=options.directives;if(dirs){for(var key in dirs){var def=dirs[key];if(typeof def==='function'){dirs[key]={bind:def,update:def};}}}}", "function normalizeDirectives(options) {\n var dirs = options.directives;\n\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n\n if (typeof def$$1 === 'function') {\n dirs[key] = {\n bind: def$$1,\n update: def$$1\n };\n }\n }\n }\n }", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def = dirs[key];\n if (typeof def === 'function') {\n dirs[key] = { bind: def, update: def };\n }\n }\n }\n }", "function normalizeDirectives(options) {\n\t\t var dirs = options.directives;\n\t\t if (dirs) {\n\t\t for (var key in dirs) {\n\t\t var def = dirs[key];\n\t\t if (typeof def === 'function') {\n\t\t dirs[key] = { bind: def, update: def };\n\t\t }\n\t\t }\n\t\t }\n\t\t}", "function normalizeDirectives(options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def = dirs[key];\n if (typeof def === 'function') {\n dirs[key] = { bind: def, update: def };\n }\n }\n }\n }", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}", "function normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}" ]
[ "0.6846047", "0.68269444", "0.68100214", "0.67178917", "0.65807444", "0.65433955", "0.65433955", "0.6526205", "0.65044594", "0.6472985", "0.6459022", "0.6459022", "0.6459022", "0.6425821", "0.64138436", "0.6358559", "0.6358559", "0.6358559", "0.6358559", "0.6333173", "0.6333173", "0.6333173", "0.6333173", "0.6262128", "0.6262128", "0.6262128", "0.62422025", "0.623998", "0.6223221", "0.6223221", "0.6223221", "0.6213364", "0.6201782", "0.6186072", "0.6181973", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234", "0.61755234" ]
0.6499601
33
Makes the request. !!! ACCESSES CLOSURE VARS: $httpBackend, defaults, $log, $rootScope, defaultCache, $http.pendingRequests
function sendReq(config, reqData) { var deferred = $q.defer(), promise = deferred.promise, cache, cachedResp, reqHeaders = config.headers, url = buildUrl(config.url, config.paramSerializer(config.params)); $http.pendingRequests.push(config); promise.then(removePendingReq, removePendingReq); if ((config.cache || defaults.cache) && config.cache !== false && (config.method === 'GET' || config.method === 'JSONP')) { cache = isObject(config.cache) ? config.cache : isObject(defaults.cache) ? defaults.cache : defaultCache; } if (cache) { cachedResp = cache.get(url); if (isDefined(cachedResp)) { if (isPromiseLike(cachedResp)) { // cached request has already been sent, but there is no response yet cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult); } else { // serving from cache if (isArray(cachedResp)) { resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]); } else { resolvePromise(cachedResp, 200, {}, 'OK'); } } } else { // put the promise for the non-transformed response into cache as a placeholder cache.put(url, promise); } } // if we won't have the response in cache, set the xsrf headers and // send the request to the backend if (isUndefined(cachedResp)) { var xsrfValue = urlIsSameOrigin(config.url) ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName] : undefined; if (xsrfValue) { reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue; } $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout, config.withCredentials, config.responseType, createApplyHandlers(config.eventHandlers), createApplyHandlers(config.uploadEventHandlers)); } return promise; function createApplyHandlers(eventHandlers) { if (eventHandlers) { var applyHandlers = {}; forEach(eventHandlers, function(eventHandler, key) { applyHandlers[key] = function(event) { if (useApplyAsync) { $rootScope.$applyAsync(callEventHandler); } else if ($rootScope.$$phase) { callEventHandler(); } else { $rootScope.$apply(callEventHandler); } function callEventHandler() { eventHandler(event); } }; }); return applyHandlers; } } /** * Callback registered to $httpBackend(): * - caches the response if desired * - resolves the raw $http promise * - calls $apply */ function done(status, response, headersString, statusText) { if (cache) { if (isSuccess(status)) { cache.put(url, [status, response, parseHeaders(headersString), statusText]); } else { // remove promise from the cache cache.remove(url); } } function resolveHttpPromise() { resolvePromise(response, status, headersString, statusText); } if (useApplyAsync) { $rootScope.$applyAsync(resolveHttpPromise); } else { resolveHttpPromise(); if (!$rootScope.$$phase) $rootScope.$apply(); } } /** * Resolves the raw $http promise. */ function resolvePromise(response, status, headers, statusText) { //status: HTTP response status code, 0, -1 (aborted by timeout / promise) status = status >= -1 ? status : 0; (isSuccess(status) ? deferred.resolve : deferred.reject)({ data: response, status: status, headers: headersGetter(headers), config: config, statusText: statusText }); } function resolvePromiseWithResult(result) { resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText); } function removePendingReq() { var idx = $http.pendingRequests.indexOf(config); if (idx !== -1) $http.pendingRequests.splice(idx, 1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_startRequest() {\n if (this._timeoutID !== undefined)\n clearTimeout(this._timeoutID);\n \n this._makeRequest()\n .then(({ request }) => {\n if (!this.isStarted)\n return;\n \n let delay = this._defaultTimeout;\n \n // Read ResponseHeader\n let cacheControl = request.getResponseHeader('Cache-Control');\n if (cacheControl !== null) {\n let maxAges = /(^|,)max-age=([0-9]+)($|,)/.exec(cacheControl);\n if (maxAges !== null &&\n maxAges[2] > 0)\n delay = Math.round(maxAges[2]*1000);\n }\n \n this.trigger('success:request', { request });\n \n if (delay !== undefined)\n this._planRequest({ delay });\n }, ({ request } = {}) => {\n if (!this.isStarted)\n return;\n \n if (request === undefined)\n return;\n \n this.trigger('error:request', { request });\n \n if (this._timeoutOnError !== undefined)\n this._planRequest({ delay: this._timeoutOnError });\n });\n }", "function sendReq(config,reqData){var deferred=$q.defer(),promise=deferred.promise,cache,cachedResp,reqHeaders=config.headers,url=buildUrl(config.url,config.paramSerializer(config.params));$http.pendingRequests.push(config);promise.then(removePendingReq,removePendingReq);if((config.cache||defaults.cache)&&config.cache!==false&&(config.method==='GET'||config.method==='JSONP')){cache=isObject(config.cache)?config.cache:isObject(defaults.cache)?defaults.cache:defaultCache;}if(cache){cachedResp=cache.get(url);if(isDefined(cachedResp)){if(isPromiseLike(cachedResp)){// cached request has already been sent, but there is no response yet\n\tcachedResp.then(resolvePromiseWithResult,resolvePromiseWithResult);}else{// serving from cache\n\tif(isArray(cachedResp)){resolvePromise(cachedResp[1],cachedResp[0],shallowCopy(cachedResp[2]),cachedResp[3]);}else{resolvePromise(cachedResp,200,{},'OK');}}}else{// put the promise for the non-transformed response into cache as a placeholder\n\tcache.put(url,promise);}}// if we won't have the response in cache, set the xsrf headers and\n\t// send the request to the backend\n\tif(isUndefined(cachedResp)){var xsrfValue=urlIsSameOrigin(config.url)?$$cookieReader()[config.xsrfCookieName||defaults.xsrfCookieName]:undefined;if(xsrfValue){reqHeaders[config.xsrfHeaderName||defaults.xsrfHeaderName]=xsrfValue;}$httpBackend(config.method,url,reqData,done,reqHeaders,config.timeout,config.withCredentials,config.responseType,createApplyHandlers(config.eventHandlers),createApplyHandlers(config.uploadEventHandlers));}return promise;function createApplyHandlers(eventHandlers){if(eventHandlers){var applyHandlers={};forEach(eventHandlers,function(eventHandler,key){applyHandlers[key]=function(event){if(useApplyAsync){$rootScope.$applyAsync(callEventHandler);}else if($rootScope.$$phase){callEventHandler();}else{$rootScope.$apply(callEventHandler);}function callEventHandler(){eventHandler(event);}};});return applyHandlers;}}/**\n\t * Callback registered to $httpBackend():\n\t * - caches the response if desired\n\t * - resolves the raw $http promise\n\t * - calls $apply\n\t */function done(status,response,headersString,statusText){if(cache){if(isSuccess(status)){cache.put(url,[status,response,parseHeaders(headersString),statusText]);}else{// remove promise from the cache\n\tcache.remove(url);}}function resolveHttpPromise(){resolvePromise(response,status,headersString,statusText);}if(useApplyAsync){$rootScope.$applyAsync(resolveHttpPromise);}else{resolveHttpPromise();if(!$rootScope.$$phase)$rootScope.$apply();}}/**\n\t * Resolves the raw $http promise.\n\t */function resolvePromise(response,status,headers,statusText){//status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n\tstatus=status>=-1?status:0;(isSuccess(status)?deferred.resolve:deferred.reject)({data:response,status:status,headers:headersGetter(headers),config:config,statusText:statusText});}function resolvePromiseWithResult(result){resolvePromise(result.data,result.status,shallowCopy(result.headers()),result.statusText);}function removePendingReq(){var idx=$http.pendingRequests.indexOf(config);if(idx!==-1)$http.pendingRequests.splice(idx,1);}}", "function sendReq(config, reqData) {\n\t var deferred = $q.defer(),\n\t promise = deferred.promise,\n\t cache,\n\t cachedResp,\n\t reqHeaders = config.headers,\n\t url = buildUrl(config.url, config.paramSerializer(config.params));\n\n\t $http.pendingRequests.push(config);\n\t promise.then(removePendingReq, removePendingReq);\n\n\n\t if ((config.cache || defaults.cache) && config.cache !== false &&\n\t (config.method === 'GET' || config.method === 'JSONP')) {\n\t cache = isObject(config.cache) ? config.cache\n\t : isObject(defaults.cache) ? defaults.cache\n\t : defaultCache;\n\t }\n\n\t if (cache) {\n\t cachedResp = cache.get(url);\n\t if (isDefined(cachedResp)) {\n\t if (isPromiseLike(cachedResp)) {\n\t // cached request has already been sent, but there is no response yet\n\t cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n\t } else {\n\t // serving from cache\n\t if (isArray(cachedResp)) {\n\t resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n\t } else {\n\t resolvePromise(cachedResp, 200, {}, 'OK');\n\t }\n\t }\n\t } else {\n\t // put the promise for the non-transformed response into cache as a placeholder\n\t cache.put(url, promise);\n\t }\n\t }\n\n\n\t // if we won't have the response in cache, set the xsrf headers and\n\t // send the request to the backend\n\t if (isUndefined(cachedResp)) {\n\t var xsrfValue = urlIsSameOrigin(config.url)\n\t ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n\t : undefined;\n\t if (xsrfValue) {\n\t reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n\t }\n\n\t $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n\t config.withCredentials, config.responseType,\n\t createApplyHandlers(config.eventHandlers),\n\t createApplyHandlers(config.uploadEventHandlers));\n\t }\n\n\t return promise;\n\n\t function createApplyHandlers(eventHandlers) {\n\t if (eventHandlers) {\n\t var applyHandlers = {};\n\t forEach(eventHandlers, function(eventHandler, key) {\n\t applyHandlers[key] = function(event) {\n\t if (useApplyAsync) {\n\t $rootScope.$applyAsync(callEventHandler);\n\t } else if ($rootScope.$$phase) {\n\t callEventHandler();\n\t } else {\n\t $rootScope.$apply(callEventHandler);\n\t }\n\n\t function callEventHandler() {\n\t eventHandler(event);\n\t }\n\t };\n\t });\n\t return applyHandlers;\n\t }\n\t }\n\n\n\t /**\n\t * Callback registered to $httpBackend():\n\t * - caches the response if desired\n\t * - resolves the raw $http promise\n\t * - calls $apply\n\t */\n\t function done(status, response, headersString, statusText) {\n\t if (cache) {\n\t if (isSuccess(status)) {\n\t cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n\t } else {\n\t // remove promise from the cache\n\t cache.remove(url);\n\t }\n\t }\n\n\t function resolveHttpPromise() {\n\t resolvePromise(response, status, headersString, statusText);\n\t }\n\n\t if (useApplyAsync) {\n\t $rootScope.$applyAsync(resolveHttpPromise);\n\t } else {\n\t resolveHttpPromise();\n\t if (!$rootScope.$$phase) $rootScope.$apply();\n\t }\n\t }\n\n\n\t /**\n\t * Resolves the raw $http promise.\n\t */\n\t function resolvePromise(response, status, headers, statusText) {\n\t //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n\t status = status >= -1 ? status : 0;\n\n\t (isSuccess(status) ? deferred.resolve : deferred.reject)({\n\t data: response,\n\t status: status,\n\t headers: headersGetter(headers),\n\t config: config,\n\t statusText: statusText\n\t });\n\t }\n\n\t function resolvePromiseWithResult(result) {\n\t resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n\t }\n\n\t function removePendingReq() {\n\t var idx = $http.pendingRequests.indexOf(config);\n\t if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n\t }\n\t }", "_request(path, options = {}) {\n return _sendRequest(this.api, path, options);\n }", "function sendReq(config, reqData, reqHeaders) {\n\t\t\t\tvar deferred = $q.defer(),\n\t\t\t\t\tpromise = deferred.promise,\n\t\t\t\t\tcache, cachedResp, url = buildUrl(config.url, config.params);\n\n\t\t\t\t$http.pendingRequests.push(config);\n\t\t\t\tpromise.then(removePendingReq, removePendingReq);\n\n\n\t\t\t\tif (config.cache && config.method == 'GET') {\n\t\t\t\t\tcache = isObject(config.cache) ? config.cache : defaultCache;\n\t\t\t\t}\n\n\t\t\t\tif (cache) {\n\t\t\t\t\tcachedResp = cache.get(url);\n\t\t\t\t\tif (cachedResp) {\n\t\t\t\t\t\tif (cachedResp.then) {\n\t\t\t\t\t\t\t// cached request has already been sent, but there is no response yet\n\t\t\t\t\t\t\tcachedResp.then(removePendingReq, removePendingReq);\n\t\t\t\t\t\t\treturn cachedResp;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// serving from cache\n\t\t\t\t\t\t\tif (isArray(cachedResp)) {\n\t\t\t\t\t\t\t\tresolvePromise(cachedResp[1], cachedResp[0], copy(cachedResp[2]));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tresolvePromise(cachedResp, 200, {});\n\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\t// put the promise for the non-transformed response into cache as a placeholder\n\t\t\t\t\t\tcache.put(url, promise);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if we won't have the response in cache, send the request to the backend\n\t\t\t\tif (!cachedResp) {\n\t\t\t\t\t$httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout, config.withCredentials);\n\t\t\t\t}\n\n\t\t\t\treturn promise;\n\n\n\t\t\t\t/**\n\t\t\t\t * Callback registered to $httpBackend():\n\t\t\t\t * - caches the response if desired\n\t\t\t\t * - resolves the raw $http promise\n\t\t\t\t * - calls $apply\n\t\t\t\t */\n\n\t\t\t\tfunction done(status, response, headersString) {\n\t\t\t\t\tif (cache) {\n\t\t\t\t\t\tif (isSuccess(status)) {\n\t\t\t\t\t\t\tcache.put(url, [status, response, parseHeaders(headersString)]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// remove promise from the cache\n\t\t\t\t\t\t\tcache.remove(url);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tresolvePromise(response, status, headersString);\n\t\t\t\t\t$rootScope.$apply();\n\t\t\t\t}\n\n\n\t\t\t\t/**\n\t\t\t\t * Resolves the raw $http promise.\n\t\t\t\t */\n\n\t\t\t\tfunction resolvePromise(response, status, headers) {\n\t\t\t\t\t// normalize internal statuses to 0\n\t\t\t\t\tstatus = Math.max(status, 0);\n\n\t\t\t\t\t(isSuccess(status) ? deferred.resolve : deferred.reject)({\n\t\t\t\t\t\tdata: response,\n\t\t\t\t\t\tstatus: status,\n\t\t\t\t\t\theaders: headersGetter(headers),\n\t\t\t\t\t\tconfig: config\n\t\t\t\t\t});\n\t\t\t\t}\n\n\n\t\t\t\tfunction removePendingReq() {\n\t\t\t\t\tvar idx = indexOf($http.pendingRequests, config);\n\t\t\t\t\tif (idx !== -1) $http.pendingRequests.splice(idx, 1);\n\t\t\t\t}\n\t\t\t}", "function sendReq(config, reqData, reqHeaders) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if (config.cache && config.method == 'GET') {\n cache = isObject(config.cache) ? config.cache : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (cachedResp) {\n if (cachedResp.then) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(removePendingReq, removePendingReq);\n return cachedResp;\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], copy(cachedResp[2]));\n } else {\n resolvePromise(cachedResp, 200, {});\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n // if we won't have the response in cache, send the request to the backend\n if (!cachedResp) {\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString)]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString);\n $rootScope.$apply();\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config\n });\n }\n\n\n function removePendingReq() {\n var idx = indexOf($http.pendingRequests, config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData, reqHeaders) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if (config.cache && config.method == 'GET') {\n cache = isObject(config.cache) ? config.cache : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (cachedResp) {\n if (cachedResp.then) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(removePendingReq, removePendingReq);\n return cachedResp;\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], copy(cachedResp[2]));\n } else {\n resolvePromise(cachedResp, 200, {});\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n // if we won't have the response in cache, send the request to the backend\n if (!cachedResp) {\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString)]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString);\n $rootScope.$apply();\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config\n });\n }\n\n\n function removePendingReq() {\n var idx = indexOf($http.pendingRequests, config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData, reqHeaders) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if (config.cache && config.method == 'GET') {\n cache = isObject(config.cache) ? config.cache : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (cachedResp) {\n if (cachedResp.then) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(removePendingReq, removePendingReq);\n return cachedResp;\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], copy(cachedResp[2]));\n } else {\n resolvePromise(cachedResp, 200, {});\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n // if we won't have the response in cache, send the request to the backend\n if (!cachedResp) {\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString)]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString);\n $rootScope.$apply();\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config\n });\n }\n\n\n function removePendingReq() {\n var idx = indexOf($http.pendingRequests, config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData, reqHeaders) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false && config.method == 'GET') {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (cachedResp.then) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(removePendingReq, removePendingReq);\n return cachedResp;\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], copy(cachedResp[2]));\n } else {\n resolvePromise(cachedResp, 200, {});\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n // if we won't have the response in cache, send the request to the backend\n if (isUndefined(cachedResp)) {\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString)]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString);\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config\n });\n }\n\n\n function removePendingReq() {\n var idx = indexOf($http.pendingRequests, config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function makeRequest(method, url, headers, body) {\n return $request[method.toLowerCase()](url, { headers, body });\n}", "function makeRequest(options, responseEndCallback, requestId){\n //console.log('making request to url: ' + options.url);\n var url = options.url,\n path = '';\n\n if(!options.url){\n var randomIndex=Math.floor(Math.random()*options.urls.length);//randomly select an index in the urls array\n url = options.urls[randomIndex];\n //console.log('url: %s randomIndex: %s', url, randomIndex);\n }\n\n //seperate the base url from the path.\n var firstSlashIndex = url.indexOf('/');\n if(firstSlashIndex >= 0){\n path = url.substr(firstSlashIndex);\n url = url.substr(0, firstSlashIndex);\n }\n\n //try using agent to get around ECONNRESET. seems to work!\n //var agent = new http.Agent();\n //agent.maxSockets = 20; //1 socket = 1936/2000 success. 10 socket = 1995/2000 success. 20 socket = 2000/2000 success!\n var agent = options.useAgents ? agentProvider.getAgent() : false; //false;//\n\n //create the request options for the http.request api.\n var requestOptions = {\n hostname: url,\n port: options.port,\n path: path,\n method: options.requestMethod,\n agent:agent, //try to fix ECONNRESET, socket closed issue.\n headers:{\n 'connection': options.connectionHeader, //'close' or 'keep-alive'\n 'requestid': requestId\n }\n };\n\n //initiate the request\n var req = http.request(requestOptions, function(res) {\n //console.log('creating request');\n pound.openConnections++;//increment count to keep track\n pound.requestsGenerated++;\n pound.requestsPerSecond = pound.requestsGenerated / ((new Date().getTime() - pound.startMilliseconds) / 1000);\n //console.log('open connections %s - open', pound.openConnections);\n pound.highestOpenConnectionsAtOneTime = pound.openConnections > pound.highestOpenConnectionsAtOneTime ? pound.openConnections : pound.highestOpenConnectionsAtOneTime;\n\n //console.log('STATUS: ' + res.statusCode);\n //console.log('HEADERS: ' + JSON.stringify(res.headers));\n //res.setEncoding('utf8');\n\n //Indicates that the underlaying connection was terminated before response.end() was called or able to flush.\n res.on('close', function(){ // this isn't getting called.\n console.log('response close called');\n });\n\n res.on('end', function(){\n pound.openConnections--;\n });\n //then you must consume the data from the response object, either by calling response.read() whenever there is a 'readable' event\n res.on('readable', function(message){\n //console.log('readable event fired');\n res.read();\n });\n\n }.bind({requestId:requestId}));\n\n //wait for the response\n /**\n * http://nodejs.org/docs/latest/api/http.html#http_class_http_agent\n * If no 'response' handler is added, then the response will be entirely discarded. However, if you add a 'response' event handler, then you must consume the data from the response object,\n * either by calling response.read() whenever there is a 'readable' event, or by adding a 'data' handler, or by calling the .resume() method.\n * Until the data is consumed, the 'end' event will not fire.\n */\n req.on('response', function(resp){\n //console.log('response received');\n //pound.openConnections--;\n \n pound.responsesReceived++;\n pound.responsesPerSecond = pound.responsesReceived / ((new Date().getTime() - pound.startMilliseconds) / 1000);\n //console.log('open connections %s - close', pound.openConnections);\n if(responseEndCallback){\n responseEndCallback(this.requestId);\n }\n });\n\n //log request errors.\n req.on('error', function(e) {\n pound.requestErrorCount++;\n console.warn('problem with requestId: %s to url: %s message: %s \\n complete: %s', this.requestId, this.url, e.message, JSON.stringify(e));\n }.bind({url:url, requestId:requestId}));\n\n //TODO: allow for request timeouts?\n // req.setTimeout(options.requestTimeout, function(e){\n // console.log('timeout for url %s', this.url);\n // this.req.end();\n // this.req.destroy();\n // }.bind({url:url, req:req}));\n\n // write data to request body\n //req.write('data\\n');\n //req.write('data\\n');\n req.end();\n }", "function sendReq(config, reqData, reqHeaders) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false && config.method == 'GET') {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (cachedResp.then) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(removePendingReq, removePendingReq);\n return cachedResp;\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n // if we won't have the response in cache, send the request to the backend\n if (isUndefined(cachedResp)) {\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString, statusText);\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText : statusText\n });\n }\n\n\n function removePendingReq() {\n var idx = indexOf($http.pendingRequests, config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData, reqHeaders) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(removePendingReq, removePendingReq);\n return cachedResp;\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString, statusText);\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText : statusText\n });\n }\n\n\n function removePendingReq() {\n var idx = indexOf($http.pendingRequests, config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData, reqHeaders) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(removePendingReq, removePendingReq);\n return cachedResp;\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText : statusText\n });\n }\n\n\n function removePendingReq() {\n var idx = indexOf($http.pendingRequests, config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData, reqHeaders) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(removePendingReq, removePendingReq);\n return cachedResp;\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString, statusText);\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText : statusText\n });\n }\n\n\n function removePendingReq() {\n var idx = indexOf($http.pendingRequests, config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData, reqHeaders) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(removePendingReq, removePendingReq);\n return cachedResp;\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString, statusText);\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText : statusText\n });\n }\n\n\n function removePendingReq() {\n var idx = indexOf($http.pendingRequests, config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData, reqHeaders) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(removePendingReq, removePendingReq);\n return cachedResp;\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString, statusText);\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText : statusText\n });\n }\n\n\n function removePendingReq() {\n var idx = indexOf($http.pendingRequests, config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "request(config) {\n config.url = this.makeUrl();\n return this.$http.request(config)\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n if ((config.cache || defaults.cache) && config.cache !== false && (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache : isObject(defaults.cache) ? defaults.cache : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url) ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName] : undefined;\n if (xsrfValue) {\n reqHeaders[config.xsrfHeaderName || defaults.xsrfHeaderName] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout, config.withCredentials, config.responseType, createApplyHandlers(config.eventHandlers), createApplyHandlers(config.uploadEventHandlers));\n }\n\n return promise;\n\n function createApplyHandlers(eventHandlers) {\n if (eventHandlers) {\n var applyHandlers = {};\n forEach(eventHandlers, function (eventHandler, key) {\n applyHandlers[key] = function (event) {\n if (useApplyAsync) {\n $rootScope.$applyAsync(callEventHandler);\n } else if ($rootScope.$$phase) {\n callEventHandler();\n } else {\n $rootScope.$apply(callEventHandler);\n }\n\n function callEventHandler() {\n eventHandler(event);\n }\n };\n });\n return applyHandlers;\n }\n }\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "request(first, url, options = {}) {\n let req;\n // First, check whether the primary argument is an instance of `HttpRequest`.\n if (first instanceof HttpRequest) {\n // It is. The other arguments must be undefined (per the signatures) and can be\n // ignored.\n req = first;\n }\n else {\n // It's a string, so it represents a URL. Construct a request based on it,\n // and incorporate the remaining arguments (assuming `GET` unless a method is\n // provided.\n // Figure out the headers.\n let headers = undefined;\n if (options.headers instanceof HttpHeaders) {\n headers = options.headers;\n }\n else {\n headers = new HttpHeaders(options.headers);\n }\n // Sort out parameters.\n let params = undefined;\n if (!!options.params) {\n if (options.params instanceof HttpParams) {\n params = options.params;\n }\n else {\n params = new HttpParams({ fromObject: options.params });\n }\n }\n // Construct the request.\n req = new HttpRequest(first, url, (options.body !== undefined ? options.body : null), {\n headers,\n params,\n reportProgress: options.reportProgress,\n // By default, JSON is assumed to be returned for all calls.\n responseType: options.responseType || 'json',\n withCredentials: options.withCredentials,\n });\n }\n // Start with an Observable.of() the initial request, and run the handler (which\n // includes all interceptors) inside a concatMap(). This way, the handler runs\n // inside an Observable chain, which causes interceptors to be re-run on every\n // subscription (this also makes retries re-run the handler, including interceptors).\n const events$ = Object(rxjs__WEBPACK_IMPORTED_MODULE_1__[\"of\"])(req).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"concatMap\"])((req) => this.handler.handle(req)));\n // If coming via the API signature which accepts a previously constructed HttpRequest,\n // the only option is to get the event stream. Otherwise, return the event stream if\n // that is what was requested.\n if (first instanceof HttpRequest || options.observe === 'events') {\n return events$;\n }\n // The requested stream contains either the full response or the body. In either\n // case, the first step is to filter the event stream to extract a stream of\n // responses(s).\n const res$ = events$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"filter\"])((event) => event instanceof HttpResponse));\n // Decide which stream to return.\n switch (options.observe || 'body') {\n case 'body':\n // The requested stream is the body. Map the response stream to the response\n // body. This could be done more simply, but a misbehaving interceptor might\n // transform the response body into a different format and ignore the requested\n // responseType. Guard against this by validating that the response is of the\n // requested type.\n switch (req.responseType) {\n case 'arraybuffer':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is an ArrayBuffer.\n if (res.body !== null && !(res.body instanceof ArrayBuffer)) {\n throw new Error('Response is not an ArrayBuffer.');\n }\n return res.body;\n }));\n case 'blob':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is a Blob.\n if (res.body !== null && !(res.body instanceof Blob)) {\n throw new Error('Response is not a Blob.');\n }\n return res.body;\n }));\n case 'text':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is a string.\n if (res.body !== null && typeof res.body !== 'string') {\n throw new Error('Response is not a string.');\n }\n return res.body;\n }));\n case 'json':\n default:\n // No validation needed for JSON responses, as they can be of any type.\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => res.body));\n }\n case 'response':\n // The response stream was requested directly, so return it.\n return res$;\n default:\n // Guard against new future observe types being added.\n throw new Error(`Unreachable: unhandled observe type ${options.observe}}`);\n }\n }", "request(first, url, options = {}) {\n let req;\n // First, check whether the primary argument is an instance of `HttpRequest`.\n if (first instanceof HttpRequest) {\n // It is. The other arguments must be undefined (per the signatures) and can be\n // ignored.\n req = first;\n }\n else {\n // It's a string, so it represents a URL. Construct a request based on it,\n // and incorporate the remaining arguments (assuming `GET` unless a method is\n // provided.\n // Figure out the headers.\n let headers = undefined;\n if (options.headers instanceof HttpHeaders) {\n headers = options.headers;\n }\n else {\n headers = new HttpHeaders(options.headers);\n }\n // Sort out parameters.\n let params = undefined;\n if (!!options.params) {\n if (options.params instanceof HttpParams) {\n params = options.params;\n }\n else {\n params = new HttpParams({ fromObject: options.params });\n }\n }\n // Construct the request.\n req = new HttpRequest(first, url, (options.body !== undefined ? options.body : null), {\n headers,\n params,\n reportProgress: options.reportProgress,\n // By default, JSON is assumed to be returned for all calls.\n responseType: options.responseType || 'json',\n withCredentials: options.withCredentials,\n });\n }\n // Start with an Observable.of() the initial request, and run the handler (which\n // includes all interceptors) inside a concatMap(). This way, the handler runs\n // inside an Observable chain, which causes interceptors to be re-run on every\n // subscription (this also makes retries re-run the handler, including interceptors).\n const events$ = Object(rxjs__WEBPACK_IMPORTED_MODULE_1__[\"of\"])(req).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"concatMap\"])((req) => this.handler.handle(req)));\n // If coming via the API signature which accepts a previously constructed HttpRequest,\n // the only option is to get the event stream. Otherwise, return the event stream if\n // that is what was requested.\n if (first instanceof HttpRequest || options.observe === 'events') {\n return events$;\n }\n // The requested stream contains either the full response or the body. In either\n // case, the first step is to filter the event stream to extract a stream of\n // responses(s).\n const res$ = events$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"filter\"])((event) => event instanceof HttpResponse));\n // Decide which stream to return.\n switch (options.observe || 'body') {\n case 'body':\n // The requested stream is the body. Map the response stream to the response\n // body. This could be done more simply, but a misbehaving interceptor might\n // transform the response body into a different format and ignore the requested\n // responseType. Guard against this by validating that the response is of the\n // requested type.\n switch (req.responseType) {\n case 'arraybuffer':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is an ArrayBuffer.\n if (res.body !== null && !(res.body instanceof ArrayBuffer)) {\n throw new Error('Response is not an ArrayBuffer.');\n }\n return res.body;\n }));\n case 'blob':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is a Blob.\n if (res.body !== null && !(res.body instanceof Blob)) {\n throw new Error('Response is not a Blob.');\n }\n return res.body;\n }));\n case 'text':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is a string.\n if (res.body !== null && typeof res.body !== 'string') {\n throw new Error('Response is not a string.');\n }\n return res.body;\n }));\n case 'json':\n default:\n // No validation needed for JSON responses, as they can be of any type.\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => res.body));\n }\n case 'response':\n // The response stream was requested directly, so return it.\n return res$;\n default:\n // Guard against new future observe types being added.\n throw new Error(`Unreachable: unhandled observe type ${options.observe}}`);\n }\n }", "request(first, url, options = {}) {\n let req;\n // First, check whether the primary argument is an instance of `HttpRequest`.\n if (first instanceof HttpRequest) {\n // It is. The other arguments must be undefined (per the signatures) and can be\n // ignored.\n req = first;\n }\n else {\n // It's a string, so it represents a URL. Construct a request based on it,\n // and incorporate the remaining arguments (assuming `GET` unless a method is\n // provided.\n // Figure out the headers.\n let headers = undefined;\n if (options.headers instanceof HttpHeaders) {\n headers = options.headers;\n }\n else {\n headers = new HttpHeaders(options.headers);\n }\n // Sort out parameters.\n let params = undefined;\n if (!!options.params) {\n if (options.params instanceof HttpParams) {\n params = options.params;\n }\n else {\n params = new HttpParams({ fromObject: options.params });\n }\n }\n // Construct the request.\n req = new HttpRequest(first, url, (options.body !== undefined ? options.body : null), {\n headers,\n params,\n reportProgress: options.reportProgress,\n // By default, JSON is assumed to be returned for all calls.\n responseType: options.responseType || 'json',\n withCredentials: options.withCredentials,\n });\n }\n // Start with an Observable.of() the initial request, and run the handler (which\n // includes all interceptors) inside a concatMap(). This way, the handler runs\n // inside an Observable chain, which causes interceptors to be re-run on every\n // subscription (this also makes retries re-run the handler, including interceptors).\n const events$ = Object(rxjs__WEBPACK_IMPORTED_MODULE_1__[\"of\"])(req).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"concatMap\"])((req) => this.handler.handle(req)));\n // If coming via the API signature which accepts a previously constructed HttpRequest,\n // the only option is to get the event stream. Otherwise, return the event stream if\n // that is what was requested.\n if (first instanceof HttpRequest || options.observe === 'events') {\n return events$;\n }\n // The requested stream contains either the full response or the body. In either\n // case, the first step is to filter the event stream to extract a stream of\n // responses(s).\n const res$ = events$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"filter\"])((event) => event instanceof HttpResponse));\n // Decide which stream to return.\n switch (options.observe || 'body') {\n case 'body':\n // The requested stream is the body. Map the response stream to the response\n // body. This could be done more simply, but a misbehaving interceptor might\n // transform the response body into a different format and ignore the requested\n // responseType. Guard against this by validating that the response is of the\n // requested type.\n switch (req.responseType) {\n case 'arraybuffer':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is an ArrayBuffer.\n if (res.body !== null && !(res.body instanceof ArrayBuffer)) {\n throw new Error('Response is not an ArrayBuffer.');\n }\n return res.body;\n }));\n case 'blob':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is a Blob.\n if (res.body !== null && !(res.body instanceof Blob)) {\n throw new Error('Response is not a Blob.');\n }\n return res.body;\n }));\n case 'text':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is a string.\n if (res.body !== null && typeof res.body !== 'string') {\n throw new Error('Response is not a string.');\n }\n return res.body;\n }));\n case 'json':\n default:\n // No validation needed for JSON responses, as they can be of any type.\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => res.body));\n }\n case 'response':\n // The response stream was requested directly, so return it.\n return res$;\n default:\n // Guard against new future observe types being added.\n throw new Error(`Unreachable: unhandled observe type ${options.observe}}`);\n }\n }", "request(first, url, options = {}) {\n let req;\n // First, check whether the primary argument is an instance of `HttpRequest`.\n if (first instanceof HttpRequest) {\n // It is. The other arguments must be undefined (per the signatures) and can be\n // ignored.\n req = first;\n }\n else {\n // It's a string, so it represents a URL. Construct a request based on it,\n // and incorporate the remaining arguments (assuming `GET` unless a method is\n // provided.\n // Figure out the headers.\n let headers = undefined;\n if (options.headers instanceof HttpHeaders) {\n headers = options.headers;\n }\n else {\n headers = new HttpHeaders(options.headers);\n }\n // Sort out parameters.\n let params = undefined;\n if (!!options.params) {\n if (options.params instanceof HttpParams) {\n params = options.params;\n }\n else {\n params = new HttpParams({ fromObject: options.params });\n }\n }\n // Construct the request.\n req = new HttpRequest(first, url, (options.body !== undefined ? options.body : null), {\n headers,\n params,\n reportProgress: options.reportProgress,\n // By default, JSON is assumed to be returned for all calls.\n responseType: options.responseType || 'json',\n withCredentials: options.withCredentials,\n });\n }\n // Start with an Observable.of() the initial request, and run the handler (which\n // includes all interceptors) inside a concatMap(). This way, the handler runs\n // inside an Observable chain, which causes interceptors to be re-run on every\n // subscription (this also makes retries re-run the handler, including interceptors).\n const events$ = Object(rxjs__WEBPACK_IMPORTED_MODULE_1__[\"of\"])(req).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"concatMap\"])((req) => this.handler.handle(req)));\n // If coming via the API signature which accepts a previously constructed HttpRequest,\n // the only option is to get the event stream. Otherwise, return the event stream if\n // that is what was requested.\n if (first instanceof HttpRequest || options.observe === 'events') {\n return events$;\n }\n // The requested stream contains either the full response or the body. In either\n // case, the first step is to filter the event stream to extract a stream of\n // responses(s).\n const res$ = events$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"filter\"])((event) => event instanceof HttpResponse));\n // Decide which stream to return.\n switch (options.observe || 'body') {\n case 'body':\n // The requested stream is the body. Map the response stream to the response\n // body. This could be done more simply, but a misbehaving interceptor might\n // transform the response body into a different format and ignore the requested\n // responseType. Guard against this by validating that the response is of the\n // requested type.\n switch (req.responseType) {\n case 'arraybuffer':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is an ArrayBuffer.\n if (res.body !== null && !(res.body instanceof ArrayBuffer)) {\n throw new Error('Response is not an ArrayBuffer.');\n }\n return res.body;\n }));\n case 'blob':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is a Blob.\n if (res.body !== null && !(res.body instanceof Blob)) {\n throw new Error('Response is not a Blob.');\n }\n return res.body;\n }));\n case 'text':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is a string.\n if (res.body !== null && typeof res.body !== 'string') {\n throw new Error('Response is not a string.');\n }\n return res.body;\n }));\n case 'json':\n default:\n // No validation needed for JSON responses, as they can be of any type.\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => res.body));\n }\n case 'response':\n // The response stream was requested directly, so return it.\n return res$;\n default:\n // Guard against new future observe types being added.\n throw new Error(`Unreachable: unhandled observe type ${options.observe}}`);\n }\n }", "request(first, url, options = {}) {\n let req;\n // First, check whether the primary argument is an instance of `HttpRequest`.\n if (first instanceof HttpRequest) {\n // It is. The other arguments must be undefined (per the signatures) and can be\n // ignored.\n req = first;\n }\n else {\n // It's a string, so it represents a URL. Construct a request based on it,\n // and incorporate the remaining arguments (assuming `GET` unless a method is\n // provided.\n // Figure out the headers.\n let headers = undefined;\n if (options.headers instanceof HttpHeaders) {\n headers = options.headers;\n }\n else {\n headers = new HttpHeaders(options.headers);\n }\n // Sort out parameters.\n let params = undefined;\n if (!!options.params) {\n if (options.params instanceof HttpParams) {\n params = options.params;\n }\n else {\n params = new HttpParams({ fromObject: options.params });\n }\n }\n // Construct the request.\n req = new HttpRequest(first, url, (options.body !== undefined ? options.body : null), {\n headers,\n params,\n reportProgress: options.reportProgress,\n // By default, JSON is assumed to be returned for all calls.\n responseType: options.responseType || 'json',\n withCredentials: options.withCredentials,\n });\n }\n // Start with an Observable.of() the initial request, and run the handler (which\n // includes all interceptors) inside a concatMap(). This way, the handler runs\n // inside an Observable chain, which causes interceptors to be re-run on every\n // subscription (this also makes retries re-run the handler, including interceptors).\n const events$ = Object(rxjs__WEBPACK_IMPORTED_MODULE_1__[\"of\"])(req).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"concatMap\"])((req) => this.handler.handle(req)));\n // If coming via the API signature which accepts a previously constructed HttpRequest,\n // the only option is to get the event stream. Otherwise, return the event stream if\n // that is what was requested.\n if (first instanceof HttpRequest || options.observe === 'events') {\n return events$;\n }\n // The requested stream contains either the full response or the body. In either\n // case, the first step is to filter the event stream to extract a stream of\n // responses(s).\n const res$ = events$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"filter\"])((event) => event instanceof HttpResponse));\n // Decide which stream to return.\n switch (options.observe || 'body') {\n case 'body':\n // The requested stream is the body. Map the response stream to the response\n // body. This could be done more simply, but a misbehaving interceptor might\n // transform the response body into a different format and ignore the requested\n // responseType. Guard against this by validating that the response is of the\n // requested type.\n switch (req.responseType) {\n case 'arraybuffer':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is an ArrayBuffer.\n if (res.body !== null && !(res.body instanceof ArrayBuffer)) {\n throw new Error('Response is not an ArrayBuffer.');\n }\n return res.body;\n }));\n case 'blob':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is a Blob.\n if (res.body !== null && !(res.body instanceof Blob)) {\n throw new Error('Response is not a Blob.');\n }\n return res.body;\n }));\n case 'text':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is a string.\n if (res.body !== null && typeof res.body !== 'string') {\n throw new Error('Response is not a string.');\n }\n return res.body;\n }));\n case 'json':\n default:\n // No validation needed for JSON responses, as they can be of any type.\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => res.body));\n }\n case 'response':\n // The response stream was requested directly, so return it.\n return res$;\n default:\n // Guard against new future observe types being added.\n throw new Error(`Unreachable: unhandled observe type ${options.observe}}`);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function makeRequest(){\n output('Sending the request...');\n var options = {\n method: $method.value,\n headers: {\n Accept: document.getElementById('accept').value\n },\n followRedirect: $followRedirect.checked\n };\n if(options.method === 'POST'){\n options.body = $requestBody.value;\n }\n client.request($url.value, options, function(error, response){\n if(error){\n genericError();\n } else {\n displayResponse(response);\n \n if(response.statusCode === 401){\n $authStatus.classList.remove('loggedin');\n $tokenDisplay.value = '';\n \n } else {\n $authStatus.classList.add('loggedin');\n $tokenDisplay.value = 'Bearer ' + client.getAccessToken();\n }\n }\n });\n}", "request(first, url, options = {}) {\n let req;\n // First, check whether the primary argument is an instance of `HttpRequest`.\n if (first instanceof HttpRequest) {\n // It is. The other arguments must be undefined (per the signatures) and can be\n // ignored.\n req = first;\n } else {\n // It's a string, so it represents a URL. Construct a request based on it,\n // and incorporate the remaining arguments (assuming `GET` unless a method is\n // provided.\n // Figure out the headers.\n let headers = undefined;\n if (options.headers instanceof HttpHeaders) {\n headers = options.headers;\n } else {\n headers = new HttpHeaders(options.headers);\n }\n // Sort out parameters.\n let params = undefined;\n if (!!options.params) {\n if (options.params instanceof HttpParams) {\n params = options.params;\n } else {\n params = new HttpParams({\n fromObject: options.params\n });\n }\n }\n // Construct the request.\n req = new HttpRequest(first, url, options.body !== undefined ? options.body : null, {\n headers,\n context: options.context,\n params,\n reportProgress: options.reportProgress,\n // By default, JSON is assumed to be returned for all calls.\n responseType: options.responseType || 'json',\n withCredentials: options.withCredentials\n });\n }\n // Start with an Observable.of() the initial request, and run the handler (which\n // includes all interceptors) inside a concatMap(). This way, the handler runs\n // inside an Observable chain, which causes interceptors to be re-run on every\n // subscription (this also makes retries re-run the handler, including interceptors).\n const events$ = (0,rxjs__WEBPACK_IMPORTED_MODULE_0__.of)(req).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_1__.concatMap)(req => this.handler.handle(req)));\n // If coming via the API signature which accepts a previously constructed HttpRequest,\n // the only option is to get the event stream. Otherwise, return the event stream if\n // that is what was requested.\n if (first instanceof HttpRequest || options.observe === 'events') {\n return events$;\n }\n // The requested stream contains either the full response or the body. In either\n // case, the first step is to filter the event stream to extract a stream of\n // responses(s).\n const res$ = events$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.filter)(event => event instanceof HttpResponse));\n // Decide which stream to return.\n switch (options.observe || 'body') {\n case 'body':\n // The requested stream is the body. Map the response stream to the response\n // body. This could be done more simply, but a misbehaving interceptor might\n // transform the response body into a different format and ignore the requested\n // responseType. Guard against this by validating that the response is of the\n // requested type.\n switch (req.responseType) {\n case 'arraybuffer':\n return res$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.map)(res => {\n // Validate that the body is an ArrayBuffer.\n if (res.body !== null && !(res.body instanceof ArrayBuffer)) {\n throw new Error('Response is not an ArrayBuffer.');\n }\n return res.body;\n }));\n case 'blob':\n return res$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.map)(res => {\n // Validate that the body is a Blob.\n if (res.body !== null && !(res.body instanceof Blob)) {\n throw new Error('Response is not a Blob.');\n }\n return res.body;\n }));\n case 'text':\n return res$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.map)(res => {\n // Validate that the body is a string.\n if (res.body !== null && typeof res.body !== 'string') {\n throw new Error('Response is not a string.');\n }\n return res.body;\n }));\n case 'json':\n default:\n // No validation needed for JSON responses, as they can be of any type.\n return res$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.map)(res => res.body));\n }\n case 'response':\n // The response stream was requested directly, so return it.\n return res$;\n default:\n // Guard against new future observe types being added.\n throw new Error(`Unreachable: unhandled observe type ${options.observe}}`);\n }\n }", "startRequesting(scope) {\n this.stopRequesting();\n\n // Initial request\n this.request_data();\n\n // Start periodic request\n this.data_request = window.setInterval(function() {\n this.request_data();\n }.bind(this), 1000);\n }", "makeRequest() {\r\n // Get Parameter Values\r\n let requestString = [];\r\n\r\n // Make Request\r\n this.getPrologRequest(requestString, this.handleReply);\r\n }", "makeRequest(opts, callback) {\n this.requestQueue.push(opts, callback);\n }", "function sendRequest(obj, request, httpService, action, error) {\n obj.running = true;\n obj.valid = null;\n obj.raw = null;\n\n // action and error are functions for the promise. if defined they'll be run after the default action and error functions\n let _action = function (result) {\n obj.raw = result;\n obj.valid = true;\n\n if (action) {\n action(result);\n }\n\n obj.running = false;\n };\n\n let _error = function (result) {\n obj.raw = result;\n obj.valid = false;\n\n if (error) {\n error(result);\n }\n\n obj.running = false;\n };\n\n httpService(request).then(_action).catch(_error);\n}", "function sendReq(config,reqData){var deferred=$q.defer(),promise=deferred.promise,cache,cachedResp,reqHeaders=config.headers,isJsonp=lowercase(config.method)==='jsonp',url=config.url;if(isJsonp){// JSONP is a pretty sensitive operation where we're allowing a script to have full access to\n// our DOM and JS space. So we require that the URL satisfies SCE.RESOURCE_URL.\nurl=$sce.getTrustedResourceUrl(url);}else if(!isString(url)){// If it is not a string then the URL must be a $sce trusted object\nurl=$sce.valueOf(url);}url=buildUrl(url,config.paramSerializer(config.params));if(isJsonp){// Check the url and add the JSONP callback placeholder\nurl=sanitizeJsonpCallbackParam(url,config.jsonpCallbackParam);}$http.pendingRequests.push(config);promise.then(removePendingReq,removePendingReq);if((config.cache||defaults.cache)&&config.cache!==false&&(config.method==='GET'||config.method==='JSONP')){cache=isObject(config.cache)?config.cache:isObject(/** @type {?} */defaults.cache)?/** @type {?} */defaults.cache:defaultCache;}if(cache){cachedResp=cache.get(url);if(isDefined(cachedResp)){if(isPromiseLike(cachedResp)){// cached request has already been sent, but there is no response yet\ncachedResp.then(resolvePromiseWithResult,resolvePromiseWithResult);}else{// serving from cache\nif(isArray(cachedResp)){resolvePromise(cachedResp[1],cachedResp[0],shallowCopy(cachedResp[2]),cachedResp[3]);}else{resolvePromise(cachedResp,200,{},'OK');}}}else{// put the promise for the non-transformed response into cache as a placeholder\ncache.put(url,promise);}}// if we won't have the response in cache, set the xsrf headers and\n// send the request to the backend\nif(isUndefined(cachedResp)){var xsrfValue=urlIsSameOrigin(config.url)?$$cookieReader()[config.xsrfCookieName||defaults.xsrfCookieName]:undefined;if(xsrfValue){reqHeaders[config.xsrfHeaderName||defaults.xsrfHeaderName]=xsrfValue;}$httpBackend(config.method,url,reqData,done,reqHeaders,config.timeout,config.withCredentials,config.responseType,createApplyHandlers(config.eventHandlers),createApplyHandlers(config.uploadEventHandlers));}return promise;function createApplyHandlers(eventHandlers){if(eventHandlers){var applyHandlers={};forEach(eventHandlers,function(eventHandler,key){applyHandlers[key]=function(event){if(useApplyAsync){$rootScope.$applyAsync(callEventHandler);}else if($rootScope.$$phase){callEventHandler();}else{$rootScope.$apply(callEventHandler);}function callEventHandler(){eventHandler(event);}};});return applyHandlers;}}/**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */function done(status,response,headersString,statusText){if(cache){if(isSuccess(status)){cache.put(url,[status,response,parseHeaders(headersString),statusText]);}else{// remove promise from the cache\ncache.remove(url);}}function resolveHttpPromise(){resolvePromise(response,status,headersString,statusText);}if(useApplyAsync){$rootScope.$applyAsync(resolveHttpPromise);}else{resolveHttpPromise();if(!$rootScope.$$phase)$rootScope.$apply();}}/**\n * Resolves the raw $http promise.\n */function resolvePromise(response,status,headers,statusText){//status: HTTP response status code, 0, -1 (aborted by timeout / promise)\nstatus=status>=-1?status:0;(isSuccess(status)?deferred.resolve:deferred.reject)({data:response,status:status,headers:headersGetter(headers),config:config,statusText:statusText});}function resolvePromiseWithResult(result){resolvePromise(result.data,result.status,shallowCopy(result.headers()),result.statusText);}function removePendingReq(){var idx=$http.pendingRequests.indexOf(config);if(idx!==-1)$http.pendingRequests.splice(idx,1);}}", "function _submit() {\n\t\t\t// execute the request and use the metadata if available\n\n\t\t\tif (that.bUseBatch) {\n\t\t\t\tthat.updateSecurityToken();\n\t\t\t\t// batch requests only need the path without the service URL\n\t\t\t\t// extract query of url and combine it with the path...\n\t\t\t\tvar sUriQuery = URI.parse(oRequest.requestUri).query;\n\t\t\t\t//var sRequestUrl = sPath.replace(/\\/$/, \"\"); // remove trailing slash if any\n\t\t\t\t//sRequestUrl += sUriQuery ? \"?\" + sUriQuery : \"\";\n\t\t\t\tvar sRequestUrl = that._createRequestUrl(sPath, null, sUriQuery, that.bUseBatch);\n\t\t\t\toRequest = that._createRequest(sRequestUrl, \"GET\", true);\n\t\t\t\tvar oBatchRequest = that._createBatchRequest([oRequest], true);\n\t\t\t\toRequestHandle = that._request(oBatchRequest, _handleSuccess, _handleError, OData.batchHandler, undefined, that.getServiceMetadata());\n\t\t\t} else {\n\t\t\t\toRequestHandle = that._request(oRequest, _handleSuccess, _handleError, that.oHandler, undefined, that.getServiceMetadata());\n\t\t\t}\n\n\t\t\tif (fnHandleUpdate) {\n\t\t\t\t// Create a wrapper for the request handle to be able to differentiate\n\t\t\t\t// between intentionally aborted requests and failed requests\n\t\t\t\tvar oWrappedHandle = {\n\t\t\t\t\tabort: function () {\n\t\t\t\t\t\toRequestHandle.bAborted = true;\n\t\t\t\t\t\toRequestHandle.abort();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tfnHandleUpdate(oWrappedHandle);\n\t\t\t}\n\t\t}", "function sendReq(config, reqData) {\n\t\t\t\t\tvar deferred = $q.defer(),\n\t\t\t\t\t\tpromise = deferred.promise,\n\t\t\t\t\t\tcache,\n\t\t\t\t\t\tcachedResp,\n\t\t\t\t\t\treqHeaders = config.headers,\n\t\t\t\t\t\turl = buildUrl(config.url, config.params);\n\n\t\t\t\t\t$http.pendingRequests.push(config);\n\t\t\t\t\tpromise.then(removePendingReq, removePendingReq);\n\n\n\t\t\t\t\tif ((config.cache || defaults.cache) && config.cache !== false &&\n\t\t\t\t\t\t(config.method === 'GET' || config.method === 'JSONP')) {\n\t\t\t\t\t\tcache = isObject(config.cache) ? config.cache\n\t\t\t\t\t\t\t: isObject(defaults.cache) ? defaults.cache\n\t\t\t\t\t\t\t: defaultCache;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (cache) {\n\t\t\t\t\t\tcachedResp = cache.get(url);\n\t\t\t\t\t\tif (isDefined(cachedResp)) {\n\t\t\t\t\t\t\tif (isPromiseLike(cachedResp)) {\n\t\t\t\t\t\t\t\t// cached request has already been sent, but there is no response yet\n\t\t\t\t\t\t\t\tcachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// serving from cache\n\t\t\t\t\t\t\t\tif (isArray(cachedResp)) {\n\t\t\t\t\t\t\t\t\tresolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tresolvePromise(cachedResp, 200, {}, 'OK');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// put the promise for the non-transformed response into cache as a placeholder\n\t\t\t\t\t\t\tcache.put(url, promise);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\n\t\t\t\t\t// if we won't have the response in cache, set the xsrf headers and\n\t\t\t\t\t// send the request to the backend\n\t\t\t\t\tif (isUndefined(cachedResp)) {\n\t\t\t\t\t\tvar xsrfValue = urlIsSameOrigin(config.url)\n\t\t\t\t\t\t\t? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\tif (xsrfValue) {\n\t\t\t\t\t\t\treqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n\t\t\t\t\t\t\tconfig.withCredentials, config.responseType);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn promise;\n\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Callback registered to $httpBackend():\n\t\t\t\t\t * - caches the response if desired\n\t\t\t\t\t * - resolves the raw $http promise\n\t\t\t\t\t * - calls $apply\n\t\t\t\t\t */\n\t\t\t\t\tfunction done(status, response, headersString, statusText) {\n\t\t\t\t\t\tif (cache) {\n\t\t\t\t\t\t\tif (isSuccess(status)) {\n\t\t\t\t\t\t\t\tcache.put(url, [status, response, parseHeaders(headersString), statusText]);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// remove promise from the cache\n\t\t\t\t\t\t\t\tcache.remove(url);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction resolveHttpPromise() {\n\t\t\t\t\t\t\tresolvePromise(response, status, headersString, statusText);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (useApplyAsync) {\n\t\t\t\t\t\t\t$rootScope.$applyAsync(resolveHttpPromise);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresolveHttpPromise();\n\t\t\t\t\t\t\tif (!$rootScope.$$phase) $rootScope.$apply();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Resolves the raw $http promise.\n\t\t\t\t\t */\n\t\t\t\t\tfunction resolvePromise(response, status, headers, statusText) {\n\t\t\t\t\t\t// normalize internal statuses to 0\n\t\t\t\t\t\tstatus = Math.max(status, 0);\n\n\t\t\t\t\t\t(isSuccess(status) ? deferred.resolve : deferred.reject)({\n\t\t\t\t\t\t\tdata: response,\n\t\t\t\t\t\t\tstatus: status,\n\t\t\t\t\t\t\theaders: headersGetter(headers),\n\t\t\t\t\t\t\tconfig: config,\n\t\t\t\t\t\t\tstatusText: statusText\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction resolvePromiseWithResult(result) {\n\t\t\t\t\t\tresolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction removePendingReq() {\n\t\t\t\t\t\tvar idx = $http.pendingRequests.indexOf(config);\n\t\t\t\t\t\tif (idx !== -1) $http.pendingRequests.splice(idx, 1);\n\t\t\t\t\t}\n\t\t\t\t}", "function sendReq(config, reqData) { // 10508\n var deferred = $q.defer(), // 10509\n promise = deferred.promise, // 10510\n cache, // 10511\n cachedResp, // 10512\n reqHeaders = config.headers, // 10513\n url = buildUrl(config.url, config.paramSerializer(config.params)); // 10514\n // 10515\n $http.pendingRequests.push(config); // 10516\n promise.then(removePendingReq, removePendingReq); // 10517\n // 10518\n // 10519\n if ((config.cache || defaults.cache) && config.cache !== false && // 10520\n (config.method === 'GET' || config.method === 'JSONP')) { // 10521\n cache = isObject(config.cache) ? config.cache // 10522\n : isObject(defaults.cache) ? defaults.cache // 10523\n : defaultCache; // 10524\n } // 10525\n // 10526\n if (cache) { // 10527\n cachedResp = cache.get(url); // 10528\n if (isDefined(cachedResp)) { // 10529\n if (isPromiseLike(cachedResp)) { // 10530\n // cached request has already been sent, but there is no response yet // 10531\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult); // 10532\n } else { // 10533\n // serving from cache // 10534\n if (isArray(cachedResp)) { // 10535\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]); // 10536\n } else { // 10537\n resolvePromise(cachedResp, 200, {}, 'OK'); // 10538\n } // 10539\n } // 10540\n } else { // 10541\n // put the promise for the non-transformed response into cache as a placeholder // 10542\n cache.put(url, promise); // 10543\n } // 10544\n } // 10545\n // 10546\n // 10547\n // if we won't have the response in cache, set the xsrf headers and // 10548\n // send the request to the backend // 10549\n if (isUndefined(cachedResp)) { // 10550\n var xsrfValue = urlIsSameOrigin(config.url) // 10551\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName] // 10552\n : undefined; // 10553\n if (xsrfValue) { // 10554\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue; // 10555\n } // 10556\n // 10557\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout, // 10558\n config.withCredentials, config.responseType); // 10559\n } // 10560\n // 10561\n return promise; // 10562\n // 10563\n // 10564\n /** // 10565\n * Callback registered to $httpBackend(): // 10566\n * - caches the response if desired // 10567\n * - resolves the raw $http promise // 10568\n * - calls $apply // 10569\n */ // 10570\n function done(status, response, headersString, statusText) { // 10571\n if (cache) { // 10572\n if (isSuccess(status)) { // 10573\n cache.put(url, [status, response, parseHeaders(headersString), statusText]); // 10574\n } else { // 10575\n // remove promise from the cache // 10576\n cache.remove(url); // 10577\n } // 10578\n } // 10579\n // 10580\n function resolveHttpPromise() { // 10581\n resolvePromise(response, status, headersString, statusText); // 10582\n } // 10583\n // 10584\n if (useApplyAsync) { // 10585\n $rootScope.$applyAsync(resolveHttpPromise); // 10586\n } else { // 10587\n resolveHttpPromise(); // 10588\n if (!$rootScope.$$phase) $rootScope.$apply(); // 10589\n } // 10590\n } // 10591\n // 10592\n // 10593\n /** // 10594\n * Resolves the raw $http promise. // 10595\n */ // 10596\n function resolvePromise(response, status, headers, statusText) { // 10597\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise) // 10598\n status = status >= -1 ? status : 0; // 10599\n // 10600\n (isSuccess(status) ? deferred.resolve : deferred.reject)({ // 10601\n data: response, // 10602\n status: status, // 10603\n headers: headersGetter(headers), // 10604\n config: config, // 10605\n statusText: statusText // 10606\n }); // 10607\n } // 10608\n // 10609\n function resolvePromiseWithResult(result) { // 10610\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText); // 10611\n } // 10612\n // 10613\n function removePendingReq() { // 10614\n var idx = $http.pendingRequests.indexOf(config); // 10615\n if (idx !== -1) $http.pendingRequests.splice(idx, 1); // 10616\n } // 10617\n } // 10618", "function sendPostRequest( url, data ) {\n if (mockPost) {\n var deferred;\n deferred = $q.defer();\n deferred.resolve({ data: data });\n return deferred.promise;\n } else {\n return $http.post( url, data );\n }\n }", "function Request(){\n\t\treturn $http({\n\t\t\tmethod: vm.getMethod,\n\t\t\turl: vm.url\n\t\t});\n\t}", "function makeRequest(options) {\n data = options.body;\n // Normalize the request url\n url = utils.trim(options.url);\n var baseUrl = utils.trim(options.baseURL || \"\");\n if (!url && isBrowser && !baseUrl) url = location.href;\n if (url.indexOf(\"http\") !== 0) {\n var isAbsolute = url[0] === \"/\";\n if (!baseUrl && isBrowser) {\n var arr = location.pathname.split(\"/\");\n arr.pop();\n baseUrl = location.protocol + \"//\" + location.host + (isAbsolute ? \"\" : arr.join(\"/\"))\n }\n if (baseUrl[baseUrl.length - 1] !== \"/\") {\n baseUrl += \"/\"\n }\n url = baseUrl + (isAbsolute ? url.substr(1) : url)\n if (isBrowser) {\n\n // Normalize the url which contains the \"..\" or \".\", such as\n // \"http://xx.com/aa/bb/../../xx\" to \"http://xx.com/xx\" .\n var t = document.createElement(\"a\");\n t.href = url;\n url = t.href;\n }\n }\n\n var responseType = utils.trim(options.responseType || \"\")\n engine.withCredentials = !!options.withCredentials;\n var isGet = options.method === \"GET\";\n if (isGet) {\n if (data) {\n if (utils.type(data) !== \"string\") {\n data = utils.formatParams(data);\n }\n url += (url.indexOf(\"?\") === -1 ? \"?\" : \"&\") + data;\n }\n }\n engine.open(options.method, url);\n\n // try catch for ie >=9\n try {\n engine.timeout = options.timeout || 0;\n if (responseType !== \"stream\") {\n engine.responseType = responseType\n }\n } catch (e) {\n }\n\n // If the request data is json object, transforming it to json string,\n // and set request content-type to \"json\". In browser, the data will\n // be sent as RequestBody instead of FormData\n if (!utils.isFormData(data) && [\"object\", \"array\"].indexOf(utils.type(data)) !== -1) {\n options.headers[contentType] = 'application/json;charset=utf-8'\n data = JSON.stringify(data);\n }\n\n for (var k in options.headers) {\n if (k === contentType &&\n (utils.isFormData(data) || !data || isGet)) {\n // Delete the content-type, Let the browser set it\n delete options.headers[k];\n } else {\n try {\n // In browser environment, some header fields are readonly,\n // write will cause the exception .\n engine.setRequestHeader(k, options.headers[k])\n } catch (e) {\n }\n }\n }\n\n function onresult(handler, data, type) {\n enqueueIfLocked(responseInterceptor.p, function () {\n if (handler) {\n //如果失败,添加请求信息\n if (type) {\n data.request = options;\n }\n data = handler.call(responseInterceptor, data, Promise) || data\n }\n if (!isPromise(data)) {\n data = Promise[type === 0 ? \"resolve\" : \"reject\"](data)\n }\n data.then(d => {\n resolve(d)\n }).catch((e) => {\n reject(e)\n })\n })\n }\n\n\n function onerror(e) {\n e.engine = engine;\n onresult(responseInterceptor.onerror, e, -1)\n }\n\n function Err(msg, status) {\n this.message = msg\n this.status = status;\n }\n\n engine.onload = () => {\n // The xhr of IE9 has not response filed\n var response = engine.response || engine.responseText;\n if (options.parseJson && (engine.getResponseHeader(contentType) || \"\").indexOf(\"json\") !== -1\n // Some third engine implementation may transform the response text to json object automatically,\n // so we should test the type of response before transforming it\n && !utils.isObject(response)) {\n response = JSON.parse(response);\n }\n var headers = {};\n var items = (engine.getAllResponseHeaders() || \"\").split(\"\\r\\n\");\n items.pop();\n items.forEach((e) => {\n var key = e.split(\":\")[0]\n headers[key] = engine.getResponseHeader(key)\n })\n var status = engine.status\n var statusText = engine.statusText\n var data = {data: response, headers, status, statusText};\n // The _response filed of engine is set in adapter which be called in engine-wrapper.js\n utils.merge(data, engine._response)\n if ((status >= 200 && status < 300) || status === 304) {\n data.engine = engine;\n data.request = options;\n onresult(responseInterceptor.handler, data, 0)\n } else {\n var e = new Err(statusText, status);\n e.response = data\n onerror(e)\n }\n }\n\n engine.onerror = (e) => {\n onerror(new Err(e.msg || \"Network Error\", 0))\n }\n\n engine.ontimeout = () => {\n onerror(new Err(`timeout [ ${engine.timeout}ms ]`, 1))\n }\n engine._options = options;\n setTimeout(() => {\n engine.send(isGet ? null : data)\n }, 0)\n }", "function sendReq(config, reqData) {\n\t var deferred = $q.defer(),\n\t promise = deferred.promise,\n\t cache,\n\t cachedResp,\n\t reqHeaders = config.headers,\n\t isJsonp = lowercase(config.method) === 'jsonp',\n\t url = config.url;\n\n\t if (isJsonp) {\n\t // JSONP is a pretty sensitive operation where we're allowing a script to have full access to\n\t // our DOM and JS space. So we require that the URL satisfies SCE.RESOURCE_URL.\n\t url = $sce.getTrustedResourceUrl(url);\n\t } else if (!isString(url)) {\n\t // If it is not a string then the URL must be a $sce trusted object\n\t url = $sce.valueOf(url);\n\t }\n\n\t url = buildUrl(url, config.paramSerializer(config.params));\n\n\t if (isJsonp) {\n\t // Check the url and add the JSONP callback placeholder\n\t url = sanitizeJsonpCallbackParam(url, config.jsonpCallbackParam);\n\t }\n\n\t $http.pendingRequests.push(config);\n\t promise.then(removePendingReq, removePendingReq);\n\n\t if ((config.cache || defaults.cache) && config.cache !== false &&\n\t (config.method === 'GET' || config.method === 'JSONP')) {\n\t cache = isObject(config.cache) ? config.cache\n\t : isObject(/** @type {?} */ (defaults).cache)\n\t ? /** @type {?} */ (defaults).cache\n\t : defaultCache;\n\t }\n\n\t if (cache) {\n\t cachedResp = cache.get(url);\n\t if (isDefined(cachedResp)) {\n\t if (isPromiseLike(cachedResp)) {\n\t // cached request has already been sent, but there is no response yet\n\t cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n\t } else {\n\t // serving from cache\n\t if (isArray(cachedResp)) {\n\t resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3], cachedResp[4]);\n\t } else {\n\t resolvePromise(cachedResp, 200, {}, 'OK', 'complete');\n\t }\n\t }\n\t } else {\n\t // put the promise for the non-transformed response into cache as a placeholder\n\t cache.put(url, promise);\n\t }\n\t }\n\n\n\t // if we won't have the response in cache, set the xsrf headers and\n\t // send the request to the backend\n\t if (isUndefined(cachedResp)) {\n\t var xsrfValue = urlIsAllowedOrigin(config.url)\n\t ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n\t : undefined;\n\t if (xsrfValue) {\n\t reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n\t }\n\n\t $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n\t config.withCredentials, config.responseType,\n\t createApplyHandlers(config.eventHandlers),\n\t createApplyHandlers(config.uploadEventHandlers));\n\t }\n\n\t return promise;\n\n\t function createApplyHandlers(eventHandlers) {\n\t if (eventHandlers) {\n\t var applyHandlers = {};\n\t forEach(eventHandlers, function(eventHandler, key) {\n\t applyHandlers[key] = function(event) {\n\t if (useApplyAsync) {\n\t $rootScope.$applyAsync(callEventHandler);\n\t } else if ($rootScope.$$phase) {\n\t callEventHandler();\n\t } else {\n\t $rootScope.$apply(callEventHandler);\n\t }\n\n\t function callEventHandler() {\n\t eventHandler(event);\n\t }\n\t };\n\t });\n\t return applyHandlers;\n\t }\n\t }\n\n\n\t /**\n\t * Callback registered to $httpBackend():\n\t * - caches the response if desired\n\t * - resolves the raw $http promise\n\t * - calls $apply\n\t */\n\t function done(status, response, headersString, statusText, xhrStatus) {\n\t if (cache) {\n\t if (isSuccess(status)) {\n\t cache.put(url, [status, response, parseHeaders(headersString), statusText, xhrStatus]);\n\t } else {\n\t // remove promise from the cache\n\t cache.remove(url);\n\t }\n\t }\n\n\t function resolveHttpPromise() {\n\t resolvePromise(response, status, headersString, statusText, xhrStatus);\n\t }\n\n\t if (useApplyAsync) {\n\t $rootScope.$applyAsync(resolveHttpPromise);\n\t } else {\n\t resolveHttpPromise();\n\t if (!$rootScope.$$phase) $rootScope.$apply();\n\t }\n\t }\n\n\n\t /**\n\t * Resolves the raw $http promise.\n\t */\n\t function resolvePromise(response, status, headers, statusText, xhrStatus) {\n\t //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n\t status = status >= -1 ? status : 0;\n\n\t (isSuccess(status) ? deferred.resolve : deferred.reject)({\n\t data: response,\n\t status: status,\n\t headers: headersGetter(headers),\n\t config: config,\n\t statusText: statusText,\n\t xhrStatus: xhrStatus\n\t });\n\t }\n\n\t function resolvePromiseWithResult(result) {\n\t resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText, result.xhrStatus);\n\t }\n\n\t function removePendingReq() {\n\t var idx = $http.pendingRequests.indexOf(config);\n\t if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n\t }\n\t }", "async request() {\n if (this.isTest()) { console.log(\"in getAllCalls\"); }\n // GET first page (and number of pages)\n await this.getCallsPage();\n \n if (this.isTest()) { console.log(`getLastPage = ` + this.getLastPage()); }\n // GET the remaining pages\n for (let pageNum = 2; pageNum <= this.getLastPage(); pageNum++) {\n await Util.throttle(this.#config.throttle);\n await this.getCallsPage(pageNum);\n }\n }", "function makeRequest(method, auth, url, qs, data, cb) {\t\t// eslint-disable-line max-params\n\tconst options = {\n\t\tmethod: method,\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json',\n\t\t\t'Authorization': auth\n\t\t},\n\t\turl: url, // for debugging set to: \"https://httpbin.org/get\"\n\t\tqs: qs\n\t}\n\n\tif(data) {\n\t\toptions.body = JSON.stringify(data)\n\t}\n\n\trequest(options, createResponseHandler(cb))\n}", "function _request(model, query64, _t){\n\t\t\t\t$.getJSON(_.template(model.API, { network: options.network || \"umg.fyre.co\" , query: query64} ), requestParams, \n\t\t\t\t\t\t_.bind(self.handleResponse, self, {requestCount:_batches.length, _batch: batch}, callback));\n\t\t\t}", "function request($http, url, method, data, successCallback, errorCallback){\n $http({\n url: url,\n method: method, \n data: data\n }).then(function(response){\n successCallback(response);\n }, function(response){\n errorCallback(response);\n });\n}", "function doRequest(requestUrl, options, callback){\n // in case no options are used\n if(typeof options == \"function\"){callback = options;options = {}; }\n // parse url into parts\n requestUrl = url.parse(requestUrl, true);\n // options hash to pass to core http\n var settings = {\n host: hostForUrl(requestUrl),\n port: portForUrl(requestUrl),\n path: pathForUrl(requestUrl),\n headers: options.headers || {},\n method: options.method || 'GET'\n };\n // handle params\n if(options.params){\n options.params = JSON.stringify(options.params);\n settings.headers['Content-Type'] = 'application/json';\n settings.headers['Content-Length'] = options.params.length;\n }\n // create request object\n var req = http.request(settings);\n // send params if given\n if(options.params){ req.write(options.params); }\n // handle response\n req.on('response', function(res){\n res.body = '';\n res.setEncoding('utf-8'); // configurable?\n res.on('data', function(chunk){ res.body += chunk; });\n res.on('end', function(){ callback(res.body, res); });\n });\n // fire request\n req.end();\n}", "willSendRequest (request) {\n request.headers.set('Accept', 'application/json')\n request.headers.set('Content-Type', 'application/json')\n request.headers.set('Host', 'api.producthunt.com')\n request.headers.set('Authorization', `Bearer ${TOKEN}`)\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n isJsonp = lowercase(config.method) === 'jsonp',\n url = config.url;\n\n if (isJsonp) {\n // JSONP is a pretty sensitive operation where we're allowing a script to have full access to\n // our DOM and JS space. So we require that the URL satisfies SCE.RESOURCE_URL.\n url = $sce.getTrustedResourceUrl(url);\n } else if (!isString(url)) {\n // If it is not a string then the URL must be a $sce trusted object\n url = $sce.valueOf(url);\n }\n\n url = buildUrl(url, config.paramSerializer(config.params));\n\n if (isJsonp) {\n // Check the url and add the JSONP callback placeholder\n url = sanitizeJsonpCallbackParam(url, config.jsonpCallbackParam);\n }\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(/** @type {?} */ (defaults).cache)\n ? /** @type {?} */ (defaults).cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3], cachedResp[4]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK', 'complete');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType,\n createApplyHandlers(config.eventHandlers),\n createApplyHandlers(config.uploadEventHandlers));\n }\n\n return promise;\n\n function createApplyHandlers(eventHandlers) {\n if (eventHandlers) {\n var applyHandlers = {};\n forEach(eventHandlers, function(eventHandler, key) {\n applyHandlers[key] = function(event) {\n if (useApplyAsync) {\n $rootScope.$applyAsync(callEventHandler);\n } else if ($rootScope.$$phase) {\n callEventHandler();\n } else {\n $rootScope.$apply(callEventHandler);\n }\n\n function callEventHandler() {\n eventHandler(event);\n }\n };\n });\n return applyHandlers;\n }\n }\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText, xhrStatus) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText, xhrStatus]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText, xhrStatus);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText, xhrStatus) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText,\n xhrStatus: xhrStatus\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText, result.xhrStatus);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n isJsonp = lowercase(config.method) === 'jsonp',\n url = config.url;\n\n if (isJsonp) {\n // JSONP is a pretty sensitive operation where we're allowing a script to have full access to\n // our DOM and JS space. So we require that the URL satisfies SCE.RESOURCE_URL.\n url = $sce.getTrustedResourceUrl(url);\n } else if (!isString(url)) {\n // If it is not a string then the URL must be a $sce trusted object\n url = $sce.valueOf(url);\n }\n\n url = buildUrl(url, config.paramSerializer(config.params));\n\n if (isJsonp) {\n // Check the url and add the JSONP callback placeholder\n url = sanitizeJsonpCallbackParam(url, config.jsonpCallbackParam);\n }\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(/** @type {?} */ (defaults).cache)\n ? /** @type {?} */ (defaults).cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3], cachedResp[4]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK', 'complete');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsAllowedOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType,\n createApplyHandlers(config.eventHandlers),\n createApplyHandlers(config.uploadEventHandlers));\n }\n\n return promise;\n\n function createApplyHandlers(eventHandlers) {\n if (eventHandlers) {\n var applyHandlers = {};\n forEach(eventHandlers, function(eventHandler, key) {\n applyHandlers[key] = function(event) {\n if (useApplyAsync) {\n $rootScope.$applyAsync(callEventHandler);\n } else if ($rootScope.$$phase) {\n callEventHandler();\n } else {\n $rootScope.$apply(callEventHandler);\n }\n\n function callEventHandler() {\n eventHandler(event);\n }\n };\n });\n return applyHandlers;\n }\n }\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText, xhrStatus) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText, xhrStatus]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText, xhrStatus);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText, xhrStatus) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText,\n xhrStatus: xhrStatus\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText, result.xhrStatus);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n isJsonp = lowercase(config.method) === 'jsonp',\n url = config.url;\n\n if (isJsonp) {\n // JSONP is a pretty sensitive operation where we're allowing a script to have full access to\n // our DOM and JS space. So we require that the URL satisfies SCE.RESOURCE_URL.\n url = $sce.getTrustedResourceUrl(url);\n } else if (!isString(url)) {\n // If it is not a string then the URL must be a $sce trusted object\n url = $sce.valueOf(url);\n }\n\n url = buildUrl(url, config.paramSerializer(config.params));\n\n if (isJsonp) {\n // Check the url and add the JSONP callback placeholder\n url = sanitizeJsonpCallbackParam(url, config.jsonpCallbackParam);\n }\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(/** @type {?} */ (defaults).cache)\n ? /** @type {?} */ (defaults).cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3], cachedResp[4]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK', 'complete');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsAllowedOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType,\n createApplyHandlers(config.eventHandlers),\n createApplyHandlers(config.uploadEventHandlers));\n }\n\n return promise;\n\n function createApplyHandlers(eventHandlers) {\n if (eventHandlers) {\n var applyHandlers = {};\n forEach(eventHandlers, function(eventHandler, key) {\n applyHandlers[key] = function(event) {\n if (useApplyAsync) {\n $rootScope.$applyAsync(callEventHandler);\n } else if ($rootScope.$$phase) {\n callEventHandler();\n } else {\n $rootScope.$apply(callEventHandler);\n }\n\n function callEventHandler() {\n eventHandler(event);\n }\n };\n });\n return applyHandlers;\n }\n }\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText, xhrStatus) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText, xhrStatus]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText, xhrStatus);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText, xhrStatus) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText,\n xhrStatus: xhrStatus\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText, result.xhrStatus);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n isJsonp = lowercase(config.method) === 'jsonp',\n url = config.url;\n\n if (isJsonp) {\n // JSONP is a pretty sensitive operation where we're allowing a script to have full access to\n // our DOM and JS space. So we require that the URL satisfies SCE.RESOURCE_URL.\n url = $sce.getTrustedResourceUrl(url);\n } else if (!isString(url)) {\n // If it is not a string then the URL must be a $sce trusted object\n url = $sce.valueOf(url);\n }\n\n url = buildUrl(url, config.paramSerializer(config.params));\n\n if (isJsonp) {\n // Check the url and add the JSONP callback placeholder\n url = sanitizeJsonpCallbackParam(url, config.jsonpCallbackParam);\n }\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(/** @type {?} */ (defaults).cache)\n ? /** @type {?} */ (defaults).cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3], cachedResp[4]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK', 'complete');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsAllowedOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType,\n createApplyHandlers(config.eventHandlers),\n createApplyHandlers(config.uploadEventHandlers));\n }\n\n return promise;\n\n function createApplyHandlers(eventHandlers) {\n if (eventHandlers) {\n var applyHandlers = {};\n forEach(eventHandlers, function(eventHandler, key) {\n applyHandlers[key] = function(event) {\n if (useApplyAsync) {\n $rootScope.$applyAsync(callEventHandler);\n } else if ($rootScope.$$phase) {\n callEventHandler();\n } else {\n $rootScope.$apply(callEventHandler);\n }\n\n function callEventHandler() {\n eventHandler(event);\n }\n };\n });\n return applyHandlers;\n }\n }\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText, xhrStatus) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText, xhrStatus]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText, xhrStatus);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText, xhrStatus) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText,\n xhrStatus: xhrStatus\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText, result.xhrStatus);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n isJsonp = lowercase(config.method) === 'jsonp',\n url = config.url;\n\n if (isJsonp) {\n // JSONP is a pretty sensitive operation where we're allowing a script to have full access to\n // our DOM and JS space. So we require that the URL satisfies SCE.RESOURCE_URL.\n url = $sce.getTrustedResourceUrl(url);\n } else if (!isString(url)) {\n // If it is not a string then the URL must be a $sce trusted object\n url = $sce.valueOf(url);\n }\n\n url = buildUrl(url, config.paramSerializer(config.params));\n\n if (isJsonp) {\n // Check the url and add the JSONP callback placeholder\n url = sanitizeJsonpCallbackParam(url, config.jsonpCallbackParam);\n }\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(/** @type {?} */ (defaults).cache)\n ? /** @type {?} */ (defaults).cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3], cachedResp[4]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK', 'complete');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsAllowedOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType,\n createApplyHandlers(config.eventHandlers),\n createApplyHandlers(config.uploadEventHandlers));\n }\n\n return promise;\n\n function createApplyHandlers(eventHandlers) {\n if (eventHandlers) {\n var applyHandlers = {};\n forEach(eventHandlers, function(eventHandler, key) {\n applyHandlers[key] = function(event) {\n if (useApplyAsync) {\n $rootScope.$applyAsync(callEventHandler);\n } else if ($rootScope.$$phase) {\n callEventHandler();\n } else {\n $rootScope.$apply(callEventHandler);\n }\n\n function callEventHandler() {\n eventHandler(event);\n }\n };\n });\n return applyHandlers;\n }\n }\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText, xhrStatus) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText, xhrStatus]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText, xhrStatus);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText, xhrStatus) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText,\n xhrStatus: xhrStatus\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText, result.xhrStatus);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "httpRequest({\n\t\tmethod = 'get',\n\t\turl = '',\n\t\tbody = {},\n\t\tcross = false , \n\t\tgetBody = true , \n\t\tjson = true,\n\t\tform = {},\n timeout = 10000\n\t}){\n\t\tconst { buildUrl , consoleUrl , promise , getContent } = this;\n\t\tconst requestUrl = buildUrl(url,cross);\n\t\tconsoleUrl(requestUrl,method);\n\t\tconst options = {\n\t\t\tmethod : method ,\n\t\t\turi : requestUrl ,\n\t\t\tjson : json,\n\t\t\ttimeout: timeout\n\t\t};\n\t\tif(json){\n\t\t\toptions.body = body;\n\t\t}else{\n\t\t\toptions.form = form;\n\t\t}\n\t\treturn promise((resolve,reject)=>{\n\t\t\trequest(options,(error, response, body)=>{\n\t\t\t\tconsole.log(body);\n\t\t\t\tconsole.log(error);\n\t\t\t\tif (!error && response.statusCode == 200) {\n\t\t\t \tresolve(getContent(response,getBody));\n\t\t\t }else{\n\t\t\t \treject(error);\n\t\t\t }\n\t\t\t})\n\t\t});\n\t}", "function makeRequest(options) {\n data = options.body;\n // Normalize the request url\n url = utils.trim(options.url);\n var baseUrl = utils.trim(options.baseURL || \"\");\n if (!url && isBrowser && !baseUrl) url = location.href;\n if (url.indexOf(\"http\") !== 0) {\n var isAbsolute = url[0] === \"/\";\n if (!baseUrl && isBrowser) {\n var arr = location.pathname.split(\"/\");\n arr.pop();\n baseUrl = location.protocol + \"//\" + location.host + (isAbsolute ? \"\" : arr.join(\"/\"));\n }\n if (baseUrl[baseUrl.length - 1] !== \"/\") {\n baseUrl += \"/\";\n }\n url = baseUrl + (isAbsolute ? url.substr(1) : url);\n if (isBrowser) {\n\n // Normalize the url which contains the \"..\" or \".\", such as\n // \"http://xx.com/aa/bb/../../xx\" to \"http://xx.com/xx\" .\n var t = document.createElement(\"a\");\n t.href = url;\n url = t.href;\n }\n }\n\n var responseType = utils.trim(options.responseType || \"\");\n var needQuery = [\"GET\", \"HEAD\", \"DELETE\", \"OPTION\"].indexOf(options.method) !== -1;\n var dataType = utils.type(data);\n var params = options.params || {};\n\n // merge url params when the method is \"GET\" (data is object)\n if (needQuery && dataType === \"object\") {\n params = utils.merge(data, params);\n }\n // encode params to String\n params = utils.formatParams(params);\n\n // save url params\n var _params = [];\n if (params) {\n _params.push(params);\n }\n // Add data to url params when the method is \"GET\" (data is String)\n if (needQuery && data && dataType === \"string\") {\n _params.push(data);\n }\n\n // make the final url\n if (_params.length > 0) {\n url += (url.indexOf(\"?\") === -1 ? \"?\" : \"&\") + _params.join(\"&\");\n }\n\n engine.open(options.method, url);\n\n // try catch for ie >=9\n try {\n engine.withCredentials = !!options.withCredentials;\n engine.timeout = options.timeout || 0;\n if (responseType !== \"stream\") {\n engine.responseType = responseType;\n }\n } catch (e) {}\n\n var customContentType = options.headers[contentType] || options.headers[contentTypeLowerCase];\n\n // default content type\n var _contentType = \"application/x-www-form-urlencoded\";\n // If the request data is json object, transforming it to json string,\n // and set request content-type to \"json\". In browser, the data will\n // be sent as RequestBody instead of FormData\n if (utils.trim((customContentType || \"\").toLowerCase()) === _contentType) {\n data = utils.formatParams(data);\n } else if (!utils.isFormData(data) && [\"object\", \"array\"].indexOf(utils.type(data)) !== -1) {\n _contentType = 'application/json;charset=utf-8';\n data = JSON.stringify(data);\n }\n //If user doesn't set content-type, set default.\n if (!(customContentType || needQuery)) {\n options.headers[contentType] = _contentType;\n }\n\n for (var k in options.headers) {\n if (k === contentType && utils.isFormData(data)) {\n // Delete the content-type, Let the browser set it\n delete options.headers[k];\n } else {\n try {\n // In browser environment, some header fields are readonly,\n // write will cause the exception .\n engine.setRequestHeader(k, options.headers[k]);\n } catch (e) {}\n }\n }\n\n function onresult(handler, data, type) {\n enqueueIfLocked(responseInterceptor.p, function () {\n if (handler) {\n //如果失败,添加请求信息\n if (type) {\n data.request = options;\n }\n var ret = handler.call(responseInterceptor, data, Promise);\n data = ret === undefined ? data : ret;\n }\n if (!isPromise(data)) {\n data = Promise[type === 0 ? \"resolve\" : \"reject\"](data);\n }\n data.then(function (d) {\n resolve(d);\n }).catch(function (e) {\n reject(e);\n });\n });\n }\n\n function onerror(e) {\n e.engine = engine;\n onresult(responseInterceptor.onerror, e, -1);\n }\n\n function Err(msg, status) {\n this.message = msg;\n this.status = status;\n }\n\n engine.onload = function () {\n try {\n // The xhr of IE9 has not response field\n var response = engine.response || engine.responseText;\n if (response && options.parseJson && (engine.getResponseHeader(contentType) || \"\").indexOf(\"json\") !== -1\n // Some third engine implementation may transform the response text to json object automatically,\n // so we should test the type of response before transforming it\n && !utils.isObject(response)) {\n response = JSON.parse(response);\n }\n\n var headers = engine.responseHeaders;\n // In browser\n if (!headers) {\n headers = {};\n var items = (engine.getAllResponseHeaders() || \"\").split(\"\\r\\n\");\n items.pop();\n items.forEach(function (e) {\n if (!e) return;\n var key = e.split(\":\")[0];\n headers[key] = engine.getResponseHeader(key);\n });\n }\n var status = engine.status;\n var statusText = engine.statusText;\n var _data = { data: response, headers: headers, status: status, statusText: statusText };\n // The _response filed of engine is set in adapter which be called in engine-wrapper.js\n utils.merge(_data, engine._response);\n if (status >= 200 && status < 300 || status === 304) {\n _data.engine = engine;\n _data.request = options;\n onresult(responseInterceptor.handler, _data, 0);\n } else {\n var e = new Err(statusText, status);\n e.response = _data;\n onerror(e);\n }\n } catch (e) {\n onerror(new Err(e.msg, engine.status));\n }\n };\n\n engine.onerror = function (e) {\n onerror(new Err(e.msg || \"Network Error\", 0));\n };\n\n engine.ontimeout = function () {\n onerror(new Err(\"timeout [ \" + engine.timeout + \"ms ]\", 1));\n };\n engine._options = options;\n setTimeout(function () {\n engine.send(needQuery ? null : data);\n }, 0);\n }", "function makeRequest(options) {\n data = options.body;\n // Normalize the request url\n url = utils.trim(options.url);\n var baseUrl = utils.trim(options.baseURL || \"\");\n if (!url && isBrowser && !baseUrl) url = location.href;\n if (url.indexOf(\"http\") !== 0) {\n var isAbsolute = url[0] === \"/\";\n if (!baseUrl && isBrowser) {\n var arr = location.pathname.split(\"/\");\n arr.pop();\n baseUrl = location.protocol + \"//\" + location.host + (isAbsolute ? \"\" : arr.join(\"/\"));\n }\n if (baseUrl[baseUrl.length - 1] !== \"/\") {\n baseUrl += \"/\";\n }\n url = baseUrl + (isAbsolute ? url.substr(1) : url);\n if (isBrowser) {\n\n // Normalize the url which contains the \"..\" or \".\", such as\n // \"http://xx.com/aa/bb/../../xx\" to \"http://xx.com/xx\" .\n var t = document.createElement(\"a\");\n t.href = url;\n url = t.href;\n }\n }\n\n var responseType = utils.trim(options.responseType || \"\");\n var needQuery = [\"GET\", \"HEAD\", \"DELETE\", \"OPTION\"].indexOf(options.method) !== -1;\n var dataType = utils.type(data);\n var params = options.params || {};\n\n // merge url params when the method is \"GET\" (data is object)\n if (needQuery && dataType === \"object\") {\n params = utils.merge(data, params);\n }\n // encode params to String\n params = utils.formatParams(params);\n\n // save url params\n var _params = [];\n if (params) {\n _params.push(params);\n }\n // Add data to url params when the method is \"GET\" (data is String)\n if (needQuery && data && dataType === \"string\") {\n _params.push(data);\n }\n\n // make the final url\n if (_params.length > 0) {\n url += (url.indexOf(\"?\") === -1 ? \"?\" : \"&\") + _params.join(\"&\");\n }\n\n engine.open(options.method, url);\n\n // try catch for ie >=9\n try {\n engine.withCredentials = !!options.withCredentials;\n engine.timeout = options.timeout || 0;\n if (responseType !== \"stream\") {\n engine.responseType = responseType;\n }\n } catch (e) {}\n\n var customContentType = options.headers[contentType] || options.headers[contentTypeLowerCase];\n\n // default content type\n var _contentType = \"application/x-www-form-urlencoded\";\n // If the request data is json object, transforming it to json string,\n // and set request content-type to \"json\". In browser, the data will\n // be sent as RequestBody instead of FormData\n if (utils.trim((customContentType || \"\").toLowerCase()) === _contentType) {\n data = utils.formatParams(data);\n } else if (!utils.isFormData(data) && [\"object\", \"array\"].indexOf(utils.type(data)) !== -1) {\n _contentType = 'application/json;charset=utf-8';\n data = JSON.stringify(data);\n }\n //If user doesn't set content-type, set default.\n if (!(customContentType || needQuery)) {\n options.headers[contentType] = _contentType;\n }\n\n for (var k in options.headers) {\n if (k === contentType && utils.isFormData(data)) {\n // Delete the content-type, Let the browser set it\n delete options.headers[k];\n } else {\n try {\n // In browser environment, some header fields are readonly,\n // write will cause the exception .\n engine.setRequestHeader(k, options.headers[k]);\n } catch (e) {}\n }\n }\n\n function onresult(handler, data, type) {\n enqueueIfLocked(responseInterceptor.p, function () {\n if (handler) {\n //如果失败,添加请求信息\n if (type) {\n data.request = options;\n }\n var ret = handler.call(responseInterceptor, data, Promise);\n data = ret === undefined ? data : ret;\n }\n if (!isPromise(data)) {\n data = Promise[type === 0 ? \"resolve\" : \"reject\"](data);\n }\n data.then(function (d) {\n resolve(d);\n }).catch(function (e) {\n reject(e);\n });\n });\n }\n\n function onerror(e) {\n e.engine = engine;\n onresult(responseInterceptor.onerror, e, -1);\n }\n\n function Err(msg, status) {\n this.message = msg;\n this.status = status;\n }\n\n engine.onload = function () {\n try {\n // The xhr of IE9 has not response field\n var response = engine.response || engine.responseText;\n if (response && options.parseJson && (engine.getResponseHeader(contentType) || \"\").indexOf(\"json\") !== -1\n // Some third engine implementation may transform the response text to json object automatically,\n // so we should test the type of response before transforming it\n && !utils.isObject(response)) {\n response = JSON.parse(response);\n }\n\n var headers = engine.responseHeaders;\n // In browser\n if (!headers) {\n headers = {};\n var items = (engine.getAllResponseHeaders() || \"\").split(\"\\r\\n\");\n items.pop();\n items.forEach(function (e) {\n if (!e) return;\n var key = e.split(\":\")[0];\n headers[key] = engine.getResponseHeader(key);\n });\n }\n var status = engine.status;\n var statusText = engine.statusText;\n var _data = { data: response, headers: headers, status: status, statusText: statusText };\n // The _response filed of engine is set in adapter which be called in engine-wrapper.js\n utils.merge(_data, engine._response);\n if (status >= 200 && status < 300 || status === 304) {\n _data.engine = engine;\n _data.request = options;\n onresult(responseInterceptor.handler, _data, 0);\n } else {\n var e = new Err(statusText, status);\n e.response = _data;\n onerror(e);\n }\n } catch (e) {\n onerror(new Err(e.msg, engine.status));\n }\n };\n\n engine.onerror = function (e) {\n onerror(new Err(e.msg || \"Network Error\", 0));\n };\n\n engine.ontimeout = function () {\n onerror(new Err(\"timeout [ \" + engine.timeout + \"ms ]\", 1));\n };\n engine._options = options;\n setTimeout(function () {\n engine.send(needQuery ? null : data);\n }, 0);\n }", "function makeRequest(serviceMethod, data, params) {\n return $http({\n method: serviceMethod.httpMethod || 'GET',\n url: getServiceUrl(serviceMethod),\n data: data || {},\n params: params || {}\n });\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n isJsonp = lowercase(config.method) === 'jsonp',\n url = config.url;\n\n if (isJsonp) {\n // JSONP is a pretty sensitive operation where we're allowing a script to have full access to\n // our DOM and JS space. So we require that the URL satisfies SCE.RESOURCE_URL.\n url = $sce.getTrustedResourceUrl(url);\n } else if (!isString(url)) {\n // If it is not a string then the URL must be a $sce trusted object\n url = $sce.valueOf(url);\n }\n\n url = buildUrl(url, config.paramSerializer(config.params));\n\n if (isJsonp) {\n // Check the url and add the JSONP callback placeholder\n url = sanitizeJsonpCallbackParam(url, config.jsonpCallbackParam);\n }\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(/** @type {?} */ (defaults).cache)\n ? /** @type {?} */ (defaults).cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType,\n createApplyHandlers(config.eventHandlers),\n createApplyHandlers(config.uploadEventHandlers));\n }\n\n return promise;\n\n function createApplyHandlers(eventHandlers) {\n if (eventHandlers) {\n var applyHandlers = {};\n forEach(eventHandlers, function(eventHandler, key) {\n applyHandlers[key] = function(event) {\n if (useApplyAsync) {\n $rootScope.$applyAsync(callEventHandler);\n } else if ($rootScope.$$phase) {\n callEventHandler();\n } else {\n $rootScope.$apply(callEventHandler);\n }\n\n function callEventHandler() {\n eventHandler(event);\n }\n };\n });\n return applyHandlers;\n }\n }\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n isJsonp = lowercase(config.method) === 'jsonp',\n url = config.url;\n\n if (isJsonp) {\n // JSONP is a pretty sensitive operation where we're allowing a script to have full access to\n // our DOM and JS space. So we require that the URL satisfies SCE.RESOURCE_URL.\n url = $sce.getTrustedResourceUrl(url);\n } else if (!isString(url)) {\n // If it is not a string then the URL must be a $sce trusted object\n url = $sce.valueOf(url);\n }\n\n url = buildUrl(url, config.paramSerializer(config.params));\n\n if (isJsonp) {\n // Check the url and add the JSONP callback placeholder\n url = sanitizeJsonpCallbackParam(url, config.jsonpCallbackParam);\n }\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(/** @type {?} */ (defaults).cache)\n ? /** @type {?} */ (defaults).cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType,\n createApplyHandlers(config.eventHandlers),\n createApplyHandlers(config.uploadEventHandlers));\n }\n\n return promise;\n\n function createApplyHandlers(eventHandlers) {\n if (eventHandlers) {\n var applyHandlers = {};\n forEach(eventHandlers, function(eventHandler, key) {\n applyHandlers[key] = function(event) {\n if (useApplyAsync) {\n $rootScope.$applyAsync(callEventHandler);\n } else if ($rootScope.$$phase) {\n callEventHandler();\n } else {\n $rootScope.$apply(callEventHandler);\n }\n\n function callEventHandler() {\n eventHandler(event);\n }\n };\n });\n return applyHandlers;\n }\n }\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n isJsonp = lowercase(config.method) === 'jsonp',\n url = config.url;\n\n if (isJsonp) {\n // JSONP is a pretty sensitive operation where we're allowing a script to have full access to\n // our DOM and JS space. So we require that the URL satisfies SCE.RESOURCE_URL.\n url = $sce.getTrustedResourceUrl(url);\n } else if (!isString(url)) {\n // If it is not a string then the URL must be a $sce trusted object\n url = $sce.valueOf(url);\n }\n\n url = buildUrl(url, config.paramSerializer(config.params));\n\n if (isJsonp) {\n // Check the url and add the JSONP callback placeholder\n url = sanitizeJsonpCallbackParam(url, config.jsonpCallbackParam);\n }\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(/** @type {?} */ (defaults).cache)\n ? /** @type {?} */ (defaults).cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType,\n createApplyHandlers(config.eventHandlers),\n createApplyHandlers(config.uploadEventHandlers));\n }\n\n return promise;\n\n function createApplyHandlers(eventHandlers) {\n if (eventHandlers) {\n var applyHandlers = {};\n forEach(eventHandlers, function(eventHandler, key) {\n applyHandlers[key] = function(event) {\n if (useApplyAsync) {\n $rootScope.$applyAsync(callEventHandler);\n } else if ($rootScope.$$phase) {\n callEventHandler();\n } else {\n $rootScope.$apply(callEventHandler);\n }\n\n function callEventHandler() {\n eventHandler(event);\n }\n };\n });\n return applyHandlers;\n }\n }\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "performRequest() {\n this.attempts += 1;\n /* Kick of a 3 second timer that will confirm to the user that the loading process is taking unusually long, unless cancelled\n by a successful load (or an error) */\n this.loadTimer = setTimeout(function () {\n let loadingText = document.getElementById(\"at_loadingtext\");\n loadingText.textContent = RoKA.Application.localisationManager.get(\"loading_slow_message\");\n }, 3000);\n /* Kick of a 30 second timer that will cancel the connection attempt and display an error to the user letting them know\n something is probably blocking the connection. */\n this.timeoutTimer = setTimeout(function () {\n new RoKA.ErrorScreen(RoKA.Application.commentSection, RoKA.ErrorState.CONNECTERROR);\n }, 30000);\n /* Perform the reddit api request */\n new RoKA.HttpRequest(this.requestUrl, this.requestType, this.onSuccess.bind(this), this.postData, this.onRequestError.bind(this));\n }", "function makeRequest(rUrl=SERVER_URL, rMethod, rHeader, rBody, rQs, cback) {\n var options = {\n url: rUrl,\n method: rethod,\n headers: rHeaders,\n body: rBody, // add body if necessary\n qs: rQs // add query strings \n };\n request(options, function (error, response, body) {\n if (error) {\n console.error('Could not connect: Error Message: ' + error.message);\n callback(error);\n } else {\n // writing the full body to the console so we can see what we got back\n console.log('Made request, body: ' + str(body));\n }\n });\n}", "async _request(options) {\n return request(options)\n }", "function http($http, $q, $localStorage , toastr) {\n console.log('create request service');\n\n return {\n get: function (url, data) {\n return request('GET', url, data);\n },\n post: function (url, data) {\n return request('POST', url, data);\n },\n put: function (url, data) {\n return request('PUT', url, data);\n },\n delete: function (url, data) {\n return request('DELETE', url, data);\n },\n file: function (url, data) {\n return requestFile(url, data);\n }\n };\n\n\n /**\n * Main request function\n * @param {string} method - Method name\n * @param {string} url - Request url\n * @param {object} data - Data to request\n * @returns {promise}\n */\n\n function request(method, url, data) {\n\n let token = $localStorage.token;\n\n\n let config = {\n dataType: 'json',\n method: method,\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n }\n };\n if(typeof token != 'undefined') {\n config.headers.Authorization = 'Bearer ' + token;\n }\n\n if (method === 'GET') {\n config.params = data;\n config.timeout = 20000;\n }\n else {\n config.data = data;\n }\n\n config.url = url;\n\n // console.log(config, 'data for sand');\n\n return $http(config)\n .then(requestComplete)\n .catch(requestFailed);\n }\n\n /**\n * Function for sending files\n * @param {string} url - Request url\n * @param {object} data - Data to request\n * @returns {promise}\n */\n\n function requestFile (url, data) {\n let token = $localStorage.token;\n console.log(data);\n let config = {\n transformRequest: angular.identity,\n headers: {\n 'Content-Type': undefined\n }\n };\n\n if(typeof token != 'undefined') {\n config.headers.Authorization = 'Bearer ' + token;\n }\n\n return $http.post(url, data, config).then(\n function (response) {\n let defer = $q.defer();\n\n // console.info('response', url, response);\n if (response.data.error) {\n toastr.error(response.data.error);\n defer.reject(response.data.error);\n }\n defer.resolve(response.data);\n return defer.promise;\n },\n function (response) {\n let defer = $q.defer();\n // console.info('error', url, response);\n\n if (response.status === 200) {\n toastr.error('Server Error: ' + response.data);\n defer.reject(response.data);\n }\n else if (response.status === -1) {\n toastr.error('Server unavailable');\n defer.reject(response.data);\n }\n else if (response.status === 500) {\n toastr.error(response.data.message);\n // toastr.error('Server Error: ' + response.status + ' ' + response.data.message);\n defer.reject(response.data);\n }\n else if (response.status === 403) {\n toastr.error('Access denied.');\n defer.reject(response.data);\n }\n else {\n toastr.error('Server Error: ' + response.status + ' ' + response.data.message);\n defer.reject(response.data);\n }\n defer.reject(response.data);\n return defer.promise;\n }\n );\n };\n\n /**\n * Callback function for failed request\n * @param err\n * @returns {promise}\n */\n function requestFailed(err) {\n console.info('error', err);\n\n if (err.data == null || !err.data.error) {\n if (err.status === 200) {\n toastr.error('Server error: ' + err.data);\n }\n else if (err.status === -1) {\n toastr.error('Server is not available');\n }\n else if (err.status === 0) {\n toastr.error('There is no Internet connection');\n }\n else if (err.status === 500) {\n toastr.error('Server error: ' + err.status + ' ' + err.data.message);\n }\n else {\n toastr.error('Server error: ' + err.status + ' ' + err.statusText);\n }\n }\n else {\n toastr.error(err.data.error);\n\n }\n\n return {status: false};\n }\n\n /**\n * Callback function for success request\n * @param response\n * @returns {promise}\n */\n\n function requestComplete(response) {\n // let promise = $q.defer();\n // console.info('response complete', response.config.url);\n // // console.log(!response.data.status, '123')\n // if (response.data.status) {\n // promise.resolve(response.data);\n // }\n // else {\n // promise.reject(response.data);\n // }\n console.log(response, 'request response');\n\n return response.data;\n\n\n }\n }", "http (url, options) {\n return this.robot.http(url, options)\n }", "request(opts) {\n opts.params = opts.params || {};\n \n\t\t// build request options\n\t\tconst _options = {\n\t\t\tmethod: opts.method ? opts.method.toLowerCase() : \"get\",\n\t\t\turi: this.endpoint(opts.path)\n\t\t}\n \n switch (_options.method) {\n case \"get\":\n _options.qs = opts.params;\n break;\n case \"post\":\n _options.form = opts.params;\n break;\n }\n \n // return new promise based on back off api status\n return new Promise((resolve,reject) => {\n // make the request\n if (this._shouldBackoff(opts.path)) {\n reject({type: 'twitter:backoff', err: {path: opts.path, backoff: this._backoff[opts.path]}});\n }\n \n // make request to twitter\n this._request(_options, (err, res, data) => {\n if (err) reject({type:'twitter:request', err});\n data = JSON.parse(data);\n\n // check backoff status of path and resolve or reject based on the end point api status\n this._checkBackoff(opts.path, res.headers)\n .then(msg => {\n resolve({ api:msg.api, data });\n })\n .catch(err => {\n reject({type: 'twitter:checkapi', error: {err,res,data}});\n });\n });\n\n });\n\t}", "function new_test_request() {\n return new Request(test_url)\n}", "_request() {\n var options = url.parse(this._url);\n options.headers = {\n 'User-Agent': 'Benjamin Tambourine',\n 'If-None-Match': this._etag\n };\n https.get(options, this._onResponse.bind(this));\n }", "function makeHttpRequest(req,reqPath,sessionInfo,res, next,queryString){\n common.prepareCommonApiManagerRequest({request:req,sessionInfo:sessionInfo,identifier:'api'})\n .then((response) => {\n proxy({\n url: response.apiUrl+reqPath,\n timeout: 120000\n })(response.request, res, next);\n }).catch((error) => {\n res.status(500).send(error);\n });\n}", "createRequest(settings) {\n // PERFORMANCE HACK:\n // Reduce OPTIONS preflight requests by removing the Accept-Datetime header\n // on requests for resources that are presumed to have been time-negotiated\n if (this.negotiatedResources[this.removeQuery(settings.url)]) {\n delete settings.headers['accept-datetime'];\n }\n // Create the actual XMLHttpRequest\n const request = new XMLHttpRequest();\n const reqHeaders = settings.headers;\n request.open(settings.method, settings.url, true);\n request.timeout = settings.timeout;\n for (const header in reqHeaders) {\n if (!(header in UNSAFE_REQUEST_HEADERS) && reqHeaders[header]) {\n request.setRequestHeader(header, reqHeaders[header]);\n }\n }\n // Create a proxy for the XMLHttpRequest\n const requestProxy = new events_1.EventEmitter();\n requestProxy.abort = () => { request.abort(); };\n // Handle the arrival of a response\n request.onload = () => {\n // Convert the response into an iterator\n const response = new stream_1.Readable();\n response.push(request.responseText || '');\n response.push(null);\n response.statusCode = request.status;\n response.responseUrl = request.responseURL;\n // Parse the response headers\n response.headers = {};\n const resHeaders = response.headers;\n const rawHeaders = request.getAllResponseHeaders() || '';\n const headerMatcher = /^([^:\\n\\r]+):[ \\t]*([^\\r\\n]*)$/mg;\n let match = headerMatcher.exec(rawHeaders);\n while (match) {\n resHeaders[match[1].toLowerCase()] = match[2];\n match = headerMatcher.exec(rawHeaders);\n }\n // Emit the response\n requestProxy.emit('response', response);\n // If the resource was time-negotiated, store its queryless URI\n // to enable the PERFORMANCE HACK explained above\n if (reqHeaders['accept-datetime'] && resHeaders['memento-datetime']) {\n const resource = this.removeQuery(resHeaders['content-location'] || settings.url);\n if (!this.negotiatedResources[resource]) {\n // Ensure the resource is not a timegate\n const links = resHeaders.link && parseLink(resHeaders.link);\n const timegate = this.removeQuery(links && links.timegate && links.timegate.url);\n if (resource !== timegate) {\n this.negotiatedResources[resource] = true;\n }\n }\n }\n };\n // Report errors and timeouts\n request.onerror = () => {\n requestProxy.emit('error', new Error('Error requesting ' + settings.url));\n };\n request.ontimeout = () => {\n requestProxy.emit('error', new Error('Timeout requesting ' + settings.url));\n };\n // Execute the request\n request.send();\n return requestProxy;\n }", "function _makeAPIcall(method, url, params,withResults) {\r\n var _method = method;\r\n var _url = url;\r\n var _params = params;\r\n var _withResults = withResults; \r\n return _authToken().then(function (response) {\r\n if (response.error === undefined) {\r\n var _token = response;\r\n $http.defaults.headers.common.Authorization = 'Bearer token: ' + _token;\r\n if (_method == 'get') { \r\n return $http.get(_url, { params: _params })\r\n .then(function (response) { \r\n \r\n return _apiCallSuccess(response, _url,_withResults);\r\n })\r\n .catch(function (response) { \r\n \r\n return _apiCallFail(response, _url)\r\n });\r\n } else {\r\n return $http.post(_url, _params)\r\n .then(function (response) {\r\n return _apiCallSuccess(response, _url,_withResults);\r\n })\r\n .catch(function (response) { \r\n return _apiCallFail(response, _url)\r\n });\r\n }\r\n } else {\r\n return response;\r\n }\r\n\r\n });\r\n\r\n }", "sendRequest (path, request) {\r\n return this.http.fetch(\r\n path,\r\n {\r\n body : JSON.stringify(request) || null,\r\n headers : {\r\n 'Content-Type' : 'application/json',\r\n 'Accept' : 'application/json'\r\n },\r\n method : 'post',\r\n credentials : 'same-origin'\r\n }\r\n ).then(response => response.json());\r\n }", "function RequestFactory($http, $q){\n var factory = {\n request: request\n };\n\n return factory;\n\n //returns a promise that will be resolved or rejected (asynchronously) based on the return of $http.get request\n //resource: to be added to the BASE_URL\n function request(resource, page, extraParams){\n //default value of 1 if page is undefined\n page = page ? page : 1;\n\n var deferred = $q.defer();\n var FINAL_URL = BASE_URL+ resource + '?api_key=' + API_KEY + '&page=' + page;\n //add any extra params added\n if ( extraParams ) {\n extraParams.forEach(function(param){\n //make sure the param has key and value properties\n if(param.key && param.value){\n FINAL_URL += '&'+param.key+'='+param.value ;\n }\n });\n }\n $http.get(FINAL_URL)\n .then(\n //success function\n function(response){\n //return the actually resource (e.g. movies), so that the caller can use it right away\n //if has results (array of something), return it, otherwise return data (single data)\n deferred.resolve(response.data.results ? response.data.results : response.data);\n },\n\n //error function\n function(error){\n //propagate the error to the caller\n deferred.reject(error);\n });\n return deferred.promise;\n }\n}", "sendHttpRequest(apiEndpoint, opts, body = null, httpType) {\n let headers;\n if (this.keyValueExistsAndNonNull(opts, 'accessToken')) {\n if (this.keyValueExistsAndNonNull(opts, 'accessTokenUsesParam') && opts['accessTokenUsesParam']) {\n // Using parameter\n opts['access_token'] = opts['accessToken'];\n delete opts['accessToken'];\n // We don't want to pass this to the actual API endpoint\n delete opts['accessTokenUsesParam'];\n }\n else {\n // Using HTTP headers\n headers = new HttpHeaders()\n .set('Authorization', `Bearer ${opts['accessToken']}`);\n }\n }\n switch (httpType) {\n case 'delete':\n if (headers) {\n return this.http.createHttpDelete(apiEndpoint, opts, headers);\n }\n else {\n return this.http.createHttpDelete(apiEndpoint, opts);\n }\n case 'get':\n if (headers) {\n return this.http.createHttpGet(apiEndpoint, opts, headers);\n }\n else {\n return this.http.createHttpGet(apiEndpoint, opts);\n }\n case 'post':\n if (headers) {\n if (body) {\n return this.http.createHttpPost(apiEndpoint, opts, body, headers);\n }\n else {\n return this.http.createHttpPost(apiEndpoint, opts, null, headers);\n }\n }\n else {\n if (body) {\n return this.http.createHttpPost(apiEndpoint, opts, body);\n }\n else {\n return this.http.createHttpPost(apiEndpoint, opts, null);\n }\n }\n case 'put':\n if (headers) {\n if (body) {\n return this.http.createHttpPut(apiEndpoint, opts, body, headers);\n }\n else {\n return this.http.createHttpPut(apiEndpoint, opts, null, headers);\n }\n }\n else {\n if (body) {\n return this.http.createHttpPut(apiEndpoint, opts, body);\n }\n else {\n return this.http.createHttpPut(apiEndpoint, opts, null);\n }\n }\n }\n }", "function request(url) {\n\t\t\t\tvar pingerResponseString\n\t\t\t\tvar writeHeadInvocation = 0\n\n\t\t\t\t// make sure ops initialized the url\n\t\t\t\tvar opsMiddleware = app.gets[url]\n\t\t\t\tassert.ok(opsMiddleware, 'test url was not registered by ops')\n\n\t\t\t\t// execute a request for the tested ops intance to repond to\n\t\t\t\tvar mockRequestInstance\n\t\t\t\tvar mockResponseInstance = {\n\t\t\t\t\twriteHead: writeHead,\n\t\t\t\t\tsend: send\t\t\t\t\n\t\t\t\t}\n\t\t\t\topsMiddleware(mockRequestInstance, mockResponseInstance)\n\n\t\t\t\t// check outcome, return response\n\t\t\t\tassert.equal(writeHeadInvocation, 1, 'ops did not set response code:' + writeHeadInvocation)\n\t\t\t\treturn pingerResponseString\n\n\t\t\t\t// reponse.writeHead mockup\n\t\t\t\tfunction writeHead(code, json) {\n\t\t\t\t\tassert.equal(code, 200, 'ops responded with bad status code:' + code)\n\t\t\t\t\twriteHeadInvocation++\n\t\t\t\t}\n\n\t\t\t\t// response.send mockup\n\t\t\t\tfunction send(jsonString, headerObject, statusCode) {\n\t\t\t\t\tif (headerObject || statusCode) writeHead(statusCode, headerObject)\n\t\t\t\t\tpingerResponseString =jsonString\n\t\t\t\t}\n\n\t\t\t}", "function http($http, $q, Upload, toastr, back4app) {\n console.log('create request service');\n\n return {\n get: function (url, data) {\n return request('GET', url, data);\n },\n post: function (url, data) {\n return request('POST', url, data);\n },\n put: function (url, data) {\n return request('PUT', url, data);\n },\n delete: function (url, data) {\n return request('DELETE', url, data);\n },\n file: function (url, data) {\n return requestFile(url, data);\n }\n };\n\n\n /**\n * Main request function\n * @param {string} method - Method name\n * @param {string} url - Request url\n * @param {object} data - Data to request\n * @returns {promise}\n */\n\n function request(method, url, data) {\n\n\n let config = {\n dataType: 'json',\n method: method,\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json; charset=UTF-8',\n 'X-Parse-Application-Id': back4app.appId,\n 'X-Parse-REST-API-Key': back4app.token\n }\n };\n\n if (method === 'GET') {\n config.params = data;\n config.timeout = 20000;\n }\n else {\n config.data = data;\n }\n\n // if ($sessionStorage.auth_key) {\n // config.url = url + '?auth_key=' + $sessionStorage.auth_key;\n // }\n // else {\n config.url = url;\n // }\n\n return $http(config)\n .then(requestComplete)\n .catch(requestFailed);\n }\n\n /**\n * Callback function for failed request\n * @param err\n * @returns {promise}\n */\n function requestFailed(err) {\n console.info('error', err.config.url, err);\n\n if (err.data == null || !err.data.error) {\n if (err.status === 200) {\n toastr.error('Server error: ' + err.data);\n }\n else if (err.status === -1) {\n toastr.error('Server is not available');\n }\n else if (err.status === 0) {\n toastr.error('There is no Internet connection');\n }\n else if (err.status === 500) {\n toastr.error('Server error: ' + err.status + ' ' + err.data.message);\n }\n else {\n toastr.error('Server error: ' + err.status + ' ' + err.statusText);\n }\n // console.log('XHR Failed: ' + err.status);\n } else {\n toastr.error(err.data.error);\n }\n\n\n return $q.reject(err.data.error);\n }\n\n /**\n * Callback function for success request\n * @param response\n * @returns {promise}\n */\n\n function requestComplete(response) {\n let promise = $q.defer();\n\n console.info('response complete', response.config.url, response);\n\n if (!response.data.error) {\n promise.resolve(response.data);\n }\n else {\n promise.reject(response);\n }\n\n\n return promise.promise;\n }\n\n /**\n * Function for sending files\n * @param {string} url - Request url\n * @param {object} data - Data to request\n * @returns {promise}\n */\n function requestFile(url, file) {\n return Upload.http({\n url: url,\n headers: {\n 'Content-Type': file.type,\n 'X-Parse-Application-Id': back4app.appId,\n 'X-Parse-REST-API-Key': back4app.token\n },\n data: file\n });\n }\n }", "function http(_x) {\n return _http.apply(this, arguments);\n} // exported for testing", "function http(_x) {\n return _http.apply(this, arguments);\n} // exported for testing", "function MockHttpRequest () {\n\t// These are internal flags and data structures\n\tthis.error = false;\n\tthis.sent = false;\n\tthis.requestHeaders = {};\n\tthis.responseHeaders = {};\n}", "willSendRequest(request) {\n request.headers.set('x-rapidapi-key', process.env.API_KEY)\n request.headers.set('x-rapidapi-host', 'coronavirus-smartable.p.rapidapi.com')\n }", "function _createRequestFacade(request, loadEndCallback) {\n var loaded = 0;\n var total = 0;\n var responseHeaders = {};\n var status = 0;\n var response = null;\n var error = null;\n\n function _getCurrentProgress() {\n // posiiton and totalSize are aliases for FF\n // found here: http://www.opensource.apple.com/source/WebCore/WebCore-1298/xml/XMLHttpRequestProgressEvent.h\n return {\n loaded: loaded,\n total: total,\n position: loaded,\n totalSize: total\n };\n }\n\n return {\n url: request.url,\n origin: request.origin,\n requestHeaders: request.headers,\n data: request.data,\n getResponse: function getResponse() {\n return {\n loaded: loaded,\n total: total,\n headers: responseHeaders,\n status: status,\n response: response,\n error: error\n };\n },\n sendHeaders: function sendHeaders(_responseHeaders_) {\n responseHeaders = mapValues(_responseHeaders_, function (value) {\n if (!Array.isArray(value)) {\n return value.split(',').map(function (header) {\n return header.trim();\n });\n } else {\n return value;\n }\n });\n\n return new Promise(function (resolve) {\n if (request.async) {\n queuedRandomAsync(function () {\n request.onheaders(responseHeaders);\n\n resolve();\n });\n } else {\n request.onheaders(responseHeaders);\n\n resolve();\n }\n });\n },\n sendProgress: function sendProgress(_loaded_) {\n loaded = _loaded_;\n\n return new Promise(function (resolve) {\n if (request.async) {\n queuedRandomAsync(function () {\n request.onprogress(_getCurrentProgress());\n\n resolve();\n });\n } else {\n request.onprogress(_getCurrentProgress());\n\n resolve();\n }\n });\n },\n sendResponse: function sendResponse(_status_, _response_) {\n status = _status_;\n response = _response_ + '';\n\n return new Promise(function (resolve) {\n if (request.async) {\n queuedRandomAsync(function () {\n request.onresponse(status, response);\n\n resolve();\n });\n } else {\n request.onresponse(status, response);\n\n resolve();\n }\n }).then(loadEndCallback);\n },\n sendError: function sendError(_error_) {\n error = _error_;\n\n return new Promise(function (resolve) {\n if (request.async) {\n queuedRandomAsync(function () {\n request.onerror(error, _getCurrentProgress());\n\n resolve();\n });\n } else {\n request.onerror(error, _getCurrentProgress());\n\n resolve();\n }\n }).then(loadEndCallback);\n }\n };\n}", "doRequestBy(alias, params = {}) {\n const RequestFactoryInstance = new RequestFactory();\n\n this.requests = RequestFactoryInstance.createRequestsBy(alias, params);\n\n // console.log(this.requests);\n\n return this.executeChain();\n }", "_sendRequest(api, path, options) {\n options.headers = options.headers || {};\n if (this.token) {\n options.headers[\"Authoriztion\"] = `Bearer ${ this.token }`;\n }\n\n return api.request(path, options);\n }" ]
[ "0.6381797", "0.6297676", "0.60881376", "0.6082422", "0.6062736", "0.6052115", "0.6052115", "0.6052115", "0.60195273", "0.6002649", "0.59809446", "0.59783936", "0.59326667", "0.59326667", "0.59326667", "0.59326667", "0.59326667", "0.59271425", "0.59077907", "0.59077907", "0.59077907", "0.59077907", "0.59077907", "0.59077907", "0.59077907", "0.59077907", "0.59077907", "0.59077907", "0.59077907", "0.59077907", "0.5906648", "0.5902764", "0.5902764", "0.5902764", "0.5902764", "0.5902764", "0.5892683", "0.5892683", "0.5892683", "0.5892683", "0.5892683", "0.58900267", "0.58811593", "0.58139753", "0.579581", "0.57930195", "0.5782823", "0.57797825", "0.5756966", "0.5741618", "0.5736719", "0.57367027", "0.5723311", "0.5714362", "0.5687636", "0.5675541", "0.5606118", "0.5600624", "0.5583634", "0.55813134", "0.5580098", "0.5575655", "0.5575655", "0.5575655", "0.5575655", "0.5575655", "0.5565415", "0.55243224", "0.55243224", "0.5509513", "0.5491332", "0.5491332", "0.5491332", "0.5487111", "0.5476582", "0.5454176", "0.5443133", "0.54313475", "0.5414748", "0.5414301", "0.54072833", "0.54039407", "0.5399861", "0.5389639", "0.53538597", "0.53500473", "0.534625", "0.53333575", "0.5325326", "0.53252596", "0.53252596", "0.53192186", "0.53191835", "0.5318937", "0.5318168", "0.5310721" ]
0.58721536
46
Callback registered to $httpBackend(): caches the response if desired resolves the raw $http promise calls $apply
function done(status, response, headersString, statusText) { if (cache) { if (isSuccess(status)) { cache.put(url, [status, response, parseHeaders(headersString), statusText]); } else { // remove promise from the cache cache.remove(url); } } function resolveHttpPromise() { resolvePromise(response, status, headersString, statusText); } if (useApplyAsync) { $rootScope.$applyAsync(resolveHttpPromise); } else { resolveHttpPromise(); if (!$rootScope.$$phase) $rootScope.$apply(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function done(status, response, headersString, statusText) { // 10571\n if (cache) { // 10572\n if (isSuccess(status)) { // 10573\n cache.put(url, [status, response, parseHeaders(headersString), statusText]); // 10574\n } else { // 10575\n // remove promise from the cache // 10576\n cache.remove(url); // 10577\n } // 10578\n } // 10579\n // 10580\n function resolveHttpPromise() { // 10581\n resolvePromise(response, status, headersString, statusText); // 10582\n } // 10583\n // 10584\n if (useApplyAsync) { // 10585\n $rootScope.$applyAsync(resolveHttpPromise); // 10586\n } else { // 10587\n resolveHttpPromise(); // 10588\n if (!$rootScope.$$phase) $rootScope.$apply(); // 10589\n } // 10590\n } // 10591", "function done(status,response,headersString,statusText){if(cache){if(isSuccess(status)){cache.put(url,[status,response,parseHeaders(headersString),statusText]);}else{// remove promise from the cache\ncache.remove(url);}}function resolveHttpPromise(){resolvePromise(response,status,headersString,statusText);}if(useApplyAsync){$rootScope.$applyAsync(resolveHttpPromise);}else{resolveHttpPromise();if(!$rootScope.$$phase)$rootScope.$apply();}}", "function done(status,response,headersString,statusText){if(cache){if(isSuccess(status)){cache.put(url,[status,response,parseHeaders(headersString),statusText]);}else{// remove promise from the cache\n\tcache.remove(url);}}function resolveHttpPromise(){resolvePromise(response,status,headersString,statusText);}if(useApplyAsync){$rootScope.$applyAsync(resolveHttpPromise);}else{resolveHttpPromise();if(!$rootScope.$$phase)$rootScope.$apply();}}", "function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }", "function done(status, response, headersString, statusText) {\n\t\t\t\t\t\tif (cache) {\n\t\t\t\t\t\t\tif (isSuccess(status)) {\n\t\t\t\t\t\t\t\tcache.put(url, [status, response, parseHeaders(headersString), statusText]);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// remove promise from the cache\n\t\t\t\t\t\t\t\tcache.remove(url);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction resolveHttpPromise() {\n\t\t\t\t\t\t\tresolvePromise(response, status, headersString, statusText);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (useApplyAsync) {\n\t\t\t\t\t\t\t$rootScope.$applyAsync(resolveHttpPromise);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresolveHttpPromise();\n\t\t\t\t\t\t\tif (!$rootScope.$$phase) $rootScope.$apply();\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "function done(status, response, headersString, statusText, xhrStatus) {\n\t if (cache) {\n\t if (isSuccess(status)) {\n\t cache.put(url, [status, response, parseHeaders(headersString), statusText, xhrStatus]);\n\t } else {\n\t // remove promise from the cache\n\t cache.remove(url);\n\t }\n\t }\n\n\t function resolveHttpPromise() {\n\t resolvePromise(response, status, headersString, statusText, xhrStatus);\n\t }\n\n\t if (useApplyAsync) {\n\t $rootScope.$applyAsync(resolveHttpPromise);\n\t } else {\n\t resolveHttpPromise();\n\t if (!$rootScope.$$phase) $rootScope.$apply();\n\t }\n\t }", "function done(status, response, headersString, statusText) {\n\t if (cache) {\n\t if (isSuccess(status)) {\n\t cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n\t } else {\n\t // remove promise from the cache\n\t cache.remove(url);\n\t }\n\t }\n\n\t function resolveHttpPromise() {\n\t resolvePromise(response, status, headersString, statusText);\n\t }\n\n\t if (useApplyAsync) {\n\t $rootScope.$applyAsync(resolveHttpPromise);\n\t } else {\n\t resolveHttpPromise();\n\t if (!$rootScope.$$phase) $rootScope.$apply();\n\t }\n\t }", "function done(status, response, headersString, statusText, xhrStatus) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText, xhrStatus]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText, xhrStatus);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }", "function done(status, response, headersString, statusText, xhrStatus) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText, xhrStatus]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText, xhrStatus);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }", "function done(status, response, headersString, statusText, xhrStatus) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText, xhrStatus]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText, xhrStatus);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }", "function done(status, response, headersString, statusText, xhrStatus) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText, xhrStatus]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText, xhrStatus);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }", "function done(status, response, headersString, statusText, xhrStatus) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText, xhrStatus]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText, xhrStatus);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }", "function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString, statusText);\n if (!$rootScope.$$phase) $rootScope.$apply();\n }", "function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString, statusText);\n if (!$rootScope.$$phase) $rootScope.$apply();\n }", "function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString, statusText);\n if (!$rootScope.$$phase) $rootScope.$apply();\n }", "function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString, statusText);\n if (!$rootScope.$$phase) $rootScope.$apply();\n }", "function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString, statusText);\n if (!$rootScope.$$phase) $rootScope.$apply();\n }", "function done(status, response, headersString) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString)]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString);\n if (!$rootScope.$$phase) $rootScope.$apply();\n }", "function done(status, response, headersString) {\n\t\t\t\t\tif (cache) {\n\t\t\t\t\t\tif (isSuccess(status)) {\n\t\t\t\t\t\t\tcache.put(url, [status, response, parseHeaders(headersString)]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// remove promise from the cache\n\t\t\t\t\t\t\tcache.remove(url);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tresolvePromise(response, status, headersString);\n\t\t\t\t\t$rootScope.$apply();\n\t\t\t\t}", "function sendReq(config, reqData, reqHeaders) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if (config.cache && config.method == 'GET') {\n cache = isObject(config.cache) ? config.cache : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (cachedResp) {\n if (cachedResp.then) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(removePendingReq, removePendingReq);\n return cachedResp;\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], copy(cachedResp[2]));\n } else {\n resolvePromise(cachedResp, 200, {});\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n // if we won't have the response in cache, send the request to the backend\n if (!cachedResp) {\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString)]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString);\n $rootScope.$apply();\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config\n });\n }\n\n\n function removePendingReq() {\n var idx = indexOf($http.pendingRequests, config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData, reqHeaders) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if (config.cache && config.method == 'GET') {\n cache = isObject(config.cache) ? config.cache : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (cachedResp) {\n if (cachedResp.then) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(removePendingReq, removePendingReq);\n return cachedResp;\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], copy(cachedResp[2]));\n } else {\n resolvePromise(cachedResp, 200, {});\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n // if we won't have the response in cache, send the request to the backend\n if (!cachedResp) {\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString)]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString);\n $rootScope.$apply();\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config\n });\n }\n\n\n function removePendingReq() {\n var idx = indexOf($http.pendingRequests, config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData, reqHeaders) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if (config.cache && config.method == 'GET') {\n cache = isObject(config.cache) ? config.cache : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (cachedResp) {\n if (cachedResp.then) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(removePendingReq, removePendingReq);\n return cachedResp;\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], copy(cachedResp[2]));\n } else {\n resolvePromise(cachedResp, 200, {});\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n // if we won't have the response in cache, send the request to the backend\n if (!cachedResp) {\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString)]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString);\n $rootScope.$apply();\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config\n });\n }\n\n\n function removePendingReq() {\n var idx = indexOf($http.pendingRequests, config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function done(status, response, headersString) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString)]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString);\n $rootScope.$apply();\n }", "function done(status, response, headersString) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString)]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString);\n $rootScope.$apply();\n }", "function done(status, response, headersString) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString)]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString);\n $rootScope.$apply();\n }", "respondSubsequent(response, reqIdx, shouldStubResp) {\n var response = response || \"\",\n validReqIdx = reqIdx !== undefined;\n\n // this.res.__requests isn't available after 'privates' optimization\n // so find it by some kind of feature detection - this isn't beautiful,\n // but adding a protected getter just for that is worse\n var requests = \"\";\n Object.keys(this.res).forEach(function (propName) {\n if (\n propName.indexOf(\"__\") === 0 &&\n \"get\" in this.res[propName] &&\n qx.lang.Type.isArray(this.res[propName].get) &&\n qx.lang.Type.isObject(this.res[propName].get[0]) &&\n \"$$hash\" in this.res[propName].get[0]\n ) {\n requests = propName;\n }\n }, this);\n\n if (validReqIdx && requests) {\n var reqWithin = this.res[requests].get[reqIdx];\n if (shouldStubResp) {\n this.stub(reqWithin, \"isDone\");\n this.stub(reqWithin, \"getResponse\");\n reqWithin.isDone.returns(true);\n reqWithin.getResponse.returns(response);\n }\n reqWithin.emit(\"success\");\n reqWithin.emit(\"loadEnd\");\n this.res[requests].get[reqIdx] = reqWithin;\n }\n }", "function $httpBackend(method, url, data, callback, headers, timeout, withCredentials, responseType) {\n\n var xhr = new MockXhr(),\n expectation = expectations[0],\n wasExpected = false;\n\n function prettyPrint(data) {\n return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp)\n ? data\n : angular.toJson(data);\n }\n\n function wrapResponse(wrapped) {\n if (!$browser && timeout) {\n timeout.then ? timeout.then(handleTimeout) : $timeout(handleTimeout, timeout);\n }\n\n return handleResponse;\n\n function handleResponse() {\n var response = wrapped.response(method, url, data, headers);\n xhr.$$respHeaders = response[2];\n callback(copy(response[0]), copy(response[1]), xhr.getAllResponseHeaders(),\n copy(response[3] || ''));\n }\n\n function handleTimeout() {\n for (var i = 0, ii = responses.length; i < ii; i++) {\n if (responses[i] === handleResponse) {\n responses.splice(i, 1);\n callback(-1, undefined, '');\n break;\n }\n }\n }\n }\n\n if (expectation && expectation.match(method, url)) {\n if (!expectation.matchData(data)) {\n throw new Error('Expected ' + expectation + ' with different data\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.data) + '\\nGOT: ' + data);\n }\n\n if (!expectation.matchHeaders(headers)) {\n throw new Error('Expected ' + expectation + ' with different headers\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.headers) + '\\nGOT: ' +\n prettyPrint(headers));\n }\n\n expectations.shift();\n\n if (expectation.response) {\n responses.push(wrapResponse(expectation));\n return;\n }\n wasExpected = true;\n }\n\n var i = -1, definition;\n while ((definition = definitions[++i])) {\n if (definition.match(method, url, data, headers || {})) {\n if (definition.response) {\n // if $browser specified, we do auto flush all requests\n ($browser ? $browser.defer : responsesPush)(wrapResponse(definition));\n } else if (definition.passThrough) {\n $delegate(method, url, data, callback, headers, timeout, withCredentials, responseType);\n } else throw new Error('No response defined !');\n return;\n }\n }\n throw wasExpected ?\n new Error('No response defined !') :\n new Error('Unexpected request: ' + method + ' ' + url + '\\n' +\n (expectation ? 'Expected ' + expectation : 'No more request expected'));\n }", "function $httpBackend(method, url, data, callback, headers, timeout, withCredentials) {\n var xhr = new MockXhr(),\n expectation = expectations[0],\n wasExpected = false;\n\n function prettyPrint(data) {\n return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp)\n ? data\n : angular.toJson(data);\n }\n\n function wrapResponse(wrapped) {\n if (!$browser && timeout) {\n timeout.then ? timeout.then(handleTimeout) : $timeout(handleTimeout, timeout);\n }\n\n return handleResponse;\n\n function handleResponse() {\n var response = wrapped.response(method, url, data, headers);\n xhr.$$respHeaders = response[2];\n callback(copy(response[0]), copy(response[1]), xhr.getAllResponseHeaders(),\n copy(response[3] || ''));\n }\n\n function handleTimeout() {\n for (var i = 0, ii = responses.length; i < ii; i++) {\n if (responses[i] === handleResponse) {\n responses.splice(i, 1);\n callback(-1, undefined, '');\n break;\n }\n }\n }\n }\n\n if (expectation && expectation.match(method, url)) {\n if (!expectation.matchData(data)) {\n throw new Error('Expected ' + expectation + ' with different data\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.data) + '\\nGOT: ' + data);\n }\n\n if (!expectation.matchHeaders(headers)) {\n throw new Error('Expected ' + expectation + ' with different headers\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.headers) + '\\nGOT: ' +\n prettyPrint(headers));\n }\n\n expectations.shift();\n\n if (expectation.response) {\n responses.push(wrapResponse(expectation));\n return;\n }\n wasExpected = true;\n }\n\n var i = -1, definition;\n while ((definition = definitions[++i])) {\n if (definition.match(method, url, data, headers || {})) {\n if (definition.response) {\n // if $browser specified, we do auto flush all requests\n ($browser ? $browser.defer : responsesPush)(wrapResponse(definition));\n } else if (definition.passThrough) {\n $delegate(method, url, data, callback, headers, timeout, withCredentials);\n } else throw new Error('No response defined !');\n return;\n }\n }\n throw wasExpected ?\n new Error('No response defined !') :\n new Error('Unexpected request: ' + method + ' ' + url + '\\n' +\n (expectation ? 'Expected ' + expectation : 'No more request expected'));\n }", "function sendReq(config, reqData, reqHeaders) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false && config.method == 'GET') {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (cachedResp.then) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(removePendingReq, removePendingReq);\n return cachedResp;\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], copy(cachedResp[2]));\n } else {\n resolvePromise(cachedResp, 200, {});\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n // if we won't have the response in cache, send the request to the backend\n if (isUndefined(cachedResp)) {\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString)]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString);\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config\n });\n }\n\n\n function removePendingReq() {\n var idx = indexOf($http.pendingRequests, config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData, reqHeaders) {\n\t\t\t\tvar deferred = $q.defer(),\n\t\t\t\t\tpromise = deferred.promise,\n\t\t\t\t\tcache, cachedResp, url = buildUrl(config.url, config.params);\n\n\t\t\t\t$http.pendingRequests.push(config);\n\t\t\t\tpromise.then(removePendingReq, removePendingReq);\n\n\n\t\t\t\tif (config.cache && config.method == 'GET') {\n\t\t\t\t\tcache = isObject(config.cache) ? config.cache : defaultCache;\n\t\t\t\t}\n\n\t\t\t\tif (cache) {\n\t\t\t\t\tcachedResp = cache.get(url);\n\t\t\t\t\tif (cachedResp) {\n\t\t\t\t\t\tif (cachedResp.then) {\n\t\t\t\t\t\t\t// cached request has already been sent, but there is no response yet\n\t\t\t\t\t\t\tcachedResp.then(removePendingReq, removePendingReq);\n\t\t\t\t\t\t\treturn cachedResp;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// serving from cache\n\t\t\t\t\t\t\tif (isArray(cachedResp)) {\n\t\t\t\t\t\t\t\tresolvePromise(cachedResp[1], cachedResp[0], copy(cachedResp[2]));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tresolvePromise(cachedResp, 200, {});\n\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\t// put the promise for the non-transformed response into cache as a placeholder\n\t\t\t\t\t\tcache.put(url, promise);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if we won't have the response in cache, send the request to the backend\n\t\t\t\tif (!cachedResp) {\n\t\t\t\t\t$httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout, config.withCredentials);\n\t\t\t\t}\n\n\t\t\t\treturn promise;\n\n\n\t\t\t\t/**\n\t\t\t\t * Callback registered to $httpBackend():\n\t\t\t\t * - caches the response if desired\n\t\t\t\t * - resolves the raw $http promise\n\t\t\t\t * - calls $apply\n\t\t\t\t */\n\n\t\t\t\tfunction done(status, response, headersString) {\n\t\t\t\t\tif (cache) {\n\t\t\t\t\t\tif (isSuccess(status)) {\n\t\t\t\t\t\t\tcache.put(url, [status, response, parseHeaders(headersString)]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// remove promise from the cache\n\t\t\t\t\t\t\tcache.remove(url);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tresolvePromise(response, status, headersString);\n\t\t\t\t\t$rootScope.$apply();\n\t\t\t\t}\n\n\n\t\t\t\t/**\n\t\t\t\t * Resolves the raw $http promise.\n\t\t\t\t */\n\n\t\t\t\tfunction resolvePromise(response, status, headers) {\n\t\t\t\t\t// normalize internal statuses to 0\n\t\t\t\t\tstatus = Math.max(status, 0);\n\n\t\t\t\t\t(isSuccess(status) ? deferred.resolve : deferred.reject)({\n\t\t\t\t\t\tdata: response,\n\t\t\t\t\t\tstatus: status,\n\t\t\t\t\t\theaders: headersGetter(headers),\n\t\t\t\t\t\tconfig: config\n\t\t\t\t\t});\n\t\t\t\t}\n\n\n\t\t\t\tfunction removePendingReq() {\n\t\t\t\t\tvar idx = indexOf($http.pendingRequests, config);\n\t\t\t\t\tif (idx !== -1) $http.pendingRequests.splice(idx, 1);\n\t\t\t\t}\n\t\t\t}", "function $httpBackend(method, url, data, callback, headers, timeout, withCredentials) {\n var xhr = new MockXhr(),\n expectation = expectations[0],\n wasExpected = false;\n\n function prettyPrint(data) {\n return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp)\n ? data\n : angular.toJson(data);\n }\n\n function wrapResponse(wrapped) {\n if (!$browser && timeout && timeout.then) timeout.then(handleTimeout);\n\n return handleResponse;\n\n function handleResponse() {\n var response = wrapped.response(method, url, data, headers);\n xhr.$$respHeaders = response[2];\n callback(copy(response[0]), copy(response[1]), xhr.getAllResponseHeaders(),\n copy(response[3] || ''));\n }\n\n function handleTimeout() {\n for (var i = 0, ii = responses.length; i < ii; i++) {\n if (responses[i] === handleResponse) {\n responses.splice(i, 1);\n callback(-1, undefined, '');\n break;\n }\n }\n }\n }\n\n if (expectation && expectation.match(method, url)) {\n if (!expectation.matchData(data))\n throw new Error('Expected ' + expectation + ' with different data\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.data) + '\\nGOT: ' + data);\n\n if (!expectation.matchHeaders(headers))\n throw new Error('Expected ' + expectation + ' with different headers\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.headers) + '\\nGOT: ' +\n prettyPrint(headers));\n\n expectations.shift();\n\n if (expectation.response) {\n responses.push(wrapResponse(expectation));\n return;\n }\n wasExpected = true;\n }\n\n var i = -1, definition;\n while ((definition = definitions[++i])) {\n if (definition.match(method, url, data, headers || {})) {\n if (definition.response) {\n // if $browser specified, we do auto flush all requests\n ($browser ? $browser.defer : responsesPush)(wrapResponse(definition));\n } else if (definition.passThrough) {\n $delegate(method, url, data, callback, headers, timeout, withCredentials);\n } else throw new Error('No response defined !');\n return;\n }\n }\n throw wasExpected ?\n new Error('No response defined !') :\n new Error('Unexpected request: ' + method + ' ' + url + '\\n' +\n (expectation ? 'Expected ' + expectation : 'No more request expected'));\n }", "function $httpBackend(method, url, data, callback, headers, timeout, withCredentials) {\n var xhr = new MockXhr(),\n expectation = expectations[0],\n wasExpected = false;\n\n function prettyPrint(data) {\n return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp)\n ? data\n : angular.toJson(data);\n }\n\n function wrapResponse(wrapped) {\n if (!$browser && timeout && timeout.then) timeout.then(handleTimeout);\n\n return handleResponse;\n\n function handleResponse() {\n var response = wrapped.response(method, url, data, headers);\n xhr.$$respHeaders = response[2];\n callback(copy(response[0]), copy(response[1]), xhr.getAllResponseHeaders(),\n copy(response[3] || ''));\n }\n\n function handleTimeout() {\n for (var i = 0, ii = responses.length; i < ii; i++) {\n if (responses[i] === handleResponse) {\n responses.splice(i, 1);\n callback(-1, undefined, '');\n break;\n }\n }\n }\n }\n\n if (expectation && expectation.match(method, url)) {\n if (!expectation.matchData(data))\n throw new Error('Expected ' + expectation + ' with different data\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.data) + '\\nGOT: ' + data);\n\n if (!expectation.matchHeaders(headers))\n throw new Error('Expected ' + expectation + ' with different headers\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.headers) + '\\nGOT: ' +\n prettyPrint(headers));\n\n expectations.shift();\n\n if (expectation.response) {\n responses.push(wrapResponse(expectation));\n return;\n }\n wasExpected = true;\n }\n\n var i = -1, definition;\n while ((definition = definitions[++i])) {\n if (definition.match(method, url, data, headers || {})) {\n if (definition.response) {\n // if $browser specified, we do auto flush all requests\n ($browser ? $browser.defer : responsesPush)(wrapResponse(definition));\n } else if (definition.passThrough) {\n $delegate(method, url, data, callback, headers, timeout, withCredentials);\n } else throw new Error('No response defined !');\n return;\n }\n }\n throw wasExpected ?\n new Error('No response defined !') :\n new Error('Unexpected request: ' + method + ' ' + url + '\\n' +\n (expectation ? 'Expected ' + expectation : 'No more request expected'));\n }", "function sendReq(config, reqData) { // 10508\n var deferred = $q.defer(), // 10509\n promise = deferred.promise, // 10510\n cache, // 10511\n cachedResp, // 10512\n reqHeaders = config.headers, // 10513\n url = buildUrl(config.url, config.paramSerializer(config.params)); // 10514\n // 10515\n $http.pendingRequests.push(config); // 10516\n promise.then(removePendingReq, removePendingReq); // 10517\n // 10518\n // 10519\n if ((config.cache || defaults.cache) && config.cache !== false && // 10520\n (config.method === 'GET' || config.method === 'JSONP')) { // 10521\n cache = isObject(config.cache) ? config.cache // 10522\n : isObject(defaults.cache) ? defaults.cache // 10523\n : defaultCache; // 10524\n } // 10525\n // 10526\n if (cache) { // 10527\n cachedResp = cache.get(url); // 10528\n if (isDefined(cachedResp)) { // 10529\n if (isPromiseLike(cachedResp)) { // 10530\n // cached request has already been sent, but there is no response yet // 10531\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult); // 10532\n } else { // 10533\n // serving from cache // 10534\n if (isArray(cachedResp)) { // 10535\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]); // 10536\n } else { // 10537\n resolvePromise(cachedResp, 200, {}, 'OK'); // 10538\n } // 10539\n } // 10540\n } else { // 10541\n // put the promise for the non-transformed response into cache as a placeholder // 10542\n cache.put(url, promise); // 10543\n } // 10544\n } // 10545\n // 10546\n // 10547\n // if we won't have the response in cache, set the xsrf headers and // 10548\n // send the request to the backend // 10549\n if (isUndefined(cachedResp)) { // 10550\n var xsrfValue = urlIsSameOrigin(config.url) // 10551\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName] // 10552\n : undefined; // 10553\n if (xsrfValue) { // 10554\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue; // 10555\n } // 10556\n // 10557\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout, // 10558\n config.withCredentials, config.responseType); // 10559\n } // 10560\n // 10561\n return promise; // 10562\n // 10563\n // 10564\n /** // 10565\n * Callback registered to $httpBackend(): // 10566\n * - caches the response if desired // 10567\n * - resolves the raw $http promise // 10568\n * - calls $apply // 10569\n */ // 10570\n function done(status, response, headersString, statusText) { // 10571\n if (cache) { // 10572\n if (isSuccess(status)) { // 10573\n cache.put(url, [status, response, parseHeaders(headersString), statusText]); // 10574\n } else { // 10575\n // remove promise from the cache // 10576\n cache.remove(url); // 10577\n } // 10578\n } // 10579\n // 10580\n function resolveHttpPromise() { // 10581\n resolvePromise(response, status, headersString, statusText); // 10582\n } // 10583\n // 10584\n if (useApplyAsync) { // 10585\n $rootScope.$applyAsync(resolveHttpPromise); // 10586\n } else { // 10587\n resolveHttpPromise(); // 10588\n if (!$rootScope.$$phase) $rootScope.$apply(); // 10589\n } // 10590\n } // 10591\n // 10592\n // 10593\n /** // 10594\n * Resolves the raw $http promise. // 10595\n */ // 10596\n function resolvePromise(response, status, headers, statusText) { // 10597\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise) // 10598\n status = status >= -1 ? status : 0; // 10599\n // 10600\n (isSuccess(status) ? deferred.resolve : deferred.reject)({ // 10601\n data: response, // 10602\n status: status, // 10603\n headers: headersGetter(headers), // 10604\n config: config, // 10605\n statusText: statusText // 10606\n }); // 10607\n } // 10608\n // 10609\n function resolvePromiseWithResult(result) { // 10610\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText); // 10611\n } // 10612\n // 10613\n function removePendingReq() { // 10614\n var idx = $http.pendingRequests.indexOf(config); // 10615\n if (idx !== -1) $http.pendingRequests.splice(idx, 1); // 10616\n } // 10617\n } // 10618", "function $httpBackend(method, url, data, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers) {\n\n var xhr = new MockXhr(),\n expectation = expectations[0],\n wasExpected = false;\n\n xhr.$$events = eventHandlers;\n xhr.upload.$$events = uploadEventHandlers;\n\n function prettyPrint(data) {\n return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp)\n ? data\n : angular.toJson(data);\n }\n\n function wrapResponse(wrapped) {\n if (!$browser && timeout) {\n timeout.then ? timeout.then(handleTimeout) : $timeout(handleTimeout, timeout);\n }\n\n return handleResponse;\n\n function handleResponse() {\n var response = wrapped.response(method, url, data, headers, wrapped.params(url));\n xhr.$$respHeaders = response[2];\n callback(copy(response[0]), copy(response[1]), xhr.getAllResponseHeaders(),\n copy(response[3] || ''));\n }\n\n function handleTimeout() {\n for (var i = 0, ii = responses.length; i < ii; i++) {\n if (responses[i] === handleResponse) {\n responses.splice(i, 1);\n callback(-1, undefined, '');\n break;\n }\n }\n }\n }\n\n if (expectation && expectation.match(method, url)) {\n if (!expectation.matchData(data)) {\n throw new Error('Expected ' + expectation + ' with different data\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.data) + '\\nGOT: ' + data);\n }\n\n if (!expectation.matchHeaders(headers)) {\n throw new Error('Expected ' + expectation + ' with different headers\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.headers) + '\\nGOT: ' +\n prettyPrint(headers));\n }\n\n expectations.shift();\n\n if (expectation.response) {\n responses.push(wrapResponse(expectation));\n return;\n }\n wasExpected = true;\n }\n\n var i = -1, definition;\n while ((definition = definitions[++i])) {\n if (definition.match(method, url, data, headers || {})) {\n if (definition.response) {\n // if $browser specified, we do auto flush all requests\n ($browser ? $browser.defer : responsesPush)(wrapResponse(definition));\n } else if (definition.passThrough) {\n $delegate(method, url, data, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers);\n } else throw new Error('No response defined !');\n return;\n }\n }\n throw wasExpected ?\n new Error('No response defined !') :\n new Error('Unexpected request: ' + method + ' ' + url + '\\n' +\n (expectation ? 'Expected ' + expectation : 'No more request expected'));\n }", "function sendReq(config, reqData, reqHeaders) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false && config.method == 'GET') {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (cachedResp.then) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(removePendingReq, removePendingReq);\n return cachedResp;\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n // if we won't have the response in cache, send the request to the backend\n if (isUndefined(cachedResp)) {\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString, statusText);\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText : statusText\n });\n }\n\n\n function removePendingReq() {\n var idx = indexOf($http.pendingRequests, config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function interceptResponse(parms, res) {\n\n\t// only cache if the last-modified header is set.\n\tif(res.headers['last-modified']) {\n\n\t\tvar cacheObj = {data:''};\n\t\tres.on('end', function() {\n\n\t\t\t// commit to cache\n\t\t\t_.extend(cacheObj, _.pick(res, [\n\t\t\t\t\t'headers', 'rawHeaders', 'httpVersion', 'trailers', 'rawTrailers',\n\t\t\t\t\t'method', 'url']));\n\n\t\t\tcache.set(parms.cacheKey, cacheObj, parms.cacheTtl);\n\n\t\t});\n\n\t\tres.on('data', function(chunk) {\n\t\t\tcacheObj.data += chunk;\n\t\t});\n\n\t}\n\n}", "function $httpBackend(method, url, data, callback, headers) {\n var xhr = new MockXhr(),\n expectation = expectations[0],\n wasExpected = false;\n\n function prettyPrint(data) {\n return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp)\n ? data\n : angular.toJson(data);\n }\n\n if (expectation && expectation.match(method, url)) {\n if (!expectation.matchData(data))\n throw Error('Expected ' + expectation + ' with different data\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.data) + '\\nGOT: ' + data);\n\n if (!expectation.matchHeaders(headers))\n throw Error('Expected ' + expectation + ' with different headers\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.headers) + '\\nGOT: ' +\n prettyPrint(headers));\n\n expectations.shift();\n\n if (expectation.response) {\n responses.push(function() {\n var response = expectation.response(method, url, data, headers);\n xhr.$$respHeaders = response[2];\n callback(response[0], response[1], xhr.getAllResponseHeaders());\n });\n return;\n }\n wasExpected = true;\n }\n\n var i = -1, definition;\n while ((definition = definitions[++i])) {\n if (definition.match(method, url, data, headers || {})) {\n if (definition.response) {\n // if $browser specified, we do auto flush all requests\n ($browser ? $browser.defer : responsesPush)(function() {\n var response = definition.response(method, url, data, headers);\n xhr.$$respHeaders = response[2];\n callback(response[0], response[1], xhr.getAllResponseHeaders());\n });\n } else if (definition.passThrough) {\n $delegate(method, url, data, callback, headers);\n } else throw Error('No response defined !');\n return;\n }\n }\n throw wasExpected ?\n Error('No response defined !') :\n Error('Unexpected request: ' + method + ' ' + url + '\\n' +\n (expectation ? 'Expected ' + expectation : 'No more request expected'));\n }", "function $httpBackend(method, url, data, callback, headers) {\n var xhr = new MockXhr(),\n expectation = expectations[0],\n wasExpected = false;\n\n function prettyPrint(data) {\n return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp)\n ? data\n : angular.toJson(data);\n }\n\n if (expectation && expectation.match(method, url)) {\n if (!expectation.matchData(data))\n throw Error('Expected ' + expectation + ' with different data\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.data) + '\\nGOT: ' + data);\n\n if (!expectation.matchHeaders(headers))\n throw Error('Expected ' + expectation + ' with different headers\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.headers) + '\\nGOT: ' +\n prettyPrint(headers));\n\n expectations.shift();\n\n if (expectation.response) {\n responses.push(function() {\n var response = expectation.response(method, url, data, headers);\n xhr.$$respHeaders = response[2];\n callback(response[0], response[1], xhr.getAllResponseHeaders());\n });\n return;\n }\n wasExpected = true;\n }\n\n var i = -1, definition;\n while ((definition = definitions[++i])) {\n if (definition.match(method, url, data, headers || {})) {\n if (definition.response) {\n // if $browser specified, we do auto flush all requests\n ($browser ? $browser.defer : responsesPush)(function() {\n var response = definition.response(method, url, data, headers);\n xhr.$$respHeaders = response[2];\n callback(response[0], response[1], xhr.getAllResponseHeaders());\n });\n } else if (definition.passThrough) {\n $delegate(method, url, data, callback, headers);\n } else throw Error('No response defined !');\n return;\n }\n }\n throw wasExpected ?\n Error('No response defined !') :\n Error('Unexpected request: ' + method + ' ' + url + '\\n' +\n (expectation ? 'Expected ' + expectation : 'No more request expected'));\n }", "function $httpBackend(method, url, data, callback, headers) {\n var xhr = new MockXhr(),\n expectation = expectations[0],\n wasExpected = false;\n\n function prettyPrint(data) {\n return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp)\n ? data\n : angular.toJson(data);\n }\n\n if (expectation && expectation.match(method, url)) {\n if (!expectation.matchData(data))\n throw Error('Expected ' + expectation + ' with different data\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.data) + '\\nGOT: ' + data);\n\n if (!expectation.matchHeaders(headers))\n throw Error('Expected ' + expectation + ' with different headers\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.headers) + '\\nGOT: ' +\n prettyPrint(headers));\n\n expectations.shift();\n\n if (expectation.response) {\n responses.push(function() {\n var response = expectation.response(method, url, data, headers);\n xhr.$$respHeaders = response[2];\n callback(response[0], response[1], xhr.getAllResponseHeaders());\n });\n return;\n }\n wasExpected = true;\n }\n\n var i = -1, definition;\n while ((definition = definitions[++i])) {\n if (definition.match(method, url, data, headers || {})) {\n if (definition.response) {\n // if $browser specified, we do auto flush all requests\n ($browser ? $browser.defer : responsesPush)(function() {\n var response = definition.response(method, url, data, headers);\n xhr.$$respHeaders = response[2];\n callback(response[0], response[1], xhr.getAllResponseHeaders());\n });\n } else if (definition.passThrough) {\n $delegate(method, url, data, callback, headers);\n } else throw Error('No response defined !');\n return;\n }\n }\n throw wasExpected ?\n Error('No response defined !') :\n Error('Unexpected request: ' + method + ' ' + url + '\\n' +\n (expectation ? 'Expected ' + expectation : 'No more request expected'));\n }", "_get(callback, data, id) {\n let err = null; //placeholder for real calls\n //call API - for this example fake an async call with setTimeout\n setTimeout( () => {\n //set the response in the cache - cache exists across\n //multiple calls and this solves a problem with having\n //to make a state existence check in componentWillMount\n let dataToCache = data;\n if (err) {\n dataToCache = err;\n }\n cache.add(id, dataToCache);\n return callback(err, {result: dataToCache, id: id});\n }, 200);\n }", "function sendReq(config, reqData, reqHeaders) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(removePendingReq, removePendingReq);\n return cachedResp;\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString, statusText);\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText : statusText\n });\n }\n\n\n function removePendingReq() {\n var idx = indexOf($http.pendingRequests, config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData, reqHeaders) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(removePendingReq, removePendingReq);\n return cachedResp;\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText : statusText\n });\n }\n\n\n function removePendingReq() {\n var idx = indexOf($http.pendingRequests, config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData, reqHeaders) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(removePendingReq, removePendingReq);\n return cachedResp;\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString, statusText);\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText : statusText\n });\n }\n\n\n function removePendingReq() {\n var idx = indexOf($http.pendingRequests, config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData, reqHeaders) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(removePendingReq, removePendingReq);\n return cachedResp;\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString, statusText);\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText : statusText\n });\n }\n\n\n function removePendingReq() {\n var idx = indexOf($http.pendingRequests, config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData, reqHeaders) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(removePendingReq, removePendingReq);\n return cachedResp;\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString, statusText);\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText : statusText\n });\n }\n\n\n function removePendingReq() {\n var idx = indexOf($http.pendingRequests, config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function $httpBackend(method, url, data, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers) {\n\n var xhr = new MockXhr(),\n expectation = expectations[0],\n wasExpected = false;\n\n xhr.$$events = eventHandlers;\n xhr.upload.$$events = uploadEventHandlers;\n\n function prettyPrint(data) {\n return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp)\n ? data\n : angular.toJson(data);\n }\n\n function wrapResponse(wrapped) {\n if (!$browser && timeout) {\n if (timeout.then) {\n timeout.then(handleTimeout);\n } else {\n $timeout(handleTimeout, timeout);\n }\n }\n\n handleResponse.description = method + ' ' + url;\n return handleResponse;\n\n function handleResponse() {\n var response = wrapped.response(method, url, data, headers, wrapped.params(url));\n xhr.$$respHeaders = response[2];\n callback(copy(response[0]), copy(response[1]), xhr.getAllResponseHeaders(),\n copy(response[3] || ''), copy(response[4]));\n }\n\n function handleTimeout() {\n for (var i = 0, ii = responses.length; i < ii; i++) {\n if (responses[i] === handleResponse) {\n responses.splice(i, 1);\n callback(-1, undefined, '', undefined, 'timeout');\n break;\n }\n }\n }\n }\n\n if (expectation && expectation.match(method, url)) {\n if (!expectation.matchData(data)) {\n throw new Error('Expected ' + expectation + ' with different data\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.data) + '\\nGOT: ' + data);\n }\n\n if (!expectation.matchHeaders(headers)) {\n throw new Error('Expected ' + expectation + ' with different headers\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.headers) + '\\nGOT: ' +\n prettyPrint(headers));\n }\n\n expectations.shift();\n\n if (expectation.response) {\n responses.push(wrapResponse(expectation));\n return;\n }\n wasExpected = true;\n }\n\n var i = -1, definition;\n while ((definition = definitions[++i])) {\n if (definition.match(method, url, data, headers || {})) {\n if (definition.response) {\n // if $browser specified, we do auto flush all requests\n ($browser ? $browser.defer : responsesPush)(wrapResponse(definition));\n } else if (definition.passThrough) {\n originalHttpBackend(method, url, data, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers);\n } else throw new Error('No response defined !');\n return;\n }\n }\n throw wasExpected ?\n new Error('No response defined !') :\n new Error('Unexpected request: ' + method + ' ' + url + '\\n' +\n (expectation ? 'Expected ' + expectation : 'No more request expected'));\n }", "_makeRequest(hash) {\n const method = hash.method || hash.type || 'GET';\n const requestData = { method, type: method, url: hash.url };\n if (isJSONStringifyable(method, hash)) {\n hash.data = JSON.stringify(hash.data);\n }\n pendingRequestCount = pendingRequestCount + 1;\n const jqXHR = (0, _ajax.default)(hash.url, hash);\n const promise = new _promise.default((resolve, reject) => {\n jqXHR.done((payload, textStatus, jqXHR) => {\n const response = this.handleResponse(jqXHR.status, (0, _parseResponseHeaders.default)(jqXHR.getAllResponseHeaders()), payload, requestData);\n if ((0, _errors.isAjaxError)(response)) {\n const rejectionParam = {\n payload,\n textStatus,\n jqXHR,\n response\n };\n Ember.run.join(null, reject, rejectionParam);\n } else {\n const resolutionParam = {\n payload,\n textStatus,\n jqXHR,\n response\n };\n Ember.run.join(null, resolve, resolutionParam);\n }\n }).fail((jqXHR, textStatus, errorThrown) => {\n Ember.runInDebug(function () {\n const message = `The server returned an empty string for ${requestData.type} ${requestData.url}, which cannot be parsed into a valid JSON. Return either null or {}.`;\n const validJSONString = !(textStatus === 'parsererror' && jqXHR.responseText === '');\n (true && Ember.warn(message, validJSONString, {\n id: 'ds.adapter.returned-empty-string-as-JSON'\n }));\n });\n const payload = this.parseErrorResponse(jqXHR.responseText) || errorThrown;\n let response;\n if (textStatus === 'timeout') {\n response = new _errors.TimeoutError();\n } else if (textStatus === 'abort') {\n response = new _errors.AbortError();\n } else {\n response = this.handleResponse(jqXHR.status, (0, _parseResponseHeaders.default)(jqXHR.getAllResponseHeaders()), payload, requestData);\n }\n const rejectionParam = {\n payload,\n textStatus,\n jqXHR,\n errorThrown,\n response\n };\n Ember.run.join(null, reject, rejectionParam);\n }).always(() => {\n pendingRequestCount = pendingRequestCount - 1;\n });\n }, `ember-ajax: ${hash.type} ${hash.url}`);\n promise.xhr = jqXHR;\n return promise;\n }", "function maybeCacheResponse(_a) {\n var response = _a.response, cacheKey = _a.cacheKey, context = _a.context;\n var _b;\n var method = (_b = cacheKey.method) === null || _b === void 0 ? void 0 : _b.toLowerCase();\n if (method && !constants_1.CACHEABLE_METHODS.has(method) && context.cacheRouteMethod !== method) {\n // POSTs should only be cached when the route explicitly defines the method criteria as POST\n response.setHeader(constants_1.HTTP_HEADERS.xXdnCachingStatus, constants_1.CACHING_STATUS.method);\n return false;\n }\n else if (cacheKey.body && Buffer.from(cacheKey.body, 'utf8').length > 8000) {\n // here we ensure that we're counting bytes by reading the string as utf8, which is a single byte per character\n // The 8000 character limit is the maximum size fastly can read from the request body\n response.setHeader(constants_1.HTTP_HEADERS.xXdnCachingStatus, constants_1.CACHING_STATUS.bodyTooBig);\n return false;\n }\n else if (response.statusCode && response.statusCode >= 400) {\n // we don't cache statuses 400 and above\n response.setHeader(constants_1.HTTP_HEADERS.xXdnCachingStatus, constants_1.CACHING_STATUS.code);\n return false;\n }\n else if (response.getHeader(constants_1.HTTP_HEADERS.setCookie)) {\n // we don't cache responses with set-cookie headers as they may contain personal data\n response.setHeader(constants_1.HTTP_HEADERS.xXdnCachingStatus, constants_1.CACHING_STATUS.setCookie);\n return false;\n }\n var cacheParams = getCacheParams(response);\n if (cacheParams.private && !context.forcePrivateCaching) {\n response.setHeader(constants_1.HTTP_HEADERS.xXdnCachingStatus, constants_1.CACHING_STATUS.private);\n return false;\n }\n else if (cacheParams.maxAge) {\n getCache().set(cacheKey.toString(), convertToCachedResponse(response), cacheParams.maxAge * 1000);\n response.setHeader(constants_1.HTTP_HEADERS.xXdnCachingStatus, constants_1.CACHING_STATUS.ok);\n return true;\n }\n else {\n response.setHeader(constants_1.HTTP_HEADERS.xXdnCachingStatus, constants_1.CACHING_STATUS.noMaxAge);\n return false;\n }\n}", "function handleWhenOffline(myOwnCallback) {\n var mutableResponse = new MutableHttpResponse(0, '', '', {});\n\n // Network Timeout\n var simulatedNetworkTimeout = setTimeout(function() {\n console.error('DataCache: a MutableHttpResponse was intercepted and modified without send() in time. Simulated network timeout.');\n ixhr.xhr.abort(); // abort to simulate timeout.\n }, DataCache.TimeoutDuration);\n\n // Allow for an async send() dispatch\n mutableResponse._afterSend = function() {\n clearTimeout(simulatedNetworkTimeout);\n myOwnCallback(mutableResponse);\n }\n\n // Mutable reference will get modified\n server.interceptor(request, mutableResponse);\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "checkResponse(response, intermediateResponse) {\n let requestSuccess = false;\n const id = response ? response.id : undefined;\n let rev;\n if (response && response.ok) {\n rev = response.rev;\n requestSuccess = true;\n }\n\n intermediateResponse.resolve(requestSuccess);\n\n if (id) {\n if (!this.objectQueue[id]) {\n this.objectQueue[id] = new CouchObjectQueue(undefined, rev);\n }\n\n this.objectQueue[id].updateRevision(rev);\n this.objectQueue[id].pending = false;\n if (this.objectQueue[id].hasNext()) {\n this.updateQueued(id);\n }\n }\n }", "function treatIt (response) {\n if (response.status == 200) {\n if (rule.action.cache) {\n // we will update the cache, in background\n cacheManager.put(rule, request, response).then(_=>{\n console.info('Updated in cache: ', request.url);\n });\n }\n console.info('From network: ', request.url);\n return response;\n }\n return cacheManager.get(rule, request, event, matching)\n .then(result=>{\n // if failed to fetch and was not in cache, we look\n // for a fallback response\n const pathName = (new URL(event.request.url)).pathname;\n if(result){\n console.info('From cache(after network failure): ', request.url);\n }\n return result || DSWManager.treatBadPage(response, pathName, event);\n });\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.params);\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function update (req, fallback) {\n if (req.cache === 'only-if-cached' && req.mode !== 'same-origin') {\n return fallback\n }\n\n return self.fetch(req).then(function (response) {\n if (!response.ok) {\n if (fallback) return fallback\n else return response\n }\n cache.put(req, response.clone())\n return response\n }, function (err) {\n if (fallback) return fallback\n throw err\n })\n }", "addResponse( result ) {\n\n const save = Object.assign( {}, result );\n this.responses.set( save.url, save );\n return Promise.resolve();\n\n }", "function cacheRquest() {\n pendingActions.push({ data:data, done:done });\n }", "function sendReq(config,reqData){var deferred=$q.defer(),promise=deferred.promise,cache,cachedResp,reqHeaders=config.headers,url=buildUrl(config.url,config.paramSerializer(config.params));$http.pendingRequests.push(config);promise.then(removePendingReq,removePendingReq);if((config.cache||defaults.cache)&&config.cache!==false&&(config.method==='GET'||config.method==='JSONP')){cache=isObject(config.cache)?config.cache:isObject(defaults.cache)?defaults.cache:defaultCache;}if(cache){cachedResp=cache.get(url);if(isDefined(cachedResp)){if(isPromiseLike(cachedResp)){// cached request has already been sent, but there is no response yet\n\tcachedResp.then(resolvePromiseWithResult,resolvePromiseWithResult);}else{// serving from cache\n\tif(isArray(cachedResp)){resolvePromise(cachedResp[1],cachedResp[0],shallowCopy(cachedResp[2]),cachedResp[3]);}else{resolvePromise(cachedResp,200,{},'OK');}}}else{// put the promise for the non-transformed response into cache as a placeholder\n\tcache.put(url,promise);}}// if we won't have the response in cache, set the xsrf headers and\n\t// send the request to the backend\n\tif(isUndefined(cachedResp)){var xsrfValue=urlIsSameOrigin(config.url)?$$cookieReader()[config.xsrfCookieName||defaults.xsrfCookieName]:undefined;if(xsrfValue){reqHeaders[config.xsrfHeaderName||defaults.xsrfHeaderName]=xsrfValue;}$httpBackend(config.method,url,reqData,done,reqHeaders,config.timeout,config.withCredentials,config.responseType,createApplyHandlers(config.eventHandlers),createApplyHandlers(config.uploadEventHandlers));}return promise;function createApplyHandlers(eventHandlers){if(eventHandlers){var applyHandlers={};forEach(eventHandlers,function(eventHandler,key){applyHandlers[key]=function(event){if(useApplyAsync){$rootScope.$applyAsync(callEventHandler);}else if($rootScope.$$phase){callEventHandler();}else{$rootScope.$apply(callEventHandler);}function callEventHandler(){eventHandler(event);}};});return applyHandlers;}}/**\n\t * Callback registered to $httpBackend():\n\t * - caches the response if desired\n\t * - resolves the raw $http promise\n\t * - calls $apply\n\t */function done(status,response,headersString,statusText){if(cache){if(isSuccess(status)){cache.put(url,[status,response,parseHeaders(headersString),statusText]);}else{// remove promise from the cache\n\tcache.remove(url);}}function resolveHttpPromise(){resolvePromise(response,status,headersString,statusText);}if(useApplyAsync){$rootScope.$applyAsync(resolveHttpPromise);}else{resolveHttpPromise();if(!$rootScope.$$phase)$rootScope.$apply();}}/**\n\t * Resolves the raw $http promise.\n\t */function resolvePromise(response,status,headers,statusText){//status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n\tstatus=status>=-1?status:0;(isSuccess(status)?deferred.resolve:deferred.reject)({data:response,status:status,headers:headersGetter(headers),config:config,statusText:statusText});}function resolvePromiseWithResult(result){resolvePromise(result.data,result.status,shallowCopy(result.headers()),result.statusText);}function removePendingReq(){var idx=$http.pendingRequests.indexOf(config);if(idx!==-1)$http.pendingRequests.splice(idx,1);}}", "function myHttpInterceptor($q, $rootScope) {\n var loadingCount = 0;\n return {\n request: function (config) {\n if(++loadingCount === 1) $rootScope.$broadcast('loading:progress');\n return config || $q.when(config);\n },\n\n response: function (response) {\n if(--loadingCount === 0) $rootScope.$broadcast('loading:finish');\n return response || $q.when(response);\n },\n\n responseError: function (response) {\n if(--loadingCount === 0) $rootScope.$broadcast('loading:finish');\n return $q.reject(response);\n }\n };\n\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType,\n createApplyHandlers(config.eventHandlers),\n createApplyHandlers(config.uploadEventHandlers));\n }\n\n return promise;\n\n function createApplyHandlers(eventHandlers) {\n if (eventHandlers) {\n var applyHandlers = {};\n forEach(eventHandlers, function(eventHandler, key) {\n applyHandlers[key] = function(event) {\n if (useApplyAsync) {\n $rootScope.$applyAsync(callEventHandler);\n } else if ($rootScope.$$phase) {\n callEventHandler();\n } else {\n $rootScope.$apply(callEventHandler);\n }\n\n function callEventHandler() {\n eventHandler(event);\n }\n };\n });\n return applyHandlers;\n }\n }\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType,\n createApplyHandlers(config.eventHandlers),\n createApplyHandlers(config.uploadEventHandlers));\n }\n\n return promise;\n\n function createApplyHandlers(eventHandlers) {\n if (eventHandlers) {\n var applyHandlers = {};\n forEach(eventHandlers, function(eventHandler, key) {\n applyHandlers[key] = function(event) {\n if (useApplyAsync) {\n $rootScope.$applyAsync(callEventHandler);\n } else if ($rootScope.$$phase) {\n callEventHandler();\n } else {\n $rootScope.$apply(callEventHandler);\n }\n\n function callEventHandler() {\n eventHandler(event);\n }\n };\n });\n return applyHandlers;\n }\n }\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }" ]
[ "0.71073914", "0.6958274", "0.66502565", "0.6382597", "0.63252", "0.6320613", "0.6296229", "0.6281358", "0.6281358", "0.6281358", "0.6281358", "0.6281358", "0.6038933", "0.6038933", "0.6038933", "0.6038933", "0.6038933", "0.5976504", "0.59484917", "0.5925191", "0.5925191", "0.5925191", "0.5912158", "0.5912158", "0.5912158", "0.5865462", "0.58561325", "0.58175474", "0.5807757", "0.57863706", "0.5783003", "0.5783003", "0.577305", "0.5754599", "0.57272404", "0.5692097", "0.5668734", "0.5668734", "0.5668734", "0.5656002", "0.5592966", "0.5592966", "0.5592966", "0.5592966", "0.5592966", "0.55835295", "0.55649567", "0.5562697", "0.54745245", "0.54310936", "0.54310936", "0.54310936", "0.54310936", "0.54310936", "0.54310936", "0.54310936", "0.54310936", "0.54310936", "0.54310936", "0.54310936", "0.54310936", "0.53971976", "0.5396742", "0.5395132", "0.5395132", "0.5395132", "0.5395132", "0.5395132", "0.53505254", "0.5344967", "0.5343565", "0.5343545", "0.53212553", "0.53117734", "0.53117734" ]
0.62438637
35
Resolves the raw $http promise.
function resolvePromise(response, status, headers, statusText) { //status: HTTP response status code, 0, -1 (aborted by timeout / promise) status = status >= -1 ? status : 0; (isSuccess(status) ? deferred.resolve : deferred.reject)({ data: response, status: status, headers: headersGetter(headers), config: config, statusText: statusText }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resolvePromise(response, status, headers, statusText) {\n\t\t\t\t\t\t// normalize internal statuses to 0\n\t\t\t\t\t\tstatus = Math.max(status, 0);\n\n\t\t\t\t\t\t(isSuccess(status) ? deferred.resolve : deferred.reject)({\n\t\t\t\t\t\t\tdata: response,\n\t\t\t\t\t\t\tstatus: status,\n\t\t\t\t\t\t\theaders: headersGetter(headers),\n\t\t\t\t\t\t\tconfig: config,\n\t\t\t\t\t\t\tstatusText: statusText\n\t\t\t\t\t\t});\n\t\t\t\t\t}", "function resolvePromise(response, status, headers, statusText) { // 10597\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise) // 10598\n status = status >= -1 ? status : 0; // 10599\n // 10600\n (isSuccess(status) ? deferred.resolve : deferred.reject)({ // 10601\n data: response, // 10602\n status: status, // 10603\n headers: headersGetter(headers), // 10604\n config: config, // 10605\n statusText: statusText // 10606\n }); // 10607\n } // 10608", "function resolvePromise(response,status,headers,statusText){//status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n\tstatus=status>=-1?status:0;(isSuccess(status)?deferred.resolve:deferred.reject)({data:response,status:status,headers:headersGetter(headers),config:config,statusText:statusText});}", "function resolvePromise(response, status, headers, statusText) {\n\t //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n\t status = status >= -1 ? status : 0;\n\n\t (isSuccess(status) ? deferred.resolve : deferred.reject)({\n\t data: response,\n\t status: status,\n\t headers: headersGetter(headers),\n\t config: config,\n\t statusText: statusText\n\t });\n\t }", "function resolvePromise(response,status,headers,statusText){//status: HTTP response status code, 0, -1 (aborted by timeout / promise)\nstatus=status>=-1?status:0;(isSuccess(status)?deferred.resolve:deferred.reject)({data:response,status:status,headers:headersGetter(headers),config:config,statusText:statusText});}", "function resolvePromise(response, status, headers) {\n\t\t\t\t\t// normalize internal statuses to 0\n\t\t\t\t\tstatus = Math.max(status, 0);\n\n\t\t\t\t\t(isSuccess(status) ? deferred.resolve : deferred.reject)({\n\t\t\t\t\t\tdata: response,\n\t\t\t\t\t\tstatus: status,\n\t\t\t\t\t\theaders: headersGetter(headers),\n\t\t\t\t\t\tconfig: config\n\t\t\t\t\t});\n\t\t\t\t}", "function resolvePromise(response, status, headers, statusText, xhrStatus) {\n\t //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n\t status = status >= -1 ? status : 0;\n\n\t (isSuccess(status) ? deferred.resolve : deferred.reject)({\n\t data: response,\n\t status: status,\n\t headers: headersGetter(headers),\n\t config: config,\n\t statusText: statusText,\n\t xhrStatus: xhrStatus\n\t });\n\t }", "function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }", "function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }", "function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }", "function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }", "function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }", "function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }", "function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }", "function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }", "function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText : statusText\n });\n }", "function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText : statusText\n });\n }", "function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText : statusText\n });\n }", "function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText : statusText\n });\n }", "function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText : statusText\n });\n }", "function resolvePromise(response, status, headers, statusText) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText : statusText\n });\n }", "function resolvePromise(response, status, headers) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config\n });\n }", "function resolvePromise(response, status, headers) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config\n });\n }", "function resolvePromise(response, status, headers) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config\n });\n }", "function resolvePromise(response, status, headers) {\n // normalize internal statuses to 0\n status = Math.max(status, 0);\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config\n });\n }", "function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }", "function resolvePromise(response, status, headers, statusText, xhrStatus) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText,\n xhrStatus: xhrStatus\n });\n }", "function resolvePromise(response, status, headers, statusText, xhrStatus) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText,\n xhrStatus: xhrStatus\n });\n }", "function resolvePromise(response, status, headers, statusText, xhrStatus) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText,\n xhrStatus: xhrStatus\n });\n }", "function resolvePromise(response, status, headers, statusText, xhrStatus) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText,\n xhrStatus: xhrStatus\n });\n }", "function resolvePromise(response, status, headers, statusText, xhrStatus) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText,\n xhrStatus: xhrStatus\n });\n }", "static resolve(f) { return new StatefulPromise(Promise.resolve(f)) }", "function _wrapPromise(val) {\n if (val && angular.isFunction(val.then)) {\n return val;\n }\n return $q.resolve(val);\n }", "async resolve(did) {\n return resolver.get({ did });\n }", "__resolvePending() {\n if (!this.__promise) {\n return;\n }\n const { resolve } = this.__promise;\n this.__promise = null;\n return resolve(true);\n }", "function Resolver($q) {\n return function (promises) {\n return $q.all(promises);\n }\n }", "function resolve(v) {\n return defer().resolve(v).promise();\n }", "then(onResolve = function(r) { return r }, onReject = function(e) { throw e }) { return this.wrapped.then(resolve => {\n\t\tif (resolve instanceof Try)\n\t\t\treturn resolve.match(s => onResolve(s), e => onReject(e));\n\t\telse\n\t\t\treturn onResolve(resolve);\n\t}, onReject) }", "static resolve(p) {\n return (p instanceof promise) ? p : new promise((r,j)=>{\n r(p)\n })\n }", "function unwrapHttpResponse( httpRequest ) {\n\n\t\t\treturn(\n\t\t\t\thttpRequest.then(\n\t\t\t\t\tfunction handleResolve( response ) {\n\n\t\t\t\t\t\treturn( response.data );\n\n\t\t\t\t\t},\n\t\t\t\t\tfunction handleReject( response ) {\n\n\t\t\t\t\t\treturn( $q.reject( response.data ) );\n\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t);\n\n\t\t}", "_resolve() {\n // Prevent loopback.\n const promise = this._promise;\n if (!promise) {\n this.dispose();\n return;\n }\n this._promise = null;\n ArrayExt.removeFirstOf(Private.launchQueue, promise.promise);\n this.dispose();\n promise.resolve();\n }", "function promiseResolve(val) {\n\t\t\treturn _resolve(val);\n\t\t}", "function promiseResolve(val) {\n\t\t\treturn _resolve(val);\n\t\t}", "then(resolve, reject) {\n return this.exec().then(resolve, reject);\n }", "resolve(resolveParams) {\n return Promise.resolve();\n }", "function httpGet(url){\n \tvar deferred = $q.defer();\n \tvar promise = deferred.promise;\n\n \t$http.get(serviceBase + url ).then(\n \t\tfunction(response){\n \t\t\treturn deferred.resolve(response.data);\n \t\t}, function(error){\n \t\t\treturn deferred.reject(error);\n \t\t});\n \treturn promise;\n }", "function httpGet(url){\n \tvar deferred = $q.defer();\n \tvar promise = deferred.promise;\n\n \t$http.get(serviceBase + url ).then(\n \t\tfunction(response){\n \t\t\treturn deferred.resolve(response.data);\n \t\t}, function(error){\n \t\t\treturn deferred.reject(error);\n \t\t});\n \treturn promise;\n }", "function request(){\n return raw.apply(null, arguments)\n .then(function(result) {\n return result.response;\n }, null, 'qd-ajax: unwrap raw ajax response');\n}", "function promiseGet (paramsObject) {\n var deferred = $q.defer();\n $http.get(paramsObject.url)\n .success(function(data) {\n deferred.resolve(data);\n })\n .error(function(data) {\n deferred.reject();\n toastr.error(data.error);\n });\n return deferred.promise;\n }", "function r(){var e=this;this.promise=new a.default(function(t,n){e.resolve=t,e.reject=n})}", "then(resolve, reject) {\n return this._deferred.promise.then(resolve, reject);\n }", "function apiGet(uri) {\n var deferred = $q.defer();\n $http({method: 'GET', url: uri})\n .success(function (data, status, headers, config) {\n //$log.debug('angular apiGet: data back: ', uri, data);\n deferred.resolve(data);\n })\n .error(function (data, status, headers, config) {\n deferred.reject(data);\n });\n return deferred.promise;\n }", "function Resolver() {\r\n /**\r\n List of success callbacks\r\n\r\n @property _callbacks\r\n @type Array\r\n @private\r\n **/\r\n this._callbacks = [];\r\n\r\n /**\r\n List of failure callbacks\r\n\r\n @property _errbacks\r\n @type Array\r\n @private\r\n **/\r\n this._errbacks = [];\r\n\r\n /**\r\n The status of the operation. This property may take only one of the following\r\n values: 'pending', 'fulfilled' or 'rejected'.\r\n\r\n @property _status\r\n @type String\r\n @default 'pending'\r\n @private\r\n **/\r\n this._status = 'pending';\r\n\r\n /**\r\n This value that this promise represents.\r\n\r\n @property _result\r\n @type Any\r\n @private\r\n **/\r\n this._result = null;\r\n }", "then(opt_resolve, opt_reject) {\n if (!opt_resolve && !opt_reject) {\n return this.promise_;\n }\n return this.promise_.then(opt_resolve, opt_reject);\n }", "_wrapAndRequest(request, resolve, reject) {\n if (this.getAuthToken()) {\n request.set('Authorization', this.getAuthToken());\n }\n request.end(function (err, result) {\n if (err) {\n reject({status: err.status, result: (result) ? result.body : null});\n } else {\n resolve(result.body);\n }\n });\n }", "_getUnresolvedQuestionDataPromise() {\n\t return new Promise((resolve, reject) => {\n\t this.vm.toResolveNextQuestionData = resolve;\n\t });\n\t }", "function asyncRemoteGet(url) {\n return new Promise(resolve => {\n $http.get({\n url: url,\n handler: ({ data }) => resolve(data)\n });\n });\n}", "function request() {\n return raw.apply(null, arguments).then(function(result) {\n return result.response;\n }, null, 'ic-ajax: unwrap raw ajax response');\n }", "function unwrapPromise() {\n $q.when($scope.options, function (options) {\n $scope.options = options;\n });\n }", "function rawData() {\n if(request.readyState == 4 && request.status == 200) {\n const data = JSON.parse(request.responseText);\n resolve(data);\n } else if(request.readyState == 4) {\n reject(\"Data error: Unable to fetch data\");\n }\n }", "function Q(resolver) {\n if (!angular.isFunction(resolver)) {\n throw new Error('missing resolver function');\n }\n\n var deferred = $q.defer();\n\n function resolveFn(value) {\n deferred.resolve(value);\n }\n\n function rejectFn(reason) {\n deferred.reject(reason);\n }\n\n resolver(resolveFn, rejectFn);\n\n return deferred.promise;\n }", "function wrappedFetch() {\n var wrappedPromise = {};\n\n var promise = new Promise(function (resolve, reject) {\n wrappedPromise.resolve = resolve;\n wrappedPromise.reject = reject;\n });\n\n var args = new Array(arguments.length);\n\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n wrappedPromise.promise = promise;\n\n Promise.resolve().then(function () {\n return fetch.apply(null, args);\n }).then(function (response) {\n wrappedPromise.resolve(response);\n }).catch(function (error) {\n wrappedPromise.reject(error);\n });\n\n return wrappedPromise;\n }", "function done(status,response,headersString,statusText){if(cache){if(isSuccess(status)){cache.put(url,[status,response,parseHeaders(headersString),statusText]);}else{// remove promise from the cache\ncache.remove(url);}}function resolveHttpPromise(){resolvePromise(response,status,headersString,statusText);}if(useApplyAsync){$rootScope.$applyAsync(resolveHttpPromise);}else{resolveHttpPromise();if(!$rootScope.$$phase)$rootScope.$apply();}}", "function resolveAll(response){self.deferred.resolve(response);}", "function createResolve(data) {\n return { data: data };\n }", "resolve() {\n return this.store.resolve(this);\n }", "function $qBluebird(resolve, reject) {\n\t return new Promise(resolve, reject);\n\t}", "_request(resource) {\n let fqdn = this.DOMAIN + resource;\n\n return axios.get(fqdn)\n .then(req => {\n return req.data;\n })\n }", "static resolve(value) {\n return new Promise(resolve => { resolve(value) });\n }", "function resolvePromise(bridgePromise, x, resolve, reject) {\n if (x instanceof MyPromise) {\n if (x.status === PENDING) {\n x.then(\n y => {\n resolvePromise(bridgePromise, y, resolve, reject);\n },\n error => {\n reject(error);\n }\n );\n } else {\n x.then(resolve, reject);\n }\n } else {\n resolve(x);\n }\n}", "function wrapRequest(request){return new PersistencePromise(function(resolve,reject){request.onsuccess=function(event){var result=event.target.result;resolve(result);};request.onerror=function(event){reject(event.target.error);};});}", "function promisify(func) {\n let deferred = $q.defer();\n\n func((response) => {\n if (response && response.error) {\n deferred.reject(response);\n } else {\n deferred.resolve(response);\n }\n\n $rootScope.$apply();\n });\n\n return deferred.promise;\n }", "function promiseResolvedWith(value) {\n var promise = new Promise(function (resolve, reject) {\n resolve(value);\n });\n return promise;\n }", "fetch ($element, $scope) {\n return new Promise(function (resolve, reject) {\n if (typeof $element === 'string') {\n $element = {\n target: $element\n }\n }\n const options = {\n target: $element.attr\n ? $element.attr('data-target')\n : $element.target,\n targetSuffix: $element.attr\n ? $element.attr('data-target-suffix')\n : $element.targetSuffix,\n id: $element.attr ? $element.attr('data-id') : $element.id,\n manifest: $element.attr\n ? $element.attr('data-manifest')\n : $element.manifest,\n decouple: $element.attr\n ? $element.attr('data-decouple')\n : $element.decouple,\n direct: $element.attr\n ? $element.attr('data-direct')\n : $element.direct,\n api: $element.attr ? $element.attr('data-api') : $element.api,\n urlRoot: $element.attr ? $element.attr('data-url-root') : $element.urlRoot\n }\n /* TODO: handle these sorts of shortcuts to the API that components are providing *\n $scope.api = _.isJSON($attrs.api) ? JSON.parse($attrs.api) : false\n const request = {\n api: {\n options: this.options ? this.options : {},\n limit: _.isJSON($attrs.limit) ? JSON.parse($attrs.limit) : 40\n }\n }\n if ($scope.api && _.isObject($scope.api)) {\n request.api = _.extendDeep(request.api, $scope.api)\n }\n /* */\n let completed = 0\n let verify = function () {\n if (!_.isNumber(completed) || completed !== _.size(options)) {\n return\n }\n resolve(AngularRegistry.build(options, $scope))\n }\n _.each(options, function (element, key) {\n if (!element || typeof element !== 'string') {\n completed++\n verify()\n return\n }\n const interpreter = $interpolate(element, false, null, true)\n const initial = interpreter($scope.$parent)\n if (typeof initial !== 'undefined') {\n options[key] = initial\n completed++\n verify()\n return\n }\n if (!Stratus.Environment.get('production')) {\n console.log('poll attribute:', key)\n }\n // TODO: Check if this ever hits a timeout\n _.poll(function () {\n return interpreter($scope.$parent)\n }, 7500, 250)\n .then(function (value) {\n if (!Stratus.Environment.get('production')) {\n console.log('interpreted:', value)\n }\n if (typeof value === 'undefined') {\n return\n }\n options[key] = value\n completed++\n verify()\n })\n .catch(function (message) {\n console.error(message)\n })\n })\n })\n }", "getResolver() {\n if (!this.resolverPromise) {\n this.resolverPromise = this.loadResolver();\n this.resolverPromise.then(this.clearResolverPromise, this.clearResolverPromise);\n }\n return this.resolverPromise;\n }", "function apiCall(obj) {\n return $q(function(resolve, reject) {\n FacebookResource.apiCall(obj).then(function (response) {\n return resolve(response);\n \n }, function (error) {\n return reject(error);\n });\n })\n }", "function todoGet() {\n \t// Inititate the promise to be returned.\n \tvar defer = $q.defer();\n \t// Use $http.get to put the generated API key to use. \n \t$http.get('http://localhost:60401/api/VSTDAs').then(\n\t \tfunction(response) {\n\t \t\t// If the promise succeeds, return the data using the following code.\n\t\t\t\t\tif(typeof response.data === 'object') {\n\t\t\t\t\t\tdefer.resolve(response.data);\n\t\t\t\t\t// If the promise fails, reject the data using the following.\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdefer.reject(response.data);\n\t\t\t\t\t}\n\t \t},\n\t \tfunction(error) {\n\t \t\tdefer.reject(error);\n\t \t}\n\t );\n \treturn defer.promise;\n }", "rawRequest(url, type, options = {}) {\n let opts = this._preRequest(url, options);\n return fetch(url, {\n method: type | 'GET',\n headers: opts.headers | {},\n }).then(response => {\n if (response.status >= 200 && response.status < 300) {\n return Ember.RSVP.resolve(response);\n } else {\n return Ember.RSVP.reject();\n }\n });\n }", "then(resolve, reject) {\r\n this.resetState();\r\n this.reject = reject;\r\n this.state = setTimeout(() => {\r\n try {\r\n resolve();\r\n } catch (error) {\r\n this.onError(error);\r\n }\r\n }, this.timeout);\r\n }", "function _future(value) {\n var deferred = $q.defer();\n\n deferred.resolve(value);\n\n return deferred.promise;\n }", "function uploadedRawFileService($http) {\n return {\n loadUploadList: loadUploadList\n };\n /**\n * Loads the list of uploaded raw files from the server.\n * @returns {Promise} A promise whose value is an array of upload records.\n * @memberOf UploadedRawFileService#\n */\n function loadUploadList() {\n return $http.get('../json/list-unprocessed-uploads.php').then(\n function (response) {\n return response.data;\n },\n function (response) {\n alert(response.statusText + '\\n' + response.data);\n }\n ).then(function (uploadList) {\n var i, m;\n for (i = 0, m = uploadList.length; i < m; i++) {\n uploadList[i].uri = uploadList[i].uri.replace(/^https?:\\/\\/[^\\/]+\\/[^\\/]+\\//, '');\n }\n return uploadList;\n });\n }\n }", "function done(status, response, headersString, statusText) { // 10571\n if (cache) { // 10572\n if (isSuccess(status)) { // 10573\n cache.put(url, [status, response, parseHeaders(headersString), statusText]); // 10574\n } else { // 10575\n // remove promise from the cache // 10576\n cache.remove(url); // 10577\n } // 10578\n } // 10579\n // 10580\n function resolveHttpPromise() { // 10581\n resolvePromise(response, status, headersString, statusText); // 10582\n } // 10583\n // 10584\n if (useApplyAsync) { // 10585\n $rootScope.$applyAsync(resolveHttpPromise); // 10586\n } else { // 10587\n resolveHttpPromise(); // 10588\n if (!$rootScope.$$phase) $rootScope.$apply(); // 10589\n } // 10590\n } // 10591", "function makePromise(tgt) {\n return new Ember.RSVP.Promise(function (resolve) {\n resolve(tgt);\n });\n }", "resolve(data) {\n this.thenFunctions.reduce((inputVal, thenFunc) => {\n return thenFunc(inputVal);\n }, data);\n }" ]
[ "0.6222225", "0.615738", "0.6097995", "0.60894793", "0.6073669", "0.6028588", "0.6026246", "0.59922177", "0.59922177", "0.59922177", "0.59922177", "0.59922177", "0.59922177", "0.59922177", "0.59922177", "0.59900814", "0.59900814", "0.59900814", "0.59900814", "0.59900814", "0.59900814", "0.5960481", "0.5960481", "0.5960481", "0.5960481", "0.59205025", "0.5905412", "0.5905412", "0.5905412", "0.5905412", "0.5905412", "0.57071596", "0.5653309", "0.5624351", "0.55487466", "0.5541182", "0.55174583", "0.5507316", "0.546438", "0.5433234", "0.5415748", "0.5381883", "0.5381883", "0.53680307", "0.53677255", "0.53105336", "0.53105336", "0.52898973", "0.5280666", "0.5272282", "0.5254385", "0.52461004", "0.52425104", "0.5215641", "0.51574314", "0.51287895", "0.5119738", "0.50781274", "0.50528634", "0.50452703", "0.5041249", "0.5029567", "0.5024329", "0.50014144", "0.49904674", "0.4977375", "0.49737358", "0.49565682", "0.4949318", "0.4948001", "0.49228486", "0.49201387", "0.4918395", "0.49150833", "0.4906965", "0.4900315", "0.489573", "0.48791453", "0.4852217", "0.48474416", "0.48415977", "0.48360047", "0.483433", "0.48337767" ]
0.5943121
36
TODO: this is the same as the constantWatchDelegate in parse.js
function constantWatchDelegate(scope, listener, objectEquality, constantInterp) { var unwatch; return unwatch = scope.$watch(function constantInterpolateWatch(scope) { unwatch(); return constantInterp(scope); }, listener, objectEquality); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initWatchVal() {} // 16439", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal(){}", "function initWatchVal(){}", "watch() {\n }", "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n\t var unwatch;\n\t return unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n\t unwatch();\n\t return constantInterp(scope);\n\t }, listener, objectEquality);\n\t }", "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n\t var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n\t unwatch();\n\t return constantInterp(scope);\n\t }, listener, objectEquality);\n\t return unwatch;\n\t }", "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch;\n return unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n }", "function updateWatch() {\n updateTime();\n }", "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n return unwatch;\n }", "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n return unwatch;\n }", "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n return unwatch;\n }", "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n return unwatch;\n }", "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n return unwatch;\n }", "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n return unwatch;\n }", "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n return unwatch;\n }", "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n return unwatch;\n }", "function staticWatcher(newVal) {\n var hash = newVal.indexOf('#');\n if (hash > -1){\n newVal = newVal.substr(hash + 1);\n }\n watcher = function watchHref() {\n modelSetter($scope, ($location.path().indexOf(newVal) > -1));\n };\n watcher();\n }", "function staticWatcher(newVal) {\n var hash = newVal.indexOf('#');\n if (hash > -1){\n newVal = newVal.substr(hash + 1);\n }\n watcher = function watchHref() {\n modelSetter($scope, ($location.path().indexOf(newVal) > -1));\n };\n watcher();\n }", "function watchExp(){\n var obj = parsed(scope);\n return [obj, obj.$priority, obj.$value];\n }", "function watchExp(){\n var obj = parsed(scope);\n return [obj, obj.$priority, obj.$value];\n }", "function staticWatcher(newVal) {\n if ((hash = newVal.indexOf('#')) > -1)\n newVal = newVal.substr(hash + 1);\n watcher = function watchHref() {\n modelSetter($scope, ($location.path().indexOf(newVal) > -1));\n };\n watcher();\n }", "function staticWatcher(newVal) {\n if ((hash = newVal.indexOf('#')) > -1)\n newVal = newVal.substr(hash + 1);\n watcher = function watchHref() {\n modelSetter($scope, ($location.path().indexOf(newVal) > -1));\n };\n watcher();\n }", "get isWatching(){ return this._isWatching }", "function analogueWatch(){\n \n\n \n}", "function updateWatch() {\n updateTime();\n updateDate(0);\n }", "watch() {\n this._createDelayedRequest(0);\n }", "function setupWatch(freq) {\n // global var here so it can be cleared on logout (or whenever).\n activeWatch = setInterval(watchLocation, freq);\n }", "function addWatches() {\n scope.watcher = watchClass();\n }", "function _watchLocateEngineProperties(id, oldval, newval) {\n\t\tif (oldval !== newval) _serializeLocateEngines();\n\t\treturn newval;\n\t}", "function setWatchlist() {\n\twatchlist = new Watchlist();\n}", "watchUserConfig () {\n this.watchFiles = [\n '.vuepress/config.js',\n '.vuepress/config.yml',\n '.vuepress/config.toml'\n ].concat(\n (\n this.context.siteConfig.extraWatchFiles || []\n ).map(file => normalizeWatchFilePath(file, this.context.sourceDir))\n )\n\n logger.debug('watchFiles', this.watchFiles)\n\n this.configWatcher = chokidar.watch(this.watchFiles, {\n cwd: this.context.sourceDir,\n ignoreInitial: true\n })\n\n this.configWatcher.on('change', target => this.handleUpdate('change', target))\n }", "async function watch_js() {\n return watch([configs.js.watch], series(compil_js));\n}", "function Constants() {}", "function Constants() {}", "watch (usePolling = false) {\n if (this.isBeingWatched) return\n const { from } = this.data\n const options = { usePolling, ignored: /(^|[\\/\\\\])\\../ }\n const switchCallback = (eventName, fromRelative) =>\n this.switchCallback(eventName, fromRelative, true)\n this.watcher = chokidar.watch(from, options).on('all', switchCallback)\n this.isBeingWatched = true\n }", "function newWatchFn(pojo_, fk) {\n return function () {\n return pojo_[fk];\n };\n}", "function setWatch(params) {\n web3APIs.getLogsAndInsertInSQLite(params)\n}", "function cb$watch(value) {\n console.log('cambiando formato!!!!');\n \t\t\t\tformat = value;\n \t\t\t\tupdateTime();\n \t\t\t}", "function watch() {\n gulp.watch(paths.stylusWatch, gulp.series('css'));\n gulp.watch(paths.pugWatch, gulp.series('html'));\n}", "_watch() {\n\t\tconst watchHandler = this._createAppDefinitions.bind(this);\n\t\tthis._componentFinder.watch();\n\t\tthis._componentFinder\n\t\t\t.on('add', watchHandler)\n\t\t\t.on('unlink', watchHandler)\n\t\t\t.on('changeTemplates', watchHandler);\n\n\t\tthis._storeFinder.watch();\n\t\tthis._storeFinder\n\t\t\t.on('add', watchHandler)\n\t\t\t.on('unlink', watchHandler);\n\t}", "function reportWatchStatusChanged(diagnostic) {\n console.info(ts.formatDiagnostic(diagnostic, formatHost));\n}", "function fsWatchBroadcast(fullPath, type, val1, val2, val3) {\n if (!FsWatchInstances[fullPath]) return;\n FsWatchInstances[fullPath][type].forEach(function (listener) {\n listener(val1, val2, val3);\n });\n}", "function fsWatchBroadcast(fullPath, type, val1, val2, val3) {\n if (!FsWatchInstances[fullPath]) return;\n FsWatchInstances[fullPath][type].forEach(function(listener) {\n listener(val1, val2, val3);\n });\n}", "function startWatch() {\n\n\t\t\t// Update acceleration every x seconds\n\t\t\tvar options = { frequency: 100 };\n\n\t\t\twatchID = navigator.accelerometer.watchAcceleration(onSuccess, onError, options);\n\t\t}", "_variablesChanged() {}", "function Watcher()\n\t{\n\t\tthis._callbacks = [];\n\t\tthis._callbacksDone = [];\n\t\tthis._callbackArgs = []; // array of argument arrays which are returned by callbacks\n\t\tthis._callbackArgsByKey = {}; // map of callbackKeyStr to callback arguments array\n\t\tthis._started = false;\n\t}", "function watchAttr(attrs, selector, type, getValue) {\n var element = $(selector).get(0);\n if (element) {\n if (getValue === undefined) {\n getValue = function(el, attr) { return el.getAttribute(attr); };\n }\n var observer = new MutationObserver(function (mutations) {\n mutations.forEach(function(mutation) { post(type, getValue(mutation.target, mutation.attributeName)); });\n });\n observers.push(observer);\n observer.observe(element, { attributes: true, attributeFilter: attrs.split(\" \") });\n post(type, getValue(element, attrs));//trigger once to initialize the info\n } else {\n console.error(\"element does not exist (did Google change their site?): \" + selector);\n }\n }", "function watch() {\n gulp.watch(\n [\n pathConfig.move[0].src,\n pathConfig.move[0].exclude[0],\n pathConfig.move[0].exclude[1],\n pathConfig.move[0].exclude[2]\n ],\n move\n );\n gulp.watch(\n [\n pathConfig.img[0].src,\n pathConfig.img[0].exclude[0]\n ],\n img\n );\n gulp.watch(\n \"./src/img/vector/\",\n svgSprite\n );\n gulp.watch(\n [\n pathConfig.js[0].src,\n pathConfig.js[1].src\n ],\n js\n );\n gulp.watch(\n [\n pathConfig.css[0].src,\n pathConfig.css[1].src\n ],\n css\n );\n}", "function watchingJS(cb) {\n watch(watchedJS, buildJS);\n cb();\n}", "function watch() {\n gulp.watch(paths.lessWatch, css);\n gulp.watch(paths.pug, html);\n gulp.watch(paths.js, js);\n}" ]
[ "0.7015519", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.7009676", "0.69382685", "0.69382685", "0.646157", "0.6187059", "0.6060594", "0.59985495", "0.5766696", "0.57659465", "0.57659465", "0.57659465", "0.57659465", "0.57659465", "0.57659465", "0.57659465", "0.57659465", "0.56815547", "0.56815547", "0.56646395", "0.56646395", "0.56630415", "0.56630415", "0.5626489", "0.55664736", "0.55232614", "0.5325677", "0.5260311", "0.5195101", "0.5194458", "0.51435906", "0.511434", "0.50619864", "0.5052891", "0.5052891", "0.50328016", "0.50134605", "0.50115734", "0.49714088", "0.49662945", "0.4955173", "0.49505046", "0.49329647", "0.4932356", "0.49021637", "0.49017766", "0.48456025", "0.4843538", "0.4831177", "0.48309118", "0.481998" ]
0.59882176
57
return the server only (scheme://host:port)
function serverBase(url) { return url.substring(0, url.indexOf('/', url.indexOf('//') + 2)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getServerUrl() {\n const {\n host,\n port\n } = this.serverConfig;\n return `//${host || 'localhost'}:${port}`;\n }", "get serverUrl() {\n return `http://${this.host}:${this.port}`;\n }", "function getSocketAddress(){\n if(location.port === '3000') {\n const host = location.host.split(':')[0];\n return 'http://'+host+':8080';\n } else {\n return location.origin;\n }\n}", "address() {\n const address = this.server.address();\n const endpoint = typeof address !== \"string\"\n ? (address.address === \"::\" ? \"localhost\" : address.address) + \":\" + address.port\n : address;\n return `${this.protocol}://${endpoint}`;\n }", "function getServerURL() {\n const url = isDev ? \"http://localhost:4000\" : document.location.host;\n log(\"Requested server: \", url);\n return url;\n}", "function SERVER_HTTP_HOST(){\n\tvar url = window.location.href;\n\turl = url.replace(\"http://\", \"\"); \n\t\n\tvar urlExplode = url.split(\"/\");\n\tvar serverName = urlExplode[0];\n\t\n\tserverName = \"http://\"+serverName;\n\treturn serverName;\n}", "function get_ws_server_address(){\n\treturn (document.location.protocol == \"https:\" ? \"wss:\":\"ws:\") + \"//\" + location.host;\n }", "function getHost() {\n return window.location.host.split('.').slice(-2).join('.');\n}", "function serverBase(url){return url.substring(0,url.indexOf('/',url.indexOf('//')+2));}", "function serverBase(url){return url.substring(0,url.indexOf('/',url.indexOf('//')+2));}", "function getServerURL(host = \"localhost\", port = \"4000\", allowSSL = true) {\n // Check for SSL\n if (allowSSL && null) {\n const stub = `https://${host || \"localhost\"}`;\n\n // If we're on port 443, that's 'regular' SSL so no need to specify port\n if (null === '443') return stub;\n return `${stub}:${null}`;\n }\n\n // Plain HTTP\n const stub = `http://${host || \"localhost\"}`;\n\n // If we're on port 80, that's 'regular' HTTP so no need to specify port\n if (port === '80') return stub;\n return `${stub}:${port}`;\n}", "function getHostURL() {\n var hostURL = window.location.protocol + '//' + window.location.hostname + ':' + host_port;\n return hostURL;\n}", "server(server) {\n if (server) {\n return $location.search('server', server);\n }\n return $location.search().server || PUPPETDB_SERVERS[0][0];\n }", "function LocalHost()\n{\n\t/*\n\tTODO: This returns an empty string when running cgiserver.py\n\t*/\n\tpathArray = location.href;\n\tidxLastSlash = pathArray.lastIndexOf(\"/\");\n\treturn pathArray.substring(0,idxLastSlash);\n}", "getRedirectUri() {\n if (!this.server) {\n throw NodeAuthError.createNoLoopbackServerExistsError();\n }\n const address = this.server.address();\n if (!address || typeof address === \"string\" || !address.port) {\n this.closeServer();\n throw NodeAuthError.createInvalidLoopbackAddressTypeError();\n }\n const port = address && address.port;\n return `${Constants.HTTP_PROTOCOL}${Constants.LOCALHOST}:${port}`;\n }", "function serverBase(url) {\n\t return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n\t}", "function serverBase(url) {\n\t return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n\t}", "function getHost(){\n\t\treturn this.host;\n\t}", "function getHost() {\n\t\tvar host = getQueryParam('host');\n\t\tif (host) {\n\t\t\tif (host.lastIndexOf('http',0) === -1) {\n\t\t\t\thost = 'http://'+host;\n\t\t\t}\n\t\t} else {\n\t\t\thost = ''; // production/default host\n\t\t}\n\t\treturn host;\n\t}", "static get port() {}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n }", "function serverBase(url) {\n\t\treturn url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n\t}", "get host() {\n return window.location.host\n }", "function isLocalhost(){\n return window.location.origin.includes(\"localhost\");\n}", "function serverBase(url) { // 11458\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2)); // 11459\n} // 11460", "static get dedicatedServer() {}", "function getPort() {\n return server.get('port');\n}", "get server() {\n\t\treturn this._server;\n\t}", "function GetServerName(){\n\tvar ServerName = \"\";\n\tvar sentenceIni = window.location.href;\n\tvar sentence1 = \"http://\";\n\tvar sentence2 = \"/game/\";\n\tvar pos1 = sentenceIni.indexOf(sentence1,0);\n\tif (pos1 >= 0 ){\n\t\tvar pos2 = sentenceIni.indexOf(sentence2,pos1+sentence1.length);\n\t\tServerName = sentenceIni.substring(pos1+sentence1.length,pos2);\n\t}\n\t//alert(ServerName);\n\treturn ServerName;\n}", "function GetServerName(){\n\tvar ServerName = \"\";\n\tvar sentenceIni = window.location.href;\n\tvar sentence1 = \"http://\";\n\tvar sentence2 = \"/game/\";\n\tvar pos1 = sentenceIni.indexOf(sentence1,0);\n\tif (pos1 >= 0 ){\n\t\tvar pos2 = sentenceIni.indexOf(sentence2,pos1+sentence1.length);\n\t\tServerName = sentenceIni.substring(pos1+sentence1.length,pos2);\n\t}\n\t//alert(ServerName);\n\treturn ServerName;\n}", "function getServerUrl() {\n return useLocalServer ? SERVER_URL_UPDATE_LOCAL : SERVER_URL_UPDATE\n}", "get_url() {\n\t\treturn config.zeromq.proto + '://' + config.zeromq.host + ':' + config.zeromq.port;\n\t}", "function setURL() {\n var proto;\n var url;\n var port;\n if (window.location.protocol == \"http:\") {\n proto = \"ws://\";\n port = \"8080\";\n } else {\n proto = \"wss://\";\n port = \"8443\";\n }\n\n url = proto + window.location.hostname + \":\" + port;\n return url;\n}", "function GetAddr(sock)\n{\n var addr = sock.remoteAddress.replace('::ffff:','');\n if (addr == '::1') addr = 'localhost';\n return addr;\n}", "function NiceHostname()\n{\n\tif (location.hostname == \"127.0.0.1\")\n\t\treturn \"localhost\";\n\treturn location.hostname;\n}", "getServer() {\n\n return this.server;\n }", "function getBaseURL() {\n if (__CLIENT__) {\n return window.location.origin;\n } else if (process.env.DOCKER === 'true') {\n return `http://${config.hosts.django}:${config.ports.django}`;\n }\n\n return `http://localhost:${config.ports.django}`;\n}", "function getHost() {\n // todo: change by setting using Sails config\n return {host: process.env.HOST || 'http://localhost:1337'};\n }", "function getServerPath(){\n return SERVER_PATH;\n }", "get _selfRestServerAlias() { return this.netFlavor.selfRestServer; }", "getServer() {\n return this.server;\n }", "function getSocketURI () {\n var protocol = (window.location.protocol === 'https:') ? 'wss' : 'ws'\n return `${protocol}://${window.location.host}/ws`\n}", "get httpServer() {\n return this._httpServer;\n }", "function addScheme(hostOrURL) {\n if (hostOrURL.match(/^http/)) {\n return hostOrURL;\n } else if (hostOrURL.match(/^localhost(:\\d+)?$/)) {\n return \"http://\" + hostOrURL;\n } else {\n return \"https://\" + hostOrURL;\n }\n}", "static REMOTE_SERVER_URL(collection, parameter, urlParametersAsString) {\n\t\tconst port = 1337;\n\t\tlet url = `http://localhost:${port}/${collection}/`;\n\t\tif (parameter) {\n\t\t\turl += `${parameter}/`;\n\t\t}\n\t\tif (urlParametersAsString) {\n\t\t\turl += `?${urlParametersAsString}`;\n\t\t}\n\t\treturn url;\n\t}", "function getTargetServer(){\n const index = Math.floor(Math.random()*appServers.length)\n console.log(index,appServers.length)\n const server = appServers[index]\n if(!server){\n return null;\n }\n return server\n}", "function detectHost() {\n\t\tvar host;\n\t\thost = (location.hostname.indexOf(\"10.128\") === 0) ? \"localhost\" : location.hostname;\n\n\t\tswitch (host) {\n\t\t\tcase \"localhost\":\n\t\t\tcase \"127.0.0.1\":\n\t\t\tcase \"skynet\":\n\t\t\tcase \"skynet-1\":\n\t\t\t\thost = \"local\";\n\t\t\t\tbreak;\n\t\t\tcase \"www.csps-efpc.gc.ca\":\n\t\t\tcase \"csps-efpc.gc.ca\":\n\t\t\t\thost = \"public\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\thost = \"prod\";\n\t\t\t\tbreak;\n\t\t}\n\t\t//console.log(host);\n\t\treturn host;\n\n\t}", "function _getServerURL() {\r\n var breakPoints = [ 'docs', 'test' ];\r\n var oldArr = location.href.split( '/' );\r\n var newArr = [];\r\n\r\n for( var i = 0; i < oldArr.length; i++ ) {\r\n if( breakPoints.indexOf( oldArr[ i ] ) !== -1 ) break;\r\n\r\n newArr.push( oldArr[ i ] );\r\n }\r\n\r\n newArr.push( 'server/' );\r\n\r\n return newArr.join( '/' );\r\n }", "function r(e){return e.socket?e.socket.remoteAddress:e.connection.remoteAddress}", "get liveServiceHostname() {\n return url.format({\n protocol: this.liveServiceProtocol,\n host: this.liveServiceHost\n });\n }", "function getTargetUrl() {\n var url = options.server.url;\n if (options.server.zPort) {\n url = url.replace(/^https\\:/, 'http:');\n if (url.match(/\\:(\\d+)/)) {\n url = url.replace(/\\:(\\d+)/, ':' + options.server.zPort);\n } else {\n url += ':' + options.server.zPort;\n }\n }\n url += options.zendesk.path;\n return url;\n }", "function constructIgUri(igServer){\n var uri = \"\";\n\n uri = igServer.protocol + \"://\" + igServer.host\n\n return uri;\n}", "function getSocketUrl(urlParts, loc) {\n var auth = urlParts.auth,\n query = urlParts.query;\n var hostname = urlParts.hostname,\n protocol = urlParts.protocol,\n port = urlParts.port;\n\n if (!port || port === '0') {\n port = loc.port;\n } // check ipv4 and ipv6 `all hostname`\n // why do we need this check?\n // hostname n/a for file protocol (example, when using electron, ionic)\n // see: https://github.com/webpack/webpack-dev-server/pull/384\n\n\n if ((hostname === '0.0.0.0' || hostname === '::') && loc.hostname && loc.protocol.indexOf('http') === 0) {\n hostname = loc.hostname;\n } // `hostname` can be empty when the script path is relative. In that case, specifying\n // a protocol would result in an invalid URL.\n // When https is used in the app, secure websockets are always necessary\n // because the browser doesn't accept non-secure websockets.\n\n\n if (hostname && hostname !== '127.0.0.1' && (loc.protocol === 'https:' || urlParts.hostname === '0.0.0.0')) {\n protocol = loc.protocol;\n } // all of these sock url params are optionally passed in through\n // resourceQuery, so we need to fall back to the default if\n // they are not provided\n\n\n var sockHost = query.sockHost || hostname;\n var sockPath = query.sockPath || '/sockjs-node';\n var sockPort = query.sockPort || port;\n\n if (sockPort === 'location') {\n sockPort = loc.port;\n }\n\n return url.format({\n protocol: protocol,\n auth: auth,\n hostname: sockHost,\n port: sockPort,\n // If sockPath is provided it'll be passed in via the resourceQuery as a\n // query param so it has to be parsed out of the querystring in order for the\n // client to open the socket to the correct location.\n pathname: sockPath\n });\n}", "function getSocketUrl(urlParts, loc) {\n var auth = urlParts.auth,\n query = urlParts.query;\n var hostname = urlParts.hostname,\n protocol = urlParts.protocol,\n port = urlParts.port;\n\n if (!port || port === '0') {\n port = loc.port;\n } // check ipv4 and ipv6 `all hostname`\n // why do we need this check?\n // hostname n/a for file protocol (example, when using electron, ionic)\n // see: https://github.com/webpack/webpack-dev-server/pull/384\n\n\n if ((hostname === '0.0.0.0' || hostname === '::') && loc.hostname && loc.protocol.indexOf('http') === 0) {\n hostname = loc.hostname;\n } // `hostname` can be empty when the script path is relative. In that case, specifying\n // a protocol would result in an invalid URL.\n // When https is used in the app, secure websockets are always necessary\n // because the browser doesn't accept non-secure websockets.\n\n\n if (hostname && hostname !== '127.0.0.1' && (loc.protocol === 'https:' || urlParts.hostname === '0.0.0.0')) {\n protocol = loc.protocol;\n } // all of these sock url params are optionally passed in through\n // resourceQuery, so we need to fall back to the default if\n // they are not provided\n\n\n var sockHost = query.sockHost || hostname;\n var sockPath = query.sockPath || '/sockjs-node';\n var sockPort = query.sockPort || port;\n\n if (sockPort === 'location') {\n sockPort = loc.port;\n }\n\n return url.format({\n protocol: protocol,\n auth: auth,\n hostname: sockHost,\n port: sockPort,\n // If sockPath is provided it'll be passed in via the resourceQuery as a\n // query param so it has to be parsed out of the querystring in order for the\n // client to open the socket to the correct location.\n pathname: sockPath\n });\n}", "function getSocketUrl(urlParts, loc) {\n var auth = urlParts.auth,\n query = urlParts.query;\n var hostname = urlParts.hostname,\n protocol = urlParts.protocol,\n port = urlParts.port;\n\n if (!port || port === '0') {\n port = loc.port;\n } // check ipv4 and ipv6 `all hostname`\n // why do we need this check?\n // hostname n/a for file protocol (example, when using electron, ionic)\n // see: https://github.com/webpack/webpack-dev-server/pull/384\n\n\n if ((hostname === '0.0.0.0' || hostname === '::') && loc.hostname && loc.protocol.indexOf('http') === 0) {\n hostname = loc.hostname;\n } // `hostname` can be empty when the script path is relative. In that case, specifying\n // a protocol would result in an invalid URL.\n // When https is used in the app, secure websockets are always necessary\n // because the browser doesn't accept non-secure websockets.\n\n\n if (hostname && hostname !== '127.0.0.1' && (loc.protocol === 'https:' || urlParts.hostname === '0.0.0.0')) {\n protocol = loc.protocol;\n } // all of these sock url params are optionally passed in through\n // resourceQuery, so we need to fall back to the default if\n // they are not provided\n\n\n var sockHost = query.sockHost || hostname;\n var sockPath = query.sockPath || '/sockjs-node';\n var sockPort = query.sockPort || port;\n\n if (sockPort === 'location') {\n sockPort = loc.port;\n }\n\n return url.format({\n protocol: protocol,\n auth: auth,\n hostname: sockHost,\n port: sockPort,\n // If sockPath is provided it'll be passed in via the resourceQuery as a\n // query param so it has to be parsed out of the querystring in order for the\n // client to open the socket to the correct location.\n pathname: sockPath\n });\n}", "function getSocketUrl(urlParts, loc) {\n var auth = urlParts.auth,\n query = urlParts.query;\n var hostname = urlParts.hostname,\n protocol = urlParts.protocol,\n port = urlParts.port;\n\n if (!port || port === '0') {\n port = loc.port;\n } // check ipv4 and ipv6 `all hostname`\n // why do we need this check?\n // hostname n/a for file protocol (example, when using electron, ionic)\n // see: https://github.com/webpack/webpack-dev-server/pull/384\n\n\n if ((hostname === '0.0.0.0' || hostname === '::') && loc.hostname && loc.protocol.indexOf('http') === 0) {\n hostname = loc.hostname;\n } // `hostname` can be empty when the script path is relative. In that case, specifying\n // a protocol would result in an invalid URL.\n // When https is used in the app, secure websockets are always necessary\n // because the browser doesn't accept non-secure websockets.\n\n\n if (hostname && hostname !== '127.0.0.1' && (loc.protocol === 'https:' || urlParts.hostname === '0.0.0.0')) {\n protocol = loc.protocol;\n } // all of these sock url params are optionally passed in through\n // resourceQuery, so we need to fall back to the default if\n // they are not provided\n\n\n var sockHost = query.sockHost || hostname;\n var sockPath = query.sockPath || '/sockjs-node';\n var sockPort = query.sockPort || port;\n\n if (sockPort === 'location') {\n sockPort = loc.port;\n }\n\n return url.format({\n protocol: protocol,\n auth: auth,\n hostname: sockHost,\n port: sockPort,\n // If sockPath is provided it'll be passed in via the resourceQuery as a\n // query param so it has to be parsed out of the querystring in order for the\n // client to open the socket to the correct location.\n pathname: sockPath\n });\n}", "function getSocketUrl(urlParts, loc) {\n var auth = urlParts.auth,\n query = urlParts.query;\n var hostname = urlParts.hostname,\n protocol = urlParts.protocol,\n port = urlParts.port;\n\n if (!port || port === '0') {\n port = loc.port;\n } // check ipv4 and ipv6 `all hostname`\n // why do we need this check?\n // hostname n/a for file protocol (example, when using electron, ionic)\n // see: https://github.com/webpack/webpack-dev-server/pull/384\n\n\n if ((hostname === '0.0.0.0' || hostname === '::') && loc.hostname && loc.protocol.indexOf('http') === 0) {\n hostname = loc.hostname;\n } // `hostname` can be empty when the script path is relative. In that case, specifying\n // a protocol would result in an invalid URL.\n // When https is used in the app, secure websockets are always necessary\n // because the browser doesn't accept non-secure websockets.\n\n\n if (hostname && hostname !== '127.0.0.1' && (loc.protocol === 'https:' || urlParts.hostname === '0.0.0.0')) {\n protocol = loc.protocol;\n } // all of these sock url params are optionally passed in through\n // resourceQuery, so we need to fall back to the default if\n // they are not provided\n\n\n var sockHost = query.sockHost || hostname;\n var sockPath = query.sockPath || '/sockjs-node';\n var sockPort = query.sockPort || port;\n\n if (sockPort === 'location') {\n sockPort = loc.port;\n }\n\n return url.format({\n protocol: protocol,\n auth: auth,\n hostname: sockHost,\n port: sockPort,\n // If sockPath is provided it'll be passed in via the resourceQuery as a\n // query param so it has to be parsed out of the querystring in order for the\n // client to open the socket to the correct location.\n pathname: sockPath\n });\n}", "function getSocketUrl(urlParts, loc) {\n var auth = urlParts.auth,\n query = urlParts.query;\n var hostname = urlParts.hostname,\n protocol = urlParts.protocol,\n port = urlParts.port;\n\n if (!port || port === '0') {\n port = loc.port;\n } // check ipv4 and ipv6 `all hostname`\n // why do we need this check?\n // hostname n/a for file protocol (example, when using electron, ionic)\n // see: https://github.com/webpack/webpack-dev-server/pull/384\n\n\n if ((hostname === '0.0.0.0' || hostname === '::') && loc.hostname && loc.protocol.indexOf('http') === 0) {\n hostname = loc.hostname;\n } // `hostname` can be empty when the script path is relative. In that case, specifying\n // a protocol would result in an invalid URL.\n // When https is used in the app, secure websockets are always necessary\n // because the browser doesn't accept non-secure websockets.\n\n\n if (hostname && hostname !== '127.0.0.1' && (loc.protocol === 'https:' || urlParts.hostname === '0.0.0.0')) {\n protocol = loc.protocol;\n } // all of these sock url params are optionally passed in through\n // resourceQuery, so we need to fall back to the default if\n // they are not provided\n\n\n var sockHost = query.sockHost || hostname;\n var sockPath = query.sockPath || '/sockjs-node';\n var sockPort = query.sockPort || port;\n\n if (sockPort === 'location') {\n sockPort = loc.port;\n }\n\n return url.format({\n protocol: protocol,\n auth: auth,\n hostname: sockHost,\n port: sockPort,\n // If sockPath is provided it'll be passed in via the resourceQuery as a\n // query param so it has to be parsed out of the querystring in order for the\n // client to open the socket to the correct location.\n pathname: sockPath\n });\n}", "function getSocketUrl(urlParts, loc) {\n var auth = urlParts.auth,\n query = urlParts.query;\n var hostname = urlParts.hostname,\n protocol = urlParts.protocol,\n port = urlParts.port;\n\n if (!port || port === '0') {\n port = loc.port;\n } // check ipv4 and ipv6 `all hostname`\n // why do we need this check?\n // hostname n/a for file protocol (example, when using electron, ionic)\n // see: https://github.com/webpack/webpack-dev-server/pull/384\n\n\n if ((hostname === '0.0.0.0' || hostname === '::') && loc.hostname && loc.protocol.indexOf('http') === 0) {\n hostname = loc.hostname;\n } // `hostname` can be empty when the script path is relative. In that case, specifying\n // a protocol would result in an invalid URL.\n // When https is used in the app, secure websockets are always necessary\n // because the browser doesn't accept non-secure websockets.\n\n\n if (hostname && hostname !== '127.0.0.1' && (loc.protocol === 'https:' || urlParts.hostname === '0.0.0.0')) {\n protocol = loc.protocol;\n } // all of these sock url params are optionally passed in through\n // resourceQuery, so we need to fall back to the default if\n // they are not provided\n\n\n var sockHost = query.sockHost || hostname;\n var sockPath = query.sockPath || '/sockjs-node';\n var sockPort = query.sockPort || port;\n\n if (sockPort === 'location') {\n sockPort = loc.port;\n }\n\n return url.format({\n protocol: protocol,\n auth: auth,\n hostname: sockHost,\n port: sockPort,\n // If sockPath is provided it'll be passed in via the resourceQuery as a\n // query param so it has to be parsed out of the querystring in order for the\n // client to open the socket to the correct location.\n pathname: sockPath\n });\n}", "function getSocketUrl(urlParts, loc) {\n var auth = urlParts.auth,\n query = urlParts.query;\n var hostname = urlParts.hostname,\n protocol = urlParts.protocol,\n port = urlParts.port;\n\n if (!port || port === '0') {\n port = loc.port;\n } // check ipv4 and ipv6 `all hostname`\n // why do we need this check?\n // hostname n/a for file protocol (example, when using electron, ionic)\n // see: https://github.com/webpack/webpack-dev-server/pull/384\n\n\n if ((hostname === '0.0.0.0' || hostname === '::') && loc.hostname && loc.protocol.indexOf('http') === 0) {\n hostname = loc.hostname;\n } // `hostname` can be empty when the script path is relative. In that case, specifying\n // a protocol would result in an invalid URL.\n // When https is used in the app, secure websockets are always necessary\n // because the browser doesn't accept non-secure websockets.\n\n\n if (hostname && hostname !== '127.0.0.1' && (loc.protocol === 'https:' || urlParts.hostname === '0.0.0.0')) {\n protocol = loc.protocol;\n } // all of these sock url params are optionally passed in through\n // resourceQuery, so we need to fall back to the default if\n // they are not provided\n\n\n var sockHost = query.sockHost || hostname;\n var sockPath = query.sockPath || '/sockjs-node';\n var sockPort = query.sockPort || port;\n\n if (sockPort === 'location') {\n sockPort = loc.port;\n }\n\n return url.format({\n protocol: protocol,\n auth: auth,\n hostname: sockHost,\n port: sockPort,\n // If sockPath is provided it'll be passed in via the resourceQuery as a\n // query param so it has to be parsed out of the querystring in order for the\n // client to open the socket to the correct location.\n pathname: sockPath\n });\n}", "function getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "function getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "function getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}", "function getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}" ]
[ "0.7348443", "0.71172404", "0.7038096", "0.6885798", "0.6820426", "0.6707075", "0.66239816", "0.65740424", "0.65101385", "0.65101385", "0.6495914", "0.64802015", "0.6466523", "0.6444576", "0.63525265", "0.62800515", "0.62800515", "0.62392193", "0.6237606", "0.6223628", "0.62192655", "0.61987334", "0.619704", "0.61530167", "0.6090015", "0.6047234", "0.6044015", "0.60091144", "0.6003557", "0.6003557", "0.5992964", "0.59735847", "0.5913413", "0.58943903", "0.5880759", "0.587599", "0.5850916", "0.5848137", "0.5839265", "0.58215266", "0.58145857", "0.5784624", "0.57797223", "0.5763314", "0.57596034", "0.57580805", "0.575292", "0.57378566", "0.5736856", "0.5736494", "0.57245946", "0.5694471", "0.5690935", "0.5690935", "0.5690935", "0.5690935", "0.5690935", "0.5690935", "0.5690935", "0.5690935", "0.56859523", "0.56859523", "0.56859523", "0.56859523" ]
0.61686623
56
In Windows, on an anchor node on documents loaded from the filesystem, the browser will return a pathname prefixed with the drive name ('/C:/path') when a pathname without a drive is set: a.setAttribute('href', '/foo') a.pathname === '/C:/foo' //true Inside of Angular, we're always using pathnames that do not include drive names for routing.
function removeWindowsDriveName(path, url, base) { /* Matches paths for file protocol on windows, such as /C:/foo/bar, and captures only /foo/bar. */ var windowsFilePathExp = /^\/[A-Z]:(\/.*)/; var firstPathSegmentMatch; //Get the relative path from the input URL. if (url.indexOf(base) === 0) { url = url.replace(base, ''); } // The input URL intentionally contains a first path segment that ends with a colon. if (windowsFilePathExp.exec(url)) { return path; } firstPathSegmentMatch = windowsFilePathExp.exec(path); return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPathname(url){\n var $anchor = $('<a></a>');\n $anchor.attr('href', url);\n return $anchor.prop('pathname');\n }", "function uriToFsPath(uri, keepDriveLetterCasing) {\n var value;\n if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') {\n // unc path: file://shares/c$/far/boo\n value = \"//\" + uri.authority + uri.path;\n }\n else if (uri.path.charCodeAt(0) === 47 /* Slash */\n && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */)\n && uri.path.charCodeAt(2) === 58 /* Colon */) {\n if (!keepDriveLetterCasing) {\n // windows drive letter: file:///c:/far/boo\n value = uri.path[1].toLowerCase() + uri.path.substr(2);\n }\n else {\n value = uri.path.substr(1);\n }\n }\n else {\n // other path\n value = uri.path;\n }\n if (isWindows) {\n value = value.replace(/\\//g, '\\\\');\n }\n return value;\n}", "function uriToFsPath(uri, keepDriveLetterCasing) {\n var value;\n if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') {\n // unc path: file://shares/c$/far/boo\n value = \"//\" + uri.authority + uri.path;\n }\n else if (uri.path.charCodeAt(0) === 47 /* Slash */\n && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */)\n && uri.path.charCodeAt(2) === 58 /* Colon */) {\n if (!keepDriveLetterCasing) {\n // windows drive letter: file:///c:/far/boo\n value = uri.path[1].toLowerCase() + uri.path.substr(2);\n }\n else {\n value = uri.path.substr(1);\n }\n }\n else {\n // other path\n value = uri.path;\n }\n if (isWindows) {\n value = value.replace(/\\//g, '\\\\');\n }\n return value;\n }", "function anchorFromLinkPath(linkPath) {\n // They pass a string like \"https://google.com\"\n // And I give them the DOM element equivalent\n // of <a href=\"https://google.com\">https://google.com</a>\n const link = document.createElement(\"a\");\n link.href = linkPath;\n link.textContent = linkPath;\n return link;\n}", "function a(e){var t=e,n=o(e);if(n){if(!n.path)return e;t=n.path}for(var r,a=\"/\"===t.charAt(0),s=t.split(/\\/+/),l=0,u=s.length-1;u>=0;u--)r=s[u],\".\"===r?s.splice(u,1):\"..\"===r?l++:l>0&&(\"\"===r?(\n// The first part is blank if the path is absolute. Trying to go\n// above the root is a no-op. Therefore we can remove all '..' parts\n// directly after the root.\ns.splice(u+1,l),l=0):(s.splice(u,2),l--));return t=s.join(\"/\"),\"\"===t&&(t=a?\"/\":\".\"),n?(n.path=t,i(n)):t}", "function pathname (route, isElectron) {\n if (isElectron) route = route.replace(stripElectron, '')\n else route = route.replace(prefix, '')\n return route.replace(suffix, '').replace(normalize, '/')\n}", "function fixPath(url) {\r\n var link = document.createElement(\"a\");\r\n link.href = url;\r\n return link.href;\r\n }", "function l(e,t){\"\"===e&&(e=\".\"),e=e.replace(/\\/$/,\"\");\n// XXX: It is possible to remove this block, and the tests still pass!\nvar n=o(e);return\"/\"==t.charAt(0)&&n&&\"/\"==n.path?t.slice(1):0===t.indexOf(e+\"/\")?t.substr(e.length+1):t}", "function _makeFsPath(uri) {\n var value;\n if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') {\n // unc path: file://shares/c$/far/boo\n value = \"//\" + uri.authority + uri.path;\n }\n else if (uri.path.charCodeAt(0) === 47 /* Slash */\n && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */)\n && uri.path.charCodeAt(2) === 58 /* Colon */) {\n // windows drive letter: file:///c:/far/boo\n value = uri.path[1].toLowerCase() + uri.path.substr(2);\n }\n else {\n // other path\n value = uri.path;\n }\n if (isWindows) {\n value = value.replace(/\\//g, '\\\\');\n }\n return value;\n}", "function fixPath(url) {\n var link = document.createElement(\"a\");\n link.href = url;\n return link.href;\n }", "function process_page_path(page){\n\tvar str = page.slice(href_initial_length);\n\tstr = str.split('/').join('=>');\n\tif(str === '')\n\t\treturn 'root';\n\telse\n\t\treturn str;\n}", "function qa(t, e) {\n return \"string\" == typeof e ? La(t, e) : e instanceof ua ? e._internalPath : e._delegate._internalPath;\n}", "function Path(raw) {\n this.raw = Path.normalizeDrive(raw);\n var firstIndex = raw.indexOf(Path.separator);\n var lastIndex = raw.lastIndexOf(Path.separator);\n this.isAbsolute = firstIndex === 0;\n this.base = lastIndex === -1 ? raw : raw.substr(lastIndex + 1);\n this.isRoot = this.isAbsolute && firstIndex === lastIndex && (!this.base || Path.isDrive(this.base));\n this.root = this.computeRoot();\n var extIndex = this.base.lastIndexOf('.');\n this.name = extIndex === -1 ? this.base : this.base.substr(0, extIndex);\n this.ext = extIndex === -1 ? '' : this.base.substr(extIndex);\n }", "is_absolute() {\n return this.path.startsWith('/')\n }", "function convertPathWindows(path) {\n let newPath = \"\"; \n // add mount if needed (otherwise just forward slash on linux)\n if (path.charAt(0) != \"C\") {\n // EXTERNAL DRIVE - eg linux & windows equivalent: /mnt/d/ and D:\\\n newPath += fwdSlash + \"mnt\" + fwdSlash; \n // change case of drive letter and add\n newPath += path.charAt(0).toLowerCase(); \n }\n let skipCharsCounter = 0;\n for (i=4;i<path.length;i++) { // loop starts after Drive letter and %3A = \":\" \n currentChar = path.charAt(i);\n // if not backslash char\n if (currentChar != \"%\" && path.charAt(i+1) !=\"5\" && path.charAt(i+2) != \"C\" && skipCharsCounter == 0) {\n // normal char - simply add\n newPath += currentChar;\n }\n // Add slash only once for each of \"%5C\"\n else if (skipCharsCounter > 0) { \n skipCharsCounter -= 1; \n }\n else { \n skipCharsCounter = 2; // 2 more chars after this one\n newPath += fwdSlash; \n }\n }\n return newPath; \n}", "get relativePathName()\n\t{\n\t\treturn true;\n\t}", "function directoryOf(/*string*/ href) {\n return href.substring(0, href.lastIndexOf('/'));\n }", "function localURL() { \n var pathWORes = location.pathname.substring(0, location.pathname.lastIndexOf(\"/\")+1);\n var protoWDom = location.href.substr(0, location.href.indexOf(\"/\", 8));\n return protoWDom + pathWORes;\n }", "function PathMapper() {\n\t}", "function PathMapper() {\n\t}", "function GetNormalizedPath() {\n}", "function nameToPath(name = '') {\n let routeName;\n if (name === '/' || name.trim().length === 0) return name\n name = removeSlash(name, 'lead');\n routeName = name.split(':')[0];\n routeName = removeSlash(routeName, 'trail');\n\n return routeName.toLowerCase()\n }", "function convertPathLinux(path) {\n let newPath = \"\";\n let driveLetterIndex = -1; // -1 for internal linux path (no drive in path)\n let driveLetter = \"C\"; // default internal drive \n // Add drive and prefix\n if (path.charAt(3) == \"m\" && path.charAt(4) == \"n\" && path.charAt(5) == \"t\") {\n // EXTERNAL DRIVE - eg linux & windows equivalent: /mnt/d/ and D:\\\n driveLetterIndex = 9; \n driveLetter = path.charAt(driveLetterIndex).toUpperCase();\n } // Otherwise INTERNAL DRIVE \n // Add drive letter & Colon\n newPath += driveLetter + colon;\n // skip for slash\n let skipCharsCounter = 0;\n // Add slashes \n for(i=driveLetterIndex+1;i<path.length;i++){\n // swap the slashes (back/forward) \n if ((path.charAt(i) != \"%\" && path.charAt(i+1) != \"2\" && path.charAt(i+2) != \"F\") && skipCharsCounter == 0) { \n // not slash - keep char same NB: %2F = /\n newPath += path.charAt(i); \n }\n else if (skipCharsCounter > 0) {\n skipCharsCounter -= 1;\n }\n else {\n // add swapped slash \n newPath += backSlash; \n // set chars to skip for this slash \n skipCharsCounter = 2; \n }\n }\n return newPath; \n}", "function pathIsActive(pathname,currentPathname){ // Normalize leading slash for consistency. Leading slash on pathname has\n\t// already been normalized in isActive. See caveat there.\n\tif(currentPathname.charAt(0)!=='/'){currentPathname='/'+currentPathname;} // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n\t// `/foo` as active, but in this case, we would already have failed the\n\t// match.\n\tif(pathname.charAt(pathname.length-1)!=='/'){pathname+='/';}if(currentPathname.charAt(currentPathname.length-1)!=='/'){currentPathname+='/';}return currentPathname===pathname;}", "function pathIsActive(pathname,currentPathname){ // Normalize leading slash for consistency. Leading slash on pathname has\n\t// already been normalized in isActive. See caveat there.\n\tif(currentPathname.charAt(0)!=='/'){currentPathname='/'+currentPathname;} // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n\t// `/foo` as active, but in this case, we would already have failed the\n\t// match.\n\tif(pathname.charAt(pathname.length-1)!=='/'){pathname+='/';}if(currentPathname.charAt(currentPathname.length-1)!=='/'){currentPathname+='/';}return currentPathname===pathname;}", "get fullpath()\t{ return \"\" + this.prefix + this.path }", "function pathIsActive(pathname,currentPathname){ // Normalize leading slash for consistency. Leading slash on pathname has\n// already been normalized in isActive. See caveat there.\nif(currentPathname.charAt(0)!=='/'){currentPathname='/'+currentPathname;} // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n// `/foo` as active, but in this case, we would already have failed the\n// match.\nif(pathname.charAt(pathname.length-1)!=='/'){pathname+='/';}if(currentPathname.charAt(currentPathname.length-1)!=='/'){currentPathname+='/';}return currentPathname===pathname;}", "resolveAsPath() { }", "function locationPath(stream, a) {\n return absoluteLocationPath(stream, a) ||\n relativeLocationPath(null, stream, a);\n }", "function locationPath(stream, a) {\n return absoluteLocationPath(stream, a) ||\n relativeLocationPath(null, stream, a);\n }", "function pathtourl (path) {\n\t\t\t\treturn (pagetable.opmlLink + path + appPrefs.cmsFileSuffix);\n\t\t\t\t}", "function _joinAndCanonicalizePath(parts) {\n\t var path = parts[_ComponentIndex.Path];\n\t path = lang_1.isBlank(path) ? '' : _removeDotSegments(path);\n\t parts[_ComponentIndex.Path] = path;\n\t return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n\t}", "get pathname() {\n return this.constructor.buildPathname(\n this._org,\n this._type,\n this._name,\n this._version,\n this._extra,\n );\n }", "function s(e,t){\"\"===e&&(e=\".\"),e=e.replace(/\\/$/,\"\");// XXX: It is possible to remove this block, and the tests still pass!\nvar n=r(e);return\"/\"==t.charAt(0)&&n&&\"/\"==n.path?t.slice(1):0===t.indexOf(e+\"/\")?t.substr(e.length+1):t}", "function nodeLinks(baseUrl, nodePath, addColonAtEnd) {\n var node_url = baseUrl;\n var span = $('<span/>');\n for (var i in nodePath) {\n node_url += '/' + nodePath[i];\n span.append($('<a>').attr('href', node_url).append(nodePath[i]));\n if (i < nodePath.length - 1) {\n span.append(' / ');\n } else if (addColonAtEnd) {\n span.append(': ');\n }\n }\n return span;\n}", "function normalizeLink(s) {\n return s.replace(/\\\\/g, '/');\n}", "function pathof(baseUri, service, resource) {\n return baseUri + service.name.toLowerCase() + \"/\" + resource.name.toLowerCase();\n}", "get pathname() {\n return this.constructor.buildPathname(\n this._org,\n this._type,\n this._name,\n this._version,\n );\n }", "function _(e){var t=document.createElement(\"a\");return t.href=e,t}", "function _joinAndCanonicalizePath(parts){var path=parts[_ComponentIndex.Path];path=path==null?'':_removeDotSegments(path);parts[_ComponentIndex.Path]=path;return _buildFromEncodedParts(parts[_ComponentIndex.Scheme],parts[_ComponentIndex.UserInfo],parts[_ComponentIndex.Domain],parts[_ComponentIndex.Port],path,parts[_ComponentIndex.QueryData],parts[_ComponentIndex.Fragment]);}", "function Ba(t, e) {\n return \"string\" == typeof e ? Ma(t, e) : e instanceof ca ? e._internalPath : e._delegate._internalPath;\n}", "function PathContestProvider() {\n\n}", "function hardcodedPath() {\n if ((0, _isUndefined3.default)(pageData.path)) return void 0;\n\n var pagePath = pageData.path;\n\n // Enforce a starting slash on all paths\n var pathStartsWithSlash = (0, _startsWith3.default)(pagePath, '/');\n if (!pathStartsWithSlash) {\n pagePath = '/' + pagePath;\n }\n\n // Enforce a trailing slash on all paths\n var pathHasExtension = _path.posix.extname(pagePath) !== '';\n var pathEndsWithSlash = (0, _endsWith3.default)(pagePath, '/');\n if (!pathEndsWithSlash && !pathHasExtension) {\n pagePath = pagePath + '/';\n }\n\n return pagePath;\n }", "set locationPathName(value) {}", "makeHref(pathname, query) {\n return this.makePath(pathname, query);\n }", "function removeWindowsDriveName(path,url,base){/*\n Matches paths for file protocol on windows,\n such as /C:/foo/bar, and captures only /foo/bar.\n */var windowsFilePathExp=/^\\/[A-Z]:(\\/.*)/;var firstPathSegmentMatch;//Get the relative path from the input URL.\nif(startsWith(url,base)){url=url.replace(base,'');}// The input URL intentionally contains a first path segment that ends with a colon.\nif(windowsFilePathExp.exec(url)){return path;}firstPathSegmentMatch=windowsFilePathExp.exec(path);return firstPathSegmentMatch?firstPathSegmentMatch[1]:path;}", "function formatPath(input) {\n if (input && input.lastIndexOf('/') !== input.length - 1) {\n input = input + '/';\n }\n if (input && input.substr(0, 2) === '//') {\n input = document.location.protocol + input;\n }\n }", "function staticWatcher(newVal) {\n var hash = newVal.indexOf('#');\n if (hash > -1){\n newVal = newVal.substr(hash + 1);\n }\n watcher = function watchHref() {\n modelSetter($scope, ($location.path().indexOf(newVal) > -1));\n };\n watcher();\n }", "function staticWatcher(newVal) {\n var hash = newVal.indexOf('#');\n if (hash > -1){\n newVal = newVal.substr(hash + 1);\n }\n watcher = function watchHref() {\n modelSetter($scope, ($location.path().indexOf(newVal) > -1));\n };\n watcher();\n }", "get locationPathName() {}", "function removeWindowsDriveName(path,url,base){/*\n\t Matches paths for file protocol on windows,\n\t such as /C:/foo/bar, and captures only /foo/bar.\n\t */var windowsFilePathExp=/^\\/[A-Z]:(\\/.*)/;var firstPathSegmentMatch;//Get the relative path from the input URL.\n\tif(startsWith(url,base)){url=url.replace(base,'');}// The input URL intentionally contains a first path segment that ends with a colon.\n\tif(windowsFilePathExp.exec(url)){return path;}firstPathSegmentMatch=windowsFilePathExp.exec(path);return firstPathSegmentMatch?firstPathSegmentMatch[1]:path;}", "static normalize(path) {\n // Ensure forward slashes\n path = path.replace(/\\\\/g, \"/\");\n // Remove all surrounding quotes\n path = path.replace(/^[\"']+|[\"']+$/g, \"\");\n // Make Windows drive letters upper case\n return path.replace(/^([^:]+):\\//, (_m, m1) => m1.toUpperCase() + \":/\");\n }", "set path(path) {\n this._path = path;\n this.setAttribute('path', path);\n }", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"b\" /* isBlank */])(path) ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "rel (relativePath) {\n return nodePath.normalize(relativePath);\n }", "function viewUrl(){\n\n\tvar before\t= '';\n\tvar parts \t= folder.split(\"\\/\");\n\tvar str\t\t= [];\n\n\t$('#path').empty();\n\n\t$('<span>/</span>').appendTo('#path');\n\n\tfor(i=1; i<parts.length; i++){\n\t\t\n\t\tvar a = $('<a class=\"parent\" id=\"'+before+'/'+parts[i]+'\">'+parts[i]+'</a>').appendTo('#path').bind('click', function() {\n\t\t\tfolderNav($(this).attr('id'));\n\t\t});\n\t\t\n\t\tif(i < parts.length-1){\n\n\t\t\ta.addClass('dropme');\n\t\t\t$('<span>/</span>').appendTo('#path');\t\t\n\n\t\t}\n\n\t\tbefore \t= before+'/'+parts[i];\n\t}\n\t\n\t$('#path').attr('data-url', before);\n}", "function anchorLinkDirective($rootRouter) {\n return {\n restrict: 'E',\n link: function (scope, element) {\n // If the linked element is not an anchor tag anymore, do nothing\n if (element[0].nodeName.toLowerCase() !== 'a') {\n return;\n }\n\n // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.\n var hrefAttrName = Object.prototype.toString.call(element.prop('href')) === '[object SVGAnimatedString]' ?\n 'xlink:href' : 'href';\n\n element.on('click', function (event) {\n if (event.which !== 1) {\n return;\n }\n\n var href = element.attr(hrefAttrName);\n var target = element.attr('target');\n var isExternal = (['_blank', '_parent', '_self', '_top'].indexOf(target) > -1);\n\n if (href && $rootRouter.recognize(href) && !isExternal) {\n $rootRouter.navigateByUrl(href);\n event.preventDefault();\n }\n });\n }\n };\n }", "function addPathFragmentContentToHref(formLink){\t\r\n\tvar formHref = formLink.href;\t\t\t\t\r\n\tif(formHref.indexOf(\"/content/\") == -1){\r\n\t\tvar index = formHref.indexOf(\"/\");\r\n\t\tindex = formHref.indexOf(\"/\", index + 1);\r\n\t\tindex = formHref.indexOf(\"/\", index + 1);\t\t\t\t\r\n\t\tvar protocolAndDomain = formHref.substring(0, index);\r\n\t\tvar path = formHref.substring(index);\t\t\t\t\r\n\t\tformHref = protocolAndDomain + \"/content\" + path;\t\t\t\t\r\n\t\tformLink.href = formHref;\t\t\t\t\t\t\r\n\t}\t\t\t\r\n}", "activate() {\n const directoryModel = this.parentTree_.directoryModel;\n const onEntryResolved = (entry) => {\n // Changes directory to the model item's root directory if needed.\n if (!util.isSameEntry(directoryModel.getCurrentDirEntry(), entry)) {\n metrics.recordUserAction('FolderShortcut.Navigate');\n directoryModel.changeDirectoryEntry(entry);\n }\n };\n\n // For shortcuts we already have an Entry, but it has to be resolved again\n // in case, it points to a non-existing directory.\n window.webkitResolveLocalFileSystemURL(\n this.entry.toURL(), onEntryResolved, () => {\n // Error, the entry can't be re-resolved. It may happen for shortcuts\n // which targets got removed after resolving the Entry during\n // initialization.\n this.parentTree_.dataModel.onItemNotFoundError(this.modelItem);\n });\n }", "get path() {}", "function handleAnchor(anchor, resolver, linkHandler) {\n // Get the link path without the location prepended.\n // (e.g. \"./foo.md#Header 1\" vs \"http://localhost:8888/foo.md#Header 1\")\n var href = anchor.getAttribute('href');\n // Bail if it is not a file-like url.\n if (!href || href.indexOf('://') !== -1 && href.indexOf('//') === 0) {\n return Promise.resolve(undefined);\n }\n // Remove the hash until we can handle it.\n var hash = anchor.hash;\n if (hash) {\n // Handle internal link in the file.\n if (hash === href) {\n anchor.target = '_self';\n return Promise.resolve(undefined);\n }\n // For external links, remove the hash until we have hash handling.\n href = href.replace(hash, '');\n }\n // Get the appropriate file path.\n return resolver.resolveUrl(href).then(function (path) {\n // Handle the click override.\n if (linkHandler && coreutils_1.URLExt.isLocal(path)) {\n linkHandler.handleLink(anchor, path);\n }\n // Get the appropriate file download path.\n return resolver.getDownloadUrl(path);\n }).then(function (url) {\n // Set the visible anchor.\n anchor.href = url + hash;\n }).catch(function (err) {\n // If there was an error getting the url,\n // just make it an empty link.\n anchor.href = '';\n });\n }", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n }", "set entry(value) {\n this.dirEntry_ = value;\n\n // Set helper attribute for testing.\n if (window.IN_TEST) {\n this.setAttribute('full-path-for-testing', this.dirEntry_.fullPath);\n }\n }", "get path() {\n return parse(this).pathname\n }", "function absoluteLocationPath(stream, a) {\n var op = stream.peek();\n if ('/' === op || '//' === op) {\n var lhs = a.node('Root');\n return relativeLocationPath(lhs, stream, a, true);\n } else {\n return null;\n }\n }", "function absoluteLocationPath(stream, a) {\n var op = stream.peek();\n if ('/' === op || '//' === op) {\n var lhs = a.node('Root');\n return relativeLocationPath(lhs, stream, a, true);\n } else {\n return null;\n }\n }", "function normalizePath(p) {\n return fslib_1.npath.toPortablePath(p);\n }", "fullpathPosix() {\n if (this.#fullpathPosix !== undefined)\n return this.#fullpathPosix;\n if (this.sep === '/')\n return (this.#fullpathPosix = this.fullpath());\n if (!this.parent) {\n const p = this.fullpath().replace(/\\\\/g, '/');\n if (/^[a-z]:\\//i.test(p)) {\n return (this.#fullpathPosix = `//?/${p}`);\n }\n else {\n return (this.#fullpathPosix = p);\n }\n }\n const p = this.parent;\n const pfpp = p.fullpathPosix();\n const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name;\n return (this.#fullpathPosix = fpp);\n }", "function browserPathHelpers () {\n // The URL of the base directory in Karma\n let rootURL = new URL(\"/base/\", window.location.href);\n\n // The URL of the current page directory\n let cwd = new URL(\".\", window.location.href);\n\n /**\n * URI-encodes a path\n */\n function encodePath (relativePath) {\n return encodeURIComponent(relativePath).split(\"%2F\").join(\"/\");\n }\n\n return {\n /**\n * Returns the relative URL\n */\n rel (relativePath) {\n let url = this.url(relativePath);\n let relativeURL = url.href.replace(cwd.href, \"\");\n return relativeURL;\n },\n\n /**\n * Returns the absolute URL string\n */\n abs (relativePath) {\n return this.url(relativePath).href;\n },\n\n /**\n * Returns the absolute URL object\n */\n url (relativePath, hash = \"\") {\n // Encode special characters in paths\n relativePath = encodePath(relativePath);\n let url = new URL(relativePath, rootURL);\n url.hash = hash;\n return url;\n },\n\n /**\n * Returns the URL of the current page.\n */\n cwd () {\n return cwd;\n }\n };\n}", "get href() {return encodeURI(stringAttribute.get(this, 'href'));}", "function SPResourcePath(value) {\r\n if (value === void 0) { value = ''; }\r\n var rootDelimeter = '//';\r\n var indexOfRootDelimeter = value.indexOf(rootDelimeter);\r\n var indexOfPathDelimeter = value.indexOf('/');\r\n // The root delimeter is the first instance of '//', unless preceded by a lone '/'\r\n var endIndexOfRootDelimeter = indexOfRootDelimeter > -1 && indexOfRootDelimeter <= indexOfPathDelimeter ?\r\n indexOfRootDelimeter + rootDelimeter.length :\r\n -1;\r\n var authority = getAuthority(value, endIndexOfRootDelimeter);\r\n var domain = authority && authority.slice(endIndexOfRootDelimeter);\r\n // By definition, everything after the authority is the path\r\n var path = value.slice(authority.length);\r\n var format = authority ?\r\n 0 /* absolute */ :\r\n path[0] === '/' ?\r\n 2 /* serverRelative */ :\r\n 1 /* relative */;\r\n var segments = path.split('/');\r\n this.authority = authority;\r\n this.domain = domain;\r\n this.format = format;\r\n this.path = path;\r\n this.segments = segments;\r\n this.value = value;\r\n }", "@readOnly\n @computed('icon')\n iconHref (icon) {\n if (icon && icon.includes('/')) {\n return icon.includes('#') ? icon : `${icon}#root`\n }\n }", "set path(value){\r\n\t\tvalue = this.resolvePathVars(this.resolveDotPath(value))\r\n\r\n\t\tvar l = this.location\r\n\r\n\t\tif(value == l || value == ''){\r\n\t\t\treturn }\r\n\r\n\t\t// old...\r\n\t\tvar otitle = this.title\r\n\t\tvar odir = this.dir\r\n\r\n\t\tif(this.exists(l)){\r\n\t\t\tthis.__wiki_data[value] = this.__wiki_data[l] }\r\n\t\tthis.location = value\r\n\r\n\t\t// new...\r\n\t\tvar ntitle = this.title\r\n\t\tvar ndir = this.dir\r\n\r\n\t\tvar redirect = false\r\n\r\n\t\t// update links to this page...\r\n\t\tthis.pages(function(page){\r\n\t\t//this.get('**').map(function(page){\r\n\t\t\t// skip the old page...\r\n\t\t\tif(page.location == l){\r\n\t\t\t\treturn }\r\n\t\t\tpage.raw = page.raw.replace(page.__wiki_link__, function(lnk){\r\n\t\t\t\tvar from = lnk[0] == '[' ? lnk.slice(1, -1) : lnk\r\n\r\n\t\t\t\t// get path/title...\r\n\t\t\t\tvar p = path2lst(from)\r\n\t\t\t\tvar t = p.pop()\r\n\t\t\t\tp = normalizePath(p)\r\n\r\n\t\t\t\tvar target = page.get(p).acquire('./'+t)\r\n\t\t\t\t// page target changed...\r\n\t\t\t\t// NOTE: this can happen either when a link was an orphan\r\n\t\t\t\t// \t\tor if the new page path shadowed the original \r\n\t\t\t\t// \t\ttarget...\r\n\t\t\t\t// XXX should we report the exact condition here???\r\n\t\t\t\tif(target == value){\r\n\t\t\t\t\tconsole.log('Link target changed:', lnk, '->', value)\r\n\t\t\t\t\treturn lnk\r\n\r\n\t\t\t\t// skip links that do not resolve to target...\r\n\t\t\t\t} else if(page.get(p).acquire('./'+t) != l){\r\n\t\t\t\t\treturn lnk }\r\n\r\n\t\t\t\t// format the new link...\r\n\t\t\t\tvar to = p == '' ? ntitle : p +'/'+ ntitle\r\n\t\t\t\tto = lnk[0] == '[' ? '['+to+']' : to\r\n\r\n\t\t\t\t// explicit link change -- replace...\r\n\t\t\t\tif(from == l){\r\n\t\t\t\t\t//console.log(lnk, '->', to)\r\n\t\t\t\t\treturn to\r\n\r\n\t\t\t\t// path did not change -- change the title...\r\n\t\t\t\t} else if(ndir == odir){\r\n\t\t\t\t\t// conflict: the new link will not resolve to the \r\n\t\t\t\t\t// \t\ttarget page...\r\n\t\t\t\t\tif(page.get(p).acquire('./'+ntitle) != value){\r\n\t\t\t\t\t\tconsole.log('ERR:', lnk, '->', to,\r\n\t\t\t\t\t\t\t'is shadowed by:', page.get(p).acquire('./'+ntitle))\r\n\t\t\t\t\t\t// XXX should we add a note to the link???\r\n\t\t\t\t\t\tredirect = true\r\n\r\n\t\t\t\t\t// replace title...\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t//console.log(lnk, '->', to)\r\n\t\t\t\t\t\treturn to }\r\n\r\n\t\t\t\t// path changed -- keep link + add redirect page...\r\n\t\t\t\t} else {\r\n\t\t\t\t\tredirect = true }\r\n\r\n\t\t\t\t// no change...\r\n\t\t\t\treturn lnk }) })\r\n\r\n\t\t// redirect...\r\n\t\t//\r\n\t\t// XXX should we use a template here???\r\n\t\t// \t\t...might be a good idea to set a .redirect attr and either\r\n\t\t// \t\tdo an internal/transparent redirect or show a redirect \r\n\t\t// \t\ttemplate\r\n\t\t// \t\t...might also be good to add an option to fix the link from\r\n\t\t// \t\tthe redirect page...\r\n\t\tif(redirect){\r\n\t\t\tconsole.log('CREATING REDIRECT PAGE:', l, '->', value, '')\r\n\t\t\tthis.__wiki_data[l].raw = 'REDIRECT TO: ' + value\r\n\t\t\t\t+'<br>'\r\n\t\t\t\t+'<br><i>NOTE: This page was created when renaming the target '\r\n\t\t\t\t\t+'page that resulted new link being broken (i.e. resolved '\r\n\t\t\t\t\t+'to a different page from the target)</i>'\r\n\t\t\tthis.__wiki_data[l].redirect = value\r\n\r\n\t\t// cleaup...\r\n\t\t} else {\r\n\t\t\tdelete this.__wiki_data[l] } }", "path(includeHash = false) {\n return this.normalize(this._platformStrategy.path(includeHash));\n }", "get pathname()\t{ return \"\" + this.path + this.file}", "function SPResourcePath(value) {\r\n if (value === void 0) { value = ''; }\r\n var rootDelimeter = '//';\r\n var indexOfRootDelimeter = value.indexOf(rootDelimeter);\r\n var indexOfPathDelimeter = value.indexOf('/');\r\n // The root delimeter is the first instance of '//', unless preceded by a lone '/'\r\n var endIndexOfRootDelimeter = indexOfRootDelimeter > -1 && indexOfRootDelimeter <= indexOfPathDelimeter ?\r\n indexOfRootDelimeter + rootDelimeter.length :\r\n -1;\r\n var authority = getAuthority(value, endIndexOfRootDelimeter);\r\n var domain = authority && authority.slice(endIndexOfRootDelimeter);\r\n // By definition, everything after the authority is the path\r\n var path = value.slice(authority.length);\r\n var format = authority ?\r\n SPResourcePathFormat.absolute :\r\n path[0] === '/' ?\r\n SPResourcePathFormat.serverRelative :\r\n SPResourcePathFormat.relative;\r\n var segments = path.split('/');\r\n this.authority = authority;\r\n this.domain = domain;\r\n this.format = format;\r\n this.path = path;\r\n this.segments = segments;\r\n this.value = value;\r\n }", "function SPResourcePath(value) {\r\n if (value === void 0) { value = ''; }\r\n var rootDelimeter = '//';\r\n var indexOfRootDelimeter = value.indexOf(rootDelimeter);\r\n var indexOfPathDelimeter = value.indexOf('/');\r\n // The root delimeter is the first instance of '//', unless preceded by a lone '/'\r\n var endIndexOfRootDelimeter = indexOfRootDelimeter > -1 && indexOfRootDelimeter <= indexOfPathDelimeter ?\r\n indexOfRootDelimeter + rootDelimeter.length :\r\n -1;\r\n var authority = getAuthority(value, endIndexOfRootDelimeter);\r\n var domain = authority && authority.slice(endIndexOfRootDelimeter);\r\n // By definition, everything after the authority is the path\r\n var path = value.slice(authority.length);\r\n var format = authority ?\r\n SPResourcePathFormat.absolute :\r\n path[0] === '/' ?\r\n SPResourcePathFormat.serverRelative :\r\n SPResourcePathFormat.relative;\r\n var segments = path.split('/');\r\n this.authority = authority;\r\n this.domain = domain;\r\n this.format = format;\r\n this.path = path;\r\n this.segments = segments;\r\n this.value = value;\r\n }", "function staticWatcher(newVal) {\n if ((hash = newVal.indexOf('#')) > -1)\n newVal = newVal.substr(hash + 1);\n watcher = function watchHref() {\n modelSetter($scope, ($location.path().indexOf(newVal) > -1));\n };\n watcher();\n }", "function staticWatcher(newVal) {\n if ((hash = newVal.indexOf('#')) > -1)\n newVal = newVal.substr(hash + 1);\n watcher = function watchHref() {\n modelSetter($scope, ($location.path().indexOf(newVal) > -1));\n };\n watcher();\n }", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function SPResourcePath(value) {\n if (value === void 0) { value = ''; }\n var rootDelimeter = '//';\n var indexOfRootDelimeter = value.indexOf(rootDelimeter);\n var indexOfPathDelimeter = value.indexOf('/');\n // The root delimeter is the first instance of '//', unless preceded by a lone '/'\n var endIndexOfRootDelimeter = indexOfRootDelimeter > -1 && indexOfRootDelimeter <= indexOfPathDelimeter ?\n indexOfRootDelimeter + rootDelimeter.length :\n -1;\n var authority = getAuthority(value, endIndexOfRootDelimeter);\n var domain = authority && authority.slice(endIndexOfRootDelimeter);\n // By definition, everything after the authority is the path\n var path = value.slice(authority.length);\n var format = authority ?\n SPResourcePathFormat.absolute :\n path[0] === '/' ?\n SPResourcePathFormat.serverRelative :\n SPResourcePathFormat.relative;\n var segments = path.split('/');\n this.authority = authority;\n this.domain = domain;\n this.format = format;\n this.path = path;\n this.segments = segments;\n this.value = value;\n }", "static getRealPath(linkPath) {\n return FileSystem._wrapException(() => {\n return fsx.realpathSync(linkPath);\n });\n }", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function abbrPath(base) {\n var basePath = base === undefined ? Object(_page__WEBPACK_IMPORTED_MODULE_1__[\"pagePath\"])() : base || '/';\n return Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"urlRelative\"])(basePath, _page__WEBPACK_IMPORTED_MODULE_1__[\"abbrPath\"]);\n}", "function makePath(var_args){\n\t var result = join(slice(arguments), '/');\n\t // need to disconsider duplicate '/' after protocol (eg: 'http://')\n\t return result.replace(/([^:\\/]|^)\\/{2,}/g, '$1/');\n\t }", "function makeOrChangeLink()\n{\n var dom = dw.getDocumentDOM(); \n\n if (typeof dom[\"setLinkHref\"] != 'undefined') //CONTRIBUTE ALERT\n dom.setLinkHref();\n}", "function formatPathname(urlobj)\n{\n\tvar pathname = joinDirs(urlobj.extra.directory, urlobj.extra.directoryLeadingSlash);\n\t\n\tif (urlobj.extra.filename !== null)\n\t{\n\t\tpathname += urlobj.extra.filename;\n\t}\n\t\n\treturn pathname;\n}", "constructor( aPath ) {\n this.fullpath = aPath;\n }", "function i(e){var t=e,n=r(e);if(n){if(!n.path)return e;t=n.path}for(var i,a=\"/\"===t.charAt(0),s=t.split(/\\/+/),l=0,u=s.length-1;u>=0;u--)i=s[u],\".\"===i?s.splice(u,1):\"..\"===i?l++:l>0&&(\"\"===i?(// The first part is blank if the path is absolute. Trying to go\n// above the root is a no-op. Therefore we can remove all '..' parts\n// directly after the root.\ns.splice(u+1,l),l=0):(s.splice(u,2),l--));return t=s.join(\"/\"),\"\"===t&&(t=a?\"/\":\".\"),n?(n.path=t,o(n)):t}", "linkName(link){\n\t\tlet linkSplit = link.split(\"/\");\n\t\treturn linkSplit[2];\n\t}", "function pagerHomePageLink() {\n 'use strict';\n var link = document.createElement('div');\n link.id = 'pagerGoHome';\n link.innerHTML = '<a href=\"../../\">Home</a>';\n return link;\n}", "function getPagePath(){var loc=String(document.location);if(loc.indexOf('?')!=-1){loc=loc.split('?')[0]}var url=loc.split('/');var tmpstr=new Array();for(i=3;i<url.length;i++){tmpstr.push(url[i])}var lastitem=tmpstr[tmpstr.length-1];if(lastitem==''){tmpstr[tmpstr.length-1]='index.html'}tmpstr=tmpstr.join('/');return tmpstr}", "getHref() {\n switch (this.type) {\n case \"room\":\n return \"room.html?\" + this.id + \"+\" + this.title.split(' ').join('_');\n case \"device\":\n return \"device.html?\" + this.id + \"+\" + this.title.split(' ').join('_');\n default:\n return \"home.html\";\n }\n }", "function toPath( name ) {\n\treturn name.replace( '-', '.' );\n}", "function toPath( name ) {\n\treturn name.replace( '-', '.' );\n}", "function removeWindowsDriveName(path, url, base) {\n\t /*\n\t Matches paths for file protocol on windows,\n\t such as /C:/foo/bar, and captures only /foo/bar.\n\t */\n\t var windowsFilePathExp = /^\\/[A-Z]:(\\/.*)/;\n\n\t var firstPathSegmentMatch;\n\n\t //Get the relative path from the input URL.\n\t if (startsWith(url, base)) {\n\t url = url.replace(base, '');\n\t }\n\n\t // The input URL intentionally contains a first path segment that ends with a colon.\n\t if (windowsFilePathExp.exec(url)) {\n\t return path;\n\t }\n\n\t firstPathSegmentMatch = windowsFilePathExp.exec(path);\n\t return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path;\n\t }", "function removeWindowsDriveName(path, url, base) {\n\t /*\n\t Matches paths for file protocol on windows,\n\t such as /C:/foo/bar, and captures only /foo/bar.\n\t */\n\t var windowsFilePathExp = /^\\/[A-Z]:(\\/.*)/;\n\n\t var firstPathSegmentMatch;\n\n\t //Get the relative path from the input URL.\n\t if (startsWith(url, base)) {\n\t url = url.replace(base, '');\n\t }\n\n\t // The input URL intentionally contains a first path segment that ends with a colon.\n\t if (windowsFilePathExp.exec(url)) {\n\t return path;\n\t }\n\n\t firstPathSegmentMatch = windowsFilePathExp.exec(path);\n\t return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path;\n\t }", "function _getServerURL() {\r\n var breakPoints = [ 'docs', 'test' ];\r\n var oldArr = location.href.split( '/' );\r\n var newArr = [];\r\n\r\n for( var i = 0; i < oldArr.length; i++ ) {\r\n if( breakPoints.indexOf( oldArr[ i ] ) !== -1 ) break;\r\n\r\n newArr.push( oldArr[ i ] );\r\n }\r\n\r\n newArr.push( 'server/' );\r\n\r\n return newArr.join( '/' );\r\n }", "rel (relativePath) {\n let url = this.url(relativePath);\n let relativeURL = url.href.replace(cwd.href, \"\");\n return relativeURL;\n }" ]
[ "0.63303757", "0.5657649", "0.56399095", "0.5571488", "0.55035555", "0.5488701", "0.54772496", "0.54768646", "0.5451669", "0.5425001", "0.5417213", "0.53954935", "0.5393001", "0.538108", "0.5378764", "0.53681004", "0.53199923", "0.5261052", "0.52440584", "0.52440584", "0.5237942", "0.5205653", "0.5196961", "0.5178369", "0.5178369", "0.51414", "0.5140825", "0.5134612", "0.5124161", "0.5124161", "0.5121866", "0.51094383", "0.51073825", "0.5095892", "0.50914484", "0.50853443", "0.5083324", "0.50788385", "0.5070124", "0.5064346", "0.506259", "0.50564766", "0.5053804", "0.50397444", "0.5036606", "0.5020552", "0.50145566", "0.5013951", "0.5013951", "0.4992875", "0.49883172", "0.49877062", "0.49872407", "0.49867448", "0.49863303", "0.49829438", "0.49811715", "0.49784938", "0.49591753", "0.49586543", "0.4955997", "0.49444702", "0.49316958", "0.4931472", "0.49299198", "0.49299198", "0.49288785", "0.49257764", "0.49250078", "0.49242747", "0.4916106", "0.4908019", "0.4904765", "0.49040782", "0.49033964", "0.48780358", "0.48780358", "0.4874418", "0.4874418", "0.48727542", "0.48691836", "0.4854896", "0.48473793", "0.48473793", "0.48473793", "0.4847141", "0.48463827", "0.48450053", "0.48414838", "0.48409766", "0.48396236", "0.48394877", "0.48343313", "0.4830778", "0.48238412", "0.48234197", "0.48234197", "0.48193282", "0.48193282", "0.4819028", "0.4817483" ]
0.0
-1
Faster, more basic than angular.bind
function simpleBind(context, fn) { return function(value) { fn.call(context, value); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function simpleBind(context,fn){return function(value){fn.call(context,value);};}", "function $bind(func, thisValue) {\n return function() {return func.apply(thisValue, arguments)}\n}", "function bind(value){var lView=getLView();return bindingUpdated(lView,lView[BINDING_INDEX]++,value)?value:NO_CHANGE;}", "function simpleBind(context, fn) { // 14775\n return function(value) { // 14776\n fn.call(context, value); // 14777\n }; // 14778\n } // 14779", "function simpleBind(context, fn) {\n\t return function(value) {\n\t fn.call(context, value);\n\t };\n\t }", "function simpleBind(context, fn) {\n return function (value) {\n fn.call(context, value);\n };\n }", "function bind(method,context){return function(){return method.apply(context,arguments);};}", "function bind(method,context){return function(){return method.apply(context,arguments);};}", "function bind(e,t){return function(){return t.apply(e,arguments)}}", "function bindings() {\n var model = $parse(attr.clickAnywhereButHere);\n var value = model(scope);\n\n //The value can be a function to afford the user more control over \n //visibility.\n if (isWatchingFunction)\n value = value();\n\n if (!angular.isUndefined(value) && lastActiveValue !== value) {\n if (value)\n $document.bind('mousedown', handler);\n else\n $document.unbind('mousedown', handler);\n\n lastActiveValue = value;\n }\n }", "function bindable(){\n\t\t\n\t}", "function i(e){return o.bind(this,e)}", "function bind(scope, fn) {\n return function() {\n return fn.apply(scope, arguments);\n }\n}", "function bind(value) {\n return bindingUpdated(viewData[BINDING_INDEX]++, value) ? value : NO_CHANGE;\n}", "function simpleBind(context, fn) {\n\t\t\treturn function(value) {\n\t\t\t\tfn.call(context, value);\n\t\t\t};\n\t\t}", "bindVariable() {\n if (Object(_placeos_ts_client__WEBPACK_IMPORTED_MODULE_1__[\"authority\"])() && this.bind && this.sys && this.mod) {\n const module = Object(_placeos_ts_client__WEBPACK_IMPORTED_MODULE_1__[\"getModule\"])(this.sys, this.mod, this.index);\n const binding = module.binding(this.bind);\n this.unbind = binding.bind();\n this.listener = binding.listen().subscribe(value => setTimeout(() => {\n this.model = value;\n this.modelChange.emit(this.model);\n }, 10));\n }\n }", "function newBind(fn,ctx) {\n return function () {\n return fn.call(ctx)\n }\n}", "function BindAndRun() {\r\n}", "Bind(IDispatch, string, string) {\n\n }", "function Bind_A_Obound() {\r\n}", "function Bind_A_A_A() {\r\n}", "function bind(fn,ctx){function boundFn(a){var l=arguments.length;return l?l>1?fn.apply(ctx,arguments):fn.call(ctx,a):fn.call(ctx);}// record original fn length\nboundFn._length=fn.length;return boundFn;}", "function bind(fn,ctx){function boundFn(a){var l=arguments.length;return l?l>1?fn.apply(ctx,arguments):fn.call(ctx,a):fn.call(ctx);}// record original fn length\nboundFn._length=fn.length;return boundFn;}", "function bind(method, context) { // 102\n\t\treturn function() { return method.apply(context, arguments); }; // 103\n\t} // 104", "function bind(value) {\n var lView = getLView();\n return bindingUpdated(lView, lView[BINDING_INDEX]++, value) ? value : NO_CHANGE;\n}", "function bind(value) {\n var lView = getLView();\n return bindingUpdated(lView, lView[BINDING_INDEX]++, value) ? value : NO_CHANGE;\n}", "function Bind_A_A_R() {\r\n}", "$bind (val, event) {\n var pattern = parsePattern(val)\n var emitter = this.subscribe(pattern, onBind)\n emitter.run(event)\n }", "function bind(fn, obj) {\n\t return function binded() {\n\t return fn.apply(obj, arguments);\n\t }\n\t}", "evalIfBind(expression) {\n if (_.startsWith(expression, 'bind:')) {\n expression = expression.replace(/\\[\\$\\i\\]/g, '[0]');\n return $parseExpr(expression.replace('bind:', ''))(this.app);\n }\n return expression;\n }", "apply(func) {\n return this.$scope.$apply.bind(this.$scope, func);\n }", "function Bindr() {\n // Save all of the injections.\n this.injections = {};\n}", "function binding (obj) {\n return function (name) {\n var _name = '_' + name;\n obj[_name] = obj[_name] || bind(obj, name);\n return obj[_name];\n }\n}", "function testCallNApplyNBind()\n{\n let o = { id: 123, \n getId : function()\n {\n \n return this.id;\n },\n getIdWPrfx : function(prefix)\n {\n \n return prefix + this.id;\n }\n };\n let newO = { id: 456};\n console.log(o.getId.call(newO));\n console.log(o.getIdWPrfx.call(newO,'IDCALL: ')); //456 call chnages the refernces of this in object to argument object. can take argument as comma separated.\n console.log(o.getIdWPrfx.apply(newO,['ID: '])); //apply is similar to call, can pass arguments with an array.\n \n let newFn = o.getId.bind(newO); //'bind' creates a copy of the function and sets context for new function with new object.\n let newFn2 = o.getIdWPrfx.bind(newO,['BIND-ID: ']); \n console.log(newFn());\n console.log(newFn2());\n}", "function callAngular(event, codeStr) {\r\n\tvar selector = angular.element(event.target);\r\n\tvar scope = selector.scope();\r\n\tvar code = unescape(codeStr);\r\n\teval(code);\r\n}", "function BindFactory(){}", "function bind$1(fn,ctx){function boundFn(a){var l=arguments.length;return l?l>1?fn.apply(ctx,arguments):fn.call(ctx,a):fn.call(ctx);}// record original fn length\n\tboundFn._length=fn.length;return boundFn;}", "function bind(fn, ctx) {\n\t\t return function (a) {\n\t\t var l = arguments.length;\n\t\t return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);\n\t\t };\n\t\t}", "constructor() { \n autoBind(this); \n }", "function myBind(func, context, ...args) {\n //call\n //input: context, arg1 ...argN\n //output: func result\n\n //input: the same as func\n //out: func result\n return function (...funcArgs) {\n func.call(context, ...args, ...funcArgs);\n };\n}", "function bind( func, ob ) {\n\treturn function() {\n\t\treturn func.apply( ob, arguments );\n\t};\n}", "function bind(fn, ctx) {\n\t function boundFn(a) {\n\t var l = arguments.length;\n\t return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);\n\t }\n\t // record original fn length\n\t boundFn._length = fn.length;\n\t return boundFn;\n\t}", "function bind(fn, ctx) {\n\t function boundFn(a) {\n\t var l = arguments.length;\n\t return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);\n\t }\n\t // record original fn length\n\t boundFn._length = fn.length;\n\t return boundFn;\n\t}", "function LfBind(){\n\tvar $watchModels = []; //models to watch for\n\tvar $watchBinds = []; //binds to watch for\n\tvar that = this;\n\n\tthis.$registerWatcher = function(){ \t\n\t\t$watchModels = $main.$rootElement.querySelectorAll('[lf-model]'); \n\t\t$watchBinds = $main.$rootElement.querySelectorAll('[lf-bind]');\n\t}\n\n\tthis.$observeObject = function(){\n\t\t//observe changes in $scope object, if any change is detected it updates respective models and bind\n\t\tObject.observe($main.$scope, function(changes){\n\t\t changes.forEach(function(change) {\n\t\t \t// console.log(change.type, ' : ',change.name,' : ', change.oldValue);\n\t\t \tthat.$updateView(change.name);\n\t\t \t }); //end of change.foreach\n\t\t}); //end of object.observe\n\t}\n\n\tthis.$addListener = function(){ \n\t\tfor(var i = 0, len = $watchModels.length; i < len; i++){\n\t\t\t$watchModels[i].count = i;\n\t\t\t$watchModels[i].addEventListener('keyup', function(evt)\n\t\t\t{ \n\t\t\t\tvar index = evt.target.count;\n\t\t\t\tvar key = $watchModels[index].getAttribute('lf-model');\n\t\t\t\tvar value = $watchModels[index].value;\n\t\t\t\t$main.$scope[key] = value;\n\t\t\t});\n\t\t}\n\t}\n\t\n\t//updates the model and binds with data if initially present in scope object\n\tthis.$initializeFirstView = function(){ \t\n\t\tfor(var i = 0, len = $watchModels.length; i < len; i++){\n\t\t\tvar $tag = $watchModels[i].getAttribute('lf-model'); \t\n\t\t\tif($main.$scope.hasOwnProperty($tag))\n\t\t\t\t$watchModels[i].value = $main.$scope[$tag];\n\t\t\t\t$watchModels[i].innerHTML = $main.$scope[$tag];\n\t\t}\n\n\t\tfor(var i = 0, len = $watchBinds.length; i < len; i++){\n\t\t\tvar $tag = $watchBinds[i].getAttribute('lf-bind'); \t\n\t\t\tif($main.$scope.hasOwnProperty($tag))\n\t\t\t\t$watchBinds[i].value = $main.$scope[$tag];\n\t\t\t\t$watchBinds[i].innerHTML = $main.$scope[$tag];\n\t\t}\n\t}\t\n\n\t//search and update all bind and models of changed variable\n\tthis.$updateView = function($tag){\n\t \tfor(var j = 0, len = $watchModels.length; j < len; j++){\n\t\t\tif($tag === $watchModels[j].getAttribute('lf-model')){\n\t\t\t\t$watchModels[j].value = $main.$scope[$tag];\n\t\t\t\t$watchModels[j].innerHTML = $main.$scope[$tag];\n\t\t\t}\n \t} \n\n \tfor(var j = 0, len = $watchBinds.length; j < len; j++){\n\t\t\tif($tag === $watchBinds[j].getAttribute('lf-bind')){\n\t\t\t\t$watchBinds[j].value = $main.$scope[$tag];\n\t\t\t\t$watchBinds[j].innerHTML = $main.$scope[$tag];\n\t\t\t}\n \t} \t\n\t}\n} //end of LfBind", "function bind(method, context) {\n\t\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t\t}", "function bind(method, context) {\n\t\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t\t}", "function bind(method, context) {\n\t\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t\t}", "function bind(method, context) {\n\t\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t\t}", "function bind(method, context) {\n\t\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t\t}", "function bind(method, context) {\n\t\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t\t}", "function bind(method, context) {\n\t\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t\t}", "function bind(fn, thisArg, ...outerArgs){\n// rest operator \n return function(...innerArgs) {\n// spread operator\n return fn.apply(thisArg, [...outerArgs, ...innerArgs]);\n }\n}", "function bind(method, context) {\n\t\t\t\t\treturn function() {\n\t\t\t\t\t\treturn method.apply(context, arguments);\n\t\t\t\t\t};\n\t\t\t\t}", "function bind$1(fn, ctx) {\n\t function boundFn(a) {\n\t var l = arguments.length;\n\t return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);\n\t }\n\t // record original fn length\n\t boundFn._length = fn.length;\n\t return boundFn;\n\t}", "function repeatBindCallApply() {\n let john = {\n name: 'John',\n age: 26,\n job: 'teacher',\n presentation: function (style, timeOfDay) {\n if (style === 'formal') {\n console.log('Good ' + timeOfDay +\n ', Ladies and gentlemen! I\\'m ' +\n this.name + ', I\\'m a ' +\n this.job + ' and I\\'m ' +\n this.age + ' years old.');\n } else if (style === 'friendly') {\n console.log('Hey! What\\'s up? I\\'m ' +\n this.name + ', I\\'m a ' +\n this.job + ' and I\\'m ' +\n this.age + ' years old. Have a nice ' +\n timeOfDay + '.');\n }\n }\n };\n\n let emily = {\n name: 'Emily',\n age: 35,\n job: 'designer'\n }\n\n john.presentation('formal', 'morning');\n // Copy johns function for emily and use arguments separately.\n john.presentation.call(emily, 'friendly', 'afternoon');\n\n // Same, but arguments as an array.\n // john.presentation.apply(emily, ['friendly', 'afternoon']);\n\n // Store function separatetely for chosen parameters.\n // Currying - Don't repeat same parameters while calling function.\n let johnFriendly = john.presentation.bind(john, 'friendly');\n johnFriendly('morning');\n\n let emilyFormal = john.presentation.bind(emily, 'formal');\n emilyFormal('afternoon');\n\n\n // Another bind example\n let years = [1990, 1965, 1937, 2005, 1998];\n\n function arrCalc(arr, fn) {\n let arrResult = [];\n for (let i = 0; i < arr.length; i++)\n arrResult.push(fn(arr[i]));\n return arrResult;\n }\n\n function calculateAge(el) {\n return 2019 - el;\n }\n\n function isFullAge(limit, el) {\n return el >= limit;\n }\n\n let ages = arrCalc(years, calculateAge);\n var fullJapan = arrCalc(ages, isFullAge.bind(this, 20));\n console.log(ages);\n console.log(fullJapan);\n}", "function myBind(func, ctx) {\n var partialArgs = [].slice.apply(arguments, [2])\n\n return function() {\n var remainingArgs = [].slice.apply(arguments);\n var fullArgs = partialArgs.concat(remainingArgs);\n\n return func.apply(ctx, fullArgs);\n }\n}", "function bind(node, scope) {\r\n var nodeType = node.nodeType;\r\n if (nodeType == 1 || nodeType == 9) { // Element or Document\r\n //console.log(\"<\"+node.nodeName+\">\");\r\n // iterate over attributes and apply bindings.\r\n var attrs = node.attributes, owned = false;\r\n for (var i=0,n=attrs&&attrs.length; i<n; i++) {\r\n var attr = attrs[i];\r\n if (attr.specified) {\r\n var name = attr.name;\r\n if (hasPrefix.test(name)) {\r\n var handler = bindings[name.slice(prefix.length)];\r\n if (handler) {\r\n //console.log(attr.name, '=', attr.value);\r\n owned = owned || handler(node, attr.value, scope, bind);\r\n } else {\r\n //console.log(\"no handler for attribute:\", name);\r\n }\r\n }\r\n }\r\n }\r\n // iterate over child nodes, unless the node has been\r\n // converted to a template.\r\n if (!owned) {\r\n var child = node.firstChild;\r\n while (child) {\r\n // note that bindings can remove the node from the document,\r\n // so advance to the next child before applying bindings.\r\n var c = child;\r\n child = child.nextSibling;\r\n bind(c, scope);\r\n }\r\n }\r\n }\r\n }", "_bind(...methods) {\n methods.forEach((method) => this[method] = this[method].bind(this));\n }", "_bindEventListenerCallbacks() {\n this._onClickBound = this._onClick.bind(this);\n this._onScrollBound = this._onScroll.bind(this);\n this._onResizeBound = this._onResize.bind(this);\n this._onVisibleBound = this._onVisible.bind(this);\n this._onMutateBound = this._onMutate.bind(this);\n }", "function bind(method, context) {\n\t\treturn function() { return method.apply(context, arguments); };\n\t}", "function bind(method, context) {\n\t\treturn function() { return method.apply(context, arguments); };\n\t}", "function bind(method, context) {\n\t\treturn function() { return method.apply(context, arguments); };\n\t}", "function bind(context) {\n var self = this; // \"trapped\" function reference\n // only if there is more than an argument\n // we are interested into more complex operations\n // this will speed up common bind creation\n // avoiding useless slices over arguments\n if (1 < arguments.length) {\n // extra arguments to send by default\n var $arguments = slice.call(arguments, 1);\n return function () {\n return self.apply(\n context,\n // thanks @kangax for this suggestion\n arguments.length ?\n // concat arguments with those received\n $arguments.concat(slice.call(arguments)) :\n // send just arguments, no concat, no slice\n $arguments\n );\n };\n }\n // optimized callback\n return function () {\n // speed up when function is called without arguments\n return arguments.length ? self.apply(context, arguments) : self.call(context);\n };\n }", "function bind(method, context) {\n\t\t\t\treturn function () {\n\t\t\t\t\treturn method.apply(context, arguments);\n\t\t\t\t};\n\t\t\t}", "function bind(method, context) {\n\t\t\t\treturn function () {\n\t\t\t\t\treturn method.apply(context, arguments);\n\t\t\t\t};\n\t\t\t}", "function bind(method, context) {\n\t\t\t\treturn function () {\n\t\t\t\t\treturn method.apply(context, arguments);\n\t\t\t\t};\n\t\t\t}", "function bind(method, context) {\n\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t}", "function bind(method, context) {\n\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t}", "function bind(method, context) {\n\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t}", "function bind(method, context) {\n\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t}", "function bind(method, context) {\n\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t}", "function bind(method, context) {\n\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t}", "function bind(method, context) {\n\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t}", "function bind(method, context) {\n\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t}", "function bind(method, context) {\n\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t}", "function bind(method, context) {\n\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t}", "function bind(method, context) {\n\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t}", "function bind(method, context) {\n\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t}" ]
[ "0.6775124", "0.6724796", "0.62795913", "0.62649524", "0.6179377", "0.61273736", "0.60670125", "0.60670125", "0.60618997", "0.60056996", "0.5995839", "0.59634364", "0.5918577", "0.59125096", "0.58677274", "0.5812696", "0.58043873", "0.574314", "0.5740524", "0.5738893", "0.57292485", "0.57056797", "0.57056797", "0.57003933", "0.5698038", "0.5698038", "0.56885713", "0.56806976", "0.56761354", "0.56687194", "0.5668043", "0.56669414", "0.5664105", "0.5628566", "0.5602442", "0.5583934", "0.5579205", "0.557724", "0.55689996", "0.5568348", "0.55502295", "0.5530118", "0.5530118", "0.5529673", "0.5526247", "0.5526247", "0.5526247", "0.5526247", "0.5526247", "0.5526247", "0.5526247", "0.55183196", "0.5517298", "0.54984087", "0.54871565", "0.5481934", "0.54817444", "0.548135", "0.5475279", "0.54738706", "0.54738706", "0.54738706", "0.5469025", "0.54616934", "0.54616934", "0.54616934", "0.5461112", "0.5461112", "0.5461112", "0.5461112", "0.5461112", "0.5461112", "0.5461112", "0.5461112", "0.5461112", "0.5461112", "0.5461112", "0.5461112" ]
0.59807986
27
function used as an initial value for watchers. because it's unique we can easily tell it apart from other values
function initWatchVal() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initWatchVal() {} // 16439", "function initWatchVal(){}", "function initWatchVal(){}", "function analogueWatch(){\n \n\n \n}", "watch() {\n }", "isFirstChange() { return this.firstChange; }", "isFirstChange() { return this.firstChange; }", "get isWatching(){ return this._isWatching }", "function newWatchFn(pojo_, fk) {\n return function () {\n return pojo_[fk];\n };\n}", "firstUpdated() {}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function generateWatchers() {\n\t\tvar uiR = $rootScope.ressources.ui;\n\t\tfor (var key in uiR) {\n\t\t\tfor (var type in uiR[key]) {\n\t\t\t\tif (type == \"variables\") {\n\t\t\t\t\tfor (var vari in uiR[key][type]) {\n\t\t\t\t\t\tui.variables[vari] = uiR[key][type][vari];\n\t\t\t\t\t\trootVar[vari] = uiR[key][type][vari];\n\t\t\t\t\t\trootfn.varChanged(vari, uiR[key][type][vari], uiR[key][type][vari]);\n\t\t\t\t\t\t\n\t\t\t\t\t\tui.variables.watch(vari, function (prop, oldval, newval) {\n\t\t\t\t\t\t\trootfn.varChanged(prop, oldval, newval);\n\t\t\t\t\t\t\treturn newval;\n\t\t\t\t\t\t});\n\t\t\t\t\t\trootVar.watch(vari, function (prop, oldval, newval) {\n\t\t\t\t\t\t\trootfn.varChanged(prop, oldval, newval);\n\t\t\t\t\t\t\treturn newval;\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}", "handler(newVal, oldVal) {\n if(!TypeChecker.isUndefined(oldVal)) {\n this.getValue();\n }\n }", "static _valueHasChanged(e,t,n=notEqual){return n(e,t)}", "initWatcher() {\n this.watcher.watch();\n this.watcher.change(services => {\n let wrapper = this.engineCache[this.serviceName];\n let hash = (0, _Util.md5)(JSON.stringify(services));\n if (wrapper && hash !== wrapper.hash) {\n wrapper.engine.update(services);\n wrapper.hash = hash;\n } else if (!wrapper) {\n wrapper = {\n engine: loadBalance.getEngine(services, loadBalance.RANDOM_ENGINE),\n hash: hash\n };\n }\n\n this.engineCache[this.serviceName] = wrapper;\n });\n\n return this.watcher;\n }", "_beforeChange () {\n // nop\n }", "_beforeChange () {\n // nop\n }", "function setupWatch(freq) {\n // global var here so it can be cleared on logout (or whenever).\n activeWatch = setInterval(watchLocation, freq);\n }", "onCurrentChanged(value) {\n /* no-op */\n }", "isFirstChange() {\n return this.firstChange;\n }", "isFirstChange() {\n return this.firstChange;\n }", "isFirstChange() {\n return this.firstChange;\n }", "isFirstChange() {\n return this.firstChange;\n }", "isFirstChange() {\n return this.firstChange;\n }", "isFirstChange() {\n return this.firstChange;\n }", "isFirstChange() {\n return this.firstChange;\n }", "function othersInit(self) {\n const el = self.element;\n el.value = self.currentValue;\n self.subscribe({event: 'change', fn: self.onchange });\n}", "function staticWatcher(newVal) {\n if ((hash = newVal.indexOf('#')) > -1)\n newVal = newVal.substr(hash + 1);\n watcher = function watchHref() {\n modelSetter($scope, ($location.path().indexOf(newVal) > -1));\n };\n watcher();\n }", "function staticWatcher(newVal) {\n if ((hash = newVal.indexOf('#')) > -1)\n newVal = newVal.substr(hash + 1);\n watcher = function watchHref() {\n modelSetter($scope, ($location.path().indexOf(newVal) > -1));\n };\n watcher();\n }", "function Watcher()\n\t{\n\t\tthis._callbacks = [];\n\t\tthis._callbacksDone = [];\n\t\tthis._callbackArgs = []; // array of argument arrays which are returned by callbacks\n\t\tthis._callbackArgsByKey = {}; // map of callbackKeyStr to callback arguments array\n\t\tthis._started = false;\n\t}", "_autoChanged(newValue){this.enabled=newValue}", "firstUpdated(_changedProperties) {\n }", "firstUpdated(_changedProperties) {\n }", "firstUpdated(_changedProperties) {\n }", "function initializeWatch() {\n if (runningUp === 0) {\n runningUp = 1;\n increment(timeUp); // call increment() for first time\n setIconUp(runningUp); // change icon to pause\n document.getElementById(\"startPauseUp\").disabled = false; //enable Play/Pause button \n } else {\n runningUp = 0;\n setIconUp(runningUp); // change icon to play\n }\n\n if (runningDown === 0) {\n runningDown = 1;\n decrement(getTarget()); // call decrement() for first time\n setIconDown(runningDown); // change icon to pause\n document.getElementById(\"startPauseDown\").disabled = false; //enable Play/Pause button \n } else {\n runningDown = 0;\n setIconDown(runningDown); // change icon to play\n }\n}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElementValue=target.value;activeElementValueProp=Object.getOwnPropertyDescriptor(target.constructor.prototype,'value');// Not guarded in a canDefineProperty check: IE8 supports defineProperty only\n// on DOM elements\nObject.defineProperty(activeElement,'value',newValueProp);if(activeElement.attachEvent){activeElement.attachEvent('onpropertychange',handlePropertyChange);}else{activeElement.addEventListener('propertychange',handlePropertyChange,false);}}", "function startWatch() {\r\n //if there's not already a watch\r\n if (!watcher) {\r\n watcher = scope.$watch(function () {\r\n return modelCtrl.$modelValue;\r\n }, function (newValue, oldValue) {\r\n\r\n if (!newValue || angular.equals(newValue, oldValue)) {\r\n return;\r\n }\r\n\r\n if (modelCtrl.$invalid) {\r\n modelCtrl.$setValidity('valServer', true);\r\n stopWatch();\r\n }\r\n }, true);\r\n }\r\n }", "function cb$watch(value) {\n console.log('cambiando formato!!!!');\n \t\t\t\tformat = value;\n \t\t\t\tupdateTime();\n \t\t\t}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElementValue=target.value;activeElementValueProp=Object.getOwnPropertyDescriptor(target.constructor.prototype,'value'); // Not guarded in a canDefineProperty check: IE8 supports defineProperty only\n\t// on DOM elements\n\tObject.defineProperty(activeElement,'value',newValueProp);if(activeElement.attachEvent){activeElement.attachEvent('onpropertychange',handlePropertyChange);}else {activeElement.addEventListener('propertychange',handlePropertyChange,false);}}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElementValue=target.value;activeElementValueProp=Object.getOwnPropertyDescriptor(target.constructor.prototype,'value'); // Not guarded in a canDefineProperty check: IE8 supports defineProperty only\n\t// on DOM elements\n\tObject.defineProperty(activeElement,'value',newValueProp);if(activeElement.attachEvent){activeElement.attachEvent('onpropertychange',handlePropertyChange);}else {activeElement.addEventListener('propertychange',handlePropertyChange,false);}}", "function staticWatcher(newVal) {\n var hash = newVal.indexOf('#');\n if (hash > -1){\n newVal = newVal.substr(hash + 1);\n }\n watcher = function watchHref() {\n modelSetter($scope, ($location.path().indexOf(newVal) > -1));\n };\n watcher();\n }", "function staticWatcher(newVal) {\n var hash = newVal.indexOf('#');\n if (hash > -1){\n newVal = newVal.substr(hash + 1);\n }\n watcher = function watchHref() {\n modelSetter($scope, ($location.path().indexOf(newVal) > -1));\n };\n watcher();\n }", "function startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent(\n 'onpropertychange',\n handlePropertyChange,\n );\n }", "initWatcher() {\n this.watcher.watch();\n this.watcher.change(services => {\n let wrapper = this.engineCache[this.serviceName];\n let hash = md5(JSON.stringify(services));\n if (wrapper && hash !== wrapper.hash) {\n wrapper.pool = services;\n wrapper.engine.update(services);\n wrapper.hash = hash;\n } else if (!wrapper) {\n wrapper = {\n pool: services,\n engine: loadBalance.getEngine(services, loadBalance.RANDOM_ENGINE),\n hash: hash\n };\n }\n\n this.event.emit(REFRESHING_SERVICE_LIST_EVENT, services, wrapper.engine._pool);\n this.engineCache[this.serviceName] = wrapper;\n });\n\n this.watcher.error(err => {\n this.event.emit(REFRESHING_SERVICE_LIST_ERROR_EVENT, err);\n });\n\n return this.watcher;\n }", "function initInitial () {\n var\n unwatch = $scope.$watch(\n function watcher () {\n return $scope.tableSortField;\n },\n function callback (tableSortField) {\n // Do nothing if we do not have the value yet\n if (!tableSortField) {\n return;\n }\n\n // De-register the watcher\n unwatch();\n\n // Reverse the initial sort if the reverse attribute is set on the\n // directive.\n if ($scope.tableSortReverseInitial) {\n console.log(\"TableSortFieldController: Initial sort reversed on expression '\" + tableSortField + \"'.\");\n\n reverse = true;\n }\n\n // Sort if this field is configured as initial sort field and there is\n // no sort configuration yet\n if ($scope.tableSortInitial && !$scope.tableSortCtrl.getTableSortField()) {\n console.log(\"TableSortFieldController: Initial sort on expression '\" + tableSortField + \"'.\");\n\n $scope.tableSort();\n }\n }\n )\n }" ]
[ "0.81336576", "0.7987343", "0.7987343", "0.6202974", "0.60983175", "0.59546864", "0.59546864", "0.59151256", "0.58454293", "0.57748675", "0.5755569", "0.5755569", "0.5755569", "0.5755569", "0.5755569", "0.5755569", "0.5755569", "0.5755569", "0.5755569", "0.5755569", "0.5755569", "0.5755569", "0.5729529", "0.56729376", "0.5671501", "0.56569916", "0.5617198", "0.5617198", "0.55713105", "0.5562698", "0.55550474", "0.55550474", "0.55550474", "0.55550474", "0.55550474", "0.55550474", "0.55550474", "0.5535767", "0.5526882", "0.5526882", "0.55253375", "0.5522074", "0.5515126", "0.5515126", "0.5515126", "0.55063725", "0.55049145", "0.547303", "0.54680735", "0.5451365", "0.5451365", "0.54369295", "0.54369295", "0.54351956", "0.5433061", "0.54278105" ]
0.80344504
36
Helper functions for `filterFilter`
function createPredicateFn(expression, comparator, matchAgainstAnyProp) { var shouldMatchPrimitives = isObject(expression) && ('$' in expression); var predicateFn; if (comparator === true) { comparator = equals; } else if (!isFunction(comparator)) { comparator = function(actual, expected) { if (isUndefined(actual)) { // No substring matching against `undefined` return false; } if ((actual === null) || (expected === null)) { // No substring matching against `null`; only match against `null` return actual === expected; } if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) { // Should not compare primitives against objects, unless they have custom `toString` method return false; } actual = lowercase('' + actual); expected = lowercase('' + expected); return actual.indexOf(expected) !== -1; }; } predicateFn = function(item) { if (shouldMatchPrimitives && !isObject(item)) { return deepCompare(item, expression.$, comparator, false); } return deepCompare(item, expression, comparator, matchAgainstAnyProp); }; return predicateFn; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "filter() {\n\t}", "filter() {\n\t}", "function filter() {\n \n}", "function filterFunction() {\n \n}", "filtering(data, filters) { // eslint-disable-line\n /**\n * Inputs:\n * data: List of JSON objects to filter\n * example: data = [\n * {\n * name: 'Joe',\n * ...\n * },\n * ...\n * ]\n * filters: The filters to apply.\n * example: filters = [\n * {\n * name: 'SexualOrient',\n * type: FILTER_CATEGORICAL,\n * value: ['Bi', 'Het'], // Take OUT 'Bi', 'Het'\n * },\n * {\n * name: 'Alcohol',\n * type: FILTER_CONTINUOUS,\n * minVal: 1,\n * maxVal: 24,\n * },\n * {\n * name: 'Age',\n * type: FILTER_BUCKETED,\n * buckets: [\n * { minVal: null, maxVal: 20 },\n * { minVal: 20, maxVal: 30 },\n * { minVal: 30, maxVal: null },\n * ]\n * },\n * {\n * name: 'date',\n * type: FILTER_DATE,\n * startYear: 2000,\n * endYear: 2012,\n * },\n * ]\n */\n // Filter each data item\n return data.filter((elem) => {\n let show = true;\n\n filters.forEach((eachFilter) => {\n switch (eachFilter.type) {\n case FILTER_CATEGORICAL: {\n show = show && eachFilter.value.indexOf(elem[eachFilter.name]) === -1;\n break;\n }\n case FILTER_CONTINUOUS: {\n show = (show && elem[eachFilter.name] >= eachFilter.minVal &&\n elem[eachFilter.name] < eachFilter.maxVal);\n break;\n }\n case FILTER_BUCKETED: {\n show = (show && elem[eachFilter.name] >= eachFilter.minVal &&\n elem[eachFilter.name] < eachFilter.maxVal);\n break;\n }\n case FILTER_DATE: {\n const date = new Date(elem[eachFilter.name]);\n\n // Make sure it is a valid date\n show = !isNaN(date.valueOf());\n\n show = (show && date.getFullYear() >= eachFilter.startYear && date.getFullYear() < eachFilter.endYear);\n break;\n }\n default:\n }\n });\n return show;\n });\n }", "function testFilter(self) {\n if (self.filters.tagOptions == \"all\") {\n return function(item) {\n console.log(\"filter run because all\");\n return true;\n }\n } else {\n return function(item) {\n console.log(\"filter run because any\");\n return true;\n }\n }\n}", "removeAllFilters() {}", "filter () {\n let ch = this.next();\n let args = [];\n let nextFilter = function (v) { return v };\n let name = this.name();\n\n if (!options.filters[name]) {\n options.onError('Cannot find filter by the name of: ' + name);\n }\n\n ch = this.white();\n\n while (ch) {\n if (ch === ':') {\n ch = this.next();\n args.push(this.expression('|'));\n }\n\n if (ch === '|') {\n nextFilter = this.filter();\n break\n }\n\n if (ch === ',') { break }\n\n ch = this.white();\n }\n\n var filter = function filter (value, ignored, context, globals, node) {\n var argValues = [value];\n\n for (var i = 0, j = args.length; i < j; ++i) {\n argValues.push(Node$1.value_of(args[i], context, globals, node));\n }\n\n return nextFilter(options.filters[name].apply(null, argValues))\n };\n\n // Lowest precedence.\n filter.precedence = 1;\n return filter\n }", "function TestFilter(){\n\t\treturn function(arr, param1, param2){\n\t\t\tconsole.log(\"filter called\");\n\t\t\tif(param1){\n\t\t\t\tvar filtered = _.select(arr, function(item) {\n\t \t\t\t\treturn item.indexOf( param1 ) !== -1;\n\t\t\t\t});\t\n\n\t\t\t\treturn filtered;\n\t\t\t} else{\n\t\t\t\treturn arr;\n\t\t\t}\n\t\t};\n\t}", "function setFilters() {} // 2166", "function compFilter(filtered){\n return function(d){\n var logical = filterProvince(d.province) &&\n filterParty(d.results[0].party) &&\n filterVoteMargin(d.voteMargin) &&\n filterRUParty(d.results[1].party) &&\n filterVoteTurnout(d[\"Percentage of Votes Polled to Registered Voters\"]) &&\n filterNARange(+d.seat.replace(/P[KPBS]-/, \"\"));\n\n if (filtered == true){\n return logical;\n }\n else {\n return !(logical);\n }\n }\n }", "function filter(field, value)\n {\n \n }", "customFilter(filter, row) {\n return typeof row[filter.id] === \"string\"\n ? stringFrIncludes(filter.value, row[filter.id])\n : true;\n }", "customFilter(filter, row) {\n return typeof row[filter.id] === \"string\"\n ? stringFrIncludes(filter.value, row[filter.id])\n : true;\n }", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}" ]
[ "0.7683927", "0.7683927", "0.7419144", "0.7203132", "0.6785491", "0.67786944", "0.6774108", "0.6726504", "0.6723168", "0.6675409", "0.66080153", "0.65757865", "0.64860916", "0.64860916", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775", "0.6483775" ]
0.0
-1
Used for easily differentiating between `null` and actual `object`
function getTypeForFilter(val) { return (val === null) ? 'null' : typeof val; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isResNull(obj) {\n return obj.type == ResType.MISC && obj.content == ResType.miscTypes.NULL;\n}", "function isObject(o){ return typeof o === 'object' && o !== null; }", "function nOrU(obj){ return obj == null || obj == undefined }", "function i(t){return null!==t&&\"object\"==typeof t}", "function o(t){return void 0===t||null===t}", "function o(t){return void 0===t||null===t}", "function o(t){return void 0===t||null===t}", "function o(t){return void 0===t||null===t}", "function o(n){return null!==n&&\"object\"==typeof n}", "function c(e){return null!==e&&\"object\"==typeof e}", "function object$1(value) {\r\n // 低版本 IE 会把 null 当作 object\r\n return value !== NULL && typeof value === 'object';\r\n }", "function isNull(obj){\n\treturn obj==undefined || obj==null;\n}", "function isNull(obj) {\n\treturn obj === NULL;\n}", "function isNull(obj) {\n return obj === null;\n}", "function isRealValue(obj){\n return obj && obj !== \"null\" && obj!== \"undefined\";\n}", "function o(e){return void 0===e||null===e}", "function isNullOrUndefined(obj) {\n return obj == null;\n}", "function isObject(obj){return obj!==null&&(typeof obj===\"undefined\"?\"undefined\":_typeof2(obj))==='object';}", "function isObject(obj){return obj!==null&&(typeof obj===\"undefined\"?\"undefined\":_typeof2(obj))==='object';}", "function t(e){return e===undefined||null===e}", "function isRealValue(obj) {\r\n return obj && obj !== 'null' && obj !== 'undefined';\r\n}", "function isVoid(obj) {\n return obj === undefined || obj === null;\n }", "function isVoid(obj) {\n return obj === undefined || obj === null;\n }", "function isObject(obj){return obj!==null&&(typeof obj==='undefined'?'undefined':_typeof(obj))==='object';}", "function isNull(obj) {\n return obj === null;\n }", "function isNull(obj) {\n return obj === null;\n }", "function isNull(obj) {\n return obj === null;\n }", "function isNull(obj) {\n return obj === null;\n }", "function isNull(obj) {\n return obj === null;\n }", "function isNull(obj) {\n return obj === null;\n }", "function isNull(obj) {\n return obj === null;\n }", "function isNull(obj) {\n return obj === null;\n }", "function isNull(obj) {\n return obj === null;\n }", "function isNonNullObject(input) {\r\n return typeof input === \"object\" && input !== null ? true : false;\r\n}", "function t(a){return void 0===a||null===a}", "function isVoid(obj) {\n return obj === undefined || obj === null;\n }", "function isVoid(obj) {\n return obj === undefined || obj === null;\n }", "function isVoid(obj) {\n return obj === undefined || obj === null;\n}", "function isObject(obj) {\n return typeof obj === \"object\" && obj !== null;\n}", "function isObject(value) { return typeof value === \"object\" && value !== null; }", "function isObjectLike(obj) {\n return typeof obj === \"object\" && obj !== null;\n}", "function sc_isNull(o) {\n return (o === null);\n}", "function isObject( x ) {\n return typeof x === \"object\" && x !== null;\n }", "isObject(obj) {\n return obj !== null && typeof obj === 'object'\n }", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function isPlainObject(value) {\r\n return value.constructor === Object || value.constructor == null;\r\n}", "function t(t){return void 0===t||null===t}", "function Null$prototype$toString() {\n return 'null';\n }", "function i(t){return void 0===t||null===t}", "function i(t){return void 0===t||null===t}", "function i(t){return void 0===t||null===t}", "function i(t){return void 0===t||null===t}", "function i(t){return void 0===t||null===t}", "function i(t){return void 0===t||null===t}", "function i(t){return void 0===t||null===t}", "function i(t){return void 0===t||null===t}", "function i(t){return void 0===t||null===t}", "function i(t){return void 0===t||null===t}", "function i(t){return void 0===t||null===t}", "function nullAndUndefined()\n{\n\n}", "function isNullOrUndefined(obj) {\n return typeof obj === 'undefined' || obj == null;\n }", "function isObject(x) {\n return typeof x === \"object\" && x !== null;\n}", "function e(t){return void 0===t||null===t}", "function e(t){return void 0===t||null===t}", "function e(t){return void 0===t||null===t}", "function n(t){return\"[object Object]\"==={}.toString.call(t)}", "function isobj(data) {\n if (data == null) return false\n if (data.constructor && data.constructor.name != 'Object') return false\n return true\n}", "function e(A){return void 0===A||null===A}", "function s(e){return void 0===e||null===e}", "function objectDefinedNotNull(obj) {\r\n return typeof obj !== \"undefined\" && obj !== null;\r\n}", "function isObject(a) {\n return typeof a === 'object' && a !== null;\n}", "function isObject(a) {\n return typeof a === 'object' && a !== null;\n}", "function isObject(a) {\n return typeof a === 'object' && a !== null;\n}", "function nully(x) {\n return x == null;\n}", "function nully(x) {\n return x == null;\n}", "function n(e) {\n return (\n !0 ==\n (null != (t = e) &&\n \"object\" == typeof t &&\n !1 === Array.isArray(t)) &&\n \"[object Object]\" === Object.prototype.toString.call(e)\n );\n /*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n var t;\n }", "function isObject(obj) {\n return obj !== null && typeof obj === 'object';\n }", "function isNull(mixElement)\n{\n return typeof mixElement == 'object' && !mixElement;\n}", "function isObject(obj) {\n return obj !== null && typeof obj === \"object\";\n }", "function isObject (obj) {\n return obj !== null && typeof obj === 'object'\n }", "function isObject (obj) {\n return obj !== null && typeof obj === 'object'\n }", "function isObject (obj) {\n return obj !== null && typeof obj === 'object'\n }", "function isObject (obj) {\n return obj !== null && typeof obj === 'object'\n }" ]
[ "0.7207444", "0.71657306", "0.71586436", "0.7144079", "0.7064218", "0.7064218", "0.7064218", "0.7064218", "0.70635104", "0.703787", "0.7002241", "0.69887596", "0.6976452", "0.6891332", "0.6880794", "0.6849825", "0.6844689", "0.68445385", "0.68445385", "0.68440264", "0.6825665", "0.6800592", "0.6800592", "0.6777454", "0.6754792", "0.6754792", "0.6754792", "0.6754792", "0.6754792", "0.6754792", "0.6754792", "0.6754792", "0.6754792", "0.6746802", "0.67280364", "0.6716033", "0.6716033", "0.66964287", "0.6659375", "0.6627238", "0.66193825", "0.6603282", "0.66022795", "0.6589132", "0.6563761", "0.6563761", "0.6563761", "0.6563761", "0.6563761", "0.6563761", "0.6563761", "0.6563761", "0.6563761", "0.6563761", "0.6563761", "0.6563761", "0.6563761", "0.6563761", "0.6563761", "0.6563761", "0.6563761", "0.6563761", "0.6563761", "0.6523994", "0.651227", "0.64923424", "0.648618", "0.648618", "0.648618", "0.648618", "0.648618", "0.648618", "0.648618", "0.648618", "0.648618", "0.648618", "0.648618", "0.6462226", "0.6456795", "0.6453235", "0.6437123", "0.6437123", "0.6437123", "0.6429159", "0.6399421", "0.6396439", "0.6381878", "0.63791585", "0.63730204", "0.63730204", "0.63730204", "0.6369298", "0.6369298", "0.6366303", "0.6365227", "0.6351444", "0.63496774", "0.6345686", "0.6345686", "0.6345686", "0.6345686" ]
0.0
-1
Round the parsed number to the specified number of decimal places This function changed the parsedNumber inplace
function roundNumber(parsedNumber, fractionSize, minFrac, maxFrac) { var digits = parsedNumber.d; var fractionLen = digits.length - parsedNumber.i; // determine fractionSize if it is not specified; `+fractionSize` converts it to a number fractionSize = (isUndefined(fractionSize)) ? Math.min(Math.max(minFrac, fractionLen), maxFrac) : +fractionSize; // The index of the digit to where rounding is to occur var roundAt = fractionSize + parsedNumber.i; var digit = digits[roundAt]; if (roundAt > 0) { // Drop fractional digits beyond `roundAt` digits.splice(Math.max(parsedNumber.i, roundAt)); // Set non-fractional digits beyond `roundAt` to 0 for (var j = roundAt; j < digits.length; j++) { digits[j] = 0; } } else { // We rounded to zero so reset the parsedNumber fractionLen = Math.max(0, fractionLen); parsedNumber.i = 1; digits.length = Math.max(1, roundAt = fractionSize + 1); digits[0] = 0; for (var i = 1; i < roundAt; i++) digits[i] = 0; } if (digit >= 5) { if (roundAt - 1 < 0) { for (var k = 0; k > roundAt; k--) { digits.unshift(0); parsedNumber.i++; } digits.unshift(1); parsedNumber.i++; } else { digits[roundAt - 1]++; } } // Pad out with zeros to get the required fraction length for (; fractionLen < Math.max(0, fractionSize); fractionLen++) digits.push(0); // Do any carrying, e.g. a digit was rounded up to 10 var carry = digits.reduceRight(function(carry, d, i, digits) { d = d + carry; digits[i] = d % 10; return Math.floor(d / 10); }, 0); if (carry) { digits.unshift(carry); parsedNumber.i++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function roundNum(num){\n return Math.round(num * 10) / 10;\n }", "function roundNumber(v) {\n\treturn parseFloat(parseFloat(v).toFixed(2));\n}", "function roundNumber(parsedNumber,fractionSize,minFrac,maxFrac){var digits=parsedNumber.d;var fractionLen=digits.length-parsedNumber.i;// determine fractionSize if it is not specified; `+fractionSize` converts it to a number\nfractionSize=isUndefined(fractionSize)?Math.min(Math.max(minFrac,fractionLen),maxFrac):+fractionSize;// The index of the digit to where rounding is to occur\nvar roundAt=fractionSize+parsedNumber.i;var digit=digits[roundAt];if(roundAt>0){// Drop fractional digits beyond `roundAt`\ndigits.splice(Math.max(parsedNumber.i,roundAt));// Set non-fractional digits beyond `roundAt` to 0\nfor(var j=roundAt;j<digits.length;j++){digits[j]=0;}}else{// We rounded to zero so reset the parsedNumber\nfractionLen=Math.max(0,fractionLen);parsedNumber.i=1;digits.length=Math.max(1,roundAt=fractionSize+1);digits[0]=0;for(var i=1;i<roundAt;i++){digits[i]=0;}}if(digit>=5){if(roundAt-1<0){for(var k=0;k>roundAt;k--){digits.unshift(0);parsedNumber.i++;}digits.unshift(1);parsedNumber.i++;}else{digits[roundAt-1]++;}}// Pad out with zeros to get the required fraction length\nfor(;fractionLen<Math.max(0,fractionSize);fractionLen++){digits.push(0);}// Do any carrying, e.g. a digit was rounded up to 10\nvar carry=digits.reduceRight(function(carry,d,i,digits){d=d+carry;digits[i]=d%10;return Math.floor(d/10);},0);if(carry){digits.unshift(carry);parsedNumber.i++;}}", "function RoundNumber (number, decimal){\n\tvar retval = Math.round(Math.pow(10, decimal) * number)/ Math.pow(10, decimal);\n\tif (decimal = 2){\n\t\tvar s_retval = retval.toString();\n\t\tif (s_retval.indexOf('.')>=0){\n\t\t\tanum = s_retval.split('.');\n\t\t\tvar rem = anum[1];\n\t\t\tif (rem.length == 1){\n\t\t\t\treturn s_retval + \"0\";\n\t\t\t}\n\t\t}else{\n\t\t\treturn s_retval + \".00\";\n\t\t}\n\t}\n\treturn retval; \n}", "function removeDecimal(number){\n return Math.round(number)\n }", "function round_to(x, num) {\n\tvar r = x.toFixed(num) + \"\";\n\tif (r.match('.'))\n\t\treturn r.replace(/\\.?0+$/,'');\n\treturn r;\n}", "function round_number(number,decimals){\n return Math.round(number*Math.pow(10,decimals))/Math.pow(10,decimals)\n }", "function round(number,decimal_points) {\r\n\tif (number == null) return 'NaN';\r\n\tif (!decimal_points || decimal_points == null) return Math.round(number);\r\n\tvar exp = Math.pow(10, decimal_points);\r\n\tnumber = Math.round(number * exp) / exp;\r\n\treturn parseFloat(number.toFixed(decimal_points));\r\n}", "function roundNum(num){\n return Number(num.toFixed(2));\n}", "function roundNumber(parsedNumber,fractionSize,minFrac,maxFrac){var digits=parsedNumber.d;var fractionLen=digits.length-parsedNumber.i;// determine fractionSize if it is not specified; `+fractionSize` converts it to a number\n\tfractionSize=isUndefined(fractionSize)?Math.min(Math.max(minFrac,fractionLen),maxFrac):+fractionSize;// The index of the digit to where rounding is to occur\n\tvar roundAt=fractionSize+parsedNumber.i;var digit=digits[roundAt];if(roundAt>0){// Drop fractional digits beyond `roundAt`\n\tdigits.splice(Math.max(parsedNumber.i,roundAt));// Set non-fractional digits beyond `roundAt` to 0\n\tfor(var j=roundAt;j<digits.length;j++){digits[j]=0;}}else{// We rounded to zero so reset the parsedNumber\n\tfractionLen=Math.max(0,fractionLen);parsedNumber.i=1;digits.length=Math.max(1,roundAt=fractionSize+1);digits[0]=0;for(var i=1;i<roundAt;i++){digits[i]=0;}}if(digit>=5){if(roundAt-1<0){for(var k=0;k>roundAt;k--){digits.unshift(0);parsedNumber.i++;}digits.unshift(1);parsedNumber.i++;}else{digits[roundAt-1]++;}}// Pad out with zeros to get the required fraction length\n\tfor(;fractionLen<Math.max(0,fractionSize);fractionLen++){digits.push(0);}// Do any carrying, e.g. a digit was rounded up to 10\n\tvar carry=digits.reduceRight(function(carry,d,i,digits){d=d+carry;digits[i]=d%10;return Math.floor(d/10);},0);if(carry){digits.unshift(carry);parsedNumber.i++;}}", "function roundNum(num) \n{ \n ans = num * 1000 \n ans = Math.round(ans /10) + \"\" \n while (ans.length < 3) {ans = \"0\" + ans} \n len = ans.length \n ans = ans.substring(0,len-2) + \".\" + ans.substring(len-2,len)\n return ans; \n}", "function roundNumber(parsedNumber,minFrac,maxFrac){if(minFrac>maxFrac){throw new Error(\"The minimum number of digits after fraction (\"+minFrac+\") is higher than the maximum (\"+maxFrac+\").\");}var digits=parsedNumber.digits;var fractionLen=digits.length-parsedNumber.integerLen;var fractionSize=Math.min(Math.max(minFrac,fractionLen),maxFrac);// The index of the digit to where rounding is to occur\nvar roundAt=fractionSize+parsedNumber.integerLen;var digit=digits[roundAt];if(roundAt>0){// Drop fractional digits beyond `roundAt`\ndigits.splice(Math.max(parsedNumber.integerLen,roundAt));// Set non-fractional digits beyond `roundAt` to 0\nfor(var j=roundAt;j<digits.length;j++){digits[j]=0;}}else{// We rounded to zero so reset the parsedNumber\nfractionLen=Math.max(0,fractionLen);parsedNumber.integerLen=1;digits.length=Math.max(1,roundAt=fractionSize+1);digits[0]=0;for(var i=1;i<roundAt;i++){digits[i]=0;}}if(digit>=5){if(roundAt-1<0){for(var k=0;k>roundAt;k--){digits.unshift(0);parsedNumber.integerLen++;}digits.unshift(1);parsedNumber.integerLen++;}else{digits[roundAt-1]++;}}// Pad out with zeros to get the required fraction length\nfor(;fractionLen<Math.max(0,fractionSize);fractionLen++){digits.push(0);}var dropTrailingZeros=fractionSize!==0;// Minimal length = nb of decimals required + current nb of integers\n// Any number besides that is optional and can be removed if it's a trailing 0\nvar minLen=minFrac+parsedNumber.integerLen;// Do any carrying, e.g. a digit was rounded up to 10\nvar carry=digits.reduceRight(function(carry,d,i,digits){d=d+carry;digits[i]=d<10?d:d-10;// d % 10\nif(dropTrailingZeros){// Do not keep meaningless fractional trailing zeros (e.g. 15.52000 --> 15.52)\nif(digits[i]===0&&i>=minLen){digits.pop();}else{dropTrailingZeros=false;}}return d>=10?1:0;// Math.floor(d / 10);\n},0);if(carry){digits.unshift(carry);parsedNumber.integerLen++;}}", "function round(num){\n return Math.round(num*10) / 10;\n }", "function round(control) \n{ \n ans = control.value * 1000 \n ans = Math.round(ans /10) + \"\" \n while (ans.length < 3) {ans = \"0\" + ans} \n len = ans.length \n ans = ans.substring(0,len-2) + \".\" + ans.substring(len-2,len)\n control.value = ans; \n}", "function roundit(num,dex) {\n return parseFloat(num).toFixed(dex);\n }", "function roundNumber(value, decPlaces) {\n let decPointShifter = Math.pow(10, decPlaces)\n return Math.round(value * decPointShifter) / decPointShifter\n}", "function roundNumber(number, decimals)\n{\n\tvar newnumber = new Number(number + '').toFixed(parseInt(decimals));\n\treturn parseFloat(newnumber);\n}", "function roundNum(num, point) {\n return 1 * num.toFixed(point);\n}", "static round(number, precision) {\n\t\tlet pair = (number + \"e\").split(\"e\");\n\t\tlet value = Math.round(pair[0] + \"e\" + (+pair[1] + precision));\n\t\tpair = (value + \"e\").split(\"e\");\n\t\treturn +(pair[0] + \"e\" + (+pair[1] - precision));\n\t}", "function roundme(val) {\n return val;\n }", "function round(num) {\n return Math.round(num * 100) / 100;\n }", "function round(number) {\n return Math.round(number * 100) / 100;\n}", "function round(number) {\n return Math.round(number * 100) / 100;\n}", "function round(number) {\n return Math.round(number * 100) / 100;\n}", "function fc_Round(num, dec) {\n num = (num+\"\")\n num = num.substring(0,num.indexOf(\".\")+dec+1); \n var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);\n return result;\n}", "function roundNumber(Number, Decimals) {\n // Argumentos: Numero a redondear, cantidad de decimales\n var Factor = Math.pow(10, Decimals);\n return Math.round(Number * Factor) / Factor;\n}", "function round(n, precision) {\n if (precision < 0) {\n const length = String(n).split('.')[0].length;\n return parseFloat(n.toLocaleString('en', { maximumSignificantDigits: length + precision, useGrouping: false }));\n }\n return parseFloat(n.toLocaleString('en', { maximumFractionDigits: precision, useGrouping: false }));\n}", "function roundNumber(parsedNumber, fractionSize, minFrac, maxFrac) {\n var digits = parsedNumber.d;\n var fractionLen = digits.length - parsedNumber.i;\n\n // determine fractionSize if it is not specified; `+fractionSize` converts it to a number\n fractionSize = (isUndefined(fractionSize)) ? Math.min(Math.max(minFrac, fractionLen), maxFrac) : +fractionSize;\n\n // The index of the digit to where rounding is to occur\n var roundAt = fractionSize + parsedNumber.i;\n var digit = digits[roundAt];\n\n if (roundAt > 0) {\n digits.splice(roundAt);\n } else {\n // We rounded to zero so reset the parsedNumber\n parsedNumber.i = 1;\n digits.length = roundAt = fractionSize + 1;\n for (var i=0; i < roundAt; i++) digits[i] = 0;\n }\n\n if (digit >= 5) digits[roundAt - 1]++;\n\n // Pad out with zeros to get the required fraction length\n for (; fractionLen < fractionSize; fractionLen++) digits.push(0);\n\n\n // Do any carrying, e.g. a digit was rounded up to 10\n var carry = digits.reduceRight(function(carry, d, i, digits) {\n d = d + carry;\n digits[i] = d % 10;\n return Math.floor(d / 10);\n }, 0);\n if (carry) {\n digits.unshift(carry);\n parsedNumber.i++;\n }\n}", "function roundNumber(parsedNumber, fractionSize, minFrac, maxFrac) {\n var digits = parsedNumber.d;\n var fractionLen = digits.length - parsedNumber.i;\n\n // determine fractionSize if it is not specified; `+fractionSize` converts it to a number\n fractionSize = (isUndefined(fractionSize)) ? Math.min(Math.max(minFrac, fractionLen), maxFrac) : +fractionSize;\n\n // The index of the digit to where rounding is to occur\n var roundAt = fractionSize + parsedNumber.i;\n var digit = digits[roundAt];\n\n if (roundAt > 0) {\n digits.splice(roundAt);\n } else {\n // We rounded to zero so reset the parsedNumber\n parsedNumber.i = 1;\n digits.length = roundAt = fractionSize + 1;\n for (var i=0; i < roundAt; i++) digits[i] = 0;\n }\n\n if (digit >= 5) digits[roundAt - 1]++;\n\n // Pad out with zeros to get the required fraction length\n for (; fractionLen < fractionSize; fractionLen++) digits.push(0);\n\n\n // Do any carrying, e.g. a digit was rounded up to 10\n var carry = digits.reduceRight(function(carry, d, i, digits) {\n d = d + carry;\n digits[i] = d % 10;\n return Math.floor(d / 10);\n }, 0);\n if (carry) {\n digits.unshift(carry);\n parsedNumber.i++;\n }\n}", "function round(decimal) {\n return parseFloat(Math.round(decimal * 100) / 100).toFixed(2);\n}", "function roundBy(decimalPlaces, num) {\n var scale = Math.pow(10, decimalPlaces);\n return Math.round(scale * num) / scale;\n }", "function round(num) {\n return Math.floor(num * 1000) / 1000;\n}", "function roundIt(value) {\n let places = 100;\n if (value < 100) {\n places = 10000;\n } else if (value < 0.001) {\n places = 1000000;\n }\n return Math.round((value + Number.EPSILON) * places) / places;\n }", "function roundToDecimalPlace(value, decimal) {\r\n var factor = Math.pow(10, decimal);\r\n roundedValue = ((Math.round(value * factor))/factor).toFixed(decimal);\r\n return roundedValue;\r\n}", "function rounding (number) {\n return Math.round(number)\n}", "function round(num) {\n return Math.round((num + Number.EPSILON) * 100) / 100;\n}", "function roundNumber(parsedNumber, fractionSize, minFrac, maxFrac) {\n\t var digits = parsedNumber.d;\n\t var fractionLen = digits.length - parsedNumber.i;\n\n\t // determine fractionSize if it is not specified; `+fractionSize` converts it to a number\n\t fractionSize = (isUndefined(fractionSize)) ? Math.min(Math.max(minFrac, fractionLen), maxFrac) : +fractionSize;\n\n\t // The index of the digit to where rounding is to occur\n\t var roundAt = fractionSize + parsedNumber.i;\n\t var digit = digits[roundAt];\n\n\t if (roundAt > 0) {\n\t // Drop fractional digits beyond `roundAt`\n\t digits.splice(Math.max(parsedNumber.i, roundAt));\n\n\t // Set non-fractional digits beyond `roundAt` to 0\n\t for (var j = roundAt; j < digits.length; j++) {\n\t digits[j] = 0;\n\t }\n\t } else {\n\t // We rounded to zero so reset the parsedNumber\n\t fractionLen = Math.max(0, fractionLen);\n\t parsedNumber.i = 1;\n\t digits.length = Math.max(1, roundAt = fractionSize + 1);\n\t digits[0] = 0;\n\t for (var i = 1; i < roundAt; i++) digits[i] = 0;\n\t }\n\n\t if (digit >= 5) {\n\t if (roundAt - 1 < 0) {\n\t for (var k = 0; k > roundAt; k--) {\n\t digits.unshift(0);\n\t parsedNumber.i++;\n\t }\n\t digits.unshift(1);\n\t parsedNumber.i++;\n\t } else {\n\t digits[roundAt - 1]++;\n\t }\n\t }\n\n\t // Pad out with zeros to get the required fraction length\n\t for (; fractionLen < Math.max(0, fractionSize); fractionLen++) digits.push(0);\n\n\n\t // Do any carrying, e.g. a digit was rounded up to 10\n\t var carry = digits.reduceRight(function(carry, d, i, digits) {\n\t d = d + carry;\n\t digits[i] = d % 10;\n\t return Math.floor(d / 10);\n\t }, 0);\n\t if (carry) {\n\t digits.unshift(carry);\n\t parsedNumber.i++;\n\t }\n\t}", "function roundNumber(parsedNumber, fractionSize, minFrac, maxFrac) {\n\t var digits = parsedNumber.d;\n\t var fractionLen = digits.length - parsedNumber.i;\n\n\t // determine fractionSize if it is not specified; `+fractionSize` converts it to a number\n\t fractionSize = (isUndefined(fractionSize)) ? Math.min(Math.max(minFrac, fractionLen), maxFrac) : +fractionSize;\n\n\t // The index of the digit to where rounding is to occur\n\t var roundAt = fractionSize + parsedNumber.i;\n\t var digit = digits[roundAt];\n\n\t if (roundAt > 0) {\n\t // Drop fractional digits beyond `roundAt`\n\t digits.splice(Math.max(parsedNumber.i, roundAt));\n\n\t // Set non-fractional digits beyond `roundAt` to 0\n\t for (var j = roundAt; j < digits.length; j++) {\n\t digits[j] = 0;\n\t }\n\t } else {\n\t // We rounded to zero so reset the parsedNumber\n\t fractionLen = Math.max(0, fractionLen);\n\t parsedNumber.i = 1;\n\t digits.length = Math.max(1, roundAt = fractionSize + 1);\n\t digits[0] = 0;\n\t for (var i = 1; i < roundAt; i++) digits[i] = 0;\n\t }\n\n\t if (digit >= 5) {\n\t if (roundAt - 1 < 0) {\n\t for (var k = 0; k > roundAt; k--) {\n\t digits.unshift(0);\n\t parsedNumber.i++;\n\t }\n\t digits.unshift(1);\n\t parsedNumber.i++;\n\t } else {\n\t digits[roundAt - 1]++;\n\t }\n\t }\n\n\t // Pad out with zeros to get the required fraction length\n\t for (; fractionLen < Math.max(0, fractionSize); fractionLen++) digits.push(0);\n\n\n\t // Do any carrying, e.g. a digit was rounded up to 10\n\t var carry = digits.reduceRight(function(carry, d, i, digits) {\n\t d = d + carry;\n\t digits[i] = d % 10;\n\t return Math.floor(d / 10);\n\t }, 0);\n\t if (carry) {\n\t digits.unshift(carry);\n\t parsedNumber.i++;\n\t }\n\t}", "function roundUsing(number, prec) {\n var tempnumber = number * Math.pow(10, prec);\n tempnumber = Math.round(tempnumber);\n return tempnumber / Math.pow(10, prec);\n}", "function round(num, places) {\n var multiplier = Math.pow(10, places);\n return Math.round(num * multiplier) / multiplier;\n }", "function roundTo3(num) {\r\n 'use strict';\r\n var postDecimal;\r\n\r\n postDecimal = num.toString().split(\".\")[1];\r\n\r\n if (!!postDecimal && postDecimal.length > 3) {\r\n return num.toFixed(3);\r\n }\r\n\r\n return num;\r\n}", "function roundUp(number, decimalPlaces) {\r\n var num = number.toFixed(decimalPlaces);\r\n return num;\r\n}", "function roundNumber(parsedNumber, fractionSize, minFrac, maxFrac) {\n var digits = parsedNumber.d;\n var fractionLen = digits.length - parsedNumber.i;\n\n // determine fractionSize if it is not specified; `+fractionSize` converts it to a number\n fractionSize = isUndefined(fractionSize) ? Math.min(Math.max(minFrac, fractionLen), maxFrac) : +fractionSize;\n\n // The index of the digit to where rounding is to occur\n var roundAt = fractionSize + parsedNumber.i;\n var digit = digits[roundAt];\n\n if (roundAt > 0) {\n // Drop fractional digits beyond `roundAt`\n digits.splice(Math.max(parsedNumber.i, roundAt));\n\n // Set non-fractional digits beyond `roundAt` to 0\n for (var j = roundAt; j < digits.length; j++) {\n digits[j] = 0;\n }\n } else {\n // We rounded to zero so reset the parsedNumber\n fractionLen = Math.max(0, fractionLen);\n parsedNumber.i = 1;\n digits.length = Math.max(1, roundAt = fractionSize + 1);\n digits[0] = 0;\n for (var i = 1; i < roundAt; i++) digits[i] = 0;\n }\n\n if (digit >= 5) {\n if (roundAt - 1 < 0) {\n for (var k = 0; k > roundAt; k--) {\n digits.unshift(0);\n parsedNumber.i++;\n }\n digits.unshift(1);\n parsedNumber.i++;\n } else {\n digits[roundAt - 1]++;\n }\n }\n\n // Pad out with zeros to get the required fraction length\n for (; fractionLen < Math.max(0, fractionSize); fractionLen++) digits.push(0);\n\n // Do any carrying, e.g. a digit was rounded up to 10\n var carry = digits.reduceRight(function (carry, d, i, digits) {\n d = d + carry;\n digits[i] = d % 10;\n return Math.floor(d / 10);\n }, 0);\n if (carry) {\n digits.unshift(carry);\n parsedNumber.i++;\n }\n }", "function round(n) {\n if (!n) {\n return 0;\n }\n return Math.floor(n * 100) / 100;\n }", "function round(number) {\n return floor(number + 0.5);\n}", "function round(number,decimal) {\n\tvar power = Math.pow(10,decimal);\n\treturn (Math.round(number*power)/power).toFixed(decimal);\n}", "function roundNumber(parsedNumber, minFrac, maxFrac) {\n if (minFrac > maxFrac) {\n throw new Error(\"The minimum number of digits after fraction (\".concat(minFrac, \") is higher than the maximum (\").concat(maxFrac, \").\"));\n }\n\n var digits = parsedNumber.digits;\n var fractionLen = digits.length - parsedNumber.integerLen;\n var fractionSize = Math.min(Math.max(minFrac, fractionLen), maxFrac); // The index of the digit to where rounding is to occur\n\n var roundAt = fractionSize + parsedNumber.integerLen;\n var digit = digits[roundAt];\n\n if (roundAt > 0) {\n // Drop fractional digits beyond `roundAt`\n digits.splice(Math.max(parsedNumber.integerLen, roundAt)); // Set non-fractional digits beyond `roundAt` to 0\n\n for (var j = roundAt; j < digits.length; j++) {\n digits[j] = 0;\n }\n } else {\n // We rounded to zero so reset the parsedNumber\n fractionLen = Math.max(0, fractionLen);\n parsedNumber.integerLen = 1;\n digits.length = Math.max(1, roundAt = fractionSize + 1);\n digits[0] = 0;\n\n for (var i = 1; i < roundAt; i++) {\n digits[i] = 0;\n }\n }\n\n if (digit >= 5) {\n if (roundAt - 1 < 0) {\n for (var k = 0; k > roundAt; k--) {\n digits.unshift(0);\n parsedNumber.integerLen++;\n }\n\n digits.unshift(1);\n parsedNumber.integerLen++;\n } else {\n digits[roundAt - 1]++;\n }\n } // Pad out with zeros to get the required fraction length\n\n\n for (; fractionLen < Math.max(0, fractionSize); fractionLen++) {\n digits.push(0);\n }\n\n var dropTrailingZeros = fractionSize !== 0; // Minimal length = nb of decimals required + current nb of integers\n // Any number besides that is optional and can be removed if it's a trailing 0\n\n var minLen = minFrac + parsedNumber.integerLen; // Do any carrying, e.g. a digit was rounded up to 10\n\n var carry = digits.reduceRight(function (carry, d, i, digits) {\n d = d + carry;\n digits[i] = d < 10 ? d : d - 10; // d % 10\n\n if (dropTrailingZeros) {\n // Do not keep meaningless fractional trailing zeros (e.g. 15.52000 --> 15.52)\n if (digits[i] === 0 && i >= minLen) {\n digits.pop();\n } else {\n dropTrailingZeros = false;\n }\n }\n\n return d >= 10 ? 1 : 0; // Math.floor(d / 10);\n }, 0);\n\n if (carry) {\n digits.unshift(carry);\n parsedNumber.integerLen++;\n }\n }", "function round(value)\n{\n\tvalue = +value.toFixed(3)\n\treturn value;\n}", "function fixPrecision(num, dec = 2, round = 0) {\n if (checkNum(num, dec, round)) {\n num = String(num);\n if (round === 0) {\n num = _round(Number(num), dec);\n }\n else if (round === 1 && num.lastIndexOf(\".\") > -1) {\n // keep decimal arg convenient\n dec += 1;\n num = num.slice(0, num.lastIndexOf(\".\") + dec);\n }\n // remove rounding and precision limits\n return Number(num);\n }\n }", "function round(value, fixed){\n\t\treturn parseFloat(Math.round(value * 10.0) / 10.0).toFixed(fixed);\n\t}", "function preciseRound(num, d){\n if (typeof num !== 'number' || typeof d !== 'number'){\n return \"not a number\";\n }\n return num.toFixed(d);\n}", "function roundString(numString) {\n // If is no decimal, we are already rounded correctly\n if (numString.indexOf('.') === -1) {\n return numString;\n }\n\n var removeAmount = 0;\n for (var i = numString.length-1 ; i >= 0; i--) {\n if (numString[i] === '0') {\n removeAmount++;\n }\n else if (numString[i] === '.') {\n removeAmount++;\n break;\n }\n else {\n break;\n }\n }\n return numString.substring(0, numString.length - removeAmount);\n}", "_round(x) {\n\t\treturn Math.round( x * 1000) / 1000;\n\t}", "function precise() {\n var num1 = 13495439.346983409;\n\n document.getElementById(\"precision\").innerHTML = num1.toPrecision(10);\n}", "function digits(value, round) {\n return parseFloat(value.toFixed(round));\n }", "round(value) {\n const context = this.context;\n\n // eslint-disable-next-line\n if (value instanceof window.JQX.Utilities.BigNumber && typeof value._d === 'bigint') {\n return value;\n }\n else if (value instanceof window.JQX.Utilities.BigNumber === false ||\n !context._wordLengthNumber || context._wordLengthNumber < 64) {\n return new JQX.Utilities.BigNumber(Math.round(value.toString()));\n }\n\n const fraction = value.mod(1);\n\n if (!(fraction._d.length === 1 && fraction._d[0] === 0)) {\n // if the entered number is with a decimal value, it is rounded up or down to its nearest integer equivalent\n\n value = value.intPart();\n if (!value._s) {\n // round positive number\n if (fraction._d[1] > 4) {\n value = value.add(1);\n }\n }\n else {\n // round negative number\n if (fraction._d[1] > 5 ||\n fraction._d[1] === 5 && fraction._d[2]) {\n value = value.add(-1);\n }\n }\n }\n return value;\n }", "round(place = 0) {\r\n const factor = Math.pow(10, place)\r\n return FNumber(Math.round(this.data * factor) / factor)\r\n }", "static roundNumber(value) {\n return Math.round(value);\n }", "function round_decimal(value, decimals) {\n return Number(Math.round(value + 'e' + decimals) + 'e-' + decimals);\n}", "function toPercent(parsedNumber) {\n // if the number is 0, don't do anything\n if (parsedNumber.digits[0] === 0) {\n return parsedNumber;\n }\n // Getting the current number of decimals\n const fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;\n if (parsedNumber.exponent) {\n parsedNumber.exponent += 2;\n }\n else {\n if (fractionLen === 0) {\n parsedNumber.digits.push(0, 0);\n }\n else if (fractionLen === 1) {\n parsedNumber.digits.push(0);\n }\n parsedNumber.integerLen += 2;\n }\n return parsedNumber;\n}", "function toPercent(parsedNumber) {\n // if the number is 0, don't do anything\n if (parsedNumber.digits[0] === 0) {\n return parsedNumber;\n }\n // Getting the current number of decimals\n const fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;\n if (parsedNumber.exponent) {\n parsedNumber.exponent += 2;\n }\n else {\n if (fractionLen === 0) {\n parsedNumber.digits.push(0, 0);\n }\n else if (fractionLen === 1) {\n parsedNumber.digits.push(0);\n }\n parsedNumber.integerLen += 2;\n }\n return parsedNumber;\n}", "function toPercent(parsedNumber) {\n // if the number is 0, don't do anything\n if (parsedNumber.digits[0] === 0) {\n return parsedNumber;\n }\n // Getting the current number of decimals\n const fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;\n if (parsedNumber.exponent) {\n parsedNumber.exponent += 2;\n }\n else {\n if (fractionLen === 0) {\n parsedNumber.digits.push(0, 0);\n }\n else if (fractionLen === 1) {\n parsedNumber.digits.push(0);\n }\n parsedNumber.integerLen += 2;\n }\n return parsedNumber;\n}", "function toPercent(parsedNumber) {\n // if the number is 0, don't do anything\n if (parsedNumber.digits[0] === 0) {\n return parsedNumber;\n }\n // Getting the current number of decimals\n const fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;\n if (parsedNumber.exponent) {\n parsedNumber.exponent += 2;\n }\n else {\n if (fractionLen === 0) {\n parsedNumber.digits.push(0, 0);\n }\n else if (fractionLen === 1) {\n parsedNumber.digits.push(0);\n }\n parsedNumber.integerLen += 2;\n }\n return parsedNumber;\n}", "function toPercent(parsedNumber) {\n // if the number is 0, don't do anything\n if (parsedNumber.digits[0] === 0) {\n return parsedNumber;\n }\n // Getting the current number of decimals\n const fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;\n if (parsedNumber.exponent) {\n parsedNumber.exponent += 2;\n }\n else {\n if (fractionLen === 0) {\n parsedNumber.digits.push(0, 0);\n }\n else if (fractionLen === 1) {\n parsedNumber.digits.push(0);\n }\n parsedNumber.integerLen += 2;\n }\n return parsedNumber;\n}", "function round(n) {\n return Math.round(n * 10000) / 10000;\n}", "function preciseRound(num, decimals) {\r\n var t = Math.pow(10, decimals);\r\n return (Math.round(num * Math.pow(10, decimals)) / Math.pow(10, decimals)).toFixed(2);\r\n}", "function toPercent(parsedNumber) {\n // if the number is 0, don't do anything\n if (parsedNumber.digits[0] === 0) {\n return parsedNumber;\n }\n // Getting the current number of decimals\n var fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;\n if (parsedNumber.exponent) {\n parsedNumber.exponent += 2;\n }\n else {\n if (fractionLen === 0) {\n parsedNumber.digits.push(0, 0);\n }\n else if (fractionLen === 1) {\n parsedNumber.digits.push(0);\n }\n parsedNumber.integerLen += 2;\n }\n return parsedNumber;\n}", "function toPercent(parsedNumber) {\n // if the number is 0, don't do anything\n if (parsedNumber.digits[0] === 0) {\n return parsedNumber;\n }\n // Getting the current number of decimals\n var fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;\n if (parsedNumber.exponent) {\n parsedNumber.exponent += 2;\n }\n else {\n if (fractionLen === 0) {\n parsedNumber.digits.push(0, 0);\n }\n else if (fractionLen === 1) {\n parsedNumber.digits.push(0);\n }\n parsedNumber.integerLen += 2;\n }\n return parsedNumber;\n}", "function toPercent(parsedNumber) {\n // if the number is 0, don't do anything\n if (parsedNumber.digits[0] === 0) {\n return parsedNumber;\n }\n // Getting the current number of decimals\n var fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;\n if (parsedNumber.exponent) {\n parsedNumber.exponent += 2;\n }\n else {\n if (fractionLen === 0) {\n parsedNumber.digits.push(0, 0);\n }\n else if (fractionLen === 1) {\n parsedNumber.digits.push(0);\n }\n parsedNumber.integerLen += 2;\n }\n return parsedNumber;\n}", "function toPercent(parsedNumber) {\n // if the number is 0, don't do anything\n if (parsedNumber.digits[0] === 0) {\n return parsedNumber;\n }\n // Getting the current number of decimals\n var fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;\n if (parsedNumber.exponent) {\n parsedNumber.exponent += 2;\n }\n else {\n if (fractionLen === 0) {\n parsedNumber.digits.push(0, 0);\n }\n else if (fractionLen === 1) {\n parsedNumber.digits.push(0);\n }\n parsedNumber.integerLen += 2;\n }\n return parsedNumber;\n}", "round(decimals) {\n if (decimals == null) {\n decimals = 0;\n }\n // Not enough precision to not already be rounded\n if (decimals >= this.decimals) {\n return this;\n }\n const delta = this.decimals - decimals;\n const bump = BN_5 * getTens(delta - 1);\n let value = this.value + bump;\n const tens = getTens(delta);\n value = (value / tens) * tens;\n checkValue(value, this.#format, \"round\");\n return new FixedNumber(_guard, value, this.#format);\n }", "function ourOwnRound(theNumber) {\n\n // Create a variable \"results\" with no value given\n var results;\n // Using the % equation, we can extra the decimal place, and store it in \"decimalOFTheNUmber\"\n var decimalOfTheNumber = theNumber % 1;\n\n // WE text the decimal value in \"decimalOfTheNumber\" and test if it is larger or smaller the then .5.....\n if (decimalOfTheNumber >= .5){\n //.... If it is larger, we round the orignal number stored in \"theNumber\" and store that in the results variable.\n results = Math.ceil(theNumber);\n }\n\n else {\n //.....If it is smaller, we round the original number stored in \"theNumber\" and sotre that in the results variable.\n results = Math.floor(theNumber);\n }\n\n // Return the value of results to where ever this function was called.\n return results;\n}", "function myRound(val,places) {\n\tvar c = 1;\n\tfor (var i = 0; i < places; i++)\n\t\tc *= 10;\n\treturn Math.round(val*c)/c;\n}", "function roundup(number,decimal_points) {\r\n\tif (number == null) return 'NaN';\r\n\tif (!decimal_points || decimal_points == null) return Math.ceil(number);\r\n\tvar exp = Math.pow(10, decimal_points);\r\n\tnumber = Math.ceil(number * exp) / exp;\r\n\treturn parseFloat(number.toFixed(decimal_points));\r\n}", "function round(num, places) {\n var shift = Math.pow(10, places);\n return Math.round(num * shift)/shift;\n }", "function round(n) {\n return Math.round(n * 100) / 100;\n }", "function round(num, places) {\n var multiplier = Math.pow(10, places);\n return Math.round(num * multiplier) / multiplier;\n}", "function roundNumber(parsedNumber, minFrac, maxFrac) {\n if (minFrac > maxFrac) {\n throw new Error(\"The minimum number of digits after fraction (\".concat(minFrac, \") is higher than the maximum (\").concat(maxFrac, \").\"));\n }\n\n var digits = parsedNumber.digits;\n var fractionLen = digits.length - parsedNumber.integerLen;\n var fractionSize = Math.min(Math.max(minFrac, fractionLen), maxFrac); // The index of the digit to where rounding is to occur\n\n var roundAt = fractionSize + parsedNumber.integerLen;\n var digit = digits[roundAt];\n\n if (roundAt > 0) {\n // Drop fractional digits beyond `roundAt`\n digits.splice(Math.max(parsedNumber.integerLen, roundAt)); // Set non-fractional digits beyond `roundAt` to 0\n\n for (var j = roundAt; j < digits.length; j++) {\n digits[j] = 0;\n }\n } else {\n // We rounded to zero so reset the parsedNumber\n fractionLen = Math.max(0, fractionLen);\n parsedNumber.integerLen = 1;\n digits.length = Math.max(1, roundAt = fractionSize + 1);\n digits[0] = 0;\n\n for (var i = 1; i < roundAt; i++) {\n digits[i] = 0;\n }\n }\n\n if (digit >= 5) {\n if (roundAt - 1 < 0) {\n for (var k = 0; k > roundAt; k--) {\n digits.unshift(0);\n parsedNumber.integerLen++;\n }\n\n digits.unshift(1);\n parsedNumber.integerLen++;\n } else {\n digits[roundAt - 1]++;\n }\n } // Pad out with zeros to get the required fraction length\n\n\n for (; fractionLen < Math.max(0, fractionSize); fractionLen++) {\n digits.push(0);\n }\n\n var dropTrailingZeros = fractionSize !== 0; // Minimal length = nb of decimals required + current nb of integers\n // Any number besides that is optional and can be removed if it's a trailing 0\n\n var minLen = minFrac + parsedNumber.integerLen; // Do any carrying, e.g. a digit was rounded up to 10\n\n var carry = digits.reduceRight(function (carry, d, i, digits) {\n d = d + carry;\n digits[i] = d < 10 ? d : d - 10; // d % 10\n\n if (dropTrailingZeros) {\n // Do not keep meaningless fractional trailing zeros (e.g. 15.52000 --> 15.52)\n if (digits[i] === 0 && i >= minLen) {\n digits.pop();\n } else {\n dropTrailingZeros = false;\n }\n }\n\n return d >= 10 ? 1 : 0; // Math.floor(d / 10);\n }, 0);\n\n if (carry) {\n digits.unshift(carry);\n parsedNumber.integerLen++;\n }\n}", "function roundto100th(number) {\n return Math.round(parseFloat(number)*100)/100;\n}", "function roundToPlaces(num, places) {\n var baseValue = Math.pow(10, places);\n return Math.round(num * baseValue) / baseValue;\n}", "function round(number, precision)\r\n{\r\n divisor = Math.pow(10, precision);\r\n return Math.round(number * divisor) / divisor;\r\n}", "function RoundNum(original_number, decimals, pad) \n{\n var result1 = original_number * Math.pow(10, decimals)\n var result2 = Math.round(result1)\n var result3 = result2 / Math.pow(10, decimals)\n\tif (pad == true)\n\t\treturn pad_with_zeros(result3, decimals);\n\telse\n\t\treturn result3;\n}", "function formatDecimal( number, numDecPlaces )\n {\n \tnumber = number.toFixed( numDecPlaces );\n \treturn number;\n }", "function round(x) {\n return Math.round( x * 1000) / 1000;\n }", "function precisionRound(number) {\n var factor = Math.pow(10, 2);\n return Math.round(number * factor) / factor;\n}", "function roundTo(n, digits) { //round up\n var negative = false;\n if (digits === undefined) {\n digits = 0;\n }\n if( n < 0) {\n negative = true;\n n = n * -1;\n }\n var multiplicator = Math.pow(10, digits);\n n = parseFloat((n * multiplicator).toFixed(11));\n n = (Math.round(n) / multiplicator).toFixed(2);\n if( negative ) { \n n = (n * -1).toFixed(2);\n }\n return n;\n} //end of roundTo", "function round(x) {\r\n return Math.round(x * 1000) / 1000;\r\n }" ]
[ "0.67974013", "0.66989106", "0.66507745", "0.66476995", "0.66258717", "0.6619844", "0.6590431", "0.6586292", "0.65827125", "0.65788805", "0.6537595", "0.653228", "0.6517625", "0.6502644", "0.6470818", "0.6466286", "0.6454938", "0.6448975", "0.6435309", "0.64146423", "0.6411703", "0.6398304", "0.63899106", "0.63899106", "0.6367092", "0.6366373", "0.6347144", "0.63417685", "0.63417685", "0.63399065", "0.63294476", "0.632517", "0.63183755", "0.63101166", "0.6309826", "0.63067466", "0.6284857", "0.6284857", "0.6281624", "0.62756586", "0.62674695", "0.624962", "0.6245894", "0.62249285", "0.62201434", "0.6211143", "0.62095815", "0.61925966", "0.6192565", "0.6180036", "0.61749226", "0.6163847", "0.61634934", "0.61623937", "0.61287606", "0.61243504", "0.61207396", "0.610678", "0.61057365", "0.60944974", "0.60944974", "0.60944974", "0.60944974", "0.60944974", "0.6085198", "0.6081308", "0.60754025", "0.60754025", "0.60754025", "0.60754025", "0.6070109", "0.60684246", "0.60657436", "0.6065133", "0.60649073", "0.6054253", "0.6049288", "0.6046699", "0.6040853", "0.60362875", "0.60346764", "0.6034134", "0.6013029", "0.6007752", "0.60043246", "0.6002965", "0.5996152" ]
0.6274346
50
1 2 3 4 5 6 7 8 9 10 11
function jsonStringToDate(string) { var match; if (match = string.match(R_ISO8601_STR)) { var date = new Date(0), tzHour = 0, tzMin = 0, dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear, timeSetter = match[8] ? date.setUTCHours : date.setHours; if (match[9]) { tzHour = toInt(match[9] + match[10]); tzMin = toInt(match[9] + match[11]); } dateSetter.call(date, toInt(match[1]), toInt(match[2]) - 1, toInt(match[3])); var h = toInt(match[4] || 0) - tzHour; var m = toInt(match[5] || 0) - tzMin; var s = toInt(match[6] || 0); var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000); timeSetter.call(date, h, m, s, ms); return date; } return string; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "range(start, count) {\n\t return Array.apply(0, Array(count))\n\t .map((element, index) =>{\n\t return index + start;\n\t \t}\n\t\t);\n }", "function range(n, m){\n var tmp = [];\n for (i = n; i < m; i++){\n tmp.push(n);\n }\n return tmp;\n}", "range(_start, _end) {\n var result = []\n for (let i=_start; i<=_end; i++){\n result.push(i)\n }\n return result\n }", "function findMultiples(int,limit){\n let result = []\n \n for (let i = int; i<=limit ; i+=int)\n result.push(i)\n \n return result\n}", "function range(first, last){\n var ans = [first];\n while(first != last){\n ans.push[first+1];\n first += 1;\n }\n return ans;\n}", "function intList(start, end) {\n var newArray = [];\n for (var i = start; i <= end; i += 2) {\n newArray.push(i);\n console.log(i);\n }\n return newArray;\n}", "function sequence(num, start) {\n let array = [];\n for (let i = 0; i < num; i += 1) {\n array.push(start);\n start += start;\n }\n return array;\n}", "function range(x) {\r\n let intRange = new Array(x);\r\n for (let i = 0; i < x; i++) {\r\n intRange[i] = i + 1;\r\n }\r\n return intRange;\r\n}", "function numbers() {\n //Minimum 5, 2 each side of index...\n var i, min, max, res, cnt = pageCount;\n\n min = $scope.options.index - 4;\n max = $scope.options.index + 4;\n\n if (min < 0) {\n max = max - min;\n min = 0;\n } else if (max >= cnt) {\n min = min - (max - cnt + 1);\n max = cnt - 1;\n }\n if (min < 0) {\n min = 0;\n }\n if (max >= cnt) {\n max = cnt - 1;\n }\n\n res = [];\n for (i = min; i <= max; i++) {\n res.push(i + 1);\n }\n return res;\n }", "function getNeibord(index,n){\n var low=Math.max(0,index-4);\n var high=Math.min(n-1,index+4);\n return [low,high];\n}", "function range(n) {\n var res = [],\n i = 1;\n while (i <= n) {\n res.push(i);\n i++;\n }\n return res;\n }", "function list() {\n for (num = 0; num < 11; num++){\n console.log(num);\n }\n}", "function range(x, y, z) {\n\n var arry = [];\n for (var i = x; i < y; i += z) {\n arry.push(i);\n }\n console.log(arry);\n\n }", "function range(...nums) {\n const arr = [];\n\n if (nums.length == 1) {\n for (let i = 1; i <= nums[0]; i++) {\n arr.push(i);\n }\n } else if (nums.length >= 2) {\n const increm = nums[2] !== undefined ? nums[2] : 1;\n if (nums[0] < nums[1]) {\n for (let i = nums[0]; i <= nums[1]; i += increm) {\n arr.push(i);\n }\n } else {\n for (let i = nums[0]; i >= nums[1]; i -= increm) {\n arr.push(i);\n }\n }\n } \n return arr;\n}", "function five(n){\r\n for(var i=1;i<=n;i++){\r\n var str=\"\"\r\n kk=n+1-i\r\n for(var k=1;k<i;k++){\r\n str=str+(kk)\r\n kk++\r\n }\r\n for(var j=i;j<=n;j++){\r\n str=str+(\"5\")\r\n }\r\n console.log(str)\r\n }\r\n \r\n }", "function populateNumbers( x ) {\n\t\tvar numbers = [];\n\t\tfor ( var i = 0; i < x; i++ ) {\n\t\t\tnumbers[ i ] = i + 1; // 1-x\n\t\t}\n\t\treturn numbers;\n\t}", "function rampNumbers2(n){\n for (var i = 0, count = 0; i < n; i++)\n if (i == ('' + i).split('').sort().join('')) count++;\n return count;\n}", "function printNumbers(start,finish) {\n for (var i = start; i <= finish; i++) {\n console.log(i);\n }\n}", "function sequence(number) {\n let results = [];\n\n for (let idx = 1; idx <= number; idx +=1) {\n results.push(idx);\n }\n\n return results;\n}", "function plus(n){\r\n for(var i=1;i<=n;i++){\r\n var str=\"\"\r\n for(var j=1;j<=i;j++){\r\n var k=9+i+j\r\n str=str+(k)\r\n }\r\n console.log(str)\r\n }\r\n }", "function range(n) {\n var numbers = [];\n for (var i = 1; i <= n; i++)\n numbers.push(i);\n return numbers;\n}", "function range(startNum, endNum)\t{ \n\tlet arr = [];\n\t for (let i = startNum +1; i < endNum; i++)\n\t arr.push(i)\n\t return arr;\n}", "function range(start, end) {\n let nums = [];\n for (let i = start; i < end; i++) {\n nums.unshift(i);\n }\n return nums;\n }", "function num(upto) { // 8\n for (var i = 0; i <= upto; i++){\n console.log(i);\n }\n}", "function number(n){\r\n \r\n var k=1,l=1\r\n for(var i=1;i<=n;i++){\r\n var str=\"\"\r\n l=k\r\n for(var j=1;j<=i;j++){\r\n // console.log(l+\"up\")\r\n str=str+(l++)\r\n // console.log(l+\"dn\")\r\n }\r\n k =l--\r\n for(var j=1;j<i;j++){\r\n str=str+(--l)\r\n }\r\n console.log(str)\r\n }\r\n }", "function printNumbers(start, end) {\n for (var i = 1; i <= 10; i++) {\n console.log(i);\n }\n}", "function findSequence (n, start) {\n const result = [];\n let count = start;\n\n while (result.length < n) {\n const digitsSum = `${count}`.split('').reduce((acc, item) => acc + parseInt(item), 0);\n\n if (count % digitsSum === 0) result.push(count);\n\n count++;\n }\n\n return result;\n}", "function pipeFix(numbers) {\n\tlet output = [];\n\tlet i = Math.min(...numbers);\n\twhile (i <= Math.max(...numbers)) {\n\t\toutput.push(i);\n\t\ti++;\n\t}\n\treturn output;\n}", "function RangePrint3(end){\n for (var num = 0; num < end; num++){\n console.log(num)\n }\n}", "function numb(n){\r\n var k=n+n-1;\r\n for(var i=k;i>=1;i-=2){\r\n var str=\"\";\r\n for(var j=1;j<=i;j++){\r\n str=str+(j)\r\n }\r\n console.log(str)\r\n }\r\n \r\n }", "function range(max)\n{\n var retVal =[]\n for (var i=0; i<max; i++)\n {\n retVal.push(i*2); //retVal[i]= i*2\n }\n return retVal;\n}", "function between(a, b) {\n // your code here\n var ar = [];\n for (var n = a; n <= b; n++) { ar.push(n); }\n return ar;\n}", "function numl(n){\r\n for(var i=1;i<=n;i++){\r\n var str=\"\"\r\n for(var j=i;j>1;j--){\r\n str=str+(j)\r\n }\r\n for(var k=1;k<=i;k++){\r\n str=str+(k)\r\n }\r\n console.log(str)\r\n }\r\n \r\n }", "function multi(x) {\n for (var i = 1; i <= 10; i++)\n console.log(x + \"X\" + i + \"=\" + (i * x));\n \n}", "function numm(n){\r\n for(var i=1;i<=5;i++){\r\n var str=\"\"\r\n for(var j=0;j<=n-i;j++){\r\n str=str+(i)\r\n }\r\n console.log(str)\r\n }\r\n }", "function range(len) { var ret = []; for(var i = 0; i < len; i++) { ret.push(i); } return ret; }", "function range(start, end, step=1) {\n // Your code here\n var list = [];\n var counter = 0;\n if(typeof step === \"undefined\"){\n step = 1;\n }\n for(var i = start; i!=end+step; i= i+step){\n list[counter] = i;\n counter++;\n }\n return list;\n}", "function numbers(num1, num2)\n{\n for (i=num1; i<=num2; i++)\n {\n console.log(i);\n }\n}", "function a() {\n for (var i = 0; i < 10; i++) { //i=0>2>3>5>6>8>9>11>12\n i = i + 2; // i= 0+2/3+2/6+2/9+2/\n console.log(i); //(2, 5, 8, 11) \n }\n}", "function opgave7(start, end){\n var arrayen = [];\n while(start<end){\n arrayen.push(start);\n start++;\n }\n arrayen.push(start);\n return arrayen;\n \n}", "function intList(start, end) {\n var newArray = [];\n for (var i = start; i <= end; i += 1) {\n newArray.push(i);\n\n }\n return newArray;\n}", "function range(n) {\n\treturn Array(n).fill().map(function (_, i) {\n\t\treturn i;\n\t});\n}", "function sequence(num) {\n var outputArr = [];\n for (i = 1; i <= num; i++) {\n outputArr.push(i);\n }\n return outputArr;\n}", "function nList(init, end){\n var res = [];\n for (var i = init; i <= end; i++){\n res.push(i);\n }\n return res;\n }", "function pipeFix(numbers) {\n const min = Math.min(...numbers)\n const max = Math.max(...numbers)\n const arr = []\n for (let i = min; i <= max; i++) {\n arr.push(i)\n }\n return arr\n}", "function nbv(i) { var r = []; fromInt(r,i); return r; }", "function num(n){\r\n for(var i=n;i>=1;i--){\r\n var str=\"\"\r\n for(var j=i;j<=n;j++){\r\n str=str+(i)\r\n }\r\n console.log(str)\r\n }\r\n }", "function arr(num){\n for(var i = 2; i <= num; i++) {\n numArr.push(i)\n }\n}", "function intList(start, end) {\n var newArray = [];\n for (var i = start; i <= end; i += 1) {\n newArray.push(i);\n }\n return newArray;\n}", "function p7(){\n var arr = []\n for(var i = 1; i <= 50; i+=2){\n arr.push(i)\n }\n console.log(arr)\n}", "function i(n){return n}", "function between(a, b) {\n const arr = []\n for (let i = a; i <= b; i++) {\n arr.push(i)\n }\n return arr\n}", "function printTheNumbers() {\n for(let i = 0; i < 19; i += 4){\n console.log(i);\n }\n}", "function cycle(nbr,min,max){let r=max-min;if(nbr<min){return nbr+Math.floor((min-nbr)/r)*r;}if(nbr>max){return nbr-Math.ceil((nbr-max)/r)*r;}return nbr;}", "function makeNumberSequence(start, end) {\n var arr = [];\n\n for (var i = start; i <= end; i++) {\n arr.push(i);\n }\n\n return arr;\n}", "function count(c) { return range(c, c); }", "function sequence2(count, startingNumber) {\n let countingArray = [];\n\n for (let counter = 1; counter <= count; counter += 1) {\n countingArray.push(counter * startingNumber);\n }\n return console.log(countingArray);\n}", "range(start, end, step = 1) {\n let res = [];\n\n if(step > 0) {\n for(let i=start; i <= end; i+=step) {\n res.push(i);\n }\n } else {\n for(let i=start; i >= end; i+=step) {\n res.push(i);\n }\n }\n\n return res;\n }", "function getSpecialNumbers(from, to) {\n let resultArray = []\n for (let i = from; i <= to; i++) {\n if (i % 3 === 0) {\n resultArray.push(i)\n }\n }\n return resultArray\n}", "function nRange(start, end) {\n return Array.from({ length: end - start }, (value, key) => key + start);\n}", "function main(n) {\n for(var stair = 1; stair <= n; stair++){\n console.log((\" \".repeat(n - stair)) + (\"#\".repeat(stair)));\n }\n\n}", "function dans_sequence(number) {\n var array = [];\n var newNumber;\n for(var i = number * 2; i < number + 38; i += 2){\n if(i > number * 10){\n var newNumber = i / 4;\n } else {\n newNumber = i;\n }\n array.push(newNumber);\n }\n return array;\n}", "function range(s, e, by){\n var arr = [];\n for(i = s; !((s<e && i>e) || (s>e && i<e));){\n arr.push(i);\n if(by == null){\n if(s<e)\n i++;\n else\n i--;\n }\n else\n i+=by;\n }\n return arr;\n}", "function printNumbers(start, end) {\n\tfor (i = start; i < end; i++) console.log(i);\n}", "function pickingNumbers(a) {\n // Write your code here\n var elements = {};\n var maxLength = 0;\n for (const element of a) {\n elements[element] = elements[element] ? elements[element]+1 : 1;\n }\n for (const element of a) {\n let left = elements[element-1] ? elements[element]+elements[element-1] : elements[element];\n let right = elements[element+1] ? elements[element]+elements[element+1] : elements[element];\n if (left > maxLength) {\n maxLength = left;\n }\n if (right > maxLength) {\n maxLength = right;\n }\n } \n return maxLength;\n}", "function numkk(n){\r\n for(var i=5;i>=1;i--){\r\n var str=\" \"\r\n for(var k=1;k<i;k++){\r\n str=str+(\" \")\r\n }\r\n for(var j=n;j>=i;j--){\r\n str=str+(j)\r\n }\r\n console.log(str)\r\n }\r\n \r\n }", "function dontGiveMeFive(start, end)\n{\n let i = start;\n let j = end;\n let num = 0;\n let result = [];\n\n while (i <= j) {\n if(i.toString().includes(\"5\")){\n i++;\n continue;\n } else{\n result.push(i);\n i++;\n }\n }\n\n return(result.length);\n}", "function print1to20(){\n for (let i = 1; i < 21; i++) {\n console.log(i)\n }\n}", "function range(n) {\n a = [];\n for(i = 0; i < n; i++) {\n a[i] = i;\n }\n return a;\n}", "function series2(n) {\n let sum = 0;\n for (let i = 9; i <= n; i += 4) {\n sum += i; //? incremented by 4\n }\n return sum;\n}", "function printAll(numbers) {\nfor (i = 0; i<=numbers; i++){\n console.log(i)\n}}", "function sequence(x,y) {\n // jika x<y => parameter x harus lebih besar dibanding y\n if (x<=y) {\n console.log(\"parameter x harus lebih besar dibanding y\");\n }else {\n var arrResult = [y];\n var c =y\n while (c>1) {\n var c= Math.pow(c,2)%x;\n x=x+1;\n arrResult.push(c);\n }\n\n console.log(\"array : \");\n console.log(arrResult);\n console.log(\"count : \"+ arrResult.length);\n }\n}", "function numin(n){\r\n var count=1\r\n for(var i=1;i<=n;i++){\r\n var str=\"\"\r\n var num=i\r\n for(var j=1;j<=i;j++){\r\n str=str+(num)\r\n num=num+n-j\r\n }\r\n console.log(str)\r\n }\r\n \r\n }", "function countBy(x, n) {\n var z = [];\n // running a loop that starts a the x value, where i value is less than n * x if its 2, 10 , i = 2 i <= 2 * 10 \n for(var i= x; i <= n * x; i += x ){\n z.push(i)\n \n }\n return z;\n }", "function printNumbers (x,y){\n for (var num=x; num<=y; num++)\n console.log(num);\n}", "function xx(i){\n \treturn 2*i/width - 1;\n}", "function xx(i){\n \treturn 2*i/width - 1;\n}", "function iRange(x, n) {\n var a = [];\n var i = 0;\n for (i = x; i <= n; i++) {\n a.push(i);\n }\n return a;\n}", "static range(min, max){\n\n let l = [];\n for(let i=min; i < max; i++) l.push(i);\n return l;\n\n }", "function range (from, to) {\n return Array.from(Array(to), (_, i) => from + i)\n}", "function a(b) { //a(3) / a(4)\n for (var i = 0; i < 10; i++) { //i=0>1>2>3>4>5>6>7>8>9>10 /i=0\n console.log(i); //console.log(0,1,3,4,5,6,7,8,9) /\n }\n return i;\n}", "function oneToTen() {\n for (i = 1; i <= 10; i++){\n console.log(i);\n }\n}", "function listOfIntegers(start, end = 100) {\n start = start || 17;\n let range = [];\n\n while (start <= 100) {\n if (start % 11 === 0) {\n range.push(start);\n start += 11;\n } else {\n start++;\n }\n }\n\n return range;\n}", "function numbers(start, length, step) {\n if (step === undefined) {\n step = 1;\n }\n var result = [];\n var entry = start;\n for (var i = 0; i < length; i++) {\n result.push(entry);\n entry += step;\n }\n return result;\n}", "function multirand(n){\n return arr.push(rand10(10))\n}", "function range(m, n) {\n return Array.apply(null, Array(n - m + 1)).map(\n function (x, i) {\n return m + i;\n }\n );\n}", "function main() {\n var n = parseInt(readLine());\n for(var i=0, j=n;i<n,j>=1;i++,j--){\n console.log(Array((j+1)-1).join(\" \") + Array((i+1)+1).join(\"#\"));\n\n }\n}", "function getRange(start, stop) {\n const nums = [];\n\n for (let num = start; num < stop; num += 1) {\n nums.push(num);\n }\n}", "function listInteger2() {\n\tfor (var i = 10; i >=0; i--) {\n\t\tdocument.write(i+\"&nbsp\");\n\t}\n}", "function computeRange(i,n){\n let index = -1, arr=[];\n for (;index<n;index++) {\n arr.push(i);\n }\n return arr;\n}", "function sequence(number) {\n let count = 1;\n let sequenceArray = [];\n\n do {\n sequenceArray.push(count);\n count += 1;\n } while (count <= number);\n return console.log(sequenceArray);\n}", "function expandNumberRange(start, end, by) {\n by = by || 1; //incrementing by 0 is a bad idea\n var converted = [];\n for (var i=start; i<=end; i+=by) {\n converted.push( Numbered.stringify(i).replace(/-/g,' ') );\n }\n return converted;\n}", "function listInteger() {\n\tfor (var i = 1; i < 11; i++) {\n\t\tdocument.write(i+\"&nbsp\"); // &nbsp la ki tu khoang trang.\n\t}\n}", "function ranger (x,y){\n let array = [];\n for (i=x+1; i<y; i++) {\n array.push(i);\n }\n return array;\n}", "function aa(n){\r\n var a=1\r\n for(var i=1;i<=n;i++){\r\n var str=\"\"\r\n for(var j=i;j>=1;j--){\r\n str=str+(j%2)\r\n \r\n }\r\n console.log(str)\r\n }\r\n \r\n }", "function integers_from(n) {\n return pair(n,\n function() {\n return integers_from(n + 1);\n });\n}", "function t$i(t,...n){let o=\"\";for(let r=0;r<n.length;r++)o+=t[r]+n[r];return o+=t[t.length-1],o}", "getRange(start, end) {\n return Array.from(\n {\n length: (parseInt(end, 10) + 1) - parseInt(start, 10)\n },\n (v, k) => k + parseInt(start, 10)\n );\n }", "range(min, max) {\n if (max < min) { return []; }\n let arr = [];\n\n for (let i = min; i <= max; i++) {\n arr.push(i);\n }\n\n return arr;\n }", "function sequence(integer) {\n let arr = [];\n for (let num = 1; num <= integer; num += 1) {\n arr.push(num);\n }\n return arr;\n}", "function sequentialSizes(val) {\n var answer = \"\";\n switch (val) {\n case 1:\n case 2:\n case 3:\n answer = \"low\";\n break;\n case 4:\n case 5:\n case 6:\n answer = \"mid\";\n break;\n case 7:\n case 8:\n case 9:\n answer = \"high\";\n break;\n\n default:\n break;\n }\n\n return answer;\n}" ]
[ "0.6412673", "0.6274146", "0.6237372", "0.60995954", "0.60658026", "0.60650635", "0.60522985", "0.6050822", "0.60398", "0.60053647", "0.6002661", "0.5985569", "0.5982486", "0.5982143", "0.59623766", "0.5949878", "0.5942199", "0.59351933", "0.59207106", "0.5917439", "0.5917169", "0.590859", "0.5901835", "0.5890174", "0.5889591", "0.5889509", "0.5885393", "0.58853114", "0.5881956", "0.5879589", "0.58757675", "0.58751494", "0.5871181", "0.58694214", "0.5868398", "0.58562547", "0.58537185", "0.5837484", "0.5837428", "0.5835914", "0.5835446", "0.5834836", "0.582897", "0.58232534", "0.5821755", "0.5819036", "0.5815391", "0.5813524", "0.5812911", "0.5800037", "0.5796219", "0.57930434", "0.5792974", "0.5788818", "0.5785622", "0.5779434", "0.5775918", "0.5774876", "0.5772872", "0.57722926", "0.5770281", "0.5769007", "0.57674044", "0.57666516", "0.57593733", "0.575765", "0.575528", "0.5754705", "0.5730498", "0.5724397", "0.572314", "0.5720904", "0.5719165", "0.5718863", "0.57172775", "0.57147187", "0.57147187", "0.5712257", "0.5711116", "0.5704075", "0.5701231", "0.56887954", "0.56823665", "0.56821173", "0.5680649", "0.56791955", "0.56770986", "0.56731176", "0.56722564", "0.5672226", "0.5671564", "0.567049", "0.56609714", "0.5649786", "0.5647867", "0.56466824", "0.56438535", "0.5642745", "0.564149", "0.5636986", "0.5636177" ]
0.0
-1
since animations are detected from CSS classes, we need to flush all parent classbased animations so that the parent classes are all present for child animations to properly function (otherwise any CSS selectors may not work)
function examineParentAnimation(node, animationDetails) { // enter/leave/move always have priority if (animationDetails.structural || !hasAnimationClasses(animationDetails.options)) return; if (animationDetails.state === RUNNING_STATE) { animationDetails.runner.end(); } clearElementAnimationState(node); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clearAnims(){\n document.querySelectorAll('.activated, .sequence').forEach( el => {\n el.classList.remove('activated', 'sequence');\n })\n }", "function resetAnimations() {\n animationEls = document.querySelectorAll('.js-animate.shown');\n for (var i = 0; i < animationEls.length; i++) {\n animationEls[i].classList.remove('shown');\n }\n }", "function resetAnimation() {\n $(\"#win-display\").removeClass('animated bounceInDown');\n $(\"#lose-display\").removeClass('animated bounceInDown');\n $(\".gameBanner\").removeClass('animated bounceInDown');\n $(\".target-number\").removeClass('animated rotateInDownRight');\n $(\".total-number\").removeClass('animated rotateInDownLeft');\n}", "function removeAnimClasses(elem) {\n var cn = elem.className;\n var ac = [\" toLeft\",\" toRight\",\" fromLeft\",\" fromRight\"]; //Animation classes\n for (var i=0;i<ac.length;i++) {\n while (cn.indexOf(ac[i])>=0) {\n cn = cn.replace(ac[i],\"\");\n }\n }\n elem.className=cn;\n}", "function removeAnimations() {\n images.forEach((element) => {\n element.classList.remove('animation');\n })\n}", "static clearAnimations() {\n this.clearItems('cycleAnimation');\n }", "function fireInitialAnimations() {\n $mdUtil.nextTick(function() {\n $animate.addClass($element, 'md-noop');\n });\n }", "function circle_animated() {\n // console.log(\"Worked\");\n circle.removeAttribute('class');\n path.removeAttribute('class');\n }", "killAnimations() {\n this.timelines.forEach((timeline) => {\n this.killTimeline(timeline);\n });\n\n this.tweens.forEach((tween) => {\n this.killTween(tween);\n });\n\n this.timelines = [];\n this.tweens = [];\n }", "function finishAllAnimations() {\n runningAnimations.forEach(function (animation) {\n animation.finishNow();\n });\n clearTimeout(fadeInTimer);\n clearTimeout(animateHeightTimer);\n clearTimeout(animationsCompleteTimer);\n runningAnimations.length = 0;\n }", "function resetTimeoutAnimation() {\n var $activeNavEl = $(\".nav__el.active\"),\n $activeParts = $activeNavEl.find(\".nav__el-clone, .nav__el\")\n $activeParts.addClass(\"instant\");\n $activeNavEl.removeClass(\"active\");\n $activeParts.css(\"top\");\n $activeParts.removeClass(\"instant\");\n $activeParts.css(\"top\");\n $activeNavEl.addClass(\"active\");\n }", "updateAnimations() {\n this.animations.forEach((animation, index) => {\n if (animation.finished) {\n this.animations.splice(index, 1);\n }\n });\n }", "function reset_animations(){\n if(active != \"idee\"){tl_idee.restart();\n tl_idee.pause();}\n if(active != \"reunion\"){tl_reunion.restart();\n tl_reunion.pause();}\n if(active != \"travail\"){tl_travail.restart();\n tl_travail.pause();}\n if(active != \"deploiement\"){tl_depl.restart();\n tl_depl.pause();}\n }", "restartAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(false);\n this.animations[key].reset();\n }\n }\n }", "remove_all_keyframes () {\n this.glitch('keyframe', () => null);\n }", "function hackRemoveAnimations(){\n if (user.hackAnimations!='')\n $jQ('.'+user.hackAnimations).removeClass(user.hackAnimations);\n}", "attached() {\n const that = this;\n\n super.attached();\n\n if (!that.isCompleted) {\n return;\n }\n\n that.$.removeClass('right');\n that.$.removeClass('left');\n that.$.removeClass('top');\n that.$.removeClass('bottom');\n that.$.removeClass('animate');\n }", "function initElementsAnimation() {\n if ($(\".animated\").length > 0) {\n $(\".animated\").each(function() {\n var $this = $(this);\n $this.appear(function() {\n $this.addClass(\"go\");\n }, {\n accX: 0,\n accY: -200\n });\n })\n };\n}", "endAll() {\n this.animations.forEach((anim) => anim.onEnd());\n this.animations = [];\n }", "function testAnim(x) {\r\n $('#animationSandbox').removeClass().addClass(x + ' animated').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){\r\n $(this).removeClass();\r\n });\r\n $('#conceptdiv').removeClass().addClass(x + ' animated').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){\r\n $(this).removeClass();\r\n });\r\n }", "playAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(false);\n }\n }\n }", "function detectAnimation() {\n for (let i = 0; i <= shownCards.length - 1; i++) {\n card1.addEventListener('webkitAnimationEnd', removeclasses);\n card1.addEventListener('animationend', removeclasses)\n }\n }", "cancelAllAnimations() {\n\t\tthis._cameraAnimationQueue.clear();\n\t\tthis._currentAnimation = null;\n\t}", "reset() {\n if(!this.finishedAnimating) {\n return false;\n }\n\n const svg = this.shadowRoot.querySelector(\"svg\");\n\n svg.classList.remove(\"animate\");\n\n this.finishedAnimating = false;\n return true;\n }", "function removeWingAnimationsOnEnd(){ // Removes css animations we used for owlets wingsFlap, tuckWing\n // and wingRadiate, after last animation(wingRadiate) in sequence ends.\n // All in order to correct animation bugs across browsers.\n \n mainStyleSheet.initStyleSheet(); // If no argument it defaults to first stylesheet for document\n\n leftWing.initClass(\"left\"); // Elements that have \"left\" and \"right\" class names\n rightWing.initClass(\"right\");\n\n addPrefAnimEvent(leftWing.el, \"AnimationEnd\", function(handle){ \n setTimeout(function(){\n if(handle.animationName === \"wingRadiate\"){\n mainStyleSheet.addStyle(\".left\",\"line-height\",\"1.3em\"); \n leftWing.removeClass.call(leftWing,\"lwAnimation\"); // \"lwAnimation\" is css class name \n }\n },100) // responsible for all 3 animations\n })\n addPrefAnimEvent(rightWing.el, \"animationend\", function(handle){\n setTimeout(function(){ \n if(handle.animationName === \"wingRadiate\"){\n mainStyleSheet.addStyle(\".right\",\"line-height\",\"1.3em\"); \n rightWing.removeClass.call(rightWing, \"rwAnimation\");\n \t }\n }, 100);\n })\n }", "function deleteAnimation() {\n CHOICES.forEach(el => {\n const CLASSES = document.getElementById(el).classList;\n \n if (CLASSES.length > 1) {\n CLASSES.remove(CLASSES[1])\n }\n })\n}", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function testAnim(x) {\r\n gfx('#animationSandbox').removeClass().addClass(x + ' animation animation-active').one('webkitAnimationEnd mozAnimationEnd oAnimationEnd animationEnd', function(){\r\n gfx(this).removeClass();\r\n });\r\n }", "_resetAnimation() {\n // @breaking-change 8.0.0 Combine with _startAnimation.\n this._panelAnimationState = 'void';\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "resetTree() {\n this.root.nodes.forEach((node) => { var _a; return (_a = node.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop(); });\n this.root.nodes.forEach(clearMeasurements);\n this.root.sharedNodes.clear();\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function reset() {\n\t element[0].style.transitionDuration = 0;\n\t element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n\t }", "function cssAnimate() {\n if (!$html.hasClass('mobile') && !$html.hasClass('tablet') && $deviceWidth > 991){\n $('.css-animate .animated').each(function(){\n var that = $(this);\n if (that.data('time') != undefined){\n var delay = that.attr('data-time');\n if(that.visible(true)){\n setTimeout(function(){\n that.addClass('activate');\n that.addClass(that.data('fx'));\n }, delay)\n }\n }\n else{\n if(that.visible(true)){\n that.addClass('activate');\n that.addClass(that.data('fx'));\n }\n }\n });\n } else {\n $body.removeClass('css-animate');\n }\n }", "function doAnimations(elements) {\n \t\tvar animationEndEvents = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';\n \t\telements.each(function() {\n \t\t\tvar $this = $(this);\n \t\t\tvar $animationDelay = $this.data('delay');\n \t\t\tvar $animationType = 'animated ' + $this.data('animation');\n \t\t\t$this.css({\n \t\t\t\t'animation-delay': $animationDelay,\n \t\t\t\t'-webkit-animation-delay': $animationDelay\n \t\t\t});\n \t\t\t$this.addClass($animationType).one(animationEndEvents, function() {\n \t\t\t\t$this.removeClass($animationType);\n \t\t\t});\n \t\t});\n \t}", "initAnimations() {\n this.animations = [];\n let interpolant = new TransformationInterpolant();\n\n for (var key in this.graph.animations) {\n if (this.graph.animations.hasOwnProperty(key)) {\n let animation = this.graph.animations[key];\n let keyframes = animation.keyframes;\n let keyframeTrack = new TransformationTrack(keyframes, interpolant);\n this.animations[key] = new KeyframeAnimation(keyframeTrack);\n }\n }\n\n this.interface.addAnimations();\n }", "function resetOuterAnimation() {\n document.getElementById('svg-outer').classList.remove('animate-outer');\n setTimeout(function() {\n document.getElementById('svg-outer').style.strokeDashoffset = '' + circumferenceOuter;\n document.getElementById('svg-outer').style.animationDuration = '' + seconds + 's';\n document.getElementById('svg-outer').style.animationTimingFunction = 'linear';\n document.getElementById('svg-outer').classList.add('animate-outer');\n }, 1);\n }", "function eltdInitElementsAnimations(){\n\n var touchClass = $('.eltd-no-animations-on-touch'),\n noAnimationsOnTouch = true,\n elements = $('.eltd-grow-in, .eltd-fade-in-down, .eltd-element-from-fade, .eltd-element-from-left, .eltd-element-from-right, .eltd-element-from-top, .eltd-element-from-bottom, .eltd-flip-in, .eltd-x-rotate, .eltd-z-rotate, .eltd-y-translate, .eltd-fade-in, .eltd-fade-in-left-x-rotate'),\n clasess,\n animationClass;\n\n if (touchClass.length) {\n noAnimationsOnTouch = false;\n }\n\n if(elements.length > 0 && noAnimationsOnTouch){\n elements.each(function(){\n var element = $(this);\n\n clasess = element.attr('class').split(/\\s+/);\n animationClass = clasess[1];\n\n element.appear(function() {\n element.addClass(animationClass+'-on');\n },{accX: 0, accY: eltdGlobalVars.vars.eltdElementAppearAmount});\n });\n }\n\n }", "function __clearObjectAnimationsFromQueues(_obj){ //We may need to pass objects to sleep etc. functions to be able to remove them here\n for(var i=0;i<animationQueue.length;i++){\n for(var j=0;j<animationQueue[i].length;j++){\n if(!animationQueue[i][j]['animation']['object']){\n continue;\n }\n if(animationQueue[i][j]['animation']['object'].selector ==='#'+_obj[0].id){ //TODO something better than concatenating with # ??\n animationQueue[i].splice(j,1);\n }\n }\n }\n }", "function removeAnimationClass() {\n var active = document.querySelector('.activated');\n active.addEventListener(\"animationend\", removeAnimation, false);\n function removeAnimation() {\n $('.activated').removeClass('activated');\n }\n }", "function resetAnimations() {\n\tarthur.stand = arthur.right;\n\tarthur.goLeft = false;\n\tarthur.goRight = false;\n\tarthur.duckRight = false;\n\tarthur.atkRight = false;\n\tarthur.jumpRight = false;\n\tarthur.die = false;\n}", "__onAnimationHandler() {\n\n this._overflowClass = '';\n this._circleClass = '';\n this._labelClass = '';\n this._rectangleClass = '';\n }", "_reset(goal) {\r\n this.node.reset(!this.idle, goal);\r\n each(this._children, observer => {\r\n if (isAnimationValue(observer)) {\r\n observer._reset(goal);\r\n }\r\n });\r\n }", "function animationManager () {\n for (var i = tasks.length; i--;) {\n if (tasks[i].step() == false) {\n // remove animation tasks\n logToScreen(\"remove animation\");\n tasks.splice(i, 1);\n }\n }\n }", "function setAnimation ( _elem, _InOut ) {\n // Store all animationend event name in a string.\n var animationEndEvent = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';\n\n _elem.each ( function () {\n var $elem = $(this);\n var $animationType = 'animated ' + $elem.data( 'animation-' + _InOut );\n\n $elem.addClass($animationType).one(animationEndEvent, function () {\n $elem.removeClass($animationType); // remove animate.css Class at the end of the animations\n });\n });\n }", "function onEnd() {\n\t\t\t\t\t\t\telement.off(css3AnimationEvents, onAnimationProgress);\n\t\t\t\t\t\t\t$$jqLite.removeClass(element, activeClassName);\n\t\t\t\t\t\t\t$$jqLite.removeClass(element, pendingClassName);\n\t\t\t\t\t\t\tif (staggerTimeout) {\n\t\t\t\t\t\t\t\t$timeout.cancel(staggerTimeout);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tanimateClose(element, className);\n\t\t\t\t\t\t\tvar node = extractElementNode(element);\n\t\t\t\t\t\t\tfor (var i in appliedStyles) {\n\t\t\t\t\t\t\t\tnode.style.removeProperty(appliedStyles[i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "createAnimations() {\r\n //#region Idle animation\r\n // Idle front\r\n this.anims.create({\r\n key: 'idle_front',\r\n frames: [\r\n {\r\n key: 'idle_front_0'\r\n },\r\n {\r\n key: 'idle_front_1'\r\n },\r\n {\r\n key: 'idle_front_2'\r\n },\r\n {\r\n key: 'idle_front_3'\r\n }\r\n ],\r\n frameRate: 2,\r\n repeat: -1,\r\n });\r\n\r\n // Idle back\r\n this.anims.create({\r\n key: 'idle_back',\r\n frames: [\r\n {\r\n key: 'idle_back_0'\r\n },\r\n {\r\n key: 'idle_back_1'\r\n },\r\n {\r\n key: 'idle_back_2'\r\n },\r\n {\r\n key: 'idle_back_3'\r\n }\r\n ],\r\n frameRate: 2,\r\n repeat: -1,\r\n });\r\n\r\n // Idle side\r\n this.anims.create({\r\n key: 'idle_side',\r\n frames: [\r\n {\r\n key: 'idle_side_0'\r\n },\r\n {\r\n key: 'idle_side_1'\r\n },\r\n {\r\n key: 'idle_side_2'\r\n },\r\n {\r\n key: 'idle_side_3'\r\n }\r\n ],\r\n frameRate: 2,\r\n repeat: -1,\r\n });\r\n\r\n //#endregion\r\n\r\n //#region Run animations\r\n\r\n // Run front\r\n this.anims.create({\r\n key: 'run_front',\r\n frames: [\r\n {\r\n key: 'run_front_0'\r\n },\r\n {\r\n key: 'run_front_1'\r\n },\r\n {\r\n key: 'run_front_2'\r\n },\r\n {\r\n key: 'run_front_3'\r\n }\r\n ],\r\n frameRate: 6,\r\n repeat: -1,\r\n });\r\n\r\n // Run back\r\n this.anims.create({\r\n key: 'run_back',\r\n frames: [\r\n {\r\n key: 'run_back_0'\r\n },\r\n {\r\n key: 'run_back_1'\r\n },\r\n {\r\n key: 'run_back_2'\r\n },\r\n {\r\n key: 'run_back_3'\r\n }\r\n ],\r\n frameRate: 6,\r\n repeat: -1,\r\n });\r\n\r\n // Run side\r\n this.anims.create({\r\n key: 'run_side',\r\n frames: [\r\n {\r\n key: 'run_side_0'\r\n },\r\n {\r\n key: 'run_side_1'\r\n },\r\n {\r\n key: 'run_side_2'\r\n },\r\n {\r\n key: 'run_side_3'\r\n }\r\n ],\r\n frameRate: 6,\r\n repeat: -1,\r\n });\r\n\r\n //#endregion\r\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(`${initClass} ${activeClass} ${animation}`);\n }", "ClearAnimation() {\n this.ANIMATION = undefined;\n \n return this;\n }", "handleAnimationOn(index) {\n //TODO: test adding text instead of animation on the same classes\n const animatedFrame = document.getElementsByClassName(\"itemOnTheList\");\n animatedFrame[index].classList.add('loadingAnimation');\n console.dir(animatedFrame[index]);\n this.setState({\n animationFrame: true\n })\n }", "processAnimations(coords) {\n let moveTime = 1 / this.gameboard.orchestrator.moveSpeed\n let removeTime = moveTime * 1.75 / this.gameboard.orchestrator.moveSpeed\n\n this.moveAnimationAux = {\n animation: Animations[this.gameboard.orchestrator.moveAnimation],\n initialPosition: [0, 0.1, 0],\n finalPosition: [this.destTile.x - this.origTile.x, 0, this.destTile.y - this.origTile.y],\n duration: moveTime,\n heightLevels: [{instant: 0, height: 0.1}, {instant: moveTime * 0.5, height: 0.66}, {instant: moveTime, height: 0}]\n }\n\n this.moveAnimation = new EasingAnimation(this.moveAnimationAux, () => { this.notifyMoveAnimationCompleted(\"move\") })\n\n this.removeAnimationAux = {\n animation: Animations[this.gameboard.orchestrator.moveAnimation],\n initialPosition: [0, 0, 0],\n finalPosition: [coords.x + this.gameboard.size * 1.3 - 1 - this.destTile.x, 0.15 + coords.y * 0.2, ((this.gameboard.size / 2 - 2 + coords.z) - this.destTile.y)],\n duration: removeTime,\n heightLevels: [{instant: 0, height: 0}, {instant: removeTime * 0.3333, height: 1.5}, {instant: removeTime * 0.90 , height: 1.5}, {instant: removeTime, height: 0.15 + coords.y * 0.2}]\n }\n\n this.removeAnimation = new EasingAnimation(this.removeAnimationAux, () => { this.notifyMoveAnimationCompleted(\"remove\") })\n }", "function removeAnimation(){\n\t\tsetTimeout(function() {\n\t\t\t$('.bubble').removeClass('animating')\n\t\t}, 1000);\t\t\t\n\t}", "updateAnimation() {\n return;\n }", "function doAnimation() {\n slideContainer.children[0].classList.add('moveSlide')\n slideContainer.children[1].classList.add('moveSlide')\n addAnimationEventToChild()\n}", "function examineParentAnimation(node, animationDetails) {\n // enter/leave/move always have priority\n if (animationDetails.structural || !hasAnimationClasses(animationDetails.options)) return;\n\n if (animationDetails.state === RUNNING_STATE) {\n animationDetails.runner.end();\n }\n clearElementAnimationState(node);\n }", "function examineParentAnimation(node, animationDetails) {\n // enter/leave/move always have priority\n if (animationDetails.structural || !hasAnimationClasses(animationDetails.options)) return;\n\n if (animationDetails.state === RUNNING_STATE) {\n animationDetails.runner.end();\n }\n clearElementAnimationState(node);\n }", "function examineParentAnimation(node, animationDetails) {\n // enter/leave/move always have priority\n if (animationDetails.structural || !hasAnimationClasses(animationDetails.options)) return;\n\n if (animationDetails.state === RUNNING_STATE) {\n animationDetails.runner.end();\n }\n clearElementAnimationState(node);\n }", "OnAnimationEnd() {\n // If the animation is complete (and not stopped), then rerender to restore any flourishes hidden during animation.\n if (!this.AnimationStopped) {\n this._container.removeChildren();\n\n // Finally, re-layout and render the component\n var availSpace = new Rectangle(0, 0, this.Width, this.Height);\n this.Layout(availSpace);\n this.Render(this._container, availSpace);\n\n // Reselect the nodes using the selection handler's state\n var selectedNodes = this._selectionHandler ? this._selectionHandler.getSelection() : [];\n for (var i = 0; i < selectedNodes.length; i++) selectedNodes[i].setSelected(true);\n }\n\n // : Force full angle extent in case the display animation didn't complete\n if (this._angleExtent < 2 * Math.PI) this._animateAngleExtent(2 * Math.PI);\n\n // Delegate to the superclass to clear common things\n super.OnAnimationEnd();\n }", "function doAnimations(elems) {\n //Cache the animationend event in a variable\n var animEndEv = \"webkitAnimationEnd animationend\";\n \n elems.each(function() {\n var $this = $(this),\n $animationType = $this.data(\"animation\");\n $this.addClass($animationType).one(animEndEv, function() {\n $this.removeClass($animationType);\n });\n });\n }", "function performAnimation(animationEvent, className, element, parentElement, afterElement, domOperation, doneCallback) {\n\n var classNameAdd, classNameRemove, setClassOperation = animationEvent === 'setClass';\n if (setClassOperation) {\n classNameAdd = className[0];\n classNameRemove = className[1];\n className = classNameAdd + ' ' + classNameRemove;\n }\n\n var currentClassName, classes, node = element[0];\n if (node) {\n currentClassName = node.className;\n classes = currentClassName + ' ' + className;\n }\n\n //transcluded directives may sometimes fire an animation using only comment nodes\n //best to catch this early on to prevent any animation operations from occurring\n if (!node || !isAnimatableClassName(classes)) {\n fireDOMOperation();\n fireBeforeCallbackAsync();\n fireAfterCallbackAsync();\n fireDoneCallbackAsync();\n return;\n }\n\n var elementEvents = angular.element._data(node);\n elementEvents = elementEvents && elementEvents.events;\n\n var animationLookup = (' ' + classes).replace(/\\s+/g, '.');\n if (!parentElement) {\n parentElement = afterElement ? afterElement.parent() : element.parent();\n }\n\n var matches = lookup(animationLookup);\n var isClassBased = animationEvent === 'addClass' ||\n animationEvent === 'removeClass' ||\n setClassOperation;\n var ngAnimateState = element.data(NG_ANIMATE_STATE) || {};\n\n var runningAnimations = ngAnimateState.active || {};\n var totalActiveAnimations = ngAnimateState.totalActive || 0;\n var lastAnimation = ngAnimateState.last;\n\n //skip the animation if animations are disabled, a parent is already being animated,\n //the element is not currently attached to the document body or then completely close\n //the animation if any matching animations are not found at all.\n //NOTE: IE8 + IE9 should close properly (run closeAnimation()) in case a NO animation is not found.\n if (animationsDisabled(element, parentElement) || matches.length === 0) {\n fireDOMOperation();\n fireBeforeCallbackAsync();\n fireAfterCallbackAsync();\n closeAnimation();\n return;\n }\n\n var animations = [];\n\n //only add animations if the currently running animation is not structural\n //or if there is no animation running at all\n var allowAnimations = isClassBased ?\n !ngAnimateState.disabled && (!lastAnimation || lastAnimation.classBased) :\n true;\n\n if (allowAnimations) {\n forEach(matches, function (animation) {\n //add the animation to the queue to if it is allowed to be cancelled\n if (!animation.allowCancel || animation.allowCancel(element, animationEvent, className)) {\n var beforeFn, afterFn = animation[animationEvent];\n\n //Special case for a leave animation since there is no point in performing an\n //animation on a element node that has already been removed from the DOM\n if (animationEvent === 'leave') {\n beforeFn = afterFn;\n afterFn = null; //this must be falsy so that the animation is skipped for leave\n } else {\n beforeFn = animation['before' + animationEvent.charAt(0).toUpperCase() + animationEvent.substr(1)];\n }\n animations.push({\n before: beforeFn,\n after: afterFn\n });\n }\n });\n }\n\n //this would mean that an animation was not allowed so let the existing\n //animation do it's thing and close this one early\n if (animations.length === 0) {\n fireDOMOperation();\n fireBeforeCallbackAsync();\n fireAfterCallbackAsync();\n fireDoneCallbackAsync();\n return;\n }\n\n var skipAnimation = false;\n if (totalActiveAnimations > 0) {\n var animationsToCancel = [];\n if (!isClassBased) {\n if (animationEvent === 'leave' && runningAnimations['ng-leave']) {\n skipAnimation = true;\n } else {\n //cancel all animations when a structural animation takes place\n for (var klass in runningAnimations) {\n animationsToCancel.push(runningAnimations[klass]);\n cleanup(element, klass);\n }\n runningAnimations = {};\n totalActiveAnimations = 0;\n }\n } else if (lastAnimation.event === 'setClass') {\n animationsToCancel.push(lastAnimation);\n cleanup(element, className);\n }\n else if (runningAnimations[className]) {\n var current = runningAnimations[className];\n if (current.event === animationEvent) {\n skipAnimation = true;\n } else {\n animationsToCancel.push(current);\n cleanup(element, className);\n }\n }\n\n if (animationsToCancel.length > 0) {\n angular.forEach(animationsToCancel, function (operation) {\n (operation.done || noop)(true);\n cancelAnimations(operation.animations);\n });\n }\n }\n\n if (isClassBased && !setClassOperation && !skipAnimation) {\n skipAnimation = (animationEvent === 'addClass') === element.hasClass(className); //opposite of XOR\n }\n\n if (skipAnimation) {\n fireBeforeCallbackAsync();\n fireAfterCallbackAsync();\n fireDoneCallbackAsync();\n return;\n }\n\n //the ng-animate class does nothing, but it's here to allow for\n //parent animations to find and cancel child animations when needed\n element.addClass(NG_ANIMATE_CLASS_NAME);\n\n var localAnimationCount = globalAnimationCounter++;\n lastAnimation = {\n classBased: isClassBased,\n event: animationEvent,\n animations: animations,\n done: onBeforeAnimationsComplete\n };\n\n totalActiveAnimations++;\n runningAnimations[className] = lastAnimation;\n\n element.data(NG_ANIMATE_STATE, {\n last: lastAnimation,\n active: runningAnimations,\n index: localAnimationCount,\n totalActive: totalActiveAnimations\n });\n\n //first we run the before animations and when all of those are complete\n //then we perform the DOM operation and run the next set of animations\n invokeRegisteredAnimationFns(animations, 'before', onBeforeAnimationsComplete);\n\n function onBeforeAnimationsComplete(cancelled) {\n var data = element.data(NG_ANIMATE_STATE);\n cancelled = cancelled ||\n !data || !data.active[className] ||\n (isClassBased && data.active[className].event !== animationEvent);\n\n fireDOMOperation();\n if (cancelled === true) {\n closeAnimation();\n return;\n }\n\n //set the done function to the final done function\n //so that the DOM event won't be executed twice by accident\n //if the after animation is cancelled as well\n var currentAnimation = data.active[className];\n currentAnimation.done = closeAnimation;\n invokeRegisteredAnimationFns(animations, 'after', closeAnimation);\n }\n\n function invokeRegisteredAnimationFns(animations, phase, allAnimationFnsComplete) {\n phase === 'after' ?\n fireAfterCallbackAsync() :\n fireBeforeCallbackAsync();\n\n var endFnName = phase + 'End';\n forEach(animations, function (animation, index) {\n var animationPhaseCompleted = function () {\n progress(index, phase);\n };\n\n //there are no before functions for enter + move since the DOM\n //operations happen before the performAnimation method fires\n if (phase === 'before' && (animationEvent === 'enter' || animationEvent === 'move')) {\n animationPhaseCompleted();\n return;\n }\n\n if (animation[phase]) {\n if (setClassOperation) {\n animation[endFnName] = animation[phase](element, classNameAdd, classNameRemove, animationPhaseCompleted);\n } else {\n animation[endFnName] = isClassBased ?\n animation[phase](element, className, animationPhaseCompleted) :\n animation[phase](element, animationPhaseCompleted);\n }\n } else {\n animationPhaseCompleted();\n }\n });\n\n function progress(index, phase) {\n var phaseCompletionFlag = phase + 'Complete';\n var currentAnimation = animations[index];\n currentAnimation[phaseCompletionFlag] = true;\n (currentAnimation[endFnName] || noop)();\n\n for (var i = 0; i < animations.length; i++) {\n if (!animations[i][phaseCompletionFlag]) return;\n }\n\n allAnimationFnsComplete();\n }\n }\n\n function fireDOMCallback(animationPhase) {\n var eventName = '$animate:' + animationPhase;\n if (elementEvents && elementEvents[eventName] && elementEvents[eventName].length > 0) {\n $$asyncQueueBuffer(function () {\n element.triggerHandler(eventName, {\n event: animationEvent,\n className: className\n });\n });\n }\n }\n\n function fireBeforeCallbackAsync() {\n fireDOMCallback('before');\n }\n\n function fireAfterCallbackAsync() {\n fireDOMCallback('after');\n }\n\n function fireDoneCallbackAsync() {\n fireDOMCallback('close');\n if (doneCallback) {\n $$asyncQueueBuffer(function () {\n doneCallback();\n });\n }\n }\n\n //it is less complicated to use a flag than managing and cancelling\n //timeouts containing multiple callbacks.\n function fireDOMOperation() {\n if (!fireDOMOperation.hasBeenRun) {\n fireDOMOperation.hasBeenRun = true;\n domOperation();\n }\n }\n\n function closeAnimation() {\n if (!closeAnimation.hasBeenRun) {\n closeAnimation.hasBeenRun = true;\n var data = element.data(NG_ANIMATE_STATE);\n if (data) {\n /* only structural animations wait for reflow before removing an\n animation, but class-based animations don't. An example of this\n failing would be when a parent HTML tag has a ng-class attribute\n causing ALL directives below to skip animations during the digest */\n if (isClassBased) {\n cleanup(element, className);\n } else {\n $$asyncQueueBuffer(function () {\n var data = element.data(NG_ANIMATE_STATE) || {};\n if (localAnimationCount === data.index) {\n cleanup(element, className, animationEvent);\n }\n });\n element.data(NG_ANIMATE_STATE, data);\n }\n }\n fireDoneCallbackAsync();\n }\n }\n }", "function transformContainer(translate3d, animated){\n \t\t\tif(animated){\n \t\t\t\taddAnimation(container);\n \t\t\t}else{\n \t\t\t\tremoveAnimation(container);\n \t\t\t}\n\n \t\t\tcontainer.css(getTransforms(translate3d));\n\n \t\t\t//syncronously removing the class after the animation has been applied.\n \t\t\tsetTimeout(function(){\n \t\t\t\tcontainer.removeClass('fp-notransition');\n \t\t\t},10)\n \t\t}", "function animatableLoaded() {\n document.querySelector(\"body\").classList.remove(\"d-none\");\n }", "function startGame(){\n $('*').each(function(idx, li) {\n\n setTimeout(function(){\n $(li).css('visibility', '').addClass('animated bounceIn');\n },100*idx);\n }).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {\n $('*').removeClass('bounceIn');\n });\n}", "function clearAnimationTimers() {\r\tfor(var i = 0; i < animationTimers.length; i++)\r\t{\r\t\tvar timer = animationTimers.pop();\r\t\tif(timer)\r\t\t{\r\t\t\ttry{\r\t\t\t\tclearTimout(timer);\r\t\t\t}catch(e){\r\t\t\t\t//really can't do anything}\r\t\t\t}\r\t\t}\r\t}\r}", "function addAnimations( FBXTree, connections, sceneGraph ) {\n \n sceneGraph.animations = [];\n \n var rawClips = parseAnimations( FBXTree, connections );\n \n if ( rawClips === undefined ) return;\n \n \n for ( var key in rawClips ) {\n \n var rawClip = rawClips[ key ];\n \n var clip = addClip( rawClip );\n \n sceneGraph.animations.push( clip );\n \n }\n \n }", "function animator() {\n var delay, speed;\n $('.animated').each(function() {\n var el = $(this);\n //console.log( elements[i] , i );\n if (el.visible(true)) {\n if (el.data('animtype') == 'animate-progress') {\n\n el.css('opacity', 1);\n el.addClass('animatedVisi');\n el.css('opacity', 1);\n el.css('width', el.attr('aria-valuenow'));\n //el.find('.progress .progress-bar').html(el.data('progress-to'));\n\n return;\n }\n\n delay = el.data('animdelay');\n if (!delay) {\n delay = 0;\n }\n\n el.css('-webkit-animation-delay', delay);\n el.css('-moz-animation-delay', delay);\n el.css('-o-animation-delay', delay);\n el.css('animation-delay', delay);\n\n speed = el.data('animspeed');\n\n if (!speed) {\n speed = 0.5;\n }\n\n el.css('-webkit-animation-duration', speed);\n el.css('-moz-animation-duration', speed);\n el.css('-o-animation-duration', speed);\n el.css('animation-duration', speed);\n\n if (el.data('animtype')) {\n el.addClass(el.data('animtype'));\n }\n\n el.addClass('animatedVisi');\n // que.push(this);\n }\n else if (el.data('animrepeat') == '1') {\n el.removeClass(el.data('animtype'));\n el.removeClass('animatedVisi');\n }\n });\n}", "function anim(){\n\tarray.forEach(function(a){\n\t\ta.style.animation = ''\n\t})\t\n\t// Wykonaj funckja czysczesnia divow po 3995 sekundy\n\tsetTimeout(anim, 3995)\n}", "OnAnimationEnd() {\n // Remove the container containing the delete animations\n if (this._deleteContainer) {\n this.removeChild(this._deleteContainer);\n this._deleteContainer = null;\n }\n\n // Clean up the old container used by black box updates\n if (this._oldContainer) {\n this.removeChild(this._oldContainer);\n this._oldContainer = null;\n }\n\n // Restore event listeners\n this.EventManager.addListeners(this);\n\n // Restore visual effects on node with keyboard focus\n this._processInitialFocus(true);\n\n // Process the highlightedCategories\n this._processInitialHighlighting();\n\n if (!this.AnimationStopped) this.RenderComplete();\n\n // Reset animation flags\n this.Animation = null;\n this.AnimationStopped = false;\n }", "function animateIt($elements) {\n $elements.each( function( i, el ) {\n\n var $el = $( el ),\n animationClass = $el.data( 'animation' );\n\n $el.addClass( animationClass );\n $el.addClass( 'animated' );\n $el.addClass( 'wait-animation' );\n\n $el.one( 'inview', function() {\n $el.removeClass( 'wait-animation' );\n $el.addClass( 'done-animation' );\n });\n });\n}", "function doAnimations( elems ) {\n //Cache the animationend event in a variable\n var animEndEv = 'webkitAnimationEnd animationend';\n \n elems.each(function () {\n var $this = $(this),\n $animationType = $this.data('animation');\n $this.addClass($animationType).one(animEndEv, function () {\n $this.removeClass($animationType);\n });\n });\n }", "function iconAnimations(){\n $('[data-animation]').each(function(){\n var element = $(this),\n elementParent = $(element).parent();\n\n\n elementParent.on('mouseenter', function(){\n element.addClass('animated ' + element.attr('data-animation'));\n });\n elementParent.on('mouseleave', function(){\n element.removeClass('animated ' + element.attr('data-animation'));\n });\n\n });\n}", "startAnimation(animationName, loop) {\n var started = false; // to ensure we start only one animation\n for ( var i = 0; i < this.getAnimationGroups().length; i++ ) {\n var group = this.getAnimationGroups()[i];\n if ( group.name == animationName && !started ) {\n started = true;\n //this.log(\"Animation group: \"+animationName);\n if ( group.isPlaying ) {\n group.pause();\n this.log(\"paused \"+animationName);\n } else {\n if ( this.fixes ) {\n if (typeof this.fixes.beforeAnimation !== 'undefined' ) {\n this.log( \"Applying fixes for: \"+this.folder.name+\" beforeAnimation: \"+this.fixes.beforeAnimation);\n this.groundLevel( this.fixes.beforeAnimation );\n }\n this.disableNodes();\n if (typeof this.fixes.before !== 'undefined' ) {\n this.fixes.before.forEach( obj => {\n if ( animationName == obj.animation && obj.enableNodes ) {\n console.log(obj);\n this.enableNodes(obj.enableNodes, true);\n }\n });\n }\n }\n this.jump(0);\n if ( typeof loop != 'undefined') {\n group.play(loop);\n } else {\n group.play(group.loopAnimation);\n }\n this.log(\"playing \"+animationName);\n this.log(group);\n this.activeAnimation = animationName;\n }\n } else if ( group.isPlaying ) {\n // stop all other animations\n group.pause();\n //group.reset(); // this disables blending\n }\n }\n }", "crossFadeToAnimation(animation, duration, exclude) {\n exclude = exclude || []\n duration = duration || 0.3\n let runningAnimations = this.getRunningAnimations() \n let animationClipName = animation.getClip().name\n runningAnimations.forEach((ra) => {\n var raClipName = ra.getClip().name \n //console.log('trying to crossfadefrom ' + raClipName + ' to ' + animationClipName + ' with excludes: ', exclude)\n if (raClipName != animationClipName && !exclude.includes(raClipName)) { \n ra.crossFadeTo(animation, duration, true);\n //console.log('crossfading!')\n /*setTimeout(() => {\n ra.stop()\n }, duration)\n */\n }\n })\n }", "attachAnimations( group ) {\n this.log(\"Animation group:\"+group.name, group);\n var animationGroup = new BABYLON.AnimationGroup(group.name, this.scene);\n group.animations.forEach( a => {\n // CHECKME: fps\n var animation = new BABYLON.Animation( a.animationName, a.propertyName, a.fps, a.dataType, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);\n animation.enableBlending = true;\n animation.blendingSpeed = 0.1;\n var bone = this.skeleton.getBoneIndexByName(a.targetName);\n if ( bone >= 0 ) {\n var target = this.skeleton.bones[bone].getTransformNode();\n } else {\n console.log(\"Missing target \"+a.targetName);\n return;\n }\n var keys = [];\n if ( a.dataType == BABYLON.Animation.ANIMATIONTYPE_VECTOR3 ) {\n a.keys.forEach( key => {\n var k = {frame: key.frame, value:new BABYLON.Vector3(key.value.x, key.value.y, key.value.z)};\n if ( key.interpolation ) {\n k.interpolation = key.interpolation;\n }\n keys.push( k );\n });\n } else if ( a.dataType == BABYLON.Animation.ANIMATIONTYPE_QUATERNION ) {\n a.keys.forEach( key => {\n keys.push( {frame: key.frame, value:new BABYLON.Quaternion(key.value.x, key.value.y, key.value.z, key.value.w)} );\n });\n } else {\n // ERROR\n console.log(\"Unsupported datatype \"+a.dataType);\n }\n animation.setKeys(keys);\n animationGroup.addTargetedAnimation(animation, target);\n });\n \n animationGroup.loopAnimation = true; // CHECKME\n \n var groups = this.getAnimationGroups();\n for ( var i = 0; i < groups.length; i++ ) {\n if ( groups[i].name == animationGroup.name ) {\n var old = groups[i];\n console.log(\"old\",old);\n groups[i] = animationGroup;\n if ( old.isPlaying ) {\n old.stop();\n }\n old.dispose();\n return;\n }\n }\n groups.push(animationGroup);\n }", "function animated(element, animation) {\n // add the class animate and the animation\n AddRemoveClass(element, \"add\", \"animated\");\n AddRemoveClass(element, \"add\", animation);\n // remove the class animate and the animation thereby ending it\n setTimeout(() => {\n AddRemoveClass(element, \"remove\", \"animated\");\n AddRemoveClass(element, \"remove\", animation);\n }, 2000);\n }", "function transformContainer(translate3d, animated){\r\n if(animated){\r\n addAnimation(container);\r\n }else{\r\n removeAnimation(container);\r\n }\r\n\r\n container.css(getTransforms(translate3d));\r\n\r\n //syncronously removing the class after the animation has been applied.\r\n setTimeout(function(){\r\n container.removeClass(NO_TRANSITION);\r\n },10);\r\n }", "function transformContainer(translate3d, animated){\r\n if(animated){\r\n addAnimation(container);\r\n }else{\r\n removeAnimation(container);\r\n }\r\n\r\n container.css(getTransforms(translate3d));\r\n\r\n //syncronously removing the class after the animation has been applied.\r\n setTimeout(function(){\r\n container.removeClass(NO_TRANSITION);\r\n },10);\r\n }", "function transformContainer(translate3d, animated){\r\n if(animated){\r\n addAnimation(container);\r\n }else{\r\n removeAnimation(container);\r\n }\r\n\r\n container.css(getTransforms(translate3d));\r\n\r\n //syncronously removing the class after the animation has been applied.\r\n setTimeout(function(){\r\n container.removeClass(NO_TRANSITION);\r\n },10);\r\n }", "function toggle_animation() {\n var i;\n var packet;\n var thisPacket;\n\n if (animationRunning === true) {\n for (i = 1; i < 11; i++) {\n thisPacket = \".\" + \"demand-planning\" + \"-\" + i;\n packet = document.querySelector(thisPacket);\n addClass(packet, \"pause-animation\");\n removeClass(packet, \"start-automation\");\n console.log(\"pausing \" + thisPacket);\n }\n } else {\n for (i = 1; i < 11; i++) {\n thisPacket = \".\" + \"demand-planning\" + \"-\" + i;\n packet = document.querySelector(thisPacket);\n // packet = document.querySelector(\".demand-planning-1\");\n removeClass(packet, \"pause-animation\");\n addClass(packet, \"start-automation\");\n console.log(\"restarting \" + thisPacket);\n }\n }\n animationRunning = !animationRunning;\n}", "_removeFadeOut() {\n const that = this,\n fadeOutItems = that.$.itemsContainer.getElementsByClassName('jqx-out');\n\n if (fadeOutItems.length) {\n for (let i = 0; i < fadeOutItems.length; i++) {\n fadeOutItems[i].classList.remove('jqx-out');\n }\n }\n }", "clear_caches() {\n for (let k in this.animation_set) {\n this.animation_set[k].node_cache = {};\n }\n }", "function doAnimation() {\n\tvar animations = [\"bounce\", \"zoomInDown\", \"zoomIn\",\n\t\t\t\t\t\"zooInLeft\",\"zoomInRight\", \"zoomInUp\"];\n\tvar applyAnimation = animations[Math.floor(Math.random() * animations.length)];\n\t\n\tapplyAnimation = \"animated \" + applyAnimation;\n\t$(\"#container\").addClass(applyAnimation);\n\t$(\"#container\").one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {\n\t\t$(\"#container\").removeClass(applyAnimation);\n\t});\n}", "componentWillUpdate(nextProps) {\n const {\n cachedChildren\n } = this.state;\n const child = toChildArray(nextProps.children)[0];\n if (cachedChildren === child) return null;\n const patch = {\n cachedChildren: child\n }; // Enter transition\n\n if (child && !cachedChildren) {\n patch.className = `${transitionName}-enter`;\n cancelAnimationFrame(this.animationFrame);\n clearTimeout(this.leaveTimeout);\n this.leaveTimeout = undefined;\n this.animationFrame = requestAnimationFrame(() => {\n // Force it to render before we add the active class\n // this.base.getBoundingClientRect()\n this.setState({\n className: `${transitionName}-enter ${transitionName}-enter-active`\n });\n this.enterTimeout = setTimeout(() => {\n this.setState({\n className: ''\n });\n }, duration);\n });\n } // Leave transition\n\n\n if (cachedChildren && !child && this.leaveTimeout === undefined) {\n patch.cachedChildren = cachedChildren;\n patch.className = `${transitionName}-leave`;\n cancelAnimationFrame(this.animationFrame);\n clearTimeout(this.enterTimeout);\n this.enterTimeout = undefined;\n this.animationFrame = requestAnimationFrame(() => {\n this.setState({\n className: `${transitionName}-leave ${transitionName}-leave-active`\n });\n this.leaveTimeout = setTimeout(() => {\n this.setState({\n cachedChildren: null,\n className: ''\n });\n }, duration);\n });\n } // eslint-disable-next-line\n\n\n this.setState(patch);\n }", "_enableAnimation() {\n this.isAnimatable = true;\n toggleClass(this.navEl, 'no-animation', !this.isAnimatable);\n }", "reAnimate(){\n\t\tthis.keyFrameStyle.parentNode.removeChild(this.keyFrameStyle);\n\t\tthis.keyFrameStyle = null;\n\t\tthis.keyFrameAnimate();\n\t}", "requestUpdateAnimations () {\n this.animationsUpdateNeeded = true;\n }", "function clearStyles(ele){\n\tconsole.log('clearing styles');\n\tele.css({\n\t\ttransition : '',\n\t\ttransform : ''\n\t});\n}", "function doAnimations( elems ) {\n //Cache the animationend event in a variable\n var animEndEv = 'webkitAnimationEnd animationend';\n \n elems.each(function () {\n var $this = $(this),\n $animationType = $this.data('animation');\n $this.addClass($animationType).one(animEndEv, function () {\n $this.removeClass($animationType);\n });\n });\n }", "_animateOut() {\n document.getElementById(this.id).className += \" zoomOutLoader\";\n }", "_onAnimationEnd() {\n // Clean up the old container. This is done after the animation to avoid garbage\n // collection during the animation and because the black box updates need it.\n if (this._oldContainer) {\n this._oldContainer.removeFromParent();\n this._oldContainer.destroy();\n this._oldContainer = null;\n }\n\n if (this._delContainer) {\n this._delContainer.removeFromParent();\n this._delContainer.destroy();\n this._delContainer = null;\n }\n\n // Fire ready event saying animation is finished.\n if (!this.AnimationStopped) this.RenderComplete();\n\n // Restore event listeners\n this.EventManager.addListeners(this);\n\n // Reset animation flags\n this.Animation = null;\n this.AnimationStopped = false;\n }", "_playAnimation() {\n if (this._animationLast === undefined && this._animationQueue.length > 0) {\n this._animationLast = this._animationCurrent;\n this._animationCurrent = this._animationQueue.shift();\n console.log(\"New: \" + this._animationCurrent.name);\n this._animationCurrent.runCount = 0;\n }\n this._serviceAnimation(this._animationCurrent, true);\n this._serviceAnimation(this._animationLast, false);\n if (this._animationLast && this._animationLast.cleanup) {\n this._animationLast.animation.stop();\n this._animationLast.animation = undefined;\n this._animationLast = undefined;\n }\n }", "function setAnimation ( _elem, _InOut ) {\n\t\t // Store all animationend event name in a string.\n\t\t // cf animate.css documentation\n\t\t var animationEndEvent = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';\n\n\t\t _elem.each ( function () {\n\t\t var jQueryelem = jQuery(this);\n\t\t var jQueryanimationType = 'animated ' + jQueryelem.data( 'animation-' + _InOut );\n\n\t\t jQueryelem.addClass(jQueryanimationType).one(animationEndEvent, function () {\n\t\t jQueryelem.removeClass(jQueryanimationType); // remove animate.css Class at the end of the animations\n\t\t });\n\t\t });\n\t \t}", "function doAnimations( elems ) {\n //Cache the animationend event in a variable\n var animEndEv = 'webkitAnimationEnd animationend';\n\n elems.each(function () {\n var $this = $(this),\n $animationType = $this.data('animation');\n $this.addClass($animationType).one(animEndEv, function () {\n $this.removeClass($animationType);\n });\n });\n }" ]
[ "0.7276597", "0.6847355", "0.6560291", "0.64789283", "0.6431134", "0.63419926", "0.626006", "0.62471807", "0.6236975", "0.6159178", "0.6153979", "0.60913366", "0.6087481", "0.6020716", "0.5989465", "0.5987362", "0.5957859", "0.59303546", "0.59126073", "0.59096617", "0.59064186", "0.59046876", "0.58782536", "0.5875125", "0.5859145", "0.58566207", "0.585056", "0.58404356", "0.58404356", "0.58404356", "0.5829933", "0.58293486", "0.5827251", "0.5827251", "0.5827251", "0.5827251", "0.58232814", "0.5800908", "0.5794557", "0.57822376", "0.575261", "0.57519853", "0.5751527", "0.57129085", "0.56876504", "0.56780773", "0.56751716", "0.5673852", "0.56728673", "0.5666357", "0.5658709", "0.5654432", "0.5648771", "0.5645773", "0.5635694", "0.5633852", "0.5632534", "0.5628938", "0.5626584", "0.56187576", "0.5611272", "0.5601196", "0.5601196", "0.5601196", "0.5597087", "0.5592142", "0.5591582", "0.55882764", "0.5588238", "0.55845237", "0.5580289", "0.55647486", "0.55562145", "0.55491495", "0.5548379", "0.5544984", "0.5544592", "0.5533102", "0.55261874", "0.5514902", "0.5504008", "0.54982626", "0.54950356", "0.54950356", "0.54950356", "0.549323", "0.54932225", "0.5487584", "0.54871356", "0.5479921", "0.54760015", "0.5474942", "0.5473742", "0.5473297", "0.5472331", "0.54701847", "0.54666334", "0.5460699", "0.5457625", "0.5454316" ]
0.56077534
61
TODO(matsko): change to reference nodes
function getAnchorNodes(node) { var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']'; var items = node.hasAttribute(NG_ANIMATE_REF_ATTR) ? [node] : node.querySelectorAll(SELECTOR); var anchors = []; forEach(items, function(node) { var attr = node.getAttribute(NG_ANIMATE_REF_ATTR); if (attr && attr.length) { anchors.push(node); } }); return anchors; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function node(){}", "get node() { return this._node; }", "function Node(){}", "function Node() {}", "getNodes() {\n return this.target.assignedNodes(this.options);\n }", "constructor(nodes) {\n this.nodes = nodes\n }", "function NodeRef(node, type, text) {\n this.node = node;\n this.type = type;\n this.text = text;\n this.childNodes = [];\n this.parentNode = null;\n this.contentScore = 0;\n this.textScores = [];\n this.isBlock = false;\n}", "function NodeUtils() {\n var self = this;\n // Performs deep copy of the given node.\n this.deepCopy = function(node) {\n return JSON.parse(JSON.stringify(node));\n };\n\n // Deletes a node from the body.\n this.deleteNode = function(parentBody, nodeToDel) {\n var deleteIndex = parentBody.indexOf(nodeToDel);\n parentBody.splice(deleteIndex, 1);\n };\n\n // Replaces source node with the target node and returns a reference to the new node.\n this.replaceNode = function(source, target, context) {\n var sourceCopy = self.deepCopy(source);\n\n Object.keys(source).forEach(function(key) {\n delete source[key];\n });\n Object.keys(target).forEach(function(key) {\n source[key] = target[key];\n });\n\n // Using this check temporarily.\n // if (!self.hasLocNode(sourceCopy)) {\n // \treturn source;\n // }\n\n // Attach the loc nodes based on the context.\n switch (context) {\n // Mapping of loc nodes for N1qlQuery happens during the substitution of variables in the N1QL query string.\n /*\n \tBefore:\n \tvar res1 = new N1qlQuery(`select * from :bucket LIMIT 10;`);\n \tAfter:\n \tvar res1 = new N1qlQuery('select * from ' + bucket + ' LIMIT 10;');\n */\n case Context.N1qlQuery:\n source.loc = self.deepCopy(sourceCopy.loc);\n source.callee.loc = self.deepCopy(sourceCopy.callee.loc);\n source.arguments[0].loc = self.deepCopy(sourceCopy.arguments[\n 0].quasis[0].loc);\n break;\n\n // Mapping of if-else block to for-of loop.\n /*\n \tBefore:\n \tfor (var r of res1){...}\n \tAfter:\n \tif (res1.isInstance) {\n \t\tres1.iter(function (r) {...}\n \t} else {...}\n */\n case Context.IterTypeCheck:\n source.loc = self.deepCopy(sourceCopy.loc);\n source.consequent.loc = self.deepCopy(sourceCopy.body.loc);\n source.test.loc = self.deepCopy(sourceCopy.right.loc);\n source.test.object.loc = self.deepCopy(sourceCopy.right\n .loc);\n source.test.property.loc = self.deepCopy(sourceCopy.right\n .loc);\n\n // TODO: Currently, after breaking out from labeled break statement, it goes to the beginning of the for-of loop.\n //\t\tIdeally, it should go to the end of the labeled block. This looks quite ideal to show the iteration behaviour -\n //\t\tIt stops at the enclosing for-of loops (iterators) before coming out and thus, demonstrating the stopping\n //\t\tof iteration. Need to ask whether this is ok or if the default behaviour is needed.\n if (source.consequent.body.length > 1 &&\n /SwitchStatement/.test(source.consequent.body[1].type)\n ) {\n self.forceSetLocForAllNodes(sourceCopy.loc, source.consequent\n .body[1]);\n }\n break;\n\n // The following case handles two-way mapping of loc nodes between continue and return statements.\n case Context.ContinueStatement:\n source.loc = self.deepCopy(sourceCopy.loc);\n switch (source.type) {\n // Return to continue statement mapping - source: return, target: continue\n case 'ContinueStatement':\n if (source.label) {\n source.label.loc = self.deepCopy(sourceCopy\n .loc);\n }\n break;\n\n // Continue to return statement mapping - source: continue, target: return\n case 'ReturnStatement':\n if (source.argument && sourceCopy.label.loc) {\n source.argument = self.setLocForAllNodes(\n sourceCopy.label.loc, source.argument\n );\n }\n break;\n\n default:\n throw 'Not yet handled for ' + source.type;\n }\n break;\n\n // The following case handles two-way mapping of loc nodes between break and return statements.\n case Context.BreakStatement:\n source.loc = self.deepCopy(sourceCopy.loc);\n switch (source.type) {\n // Return to break statement mapping - source: return, target: break\n case 'BreakStatement':\n source.label.loc = self.deepCopy(sourceCopy.argument\n .loc);\n break;\n\n // Break to return statement mapping - source: break, target: return\n case 'ReturnStatement':\n source.argument = self.setLocForAllNodes(\n sourceCopy.loc, source.argument);\n break;\n\n default:\n throw 'Not yet handled for ' + source.type;\n }\n break;\n\n // The following case handles mapping of loc nodes between two different 'stopIter' calls.\n /*\n \tBefore:\n \treturn res2.stopIter({\n \t\t'code': 'labeled_break',\n \t\t'args': 'x'\n \t});\n \tAfter:\n \treturn res1.stopIter({\n \t\t'code': 'labeled_break',\n \t\t'args': 'x'\n \t});\n */\n case Context.BreakAltInterrupt:\n self.setLocMatchingNodes(sourceCopy, source);\n break;\n\n // The following case handles the mapping of loc nodes between stopIter and\n // return statement or between two stopIter statements as the above case.\n /*\n \tBefore:\n \treturn res2.stopIter({\n \t\t\t'code': 'labeled_continue',\n \t\t\t'args': 'x'\n \t\t});\n \tAfter:\n \treturn;\n */\n case Context.ContinueAltInterrupt:\n if (source.argument) {\n self.setLocMatchingNodes(sourceCopy, source);\n } else {\n source.loc = sourceCopy.loc;\n }\n break;\n }\n\n return source;\n };\n\n // Checks if atleast one loc node is present in the AST.\n this.hasLocNode = function(ast) {\n var hasLoc = false;\n estraverse.traverse(ast, {\n enter: function(node) {\n if (hasLoc) {\n return;\n }\n\n hasLoc = node.loc;\n }\n });\n\n return hasLoc;\n };\n\n // Adds loc node for all the nodes in the AST.\n // Thus, all the nodes of AST might end up having unnecessary loc nodes.\n // Though this method wouldn't modify the parsing behaviour, it must be used as a last resort.\n this.forceSetLocForAllNodes = function(loc, ast) {\n estraverse.traverse(ast, {\n enter: function(node) {\n if (!node.loc) {\n node.loc = self.deepCopy(loc);\n }\n }\n });\n };\n\n // This is a safe method for adding loc nodes for a given AST.\n // The disadvantage is that it can not be used with all the AST.\n this.setLocForAllNodes = function(loc, ast) {\n // Generate the code snippet for the given AST.\n var codeSnippet = escodegen.generate(ast);\n // Parse with loc enabled to determine the nodes to which we can attach loc node.\n var astWithLoc = esprima.parse(codeSnippet, {\n loc: true\n });\n\n // We new traverse astWithLoc and replace all the loc nodes.\n estraverse.traverse(astWithLoc, {\n enter: function(node) {\n node.loc = node.loc ? nodeUtils.deepCopy(\n loc) : null;\n }\n });\n\n return astWithLoc.body[0].expression;\n };\n\n // This is a safe method for performing a one-to-one copy of the loc nodes from AST1 to AST2.\n // The two ASTs must have the same structure.\n this.setLocMatchingNodes = function(source, target) {\n var sourceNodeStack = new Stack(),\n targetNodeStack = new Stack();\n\n // Linearizes the given AST into a stack.\n function convertTreeToStack(ast, stack) {\n estraverse.traverse(ast, {\n enter: function(node) {\n stack.push(node);\n }\n });\n }\n\n convertTreeToStack(source, sourceNodeStack);\n convertTreeToStack(target, targetNodeStack);\n\n // Pop all nodes from the sourceNodeStack and if an element contains loc node,\n // copy it to the corresponding element in the targetNodeStack.\n while (!sourceNodeStack.isEmpty()) {\n var sourceNode = sourceNodeStack.pop();\n var targetNode = targetNodeStack.pop();\n if (sourceNode.loc) {\n targetNode.loc = self.deepCopy(sourceNode.loc);\n }\n }\n };\n\n // Inserts the given node to the given parentBody at the specified index.\n this.insertNode = function(parentBody, refNode, nodeToInsert,\n insertAfter) {\n var insertIndex = insertAfter ? parentBody.indexOf(refNode) + 1 :\n parentBody.indexOf(refNode);\n parentBody.splice(insertIndex, 0, nodeToInsert);\n };\n\n // A N1QL node is a statement of the form new N1qlQuery('...');\n this.isN1qlNode = function(node) {\n return /NewExpression/.test(node.type) && /N1qlQuery/.test(node\n .callee.name);\n };\n\n this.convertToBlockStmt = function(node) {\n switch (node.type) {\n case 'ForOfStatement':\n // Transform the previous single-line statement into a block.\n node.body.body = [nodeUtils.deepCopy(node.body)];\n node.body.type = 'BlockStatement';\n break;\n case 'IfStatement':\n node.consequent.body = [nodeUtils.deepCopy(node.consequent)];\n node.consequent.type = 'BlockStatement';\n // If the 'else' part exists, convert it to a block statement.\n if (node.alternate) {\n node.alternate.body = [nodeUtils.deepCopy(node.alternate)];\n node.alternate.type = 'BlockStatement';\n }\n break;\n default:\n throw 'unhandled case for: ' + node.type;\n }\n };\n\n // Inserts an array of AST nodes into parentBody at the specified index.\n this.insertNodeArray = function(parentBody, insAfterNode, arrayToInsert) {\n var insertIndex = parentBody.indexOf(insAfterNode) + 1;\n parentBody.splice.apply(parentBody, [insertIndex, 0].concat(\n arrayToInsert));\n };\n\n // Build an ast node for N1QL function call from the query.\n this.getQueryAst = function(query) {\n // Identifier regex.\n var re = /:([a-zA-Z_$][a-zA-Z_$0-9]*)/g;\n\n // Replace the :<var> with proper substitution.\n query = query.replace(re, '\" + $1 + \"');\n query = 'new N1qlQuery(\"' + query + '\");';\n\n return esprima.parse(query).body[0].expression;\n };\n\n // Checks if the global scope contains only function declarations.\n this.checkGlobals = function(ast) {\n for (var node of ast.body) {\n if (!/FunctionDeclaration/.test(node.type)) {\n throw 'Only function declaration are allowed in global scope';\n }\n }\n }\n }", "constructor () {\n\t\tthis.nodes = {};\n\t}", "function RNode() {}", "function RNode() {}", "function RNode() {}", "function RNode(){}", "\n (\n from_n, //:- Node.Facet.id_n\n to_n, //:- Node.Facet.id_n\n facet_c=null //:- Facet\n )\n {\n const link_c = new Link( from_n, to_n, facet_c )\n this.node_a[from_n].link__v( link_c )\n //?? this.link_a.push( link_c )\n }", "function AndNodeFactory() {}", "function computeNodeLinks() {\n nodes.forEach(function (node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function (link) {\n var source = link.source, target = link.target;\n link.source_index = source;\n link.target_index = target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);/////the link in which node as souce/link\n target.targetLinks.push(link);\n });\n }", "function NodeDef(){}", "function NodeDef() {}", "function NodeDef() {}", "function NodeDef() {}", "resolveNodes() {\n const {\n map,\n _cstAliases\n } = this;\n Object.keys(map).forEach(a => {\n map[a] = map[a].resolved;\n });\n\n _cstAliases.forEach(a => {\n a.source = a.source.resolved;\n });\n\n delete this._cstAliases;\n }", "resolveNodes() {\n const {\n map,\n _cstAliases\n } = this;\n Object.keys(map).forEach(a => {\n map[a] = map[a].resolved;\n });\n\n _cstAliases.forEach(a => {\n a.source = a.source.resolved;\n });\n\n delete this._cstAliases;\n }", "resolveNodes() {\n const {\n map,\n _cstAliases\n } = this;\n Object.keys(map).forEach(a => {\n map[a] = map[a].resolved;\n });\n\n _cstAliases.forEach(a => {\n a.source = a.source.resolved;\n });\n\n delete this._cstAliases;\n }", "resolveNodes() {\n const {\n map,\n _cstAliases\n } = this;\n Object.keys(map).forEach(a => {\n map[a] = map[a].resolved;\n });\n\n _cstAliases.forEach(a => {\n a.source = a.source.resolved;\n });\n\n delete this._cstAliases;\n }", "constructor() {\n this._nodes = [];\n }", "function NWTNode() {\n\t\n}", "constructor(nodes) {\n this.nodes = nodes;\n }", "visitNode(node) { }", "resolveNodes() {\n const {\n map,\n _cstAliases\n } = this;\n Object.keys(map).forEach(a => {\n map[a] = map[a].resolved;\n });\n\n _cstAliases.forEach(a => {\n a.source = a.source.resolved;\n });\n\n delete this._cstAliases;\n }", "function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function(link) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function(link) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "getNodes() {\n return Object.values(this.lookup);\n }", "function extractRefs ( node, refs ) {\n\t \tvar i, list;\n\n\t \tif ( node.t === REFERENCE ) {\n\t \t\tif ( refs.indexOf( node.n ) === -1 ) {\n\t \t\t\trefs.unshift( node.n );\n\t \t\t}\n\t \t}\n\n\t \tlist = node.o || node.m;\n\t \tif ( list ) {\n\t \t\tif ( isObject( list ) ) {\n\t \t\t\textractRefs( list, refs );\n\t \t\t} else {\n\t \t\t\ti = list.length;\n\t \t\t\twhile ( i-- ) {\n\t \t\t\t\textractRefs( list[i], refs );\n\t \t\t\t}\n\t \t\t}\n\t \t}\n\n\t \tif ( node.x ) {\n\t \t\textractRefs( node.x, refs );\n\t \t}\n\n\t \tif ( node.r ) {\n\t \t\textractRefs( node.r, refs );\n\t \t}\n\n\t \tif ( node.v ) {\n\t \t\textractRefs( node.v, refs );\n\t \t}\n\t }", "function extractRefs(node, refs) {\n \tvar i, list;\n\n \tif (node.t === REFERENCE) {\n \t\tif (refs.indexOf(node.n) === -1) {\n \t\t\trefs.unshift(node.n);\n \t\t}\n \t}\n\n \tlist = node.o || node.m;\n \tif (list) {\n \t\tif (isObject(list)) {\n \t\t\textractRefs(list, refs);\n \t\t} else {\n \t\t\ti = list.length;\n \t\t\twhile (i--) {\n \t\t\t\textractRefs(list[i], refs);\n \t\t\t}\n \t\t}\n \t}\n\n \tif (node.x) {\n \t\textractRefs(node.x, refs);\n \t}\n\n \tif (node.r) {\n \t\textractRefs(node.r, refs);\n \t}\n\n \tif (node.v) {\n \t\textractRefs(node.v, refs);\n \t}\n }", "function computeNodeLinks() {\n\t nodes.forEach(function (node) {\n\t node.sourceLinks = [];\n\t node.targetLinks = [];\n\t });\n\t links.forEach(function (link) {\n\t var source = link.source,\n\t target = link.target;\n\t if (typeof source === \"number\") source = link.source = nodes[link.source];\n\t if (typeof target === \"number\") target = link.target = nodes[link.target];\n\t source.sourceLinks.push(link);\n\t target.targetLinks.push(link);\n\t });\n\t }", "function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = []\n node.targetLinks = []\n })\n links.forEach(function(link) {\n let source = link.source\n let target = link.target\n if (typeof source === 'number') source = link.source = nodes[link.source]\n if (typeof target === 'number') target = link.target = nodes[link.target]\n source.sourceLinks.push(link)\n target.targetLinks.push(link)\n })\n }", "SetNodeParents() {\n //let values = Array.from(Object.values(this.GraphContent));\n let values = Object.values(this.GraphContent);\n //console.log('SetNodeParents ' + JSON.stringify(values[0]));\n //console.log('data length ' + values.length );\n for (let i = 0; i < values.length; i++) {\n let links = values[i].children;\n //console.log('links for ' + i + ' = ' + JSON.stringify(links));\n //console.log('this.NodeList ' + JSON.stringify(this.NodeList));\n if (links.length != 0) {\n for (let j = 0; j < links.length; j++) {\n let childNode = this.NodeList[links[j]];\n childNode.setParents(i);\n //console.log(`parents for ${childNode.name} are :`,childNode.parents);\n }\n }\n }\n }", "function computeNodeLinks() {\n _(nodes).each(function(node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n _(links).each(function(link) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "get_root(){ return this.bones[ 0 ].ref; }", "function walk_to_node(diagram, start_node, end_addr) {\n var rel_addr = node_relative_addr(start_node.id, end_addr);\n var addr = rel_addr.split(\",\");\n var n = start_node;\n var ni;\n while (typeof (nistr = addr.shift()) != \"undefined\") {\n var ni = parseInt(nistr);\n n = n.get_child(ni);\n }\n return n;\n }", "prepareNodes() {\n const render = (node) => {\n node.html = nodeToHTML(node);\n node.nodesHTML = subnodesToHTML(node.nodes);\n\n const dimensions = getDimensions(node.html, {}, 'mindmap-node');\n node.width = dimensions.width;\n node.height = dimensions.height;\n\n const nodesDimensions = getDimensions(node.nodesHTML, {}, 'mindmap-subnode-text');\n node.nodesWidth = nodesDimensions.width;\n node.nodesHeight = nodesDimensions.height;\n };\n\n this.props.nodes.forEach(node => render(node));\n }", "function computeNodeLinks() {\r\n var count = 0;\r\n\r\n nodes.forEach(function(node) {\r\n \r\n node.sourceLinks = [];\r\n node.targetLinks = [];\r\n console.log(node.targetLinks);\r\n // console.log(\"success\" + count + node.name);\r\n // count++;\r\n });\r\n links.forEach(function(link) {\r\n var source = link.source,\r\n target = link.target;\r\n if (typeof source === \"number\") source = link.source = nodes[link.source];\r\n if (typeof target === \"number\") target = link.target = nodes[link.target];\r\n console.log(\"Count: \" + count + \" Source: \" + link.source);\r\n source.sourceLinks.push(link);\r\n target.targetLinks.push(link);\r\n });\r\n }", "function randomNode() {\n \n}", "function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function(link, i) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n link.originalIndex = i;\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "nodeParams(sourceNode, targetNode) {\n // for edges between the specified source and target\n // return element object to be passed to cy.add() for intermediary node\n return {};\n }", "function computeNodeBreadths(nodes,links) {\n var remainingNodes = nodes.map(function(d) { return d.sankeyID })\n var nextNodes\n var x = 0\n\n // console.log(nodes);\n\n while (remainingNodes.length) {\n nextNodes = [];\n remainingNodes.forEach(function(node) {\n nodes[node].x = x;\n nodes[node].sourceLinks.forEach(function(link) {\n if (nextNodes.indexOf(link.target) < 0) {\n nextNodes.push(link.target);\n }\n });\n });\n remainingNodes = nextNodes;\n ++x;\n }\n }", "function NodeDef() { }", "function NodeDef() { }", "get references() {\n return getLocalRefs(this.nativeNode);\n }", "link() {\n //the act of walking causes the nodes to be linked\n this.walk(() => { }, {\n walkMode: visitors_1.WalkMode.visitAllRecursive\n });\n }", "function Node(parent){\n this.parent = parent;\n this.nodeType = 'Node';\n this._scope = undefined;\n this._refs = (parent && parent.refs()) || new Refs()\n}", "\n (\n from_n, //:- Node.Facet.id_n\n callback_f=null //:- Function\n )\n {\n const linked_a = new Set()\n const dive__a = //:- depth first\n at_n =>\n {\n linked_a.add( at_n )\n callback_f && callback_f( at_n )\n for ( let link_c of this.node_a[at_n].link_a )\n {\n const id_n = link_c.to__n()\n if ( !linked_a.has( id_n ) ) dive__a( id_n )\n }\n }\n dive__a( from_n )\n return linked_a\n }", "function TNode(){}", "function TNode() {}", "function TNode() {}", "function TNode() {}", "function EqnNodeRenderer() { }", "function getNodes() {\n return d3.selectAll('g .node');\n}", "createNode(node) {\n nodes = webglUtils.extendArray(nodes, nodesCount, ATTRIBUTES_PER_PRIMITIVE);\n nodesCount += 1;\n }", "annotateNodes() {\n this.nodeIdMap.clear();\n this.nodeNIdMap.clear();\n\n let lastNode = null;\n let nid = 0;\n\n const loop = (nodes, parent, level) => {\n nodes.forEach((node, i) => {\n node.parent = parent;\n node.path = parent ? parent.path + (\",\" + i) : i.toString();\n node.level = level;\n node[\"aria-setsize\"] = nodes.length;\n node[\"aria-posinset\"] = i + 1;\n node.nid = nid++;\n if (lastNode) {\n node.prev = lastNode;\n lastNode.next = node;\n }\n this.nodeIdMap.set(node.id, node);\n this.nodeNIdMap.set(node.nid, node);\n lastNode = node;\n loop([...node.children()], node, level + 1);\n });\n };\n loop(this.rootNodes, null, 1);\n }", "function RNode() { }", "function RNode() { }", "function computeNodeLinks() {\n\t nodes.forEach(function(node) {\n\t // Links that have this node as source.\n\t node.sourceLinks = [];\n\t // Links that have this node as target.\n\t node.targetLinks = [];\n\t });\n\t links.forEach(function(link) {\n\t var source = link.source,\n\t target = link.target;\n\t if (typeof source === 'number') source = link.source = nodes[link.source];\n\t if (typeof target === 'number') target = link.target = nodes[link.target];\n\t source.sourceLinks.push(link);\n\t target.targetLinks.push(link);\n\t });\n\t }", "addToFront(node) {}", "function computeNodeLinks() {\r\n var nodeHash = {};\r\n var linkHash = {};\r\n // remove duplicated node\r\n nodes = nodes.filter(function (node) {\r\n if (typeof nodeHash[node.id] !== 'undefined') {\r\n $.extend(nodeHash[node.id], node);\r\n return false;\r\n }\r\n nodeHash[node.id] = node;\r\n return true;\r\n });\r\n // remove duplicated link\r\n links = links.filter(function (link) {\r\n var id1 = typeof link.source === 'string' ? link.source : link.source.id;\r\n var id2 = typeof link.target === 'string' ? link.target : link.target.id;\r\n if (typeof nodeHash[id1] === 'undefined' || typeof nodeHash[id2] === 'undefined') {\r\n return false;\r\n }\r\n var key = id1 + '_' + id2;\r\n if (typeof linkHash[key] !== 'undefined') {\r\n //$.extend(linkHash[key], link);\r\n return false;\r\n }\r\n linkHash[key] = link;\r\n return true;\r\n });\r\n\r\n nodes.forEach(function(node) {\r\n //nodeHash[node.id] = node;\r\n node.sourceLinks = [];\r\n node.targetLinks = [];\r\n });\r\n links.forEach(function(link) {\r\n var source = link.source,\r\n target = link.target;\r\n \r\n if (typeof source === \"string\") source = link.source = nodeHash[link.source];\r\n if (typeof target === \"string\") target = link.target = nodeHash[link.target];\r\n \r\n source.sourceLinks.push(link);\r\n target.targetLinks.push(link);\r\n });\r\n }", "function update_graph_nodes(nodes) {\n\t\t$.each(nodes, function (i, node) {\n\t\t\tvar node_id = node[\"id\"];\n\t\t\tvar ele = g.elements(\"node\" + \"[id='\" + node_id + \"']\")[0];\n\t\t\tif (ele) {\n\t\t\t\tele.data(node);\n\t\t\t\tele.position({x: node.view.position.x, y: node.view.position.y});\n\t\t\t}\n\t\t\telse {\n\t\t\t\talert(node_id + \" no ele\");\n\t\t\t}\n\t\t});\n\t}", "mapCoordsToNode(x, y) {\n\n\t}", "function asrNode (id, x, y) {\n\t// TODO\n}", "function computeItemNode() {\n items.forEach(function (item) {\n item.node.forEach(function (node) {\n var node_id = node;\n node = {};\n node.cluster = nodes[node];\n })\n item.start.node_id = item.start.node;\n item.start.node = nodes[item.start.node_id];\n })\n\n }", "getHostNode() {}", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }" ]
[ "0.66199833", "0.6273092", "0.61483604", "0.61361074", "0.6130364", "0.61164844", "0.60625446", "0.6038434", "0.6020035", "0.6006584", "0.6006584", "0.6006584", "0.59973246", "0.59862584", "0.5985708", "0.59555835", "0.5949035", "0.5940196", "0.5940196", "0.5940196", "0.59023494", "0.59023494", "0.59023494", "0.59023494", "0.58825123", "0.5881712", "0.58691484", "0.58581907", "0.5840937", "0.5830579", "0.5830253", "0.58175904", "0.58015496", "0.5788617", "0.57783794", "0.5719702", "0.5716799", "0.5713822", "0.57066375", "0.5701227", "0.5694454", "0.56766194", "0.5675592", "0.56755054", "0.5666964", "0.5660949", "0.5659766", "0.5659766", "0.56555265", "0.5655243", "0.5649553", "0.5649409", "0.56479424", "0.5646021", "0.5646021", "0.5646021", "0.5643423", "0.5640846", "0.5637836", "0.5624012", "0.5619864", "0.5619864", "0.56140697", "0.56025463", "0.55944663", "0.5585538", "0.55803764", "0.55622065", "0.55619246", "0.55595833", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567", "0.5554567" ]
0.0
-1
TAP EVENTS AND GHOST CLICKS Why tap events? Mobile browsers detect a tap, then wait a moment (usually ~300ms) to see if you're doubletapping, and then fire a click event. This delay sucks and makes mobile apps feel unresponsive. So we detect touchstart, touchmove, touchcancel and touchend ourselves and determine when the user has tapped on something. What happens when the browser then generates a click event? The browser, of course, also detects the tap and fires a click after a delay. This results in tapping/clicking twice. We do "clickbusting" to prevent it. How does it work? We attach global touchstart and click handlers, that run during the capture (early) phase. So the sequence for a tap is: global touchstart: Sets an "allowable region" at the point touched. element's touchstart: Starts a touch ( touchmove or touchcancel ends the touch, no click follows) element's touchend: Determines if the tap is valid (didn't move too far away, didn't hold too long) and fires the user's tap handler. The touchend also calls preventGhostClick(). preventGhostClick() removes the allowable region the global touchstart created. The browser generates a click event. The global click handler catches the click, and checks whether it was in an allowable region. If preventGhostClick was called, the region will have been removed, the click is busted. If the region is still there, the click proceeds normally. Therefore clicks on links and other elements without ngTap on them work normally. This is an ugly, terrible hack! Yeah, tell me about it. The alternatives are using the slow click events, or making our users deal with the ghost clicks, so I consider this the least of evils. Fortunately Angular encapsulates this ugly logic away from the user. Why not just put click handlers on the element? We do that too, just to be sure. If the tap event caused the DOM to change, it is possible another element is now in that position. To take account for these possibly distinct elements, the handlers are global and care only about coordinates. Checks if the coordinates are close enough to be within the region.
function hit(x1, y1, x2, y2) { return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (nodeName_(event.target) === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur && event.target.blur();\n }", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (event.target.tagName.toLowerCase() === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur();\n }", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (event.target.tagName.toLowerCase() === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur();\n }", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (nodeName_(event.target) === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n // event.target && event.target.blur && event.target.blur();\n }", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (nodeName_(event.target) === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur && event.target.blur();\n }", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (nodeName_(event.target) === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur && event.target.blur();\n }", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (event.target.tagName.toLowerCase() === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur();\n }", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (event.target.tagName.toLowerCase() === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur();\n }", "function n(t,e){\"use strict\";function a(t,e){return function(){return t.apply(e,arguments)}}var o;if(e=e||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=e.touchBoundary||10,this.layer=t,this.tapDelay=e.tapDelay||200,!n.notNeeded(t)){for(var r=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],s=this,l=0,c=r.length;c>l;l++)s[r[l]]=a(s[r[l]],s);i&&(t.addEventListener(\"mouseover\",this.onMouse,!0),t.addEventListener(\"mousedown\",this.onMouse,!0),t.addEventListener(\"mouseup\",this.onMouse,!0)),t.addEventListener(\"click\",this.onClick,!0),t.addEventListener(\"touchstart\",this.onTouchStart,!1),t.addEventListener(\"touchmove\",this.onTouchMove,!1),t.addEventListener(\"touchend\",this.onTouchEnd,!1),t.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(t.removeEventListener=function(e,n,i){var a=Node.prototype.removeEventListener;\"click\"===e?a.call(t,e,n.hijacked||n,i):a.call(t,e,n,i)},t.addEventListener=function(e,n,i){var a=Node.prototype.addEventListener;\"click\"===e?a.call(t,e,n.hijacked||(n.hijacked=function(t){t.propagationStopped||n(t)}),i):a.call(t,e,n,i)}),\"function\"==typeof t.onclick&&(o=t.onclick,t.addEventListener(\"click\",function(t){o(t)},!1),t.onclick=null)}}", "function FastClick(a, c) {\n function b(a, b) {\n return function() {\n return a.apply(b, arguments)\n }\n }\n var g;\n c = c || {};\n this.trackingClick = !1;\n this.trackingClickStart = 0;\n this.targetElement = null;\n this.lastTouchIdentifier = this.touchStartY = this.touchStartX = 0;\n this.touchBoundary = c.touchBoundary || 10;\n this.layer = a;\n this.tapDelay = c.tapDelay || 200;\n if (!FastClick.notNeeded(a)) {\n for (var d = \"onMouse onClick onTouchStart onTouchMove onTouchEnd onTouchCancel\".split(\" \"), f = 0, m = d.length; f < m; f++) this[d[f]] = b(this[d[f]], this);\n deviceIsAndroid &&\n (a.addEventListener(\"mouseover\", this.onMouse, !0), a.addEventListener(\"mousedown\", this.onMouse, !0), a.addEventListener(\"mouseup\", this.onMouse, !0));\n a.addEventListener(\"click\", this.onClick, !0);\n a.addEventListener(\"touchstart\", this.onTouchStart, !1);\n a.addEventListener(\"touchmove\", this.onTouchMove, !1);\n a.addEventListener(\"touchend\", this.onTouchEnd, !1);\n a.addEventListener(\"touchcancel\", this.onTouchCancel, !1);\n Event.prototype.stopImmediatePropagation || (a.removeEventListener = function(b, c, d) {\n var g = Node.prototype.removeEventListener;\n \"click\" === b ? g.call(a, b, c.hijacked || c, d) : g.call(a, b, c, d)\n }, a.addEventListener = function(b, c, d) {\n var g = Node.prototype.addEventListener;\n \"click\" === b ? g.call(a, b, c.hijacked || (c.hijacked = function(a) {\n a.propagationStopped || c(a)\n }), d) : g.call(a, b, c, d)\n });\n \"function\" === typeof a.onclick && (g = a.onclick, a.addEventListener(\"click\", function(a) {\n g(a)\n }, !1), a.onclick = null)\n }\n}", "function FastClick(a, c) {\n function b(a, b) {\n return function() {\n return a.apply(b, arguments)\n }\n }\n var e;\n c = c || {};\n this.trackingClick = !1;\n this.trackingClickStart = 0;\n this.targetElement = null;\n this.lastTouchIdentifier = this.touchStartY = this.touchStartX = 0;\n this.touchBoundary = c.touchBoundary || 10;\n this.layer = a;\n this.tapDelay = c.tapDelay || 200;\n if (!FastClick.notNeeded(a)) {\n for (var d = \"onMouse onClick onTouchStart onTouchMove onTouchEnd onTouchCancel\".split(\" \"), g = 0, m = d.length; g < m; g++) this[d[g]] = b(this[d[g]], this);\n deviceIsAndroid &&\n (a.addEventListener(\"mouseover\", this.onMouse, !0), a.addEventListener(\"mousedown\", this.onMouse, !0), a.addEventListener(\"mouseup\", this.onMouse, !0));\n a.addEventListener(\"click\", this.onClick, !0);\n a.addEventListener(\"touchstart\", this.onTouchStart, !1);\n a.addEventListener(\"touchmove\", this.onTouchMove, !1);\n a.addEventListener(\"touchend\", this.onTouchEnd, !1);\n a.addEventListener(\"touchcancel\", this.onTouchCancel, !1);\n Event.prototype.stopImmediatePropagation || (a.removeEventListener = function(b, c, d) {\n var e = Node.prototype.removeEventListener;\n \"click\" === b ? e.call(a, b, c.hijacked || c, d) : e.call(a, b, c, d)\n }, a.addEventListener = function(b, c, d) {\n var e = Node.prototype.addEventListener;\n \"click\" === b ? e.call(a, b, c.hijacked || (c.hijacked = function(a) {\n a.propagationStopped || c(a)\n }), d) : e.call(a, b, c, d)\n });\n \"function\" === typeof a.onclick && (e = a.onclick, a.addEventListener(\"click\", function(a) {\n e(a)\n }, !1), a.onclick = null)\n }\n}", "function FastClick(a,b){function c(a,b){return function(){return a.apply(b,arguments)}}var d;if(b=b||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=b.touchBoundary||10,this.layer=a,this.tapDelay=b.tapDelay||200,!FastClick.notNeeded(a)){for(var e=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],f=this,g=0,h=e.length;h>g;g++)f[e[g]]=c(f[e[g]],f);deviceIsAndroid&&(a.addEventListener(\"mouseover\",this.onMouse,!0),a.addEventListener(\"mousedown\",this.onMouse,!0),a.addEventListener(\"mouseup\",this.onMouse,!0)),a.addEventListener(\"click\",this.onClick,!0),a.addEventListener(\"touchstart\",this.onTouchStart,!1),a.addEventListener(\"touchmove\",this.onTouchMove,!1),a.addEventListener(\"touchend\",this.onTouchEnd,!1),a.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(b,c,d){var e=Node.prototype.removeEventListener;\"click\"===b?e.call(a,b,c.hijacked||c,d):e.call(a,b,c,d)},a.addEventListener=function(b,c,d){var e=Node.prototype.addEventListener;\"click\"===b?e.call(a,b,c.hijacked||(c.hijacked=function(a){a.propagationStopped||c(a)}),d):e.call(a,b,c,d)}),\"function\"==typeof a.onclick&&(d=a.onclick,a.addEventListener(\"click\",function(a){d(a)},!1),a.onclick=null)}}", "function FastClick(a,h){function f(a,f){return function(){return a.apply(f,arguments)}}var v;h=h||{};this.trackingClick=!1;this.trackingClickStart=0;this.targetElement=null;this.lastTouchIdentifier=this.touchStartY=this.touchStartX=0;this.touchBoundary=h.touchBoundary||10;this.layer=a;this.tapDelay=h.tapDelay||200;if(!FastClick.notNeeded(a)){for(var t=\"onMouse onClick onTouchStart onTouchMove onTouchEnd onTouchCancel\".split(\" \"),n=0,u=t.length;n<u;n++)this[t[n]]=f(this[t[n]],this);deviceIsAndroid&&\n(a.addEventListener(\"mouseover\",this.onMouse,!0),a.addEventListener(\"mousedown\",this.onMouse,!0),a.addEventListener(\"mouseup\",this.onMouse,!0));a.addEventListener(\"click\",this.onClick,!0);a.addEventListener(\"touchstart\",this.onTouchStart,!1);a.addEventListener(\"touchmove\",this.onTouchMove,!1);a.addEventListener(\"touchend\",this.onTouchEnd,!1);a.addEventListener(\"touchcancel\",this.onTouchCancel,!1);Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(f,h,q){var n=Node.prototype.removeEventListener;\n\"click\"===f?n.call(a,f,h.hijacked||h,q):n.call(a,f,h,q)},a.addEventListener=function(f,h,q){var n=Node.prototype.addEventListener;\"click\"===f?n.call(a,f,h.hijacked||(h.hijacked=function(a){a.propagationStopped||h(a)}),q):n.call(a,f,h,q)});\"function\"===typeof a.onclick&&(v=a.onclick,a.addEventListener(\"click\",function(a){v(a)},!1),a.onclick=null)}}", "function iPadTouchStart(event) {\n\tvar touches = event.changedTouches,\n\t\tfirst = touches[0],\n\t\ttype = \"mouseover\",\n\t\tsimulatedEvent = document.createEvent(\"MouseEvent\");\n\t//\n\t// Mouse over first - I have live events attached on mouse over\n\t//\n\tsimulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0, null);\n\tfirst.target.dispatchEvent(simulatedEvent);\n\n\ttype = \"mousedown\";\n\tsimulatedEvent = document.createEvent(\"MouseEvent\");\n\n\tsimulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0, null);\n\tfirst.target.dispatchEvent(simulatedEvent);\n\n\n\tif (!tapValid) {\n\t\tlastTap = first.target;\n\t\ttapValid = true;\n\t\ttapTimeout = window.setTimeout(\"cancelTap();\", 600);\n\t\tstartHold(event);\n\t}\n\telse {\n\t\twindow.clearTimeout(tapTimeout);\n\n\t\t//\n\t\t// If a double tap is still a possibility and the elements are the same\n\t\t//\tThen perform a double click\n\t\t//\n\t\tif (first.target == lastTap) {\n\t\t\tlastTap = null;\n\t\t\ttapValid = false;\n\n\t\t\ttype = \"click\";\n\t\t\tsimulatedEvent = document.createEvent(\"MouseEvent\");\n\n\t\t\tsimulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0/*left*/, null);\n\t\t\tfirst.target.dispatchEvent(simulatedEvent);\n\n\t\t\ttype = \"dblclick\";\n\t\t\tsimulatedEvent = document.createEvent(\"MouseEvent\");\n\n\t\t\tsimulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0/*left*/, null);\n\t\t\tfirst.target.dispatchEvent(simulatedEvent);\n\t\t}\n\t\telse {\n\t\t\tlastTap = first.target;\n\t\t\ttapValid = true;\n\t\t\ttapTimeout = window.setTimeout(\"cancelTap();\", 600);\n\t\t\tstartHold(event);\n\t\t}\n\t}\n}", "function FastClick(t,e){function n(t,e){return function(){return t.apply(e,arguments)}}var i;if(e=e||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=e.touchBoundary||10,this.layer=t,this.tapDelay=e.tapDelay||200,!FastClick.notNeeded(t)){for(var s=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],r=this,o=0,a=s.length;a>o;o++)r[s[o]]=n(r[s[o]],r);deviceIsAndroid&&(t.addEventListener(\"mouseover\",this.onMouse,!0),t.addEventListener(\"mousedown\",this.onMouse,!0),t.addEventListener(\"mouseup\",this.onMouse,!0)),t.addEventListener(\"click\",this.onClick,!0),t.addEventListener(\"touchstart\",this.onTouchStart,!1),t.addEventListener(\"touchmove\",this.onTouchMove,!1),t.addEventListener(\"touchend\",this.onTouchEnd,!1),t.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(t.removeEventListener=function(e,n,i){var s=Node.prototype.removeEventListener;\"click\"===e?s.call(t,e,n.hijacked||n,i):s.call(t,e,n,i)},t.addEventListener=function(e,n,i){var s=Node.prototype.addEventListener;\"click\"===e?s.call(t,e,n.hijacked||(n.hijacked=function(t){t.propagationStopped||n(t)}),i):s.call(t,e,n,i)}),\"function\"==typeof t.onclick&&(i=t.onclick,t.addEventListener(\"click\",function(t){i(t)},!1),t.onclick=null)}}", "function FastClick(e,t){\"use strict\";function n(e,t){return function(){return e.apply(t,arguments)}}var r;if(t=t||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=t.touchBoundary||10,this.layer=e,this.tapDelay=t.tapDelay||200,!FastClick.notNeeded(e)){for(var i=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],s=this,o=0,u=i.length;u>o;o++)s[i[o]]=n(s[i[o]],s);deviceIsAndroid&&(e.addEventListener(\"mouseover\",this.onMouse,!0),e.addEventListener(\"mousedown\",this.onMouse,!0),e.addEventListener(\"mouseup\",this.onMouse,!0)),e.addEventListener(\"click\",this.onClick,!0),e.addEventListener(\"touchstart\",this.onTouchStart,!1),e.addEventListener(\"touchmove\",this.onTouchMove,!1),e.addEventListener(\"touchend\",this.onTouchEnd,!1),e.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(e.removeEventListener=function(t,n,r){var i=Node.prototype.removeEventListener;\"click\"===t?i.call(e,t,n.hijacked||n,r):i.call(e,t,n,r)},e.addEventListener=function(t,n,r){var i=Node.prototype.addEventListener;\"click\"===t?i.call(e,t,n.hijacked||(n.hijacked=function(e){e.propagationStopped||n(e)}),r):i.call(e,t,n,r)}),\"function\"==typeof e.onclick&&(r=e.onclick,e.addEventListener(\"click\",function(e){r(e)},!1),e.onclick=null)}}", "function FastClick(e,t){function n(e,t){return function(){return e.apply(t,arguments)}}var i;if(t=t||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=t.touchBoundary||10,this.layer=e,this.tapDelay=t.tapDelay||200,!FastClick.notNeeded(e)){for(var r=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],s=this,a=0,o=r.length;o>a;a++)s[r[a]]=n(s[r[a]],s);deviceIsAndroid&&(e.addEventListener(\"mouseover\",this.onMouse,!0),e.addEventListener(\"mousedown\",this.onMouse,!0),e.addEventListener(\"mouseup\",this.onMouse,!0)),e.addEventListener(\"click\",this.onClick,!0),e.addEventListener(\"touchstart\",this.onTouchStart,!1),e.addEventListener(\"touchmove\",this.onTouchMove,!1),e.addEventListener(\"touchend\",this.onTouchEnd,!1),e.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(e.removeEventListener=function(t,n,i){var r=Node.prototype.removeEventListener;\"click\"===t?r.call(e,t,n.hijacked||n,i):r.call(e,t,n,i)},e.addEventListener=function(t,n,i){var r=Node.prototype.addEventListener;\"click\"===t?r.call(e,t,n.hijacked||(n.hijacked=function(e){e.propagationStopped||n(e)}),i):r.call(e,t,n,i)}),\"function\"==typeof e.onclick&&(i=e.onclick,e.addEventListener(\"click\",function(e){i(e)},!1),e.onclick=null)}}", "function eventTap(event) {\n // Erroneous events seem to be passed in occasionally on iOS/iPadOS after user finishes interacting with\n // the slider. They appear to be of type MouseEvent, yet they don't have usual properties set. Ignore tap\n // events that have no touches or buttons associated with them.\n if (!event.buttons && !event.touches) {\n return false;\n }\n\n // The tap event shouldn't propagate up\n event.stopPropagation();\n\n var proposal = calcPointToPercentage(event.calcPoint);\n var handleNumber = getClosestHandle(proposal);\n\n // Tackle the case that all handles are 'disabled'.\n if (handleNumber === false) {\n return false;\n }\n\n // Flag the slider as it is now in a transitional state.\n // Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n if (!options.events.snap) {\n addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n }\n\n setHandle(handleNumber, proposal, true, true);\n\n setZindex();\n\n fireEvent(\"slide\", handleNumber, true);\n fireEvent(\"update\", handleNumber, true);\n fireEvent(\"change\", handleNumber, true);\n fireEvent(\"set\", handleNumber, true);\n\n if (options.events.snap) {\n eventStart(event, { handleNumbers: [handleNumber] });\n }\n }", "function FastClick(t,e){\"use strict\";function i(t,e){return function(){return t.apply(e,arguments)}}var n;if(e=e||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=e.touchBoundary||10,this.layer=t,this.tapDelay=e.tapDelay||200,!FastClick.notNeeded(t)){for(var o=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],s=this,r=0,c=o.length;c>r;r++)s[o[r]]=i(s[o[r]],s);deviceIsAndroid&&(t.addEventListener(\"mouseover\",this.onMouse,!0),t.addEventListener(\"mousedown\",this.onMouse,!0),t.addEventListener(\"mouseup\",this.onMouse,!0)),t.addEventListener(\"click\",this.onClick,!0),t.addEventListener(\"touchstart\",this.onTouchStart,!1),t.addEventListener(\"touchmove\",this.onTouchMove,!1),t.addEventListener(\"touchend\",this.onTouchEnd,!1),t.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(t.removeEventListener=function(e,i,n){var o=Node.prototype.removeEventListener;\"click\"===e?o.call(t,e,i.hijacked||i,n):o.call(t,e,i,n)},t.addEventListener=function(e,i,n){var o=Node.prototype.addEventListener;\"click\"===e?o.call(t,e,i.hijacked||(i.hijacked=function(t){t.propagationStopped||i(t)}),n):o.call(t,e,i,n)}),\"function\"==typeof t.onclick&&(n=t.onclick,t.addEventListener(\"click\",function(t){n(t)},!1),t.onclick=null)}}", "function FastClick(t,e){\"use strict\";function i(t,e){return function(){return t.apply(e,arguments)}}var n;if(e=e||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=e.touchBoundary||10,this.layer=t,this.tapDelay=e.tapDelay||200,!FastClick.notNeeded(t)){for(var o=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],s=this,r=0,c=o.length;c>r;r++)s[o[r]]=i(s[o[r]],s);deviceIsAndroid&&(t.addEventListener(\"mouseover\",this.onMouse,!0),t.addEventListener(\"mousedown\",this.onMouse,!0),t.addEventListener(\"mouseup\",this.onMouse,!0)),t.addEventListener(\"click\",this.onClick,!0),t.addEventListener(\"touchstart\",this.onTouchStart,!1),t.addEventListener(\"touchmove\",this.onTouchMove,!1),t.addEventListener(\"touchend\",this.onTouchEnd,!1),t.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(t.removeEventListener=function(e,i,n){var o=Node.prototype.removeEventListener;\"click\"===e?o.call(t,e,i.hijacked||i,n):o.call(t,e,i,n)},t.addEventListener=function(e,i,n){var o=Node.prototype.addEventListener;\"click\"===e?o.call(t,e,i.hijacked||(i.hijacked=function(t){t.propagationStopped||i(t)}),n):o.call(t,e,i,n)}),\"function\"==typeof t.onclick&&(n=t.onclick,t.addEventListener(\"click\",function(t){n(t)},!1),t.onclick=null)}}", "function tapOrClickEnd(evt) {\n // time elapsed holding the click\n var elapsed = Date.now() - mousedown;\n mousedown = undefined;\n target = evt.target || evt.srcElement;\n\n // if event was right click, pass the information to the general iClickedOnAStation function\n if (evt.which == 3) {\n if (target.className == \"circleSymbol\" || target.className == 'circleSymbolSmall') {\n iClickedOnAStation(target.id, \"right\")\n return;\n }\n }\n // if click event was over 800ms, pass the information to the general iClickedOnAStation function\n if (elapsed >= 800) {\n if (target.className == \"circleSymbol\" || target.className == 'circleSymbolSmall') {\n iClickedOnAStation(target.id, \"right\")\n return;\n }\n }\n // if click event was something else (middle, left), pass the information to the general iClickedOnAStation function\n else {\n if (target.className == \"circleSymbol\" || target.className == 'circleSymbolSmall') {\n iClickedOnAStation(target.id, \"left\")\n return;\n }\n }\n evt.preventDefault();\n return false;\n}", "function iPadTouchStart(event) {\n\t\tvar touches = event.changedTouches,\n\t\t\tfirst = touches[0],\n\t\t\ttype = \"mouseover\",\n\t\t\tsimulatedEvent = document.createEvent(\"MouseEvent\");\n\t\t//\n\t\t// Mouse over first - I have live events attached on mouse over\n\t\t//\n\t\tsimulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,\n\t\t\t\t\t\t\t\tfalse, false, false, false, 0, null);\n\t\tfirst.target.dispatchEvent(simulatedEvent);\n\t\n\t\ttype = \"mousedown\";\n\t\tsimulatedEvent = document.createEvent(\"MouseEvent\");\n\t\n\t\tsimulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,\n\t\t\t\t\t\t\t\tfalse, false, false, false, 0, null);\n\t\tfirst.target.dispatchEvent(simulatedEvent);\n\t\n\t\n\t\tif (!tapValid) {\n\t\t\tlastTap = first.target;\n\t\t\ttapValid = true;\n\t\t\ttapTimeout = window.setTimeout(\"cancelTap();\", 600);\n\t\t\tstartHold(event);\n\t\t}\n\t\telse {\n\t\t\twindow.clearTimeout(tapTimeout);\n\t\n\t\t\t//\n\t\t\t// If a double tap is still a possibility and the elements are the same\n\t\t\t//\tThen perform a double click\n\t\t\t//\n\t\t\tif (first.target == lastTap) {\n\t\t\t\tlastTap = null;\n\t\t\t\ttapValid = false;\n\t\n\t\t\t\ttype = \"click\";\n\t\t\t\tsimulatedEvent = document.createEvent(\"MouseEvent\");\n\t\n\t\t\t\tsimulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,\n\t\t\t\t\t\t\t\tfalse, false, false, false, 0/*left*/, null);\n\t\t\t\tfirst.target.dispatchEvent(simulatedEvent);\n\t\n\t\t\t\ttype = \"dblclick\";\n\t\t\t\tsimulatedEvent = document.createEvent(\"MouseEvent\");\n\t\n\t\t\t\tsimulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,\n\t\t\t\t\t\t\t\tfalse, false, false, false, 0/*left*/, null);\n\t\t\t\tfirst.target.dispatchEvent(simulatedEvent);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlastTap = first.target;\n\t\t\t\ttapValid = true;\n\t\t\t\ttapTimeout = window.setTimeout(\"cancelTap();\", 600);\n\t\t\t\tstartHold(event);\n\t\t\t}\n\t\t}\n\t}", "function FastClick(a){function b(a,b){return function(){return a.apply(b,arguments)}}var c;this.trackingClick=!1;this.trackingClickStart=0;this.targetElement=null;this.lastTouchIdentifier=this.touchStartY=this.touchStartX=0;this.touchBoundary=10;this.layer=a;FastClick.notNeeded(a)||(deviceIsAndroid&&(a.addEventListener(\"mouseover\",b(this.onMouse,this),!0),a.addEventListener(\"mousedown\",b(this.onMouse,this),!0),a.addEventListener(\"mouseup\",b(this.onMouse,this),!0)),a.addEventListener(\"click\",b(this.onClick,\nthis),!0),a.addEventListener(\"touchstart\",b(this.onTouchStart,this),!1),a.addEventListener(\"touchmove\",b(this.onTouchMove,this),!1),a.addEventListener(\"touchend\",b(this.onTouchEnd,this),!1),a.addEventListener(\"touchcancel\",b(this.onTouchCancel,this),!1),Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(b,c,e){var f=Node.prototype.removeEventListener;\"click\"===b?f.call(a,b,c.hijacked||c,e):f.call(a,b,c,e)},a.addEventListener=function(b,c,e){var f=Node.prototype.addEventListener;\n\"click\"===b?f.call(a,b,c.hijacked||(c.hijacked=function(a){a.propagationStopped||c(a)}),e):f.call(a,b,c,e)}),\"function\"===typeof a.onclick&&(c=a.onclick,a.addEventListener(\"click\",function(a){c(a)},!1),a.onclick=null))}", "function instrumentClick() {\n\t\t// Capture clicks and wait 50ms to see if they result in DOM mutations\n\t\tBOOMR.subscribe(\"click\", function() {\n\t\t\tif (impl.singlePageApp) {\n\t\t\t\t// In a SPA scenario, only route changes (or events from the SPA\n\t\t\t\t// framework) trigger an interesting event.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar resource = { timing: {}, initiator: \"click\" };\n\n\t\t\tif (!BOOMR.orig_XMLHttpRequest ||\n\t\t\t BOOMR.orig_XMLHttpRequest === w.XMLHttpRequest) {\n\t\t\t\t// do nothing if we have un-instrumented XHR\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresource.timing.requestStart = BOOMR.now();\n\t\t\thandler.addEvent(resource);\n\t\t});\n\t}", "function tap(event) {\n var location = event.calcPoint,\n total = 0,\n handleNumber, to;\n // The tap event shouldn't propagate up and cause 'edge' to run.\n event.stopPropagation();\n // Add up the handle offsets.\n scope_Handles.forEach(function(a) {\n total += offset(a)[options.style];\n });\n // Find the handle closest to the tapped position.\n handleNumber = (location < total / 2 || scope_Handles.length ===\n 1) ? 0 : 1;\n // Check if handler is not disablet if yes set number to the next handler\n if (scope_Handles[handleNumber].hasAttribute('disabled')) {\n handleNumber = handleNumber ? 0 : 1;\n }\n location -= offset(scope_Base)[options.style];\n // Calculate the new position.\n to = (location * 100) / baseSize();\n if (!options.events.snap) {\n // Flag the slider as it is now in a transitional state.\n // Transition takes 300 ms, so re-enable the slider afterwards.\n addClassFor(scope_Target, cssClasses[14], 300);\n }\n // Support 'disabled' handles\n if (scope_Handles[handleNumber].hasAttribute('disabled')) {\n return false;\n }\n // Find the closest handle and calculate the tapped point.\n // The set handle to the new position.\n setHandle(scope_Handles[handleNumber], to);\n fireEvent('slide', handleNumber, true);\n fireEvent('set', handleNumber, true);\n fireEvent('change', handleNumber, true);\n if (options.events.snap) {\n start(event, {\n handles: [scope_Handles[handleNumber]]\n });\n }\n }", "function eventTap ( event ) {\r\n\r\n\t\t// The tap event shouldn't propagate up\r\n\t\tevent.stopPropagation();\r\n\r\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\r\n\t\tvar handleNumber = getClosestHandle(proposal);\r\n\r\n\t\t// Tackle the case that all handles are 'disabled'.\r\n\t\tif ( handleNumber === false ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Flag the slider as it is now in a transitional state.\r\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\r\n\t\tif ( !options.events.snap ) {\r\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\r\n\t\t}\r\n\r\n\t\tsetHandle(handleNumber, proposal, true, true);\r\n\r\n\t\tsetZindex();\r\n\r\n\t\tfireEvent('slide', handleNumber, true);\r\n\t\tfireEvent('set', handleNumber, true);\r\n\t\tfireEvent('change', handleNumber, true);\r\n\t\tfireEvent('update', handleNumber, true);\r\n\r\n\t\tif ( options.events.snap ) {\r\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\r\n\t\t}\r\n\t}", "function clickListener(event) {\n if (isPressHold) {\n // For Mobile Safari capture phase at least, returning false doesn't work; must use pD() and sP() explicitly.\n // Since it's wonky, do both for good measure.\n event.preventDefault();\n event.stopPropagation();\n isPressHold = false;\n return false;\n }\n\n return undefined;\n } // , on Chrome preventDefault on \"keyup\" will avoid triggering contextmenu event", "function eventTap ( event ) {\n\n\t\t// The tap event shouldn't propagate up\n\t\tevent.stopPropagation();\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\t\tvar handleNumber = getClosestHandle(proposal);\n\n\t\t// Tackle the case that all handles are 'disabled'.\n\t\tif ( handleNumber === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flag the slider as it is now in a transitional state.\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\tif ( !options.events.snap ) {\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n\t\t}\n\n\t\tsetHandle(handleNumber, proposal, true, true);\n\n\t\tsetZindex();\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\t\tfireEvent('update', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\n\t\t}\n\t}", "function eventTap ( event ) {\n\n\t\t// The tap event shouldn't propagate up\n\t\tevent.stopPropagation();\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\t\tvar handleNumber = getClosestHandle(proposal);\n\n\t\t// Tackle the case that all handles are 'disabled'.\n\t\tif ( handleNumber === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flag the slider as it is now in a transitional state.\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\tif ( !options.events.snap ) {\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n\t\t}\n\n\t\tsetHandle(handleNumber, proposal, true, true);\n\n\t\tsetZindex();\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\t\tfireEvent('update', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\n\t\t}\n\t}", "function eventTap ( event ) {\n\n\t\t// The tap event shouldn't propagate up\n\t\tevent.stopPropagation();\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\t\tvar handleNumber = getClosestHandle(proposal);\n\n\t\t// Tackle the case that all handles are 'disabled'.\n\t\tif ( handleNumber === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flag the slider as it is now in a transitional state.\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\tif ( !options.events.snap ) {\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n\t\t}\n\n\t\tsetHandle(handleNumber, proposal, true, true);\n\n\t\tsetZindex();\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\t\tfireEvent('update', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\n\t\t}\n\t}", "function eventTap ( event ) {\n\n\t\t// The tap event shouldn't propagate up\n\t\tevent.stopPropagation();\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\t\tvar handleNumber = getClosestHandle(proposal);\n\n\t\t// Tackle the case that all handles are 'disabled'.\n\t\tif ( handleNumber === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flag the slider as it is now in a transitional state.\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\tif ( !options.events.snap ) {\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n\t\t}\n\n\t\tsetHandle(handleNumber, proposal, true, true);\n\n\t\tsetZindex();\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('update', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\n\t\t}\n\t}", "function eventTap ( event ) {\n\n\t\t// The tap event shouldn't propagate up\n\t\tevent.stopPropagation();\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\t\tvar handleNumber = getClosestHandle(proposal);\n\n\t\t// Tackle the case that all handles are 'disabled'.\n\t\tif ( handleNumber === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flag the slider as it is now in a transitional state.\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\tif ( !options.events.snap ) {\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n\t\t}\n\n\t\tsetHandle(handleNumber, proposal, true, true);\n\n\t\tsetZindex();\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('update', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\n\t\t}\n\t}", "function eventTap ( event ) {\n\n\t\t// The tap event shouldn't propagate up\n\t\tevent.stopPropagation();\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\t\tvar handleNumber = getClosestHandle(proposal);\n\n\t\t// Tackle the case that all handles are 'disabled'.\n\t\tif ( handleNumber === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flag the slider as it is now in a transitional state.\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\tif ( !options.events.snap ) {\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n\t\t}\n\n\t\tsetHandle(handleNumber, proposal, true, true);\n\n\t\tsetZindex();\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('update', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\n\t\t}\n\t}", "function eventTap ( event ) {\n\n\t\t// The tap event shouldn't propagate up\n\t\tevent.stopPropagation();\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\t\tvar handleNumber = getClosestHandle(proposal);\n\n\t\t// Tackle the case that all handles are 'disabled'.\n\t\tif ( handleNumber === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flag the slider as it is now in a transitional state.\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\tif ( !options.events.snap ) {\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n\t\t}\n\n\t\tsetHandle(handleNumber, proposal, true, true);\n\n\t\tsetZindex();\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('update', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\n\t\t}\n\t}", "function eventTap ( event ) {\n\n\t\t// The tap event shouldn't propagate up\n\t\tevent.stopPropagation();\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\t\tvar handleNumber = getClosestHandle(proposal);\n\n\t\t// Tackle the case that all handles are 'disabled'.\n\t\tif ( handleNumber === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flag the slider as it is now in a transitional state.\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\tif ( !options.events.snap ) {\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n\t\t}\n\n\t\tsetHandle(handleNumber, proposal, true, true);\n\n\t\tsetZindex();\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('update', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\n\t\t}\n\t}", "function eventTap ( event ) {\n\n\t\t// The tap event shouldn't propagate up\n\t\tevent.stopPropagation();\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\t\tvar handleNumber = getClosestHandle(proposal);\n\n\t\t// Tackle the case that all handles are 'disabled'.\n\t\tif ( handleNumber === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flag the slider as it is now in a transitional state.\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\tif ( !options.events.snap ) {\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n\t\t}\n\n\t\tsetHandle(handleNumber, proposal, true, true);\n\n\t\tsetZindex();\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('update', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\n\t\t}\n\t}", "function eventTap ( event ) {\n\n\t\t// The tap event shouldn't propagate up\n\t\tevent.stopPropagation();\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\t\tvar handleNumber = getClosestHandle(proposal);\n\n\t\t// Tackle the case that all handles are 'disabled'.\n\t\tif ( handleNumber === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flag the slider as it is now in a transitional state.\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\tif ( !options.events.snap ) {\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n\t\t}\n\n\t\tsetHandle(handleNumber, proposal, true, true);\n\n\t\tsetZindex();\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('update', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\n\t\t}\n\t}", "function eventTap(event) {\n\n // The tap event shouldn't propagate up\n event.stopPropagation();\n\n var proposal = calcPointToPercentage(event.calcPoint);\n var handleNumber = getClosestHandle(proposal);\n\n // Tackle the case that all handles are 'disabled'.\n if (handleNumber === false) {\n return false;\n }\n\n // Flag the slider as it is now in a transitional state.\n // Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n if (!options.events.snap) {\n addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n }\n\n setHandle(handleNumber, proposal, true, true);\n\n setZindex();\n\n fireEvent('slide', handleNumber, true);\n fireEvent('update', handleNumber, true);\n fireEvent('change', handleNumber, true);\n fireEvent('set', handleNumber, true);\n\n if (options.events.snap) {\n eventStart(event, {handleNumbers: [handleNumber]});\n }\n }", "function eventTap(event) {\n // The tap event shouldn't propagate up\n event.stopPropagation();\n\n var proposal = calcPointToPercentage(event.calcPoint);\n var handleNumber = getClosestHandle(proposal);\n\n // Tackle the case that all handles are 'disabled'.\n if (handleNumber === false) {\n return false;\n }\n\n // Flag the slider as it is now in a transitional state.\n // Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n if (!options.events.snap) {\n addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n }\n\n setHandle(handleNumber, proposal, true, true);\n\n setZindex();\n\n fireEvent(\"slide\", handleNumber, true);\n fireEvent(\"update\", handleNumber, true);\n fireEvent(\"change\", handleNumber, true);\n fireEvent(\"set\", handleNumber, true);\n\n if (options.events.snap) {\n eventStart(event, { handleNumbers: [handleNumber] });\n }\n }", "function eventTap(event) {\n // The tap event shouldn't propagate up\n event.stopPropagation();\n\n var proposal = calcPointToPercentage(event.calcPoint);\n var handleNumber = getClosestHandle(proposal);\n\n // Tackle the case that all handles are 'disabled'.\n if (handleNumber === false) {\n return false;\n }\n\n // Flag the slider as it is now in a transitional state.\n // Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n if (!options.events.snap) {\n addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n }\n\n setHandle(handleNumber, proposal, true, true);\n\n setZindex();\n\n fireEvent(\"slide\", handleNumber, true);\n fireEvent(\"update\", handleNumber, true);\n fireEvent(\"change\", handleNumber, true);\n fireEvent(\"set\", handleNumber, true);\n\n if (options.events.snap) {\n eventStart(event, { handleNumbers: [handleNumber] });\n }\n }", "function eventTap(event) {\n // The tap event shouldn't propagate up\n event.stopPropagation();\n\n var proposal = calcPointToPercentage(event.calcPoint);\n var handleNumber = getClosestHandle(proposal);\n\n // Tackle the case that all handles are 'disabled'.\n if (handleNumber === false) {\n return false;\n }\n\n // Flag the slider as it is now in a transitional state.\n // Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n if (!options.events.snap) {\n addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n }\n\n setHandle(handleNumber, proposal, true, true);\n\n setZindex();\n\n fireEvent(\"slide\", handleNumber, true);\n fireEvent(\"update\", handleNumber, true);\n fireEvent(\"change\", handleNumber, true);\n fireEvent(\"set\", handleNumber, true);\n\n if (options.events.snap) {\n eventStart(event, { handleNumbers: [handleNumber] });\n }\n }", "function trapClickAndEnd(event) {\n\n var untrap;\n\n // trap the click in case we are part of an active\n // drag operation. This will effectively prevent\n // the ghost click that cannot be canceled otherwise.\n if (context.active) {\n\n untrap = install(eventBus);\n\n // remove trap after minimal delay\n setTimeout(untrap, 400);\n\n // prevent default action (click)\n preventDefault(event);\n }\n\n end(event);\n }", "function eventTap(event) {\n // The tap event shouldn't propagate up\n event.stopPropagation();\n var proposal = calcPointToPercentage(event.calcPoint);\n var handleNumber = getClosestHandle(proposal);\n // Tackle the case that all handles are 'disabled'.\n if (handleNumber === false) {\n return;\n }\n // Flag the slider as it is now in a transitional state.\n // Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n if (!options.events.snap) {\n addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n }\n setHandle(handleNumber, proposal, true, true);\n setZindex();\n fireEvent(\"slide\", handleNumber, true);\n fireEvent(\"update\", handleNumber, true);\n if (!options.events.snap) {\n fireEvent(\"change\", handleNumber, true);\n fireEvent(\"set\", handleNumber, true);\n }\n else {\n eventStart(event, { handleNumbers: [handleNumber] });\n }\n }", "function trapClickAndEnd(event) {\n\n var untrap;\n\n // trap the click in case we are part of an active\n // drag operation. This will effectively prevent\n // the ghost click that cannot be canceled otherwise.\n if (context.active) {\n\n untrap = installClickTrap(eventBus);\n\n // remove trap after minimal delay\n setTimeout(untrap, 400);\n\n // prevent default action (click)\n preventDefault(event);\n }\n\n end(event);\n }", "_onTap(e) {}", "function PointerGestureEvent(a, b) {\r\n var c = b || {}, d = document.createEvent(\"Event\"),\r\n e = {\r\n bubbles: Boolean(c.bubbles) === c.bubbles || !0,\r\n cancelable: Boolean(c.cancelable) === c.cancelable || !0\r\n };\r\n d.initEvent(a, e.bubbles, e.cancelable);\r\n for (var f, g = Object.keys(c), h = 0; h < g.length; h++) f = g[h], d[f] = c[f];\r\n return d.preventTap = this.preventTap, d\r\n}", "function MdGesture($$MdGestureHandler, $$rAF, $timeout) {\n var userAgent = navigator.userAgent || navigator.vendor || window.opera;\n var isIos = userAgent.match(/ipad|iphone|ipod/i);\n var isAndroid = userAgent.match(/android/i);\n var touchActionProperty = getTouchAction();\n var hasJQuery = (typeof window.jQuery !== 'undefined') && (angular.element === window.jQuery);\n\n var self = {\n handler: addHandler,\n register: register,\n isIos: isIos,\n isAndroid: isAndroid,\n // On mobile w/out jQuery, we normally intercept clicks. Should we skip that?\n isHijackingClicks: (isIos || isAndroid) && !hasJQuery && !forceSkipClickHijack\n };\n\n if (self.isHijackingClicks) {\n var maxClickDistance = 6;\n self.handler('click', {\n options: {\n maxDistance: maxClickDistance\n },\n onEnd: checkDistanceAndEmit('click')\n });\n\n self.handler('focus', {\n options: {\n maxDistance: maxClickDistance\n },\n onEnd: function(ev, pointer) {\n if (pointer.distance < this.state.options.maxDistance) {\n if (canFocus(ev.target)) {\n this.dispatchEvent(ev, 'focus', pointer);\n ev.target.focus();\n }\n }\n\n function canFocus(element) {\n var focusableElements = ['INPUT', 'SELECT', 'BUTTON', 'TEXTAREA', 'VIDEO', 'AUDIO'];\n\n return (element.getAttribute('tabindex') != '-1') &&\n !element.hasAttribute('DISABLED') &&\n (element.hasAttribute('tabindex') || element.hasAttribute('href') || element.isContentEditable ||\n (focusableElements.indexOf(element.nodeName) != -1));\n }\n }\n });\n\n self.handler('mouseup', {\n options: {\n maxDistance: maxClickDistance\n },\n onEnd: checkDistanceAndEmit('mouseup')\n });\n\n self.handler('mousedown', {\n onStart: function(ev) {\n this.dispatchEvent(ev, 'mousedown');\n }\n });\n }\n\n function checkDistanceAndEmit(eventName) {\n return function(ev, pointer) {\n if (pointer.distance < this.state.options.maxDistance) {\n this.dispatchEvent(ev, eventName, pointer);\n }\n };\n }\n\n /*\n * Register an element to listen for a handler.\n * This allows an element to override the default options for a handler.\n * Additionally, some handlers like drag and hold only dispatch events if\n * the domEvent happens inside an element that's registered to listen for these events.\n *\n * @see GestureHandler for how overriding of default options works.\n * @example $mdGesture.register(myElement, 'drag', { minDistance: 20, horziontal: false })\n */\n function register(element, handlerName, options) {\n var handler = HANDLERS[handlerName.replace(/^\\$md./, '')];\n if (!handler) {\n throw new Error('Failed to register element with handler ' + handlerName + '. ' +\n 'Available handlers: ' + Object.keys(HANDLERS).join(', '));\n }\n return handler.registerElement(element, options);\n }\n\n /*\n * add a handler to $mdGesture. see below.\n */\n function addHandler(name, definition) {\n var handler = new $$MdGestureHandler(name);\n angular.extend(handler, definition);\n HANDLERS[name] = handler;\n\n return self;\n }\n\n /*\n * Register handlers. These listen to touch/start/move events, interpret them,\n * and dispatch gesture events depending on options & conditions. These are all\n * instances of GestureHandler.\n * @see GestureHandler\n */\n return self\n /*\n * The press handler dispatches an event on touchdown/touchend.\n * It's a simple abstraction of touch/mouse/pointer start and end.\n */\n .handler('press', {\n onStart: function (ev, pointer) {\n this.dispatchEvent(ev, '$md.pressdown');\n },\n onEnd: function (ev, pointer) {\n this.dispatchEvent(ev, '$md.pressup');\n }\n })\n\n /*\n * The hold handler dispatches an event if the user keeps their finger within\n * the same <maxDistance> area for <delay> ms.\n * The hold handler will only run if a parent of the touch target is registered\n * to listen for hold events through $mdGesture.register()\n */\n .handler('hold', {\n options: {\n maxDistance: 6,\n delay: 500\n },\n onCancel: function () {\n $timeout.cancel(this.state.timeout);\n },\n onStart: function (ev, pointer) {\n // For hold, require a parent to be registered with $mdGesture.register()\n // Because we prevent scroll events, this is necessary.\n if (!this.state.registeredParent) return this.cancel();\n\n this.state.pos = {x: pointer.x, y: pointer.y};\n this.state.timeout = $timeout(angular.bind(this, function holdDelayFn() {\n this.dispatchEvent(ev, '$md.hold');\n this.cancel(); //we're done!\n }), this.state.options.delay, false);\n },\n onMove: function (ev, pointer) {\n // Don't scroll while waiting for hold.\n // If we don't preventDefault touchmove events here, Android will assume we don't\n // want to listen to anymore touch events. It will start scrolling and stop sending\n // touchmove events.\n if (!touchActionProperty && ev.type === 'touchmove') ev.preventDefault();\n\n // If the user moves greater than <maxDistance> pixels, stop the hold timer\n // set in onStart\n var dx = this.state.pos.x - pointer.x;\n var dy = this.state.pos.y - pointer.y;\n if (Math.sqrt(dx * dx + dy * dy) > this.options.maxDistance) {\n this.cancel();\n }\n },\n onEnd: function () {\n this.onCancel();\n }\n })\n\n /*\n * The drag handler dispatches a drag event if the user holds and moves his finger greater than\n * <minDistance> px in the x or y direction, depending on options.horizontal.\n * The drag will be cancelled if the user moves his finger greater than <minDistance>*<cancelMultiplier> in\n * the perpendicular direction. Eg if the drag is horizontal and the user moves his finger <minDistance>*<cancelMultiplier>\n * pixels vertically, this handler won't consider the move part of a drag.\n */\n .handler('drag', {\n options: {\n minDistance: 6,\n horizontal: true,\n cancelMultiplier: 1.5\n },\n onSetup: function(element, options) {\n if (touchActionProperty) {\n // We check for horizontal to be false, because otherwise we would overwrite the default opts.\n this.oldTouchAction = element[0].style[touchActionProperty];\n element[0].style[touchActionProperty] = options.horizontal === false ? 'pan-y' : 'pan-x';\n }\n },\n onCleanup: function(element) {\n if (this.oldTouchAction) {\n element[0].style[touchActionProperty] = this.oldTouchAction;\n }\n },\n onStart: function (ev) {\n // For drag, require a parent to be registered with $mdGesture.register()\n if (!this.state.registeredParent) this.cancel();\n },\n onMove: function (ev, pointer) {\n var shouldStartDrag, shouldCancel;\n // Don't scroll while deciding if this touchmove qualifies as a drag event.\n // If we don't preventDefault touchmove events here, Android will assume we don't\n // want to listen to anymore touch events. It will start scrolling and stop sending\n // touchmove events.\n if (!touchActionProperty && ev.type === 'touchmove') ev.preventDefault();\n\n if (!this.state.dragPointer) {\n if (this.state.options.horizontal) {\n shouldStartDrag = Math.abs(pointer.distanceX) > this.state.options.minDistance;\n shouldCancel = Math.abs(pointer.distanceY) > this.state.options.minDistance * this.state.options.cancelMultiplier;\n } else {\n shouldStartDrag = Math.abs(pointer.distanceY) > this.state.options.minDistance;\n shouldCancel = Math.abs(pointer.distanceX) > this.state.options.minDistance * this.state.options.cancelMultiplier;\n }\n\n if (shouldStartDrag) {\n // Create a new pointer representing this drag, starting at this point where the drag started.\n this.state.dragPointer = makeStartPointer(ev);\n updatePointerState(ev, this.state.dragPointer);\n this.dispatchEvent(ev, '$md.dragstart', this.state.dragPointer);\n\n } else if (shouldCancel) {\n this.cancel();\n }\n } else {\n this.dispatchDragMove(ev);\n }\n },\n // Only dispatch dragmove events every frame; any more is unnecessary\n dispatchDragMove: $$rAF.throttle(function (ev) {\n // Make sure the drag didn't stop while waiting for the next frame\n if (this.state.isRunning) {\n updatePointerState(ev, this.state.dragPointer);\n this.dispatchEvent(ev, '$md.drag', this.state.dragPointer);\n }\n }),\n onEnd: function (ev, pointer) {\n if (this.state.dragPointer) {\n updatePointerState(ev, this.state.dragPointer);\n this.dispatchEvent(ev, '$md.dragend', this.state.dragPointer);\n }\n }\n })\n\n /*\n * The swipe handler will dispatch a swipe event if, on the end of a touch,\n * the velocity and distance were high enough.\n */\n .handler('swipe', {\n options: {\n minVelocity: 0.65,\n minDistance: 10\n },\n onEnd: function (ev, pointer) {\n var eventType;\n\n if (Math.abs(pointer.velocityX) > this.state.options.minVelocity &&\n Math.abs(pointer.distanceX) > this.state.options.minDistance) {\n eventType = pointer.directionX == 'left' ? '$md.swipeleft' : '$md.swiperight';\n this.dispatchEvent(ev, eventType);\n }\n else if (Math.abs(pointer.velocityY) > this.state.options.minVelocity &&\n Math.abs(pointer.distanceY) > this.state.options.minDistance) {\n eventType = pointer.directionY == 'up' ? '$md.swipeup' : '$md.swipedown';\n this.dispatchEvent(ev, eventType);\n }\n }\n });\n\n function getTouchAction() {\n var testEl = document.createElement('div');\n var vendorPrefixes = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];\n\n for (var i = 0; i < vendorPrefixes.length; i++) {\n var prefix = vendorPrefixes[i];\n var property = prefix ? prefix + 'TouchAction' : 'touchAction';\n if (angular.isDefined(testEl.style[property])) {\n return property;\n }\n }\n }\n\n}", "function trapClickAndEnd(event) {\n var untrap;\n // trap the click in case we are part of an active\n // drag operation. This will effectively prevent\n // the ghost click that cannot be canceled otherwise.\n if (context.active) {\n untrap = Object(_util_ClickTrap__WEBPACK_IMPORTED_MODULE_4__[\"install\"])(eventBus);\n // remove trap after minimal delay\n setTimeout(untrap, 400);\n // prevent default action (click)\n preventDefault(event);\n }\n end(event);\n }", "onLongPress_() {\n // Swallow any click that occurs on this element without an intervening\n // touch start event. This simple click-busting technique should be\n // sufficient here since a real click should have a touchstart first.\n this.swallowNextClick_ = true;\n this.disableTap_ = true;\n\n // Dispatch to the LONG_PRESS\n assert(typeof this.startTouchX_ === 'number');\n assert(typeof this.startTouchY_ === 'number');\n this.dispatchEventXY_(\n TouchHandler.EventType.LONG_PRESS, this.element_,\n /** @type {number} */ (this.startTouchX_),\n /** @type {number} */ (this.startTouchY_));\n }", "function tap ( event ) {\r\n\r\n\t\tvar location = event.calcPoint, total = 0, handleNumber, to;\r\n\r\n\t\t// The tap event shouldn't propagate up and cause 'edge' to run.\r\n\t\tevent.stopPropagation();\r\n\r\n\t\t// Add up the handle offsets.\r\n\t\tscope_Handles.forEach(function(a){\r\n\t\t\ttotal += offset(a)[ options.style ];\r\n\t\t});\r\n\r\n\t\t// Find the handle closest to the tapped position.\r\n\t\thandleNumber = ( location < total/2 || scope_Handles.length === 1 ) ? 0 : 1;\r\n\r\n\t\t// Check if handler is not disablet if yes set number to the next handler\r\n\t\tif (scope_Handles[handleNumber].hasAttribute('disabled')) {\r\n\t\t\thandleNumber = handleNumber ? 0 : 1;\r\n\t\t}\r\n\r\n\t\tlocation -= offset(scope_Base)[ options.style ];\r\n\r\n\t\t// Calculate the new position.\r\n\t\tto = ( location * 100 ) / baseSize();\r\n\r\n\t\tif ( !options.events.snap ) {\r\n\t\t\t// Flag the slider as it is now in a transitional state.\r\n\t\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\r\n\t\t\taddClassFor( scope_Target, options.cssClasses.tap, options.animationDuration );\r\n\t\t}\r\n\r\n\t\t// Support 'disabled' handles\r\n\t\tif ( scope_Handles[handleNumber].hasAttribute('disabled') ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Find the closest handle and calculate the tapped point.\r\n\t\t// The set handle to the new position.\r\n\t\tsetHandle( scope_Handles[handleNumber], to );\r\n\r\n\t\tfireEvent('slide', handleNumber, true);\r\n\t\tfireEvent('set', handleNumber, true);\r\n\t\tfireEvent('change', handleNumber, true);\r\n\r\n\t\tif ( options.events.snap ) {\r\n\t\t\tstart(event, { handles: [scope_Handles[handleNumber]] });\r\n\t\t}\r\n\t}", "function trapClickAndEnd(event) {\n var untrap; // trap the click in case we are part of an active\n // drag operation. This will effectively prevent\n // the ghost click that cannot be canceled otherwise.\n\n if (context.active) {\n untrap = install(eventBus); // remove trap after minimal delay\n\n setTimeout(untrap, 400); // prevent default action (click)\n\n preventDefault(event);\n }\n\n end(event);\n }", "function tap ( event ) {\r\n\r\n\t\t\tvar location = event.calcPoint, total = 0, handleNumber, to;\r\n\r\n\t\t\t// The tap event shouldn't propagate up and cause 'edge' to run.\r\n\t\t\tevent.stopPropagation();\r\n\r\n\t\t\t// Add up the handle offsets.\r\n\t\t\tscope_Handles.forEach(function(a){\r\n\t\t\t\ttotal += offset(a)[ options.style ];\r\n\t\t\t});\r\n\r\n\t\t\t// Find the handle closest to the tapped position.\r\n\t\t\thandleNumber = ( location < total/2 || scope_Handles.length === 1 ) ? 0 : 1;\r\n\r\n\t\t\t// Check if handler is not disablet if yes set number to the next handler\r\n\t\t\tif (scope_Handles[handleNumber].hasAttribute('disabled')) {\r\n\t\t\t\thandleNumber = handleNumber ? 0 : 1;\r\n\t\t\t}\r\n\r\n\t\t\tlocation -= offset(scope_Base)[ options.style ];\r\n\r\n\t\t\t// Calculate the new position.\r\n\t\t\tto = ( location * 100 ) / baseSize();\r\n\r\n\t\t\tif ( !options.events.snap ) {\r\n\t\t\t\t// Flag the slider as it is now in a transitional state.\r\n\t\t\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\r\n\t\t\t\taddClassFor( scope_Target, options.cssClasses.tap, options.animationDuration );\r\n\t\t\t}\r\n\r\n\t\t\t// Support 'disabled' handles\r\n\t\t\tif ( scope_Handles[handleNumber].hasAttribute('disabled') ) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t// Find the closest handle and calculate the tapped point.\r\n\t\t\t// The set handle to the new position.\r\n\t\t\tsetHandle( scope_Handles[handleNumber], to );\r\n\r\n\t\t\tfireEvent('slide', handleNumber, true);\r\n\t\t\tfireEvent('set', handleNumber, true);\r\n\t\t\tfireEvent('change', handleNumber, true);\r\n\r\n\t\t\tif ( options.events.snap ) {\r\n\t\t\t\tstart(event, { handles: [scope_Handles[handleNumber]] });\r\n\t\t\t}\r\n\t\t}", "function Tap(el) {\n this.el = (typeof el === 'undefined' ? 'undefined' : _typeof(el)) === 'object' ? el : document.getElementById(el);\n this.moved = false; //flags if the finger has moved\n this.startX = 0; //starting x coordinate\n this.startY = 0; //starting y coordinate\n this.hasTouchEventOccured = false; //flag touch event\n this.el.addEventListener('touchstart', this, false);\n this.el.addEventListener('mousedown', this, false);\n}", "function tap ( event ) {\n\n\t\tvar location = event.calcPoint, total = 0, handleNumber, to;\n\n\t\t// The tap event shouldn't propagate up and cause 'edge' to run.\n\t\tevent.stopPropagation();\n\n\t\t// Add up the handle offsets.\n\t\tscope_Handles.forEach(function(a){\n\t\t\ttotal += offset(a)[ options.style ];\n\t\t});\n\n\t\t// Find the handle closest to the tapped position.\n\t\thandleNumber = ( location < total/2 || scope_Handles.length === 1 ) ? 0 : 1;\n\n\t\t// Check if handler is not disablet if yes set number to the next handler\n\t\tif (scope_Handles[handleNumber].hasAttribute('disabled')) {\n\t\t\thandleNumber = handleNumber ? 0 : 1;\n\t\t}\n\n\t\tlocation -= offset(scope_Base)[ options.style ];\n\n\t\t// Calculate the new position.\n\t\tto = ( location * 100 ) / baseSize();\n\n\t\tif ( !options.events.snap ) {\n\t\t\t// Flag the slider as it is now in a transitional state.\n\t\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\t\taddClassFor( scope_Target, options.cssClasses.tap, options.animationDuration );\n\t\t}\n\n\t\t// Support 'disabled' handles\n\t\tif ( scope_Handles[handleNumber].hasAttribute('disabled') ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Find the closest handle and calculate the tapped point.\n\t\t// The set handle to the new position.\n\t\tsetHandle( scope_Handles[handleNumber], to );\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\tstart(event, { handles: [scope_Handles[handleNumber]] });\n\t\t}\n\t}", "function tap ( event ) {\n\n\t\tvar location = event.calcPoint, total = 0, handleNumber, to;\n\n\t\t// The tap event shouldn't propagate up and cause 'edge' to run.\n\t\tevent.stopPropagation();\n\n\t\t// Add up the handle offsets.\n\t\tscope_Handles.forEach(function(a){\n\t\t\ttotal += offset(a)[ options.style ];\n\t\t});\n\n\t\t// Find the handle closest to the tapped position.\n\t\thandleNumber = ( location < total/2 || scope_Handles.length === 1 ) ? 0 : 1;\n\n\t\t// Check if handler is not disablet if yes set number to the next handler\n\t\tif (scope_Handles[handleNumber].hasAttribute('disabled')) {\n\t\t\thandleNumber = handleNumber ? 0 : 1;\n\t\t}\n\n\t\tlocation -= offset(scope_Base)[ options.style ];\n\n\t\t// Calculate the new position.\n\t\tto = ( location * 100 ) / baseSize();\n\n\t\tif ( !options.events.snap ) {\n\t\t\t// Flag the slider as it is now in a transitional state.\n\t\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\t\taddClassFor( scope_Target, options.cssClasses.tap, options.animationDuration );\n\t\t}\n\n\t\t// Support 'disabled' handles\n\t\tif ( scope_Handles[handleNumber].hasAttribute('disabled') ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Find the closest handle and calculate the tapped point.\n\t\t// The set handle to the new position.\n\t\tsetHandle( scope_Handles[handleNumber], to );\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\tstart(event, { handles: [scope_Handles[handleNumber]] });\n\t\t}\n\t}", "function tap () {\r\n startStop();\r\n if (tapTimer == null) {\r\n tapTimer = setTimeout(function () {\r\n tapTimer = null;\r\n }, 200)\r\n } else {\r\n clearTimeout(tapTimer);\r\n tapTimer = null;\r\n resetTheClock();\r\n alert('double tap');\r\n }\r\n}", "function gesture (elm) {\n /*\n * 0000 0000: idle\n * 0000 0001: start\n * 0000 0010: swipe\n * 0000 0100: vertical scrolling\n * 0000 1000: pinch (two fingers)\n * 0001 0000: pan (one fingers move)\n */\n // var phase = 0\n // TODO: rm window.phase\n var phase = window.phase = enumFactory().add('start', 'move', 'end', 'scroll', 'pinch', 'pan', 'swipe')\n var freeze = false\n var ismoving = false\n var tapTimes = 0, tapStart = -1, tapLast = -1\n\n var target\n var points = {\n start: [],\n last: [],\n current: []\n }\n\n var eventArg\n // const trigger = evt => handlers[evt].forEach(fn => fn(points, target, phase, eventArg))\n var instance = Object.create(hook())\n var trigger = evt => instance.trigger(evt, points, target, phase, eventArg)\n\n const loop = () => { if (ismoving) { raf(loop); render() }}\n\n const setTouchPoints = (evt, item) => {\n // if (!evt.touches || !evt.touches.length) return\n if (isArray(item)) return item.forEach(i => setTouchPoints(evt, i))\n points[item] = []\n if (isString(item)) points[item][0] = touch2point(evt.touches[0])\n if (evt.touches.length > 1) points[item][1] = touch2point(evt.touches[1])\n // else points[item].splice(1, 10)\n }\n\n const onstart = evt => {\n eventArg = evt\n // if (freeze) return\n // ga('gesture.start')\n setTouchPoints(evt, ['start', 'last', 'current'])\n // points.start[0] = points.last[0] = points.current[0] = touch2point(evt.touches[0])\n // if (evt.touches.length > 1) points.start[1] = points.last[1] = points.current[1] = touch2point(evt.touches[1])\n\n target = evt.target\n\n // phase = evt.touches.length > 1 ? 8 : 1\n phase.set('start')\n if (evt.touches.length > 1) phase.or('pinch')\n\n // ismoving = true\n\n trigger('start')\n if (phase.is('pinch')) trigger('pinchstart')\n else trigger('panstart') // one touch point trigger pan\n\n // loop()\n if (!phase.is('pinch')) tapStart = Date.now()\n }\n\n /// TODO: check pinch every time, if one point, switch behavior\n /// TODO: pinch / scroll: change status in onmove or trigger loop in onmove\n const onmove = evt => {\n eventArg = evt\n // console.log('gesture.onmove')\n // if (freeze) return\n // ga('gesture.onmove')\n\n points.last = points.current\n setTouchPoints(evt, 'current')\n\n // evt.touches.length === 1 && phase.rm('pinch')\n // evt.touches.length > 1 && phase.or('pinch')\n if (evt.touches.length > 1) phase.rm('pan').or('pinch')\n else {\n if (phase.is('pinch')) {\n // console.log('pinch ===> start')\n setTouchPoints(evt, 'start')\n // ga('move.trigger.start')\n trigger('start')\n }\n phase.rm('pinch').or('pan')\n // ga('xxxxxxxxxxx: ', phase.is('pan'))\n }\n // phase[evt.touches.length > 1 ? 'or' : 'rm']('pinch')\n\n if (phase.is('start') && !phase.is('pinch')) {\n Math.abs(points.current[0].x - points.start[0].x) < Math.abs(points.current[0].y - points.start[0].y) && phase.or('scroll')\n // phase.or('pan')\n }\n\n if (phase.is('pan') && !phase.is('scroll')) phase.or('swipe')\n\n phase.rm('start').or('move')\n //\n // if (evt.touches.length === 1) phase = 16\n\n if (!ismoving) {\n // TODO: change from two points to one points\n ismoving = true\n loop()\n }\n }\n\n const onend = evt => {\n eventArg = evt\n // console.log('end...')\n // console.log('end.touches:', evt.touches)\n // if (freeze) return\n phase.rm('start', 'move').or('end')\n\n // ga('gesture.end')\n\n phase.is('scroll') && trigger('scrollend')\n phase.is('pinch') && trigger('pinchend')\n phase.is('pan') && trigger('panend')\n ismoving = false\n // phase.set(0)\n\n // TODO: learn single / double logic\n if (!phase.is('pinch') && !phase.is('pan')) {\n var now = Date.now()\n if (now - tapStart <= 200) {\n trigger('tap')\n // if (now - tapLastTimestamp <= 200) tapTimes++\n // else tapTimes = 0\n\n tapTimes = now - tapLast <= 300 ? tapTimes + 1 : 1\n tapLast = now\n\n if (tapTimes === 1) setTimeout(() => tapTimes === 1 && trigger('single'), 300)\n else if (tapTimes === 2) trigger('double')\n }\n }\n\n trigger('end')\n }\n\n var offs = [ on(elm, 'touchstart', onstart), on(elm, 'touchmove', onmove), on(elm, 'touchend', onend) ]\n\n // return {\n // on: _on, off: _off, phase: () => phase,\n // destroy: () => offs.forEach(h => h())\n // }\n instance.phase = () => phase\n instance.destroy = () => {\n instance.$destroy()\n offs.forEach(h => h())\n }\n return instance\n\n function render () {\n trigger('move')\n\n // ga('yyyyyyyyyyyyy: ', phase.is('pan'))\n // ga(phase)\n\n // var _map = arr => JSON.stringify(arr.map(a => ({x: a.x.toFixed(0), y: a.y.toFixed(0)})))\n // console.log('current:', _map(points.current), 'start:', _map(points.start))\n\n phase.is('scroll') && trigger('scroll')\n phase.is('swipe') && trigger('swipe')\n phase.is('pinch') && trigger('pinch')\n phase.is('pan') && trigger('pan')\n\n // (phase.is('pan') && !phase.is('scroll')) && trigger('swipe')\n }\n}", "function didTap() {\n\t\t //Enure we dont return 0 or null for false values\n\t\t\treturn !!(validateTap() && hasTap());\n\t\t}", "function didTap() {\n\t\t //Enure we dont return 0 or null for false values\n\t\t\treturn !!(validateTap() && hasTap());\n\t\t}", "function didTap() {\n\t\t //Enure we dont return 0 or null for false values\n\t\t\treturn !!(validateTap() && hasTap());\n\t\t}", "function didTap() {\n //Enure we dont return 0 or null for false values\n return !!(validateTap() && hasTap());\n }", "function didTap() {\n //Enure we dont return 0 or null for false values\n return !!(validateTap() && hasTap());\n }", "function validateTap() {\n\t\t return ((fingerCount === 1 || !SUPPORTS_TOUCH) && (isNaN(distance) || distance < options.threshold));\n\t\t}", "function validateTap() {\n\t\t return ((fingerCount === 1 || !SUPPORTS_TOUCH) && (isNaN(distance) || distance < options.threshold));\n\t\t}", "function validateTap() {\n\t\t return ((fingerCount === 1 || !SUPPORTS_TOUCH) && (isNaN(distance) || distance < options.threshold));\n\t\t}", "function bindTapEvtHandler(selector, handler) {\n /*\n * In Iphone safari browser, tap event of HammerJs is breaking\n * functionalities of other controls like input[type=\"range\"].\n * So, replaced the hammer Js handler with click event handler.\n */\n WM.element(selector).off('click.deviewview').on('click.deviewview', handler);\n }", "function tap ( event ) {\n\t\n\t\t\tvar location = event.calcPoint, total = 0, handleNumber, to;\n\t\n\t\t\t// The tap event shouldn't propagate up and cause 'edge' to run.\n\t\t\tevent.stopPropagation();\n\t\n\t\t\t// Add up the handle offsets.\n\t\t\tscope_Handles.forEach(function(a){\n\t\t\t\ttotal += offset(a)[ options.style ];\n\t\t\t});\n\t\n\t\t\t// Find the handle closest to the tapped position.\n\t\t\thandleNumber = ( location < total/2 || scope_Handles.length === 1 ) ? 0 : 1;\n\t\t\t\n\t\t\t// Check if handler is not disablet if yes set number to the next handler\n\t\t\tif (scope_Handles[handleNumber].hasAttribute('disabled')) {\n\t\t\t\thandleNumber = handleNumber ? 0 : 1;\n\t\t\t}\n\t\n\t\t\tlocation -= offset(scope_Base)[ options.style ];\n\t\n\t\t\t// Calculate the new position.\n\t\t\tto = ( location * 100 ) / baseSize();\n\t\n\t\t\tif ( !options.events.snap ) {\n\t\t\t\t// Flag the slider as it is now in a transitional state.\n\t\t\t\t// Transition takes 300 ms, so re-enable the slider afterwards.\n\t\t\t\taddClassFor( scope_Target, cssClasses[14], 300 );\n\t\t\t}\n\t\n\t\t\t// Support 'disabled' handles\n\t\t\tif ( scope_Handles[handleNumber].hasAttribute('disabled') ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\n\t\t\t// Find the closest handle and calculate the tapped point.\n\t\t\t// The set handle to the new position.\n\t\t\tsetHandle( scope_Handles[handleNumber], to );\n\t\n\t\t\tfireEvent('slide', handleNumber, true);\n\t\t\tfireEvent('set', handleNumber, true);\n\t\t\tfireEvent('change', handleNumber, true);\n\t\n\t\t\tif ( options.events.snap ) {\n\t\t\t\tstart(event, { handles: [scope_Handles[handleNumber]] });\n\t\t\t}\n\t\t}", "function FastClick(a){var b,c=this;this.trackingClick=!1;this.trackingClickStart=0;this.targetElement=null;this.lastTouchIdentifier=this.touchStartY=this.touchStartX=0;this.touchBoundary=10;this.layer=a;if(!a||!a.nodeType)throw new TypeError(\"Layer must be a document node\");this.onClick=function(){return FastClick.prototype.onClick.apply(c,arguments)};this.onMouse=function(){return FastClick.prototype.onMouse.apply(c,arguments)};this.onTouchStart=function(){return FastClick.prototype.onTouchStart.apply(c,\narguments)};this.onTouchEnd=function(){return FastClick.prototype.onTouchEnd.apply(c,arguments)};this.onTouchCancel=function(){return FastClick.prototype.onTouchCancel.apply(c,arguments)};FastClick.notNeeded(a)||(this.deviceIsAndroid&&(a.addEventListener(\"mouseover\",this.onMouse,!0),a.addEventListener(\"mousedown\",this.onMouse,!0),a.addEventListener(\"mouseup\",this.onMouse,!0)),a.addEventListener(\"click\",this.onClick,!0),a.addEventListener(\"touchstart\",this.onTouchStart,!1),a.addEventListener(\"touchend\",\nthis.onTouchEnd,!1),a.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(b,c,e){var f=Node.prototype.removeEventListener;\"click\"===b?f.call(a,b,c.hijacked||c,e):f.call(a,b,c,e)},a.addEventListener=function(b,c,e){var f=Node.prototype.addEventListener;\"click\"===b?f.call(a,b,c.hijacked||(c.hijacked=function(a){a.propagationStopped||c(a)}),e):f.call(a,b,c,e)}),\"function\"===typeof a.onclick&&(b=a.onclick,a.addEventListener(\"click\",\nfunction(a){b(a)},!1),a.onclick=null))}", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function handleTouch(ev){\n ev.preventDefault();\n ev.stopImmediatePropagation();\n var touch = ev.changedTouches[0]; //this is the first object touched\n var newEvt = document.createEvent(\"MouseEvent\");\t\n //old method works across browsers, though it is deprecated.\n newEvt.initMouseEvent(\"click\", true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY);\n ev.currentTarget.dispatchEvent(newEvt);\n //send the touch to the click handler\n}", "async tap(): Promise<void> {\n await this.driver.activeWindow.touch._tap(this._parent.elementID);\n }", "function trapClickAndEnd(event) {\n\n var untrap;\n\n // trap the click in case we are part of an active\n // drag operation. This will effectively prevent\n // the ghost click that cannot be canceled otherwise.\n if (context.active) {\n untrap = ClickTrap.install();\n setTimeout(untrap, 400);\n }\n\n end(event);\n }", "function handleTouch(ev) {\n ev.preventDefault();\n ev.stopImmediatePropagation();\n var touch = ev.changedTouches[0]; //this is the first object touched\n var newEvt = document.createEvent(\"MouseEvent\");\n //old method works across browsers, though it is deprecated.\n newEvt.initMouseEvent(\"click\", true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY);\n ev.currentTarget.dispatchEvent(newEvt);\n //send the touch to the click handler\n}", "function validateTap() {\n return ((fingerCount === 1 || !SUPPORTS_TOUCH) && (isNaN(distance) || distance < options.threshold));\n }", "_onTouchStart(ev){\n\t\tif (!ev.touches || ev.touches.length === 0) {\n\t\t\tconsole.error('No touches on touch event', ev)\n\t\t\treturn\n\t\t}\n\t\t//save screen coordinates normalized to -1..1 (0,0 is at center and 1,1 is at top right)\n\t\tthis._tapEventData = [\n\t\t\tev.touches[0].clientX / window.innerWidth,\n\t\t\tev.touches[0].clientY / window.innerHeight\n\t\t]\n\t}", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function validateTap() {\n return ((fingerCount === 1 || !SUPPORTS_TOUCH) && (isNaN(distance) || distance === 0));\n }", "function MdGesture($$MdGestureHandler, $$rAF, $timeout) {\n var userAgent = navigator.userAgent || navigator.vendor || window.opera;\n var isIos = userAgent.match(/ipad|iphone|ipod/i);\n var isAndroid = userAgent.match(/android/i);\n var hasJQuery = (typeof window.jQuery !== 'undefined') && (angular.element === window.jQuery);\n\n var self = {\n handler: addHandler,\n register: register,\n // On mobile w/out jQuery, we normally intercept clicks. Should we skip that?\n isHijackingClicks: (isIos || isAndroid) && !hasJQuery && !forceSkipClickHijack\n };\n\n if (self.isHijackingClicks) {\n var maxClickDistance = 6;\n self.handler('click', {\n options: {\n maxDistance: maxClickDistance\n },\n onEnd: checkDistanceAndEmit('click')\n });\n\n self.handler('focus', {\n options: {\n maxDistance: maxClickDistance\n },\n onEnd: function(ev, pointer) {\n if (pointer.distance < this.state.options.maxDistance) {\n if (canFocus(ev.target)) {\n this.dispatchEvent(ev, 'focus', pointer);\n ev.target.focus();\n }\n }\n\n function canFocus(element) {\n var focusableElements = ['INPUT', 'SELECT', 'BUTTON', 'TEXTAREA', 'VIDEO', 'AUDIO'];\n\n return (element.getAttribute('tabindex') != '-1') &&\n !element.hasAttribute('DISABLED') &&\n (element.hasAttribute('tabindex') || element.hasAttribute('href') ||\n (focusableElements.indexOf(element.nodeName) != -1));\n }\n }\n });\n\n self.handler('mouseup', {\n options: {\n maxDistance: maxClickDistance\n },\n onEnd: checkDistanceAndEmit('mouseup')\n });\n\n self.handler('mousedown', {\n onStart: function(ev) {\n this.dispatchEvent(ev, 'mousedown');\n }\n });\n }\n\n function checkDistanceAndEmit(eventName) {\n return function(ev, pointer) {\n if (pointer.distance < this.state.options.maxDistance) {\n this.dispatchEvent(ev, eventName, pointer);\n }\n };\n }\n\n /*\n * Register an element to listen for a handler.\n * This allows an element to override the default options for a handler.\n * Additionally, some handlers like drag and hold only dispatch events if\n * the domEvent happens inside an element that's registered to listen for these events.\n *\n * @see GestureHandler for how overriding of default options works.\n * @example $mdGesture.register(myElement, 'drag', { minDistance: 20, horziontal: false })\n */\n function register(element, handlerName, options) {\n var handler = HANDLERS[handlerName.replace(/^\\$md./, '')];\n if (!handler) {\n throw new Error('Failed to register element with handler ' + handlerName + '. ' +\n 'Available handlers: ' + Object.keys(HANDLERS).join(', '));\n }\n return handler.registerElement(element, options);\n }\n\n /*\n * add a handler to $mdGesture. see below.\n */\n function addHandler(name, definition) {\n var handler = new $$MdGestureHandler(name);\n angular.extend(handler, definition);\n HANDLERS[name] = handler;\n\n return self;\n }\n\n /*\n * Register handlers. These listen to touch/start/move events, interpret them,\n * and dispatch gesture events depending on options & conditions. These are all\n * instances of GestureHandler.\n * @see GestureHandler \n */\n return self\n /*\n * The press handler dispatches an event on touchdown/touchend.\n * It's a simple abstraction of touch/mouse/pointer start and end.\n */\n .handler('press', {\n onStart: function (ev, pointer) {\n this.dispatchEvent(ev, '$md.pressdown');\n },\n onEnd: function (ev, pointer) {\n this.dispatchEvent(ev, '$md.pressup');\n }\n })\n\n /*\n * The hold handler dispatches an event if the user keeps their finger within\n * the same <maxDistance> area for <delay> ms.\n * The hold handler will only run if a parent of the touch target is registered\n * to listen for hold events through $mdGesture.register()\n */\n .handler('hold', {\n options: {\n maxDistance: 6,\n delay: 500\n },\n onCancel: function () {\n $timeout.cancel(this.state.timeout);\n },\n onStart: function (ev, pointer) {\n // For hold, require a parent to be registered with $mdGesture.register()\n // Because we prevent scroll events, this is necessary.\n if (!this.state.registeredParent) return this.cancel();\n\n this.state.pos = {x: pointer.x, y: pointer.y};\n this.state.timeout = $timeout(angular.bind(this, function holdDelayFn() {\n this.dispatchEvent(ev, '$md.hold');\n this.cancel(); //we're done!\n }), this.state.options.delay, false);\n },\n onMove: function (ev, pointer) {\n // Don't scroll while waiting for hold.\n // If we don't preventDefault touchmove events here, Android will assume we don't\n // want to listen to anymore touch events. It will start scrolling and stop sending\n // touchmove events.\n ev.preventDefault();\n\n // If the user moves greater than <maxDistance> pixels, stop the hold timer\n // set in onStart\n var dx = this.state.pos.x - pointer.x;\n var dy = this.state.pos.y - pointer.y;\n if (Math.sqrt(dx * dx + dy * dy) > this.options.maxDistance) {\n this.cancel();\n }\n },\n onEnd: function () {\n this.onCancel();\n }\n })\n\n /*\n * The drag handler dispatches a drag event if the user holds and moves his finger greater than\n * <minDistance> px in the x or y direction, depending on options.horizontal.\n * The drag will be cancelled if the user moves his finger greater than <minDistance>*<cancelMultiplier> in\n * the perpindicular direction. Eg if the drag is horizontal and the user moves his finger <minDistance>*<cancelMultiplier>\n * pixels vertically, this handler won't consider the move part of a drag.\n */\n .handler('drag', {\n options: {\n minDistance: 6,\n horizontal: true,\n cancelMultiplier: 1.5\n },\n onStart: function (ev) {\n // For drag, require a parent to be registered with $mdGesture.register()\n if (!this.state.registeredParent) this.cancel();\n },\n onMove: function (ev, pointer) {\n var shouldStartDrag, shouldCancel;\n // Don't scroll while deciding if this touchmove qualifies as a drag event.\n // If we don't preventDefault touchmove events here, Android will assume we don't\n // want to listen to anymore touch events. It will start scrolling and stop sending\n // touchmove events.\n ev.preventDefault();\n\n if (!this.state.dragPointer) {\n if (this.state.options.horizontal) {\n shouldStartDrag = Math.abs(pointer.distanceX) > this.state.options.minDistance;\n shouldCancel = Math.abs(pointer.distanceY) > this.state.options.minDistance * this.state.options.cancelMultiplier;\n } else {\n shouldStartDrag = Math.abs(pointer.distanceY) > this.state.options.minDistance;\n shouldCancel = Math.abs(pointer.distanceX) > this.state.options.minDistance * this.state.options.cancelMultiplier;\n }\n\n if (shouldStartDrag) {\n // Create a new pointer representing this drag, starting at this point where the drag started.\n this.state.dragPointer = makeStartPointer(ev);\n updatePointerState(ev, this.state.dragPointer);\n this.dispatchEvent(ev, '$md.dragstart', this.state.dragPointer);\n\n } else if (shouldCancel) {\n this.cancel();\n }\n } else {\n this.dispatchDragMove(ev);\n }\n },\n // Only dispatch dragmove events every frame; any more is unnecessray\n dispatchDragMove: $$rAF.throttle(function (ev) {\n // Make sure the drag didn't stop while waiting for the next frame\n if (this.state.isRunning) {\n updatePointerState(ev, this.state.dragPointer);\n this.dispatchEvent(ev, '$md.drag', this.state.dragPointer);\n }\n }),\n onEnd: function (ev, pointer) {\n if (this.state.dragPointer) {\n updatePointerState(ev, this.state.dragPointer);\n this.dispatchEvent(ev, '$md.dragend', this.state.dragPointer);\n }\n }\n })\n\n /*\n * The swipe handler will dispatch a swipe event if, on the end of a touch,\n * the velocity and distance were high enough.\n */\n .handler('swipe', {\n options: {\n minVelocity: 0.65,\n minDistance: 10\n },\n onEnd: function (ev, pointer) {\n var eventType;\n\n if (Math.abs(pointer.velocityX) > this.state.options.minVelocity &&\n Math.abs(pointer.distanceX) > this.state.options.minDistance) {\n eventType = pointer.directionX == 'left' ? '$md.swipeleft' : '$md.swiperight';\n this.dispatchEvent(ev, eventType);\n }\n else if (Math.abs(pointer.velocityY) > this.state.options.minVelocity &&\n Math.abs(pointer.distanceY) > this.state.options.minDistance) {\n eventType = pointer.directionY == 'up' ? '$md.swipeup' : '$md.swipedown';\n this.dispatchEvent(ev, eventType);\n }\n }\n });\n\n}", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function emulateTouch (event)\n\t\t\t{\n\t\t\t\tif (options.preventDefault)\n\t\t\t\t{\n\t\t\t\t\t// Pas d'action par défaut (bouger la page par exemple)\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\n\t\t\t\t// Récupérer les pointes\n\t\t\t\tvar touches = event.changedTouches;\n\n\t\t\t\t// Le type de l'event\n\t\t\t\tvar type = event.type;\n\n\t\t\t\t// Si on doit dispatcher direct\n\t\t\t\tif (options.dispatchOnStart)\n\t\t\t\t{\n\t\t\t\t\tif (type == \"touchstart\")\n\t\t\t\t\t\tdispatchMouseEvent(\"click\", touches[0]);\n\t\t\t\t\t\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Si on doit utiliser les fastTap\n\t\t\t\telse if (options.fastTap)\n\t\t\t\t{\n\t\t\t\t\t// Vérifier les mouvements pour émuler les clics\n\t\t\t\t\tif (type == \"touchstart\")\n\t\t\t\t\t\tmoved = false;\n\t\t\t\t\telse if (type == \"touchmove\")\n\t\t\t\t\t\tmoved = true;\n\t\t\t\t\telse if (type == \"touchend\" && !moved)\n\t\t\t\t\t\tdispatchMouseEvent(\"click\", touches[0]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Séléctionner le type de MouseEvent selon le TouchEvent\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase 'touchtap':\n\t\t\t\t\t\ttype = 'click';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'touchstart':\n\t\t\t\t\t\ttype = 'mousedown';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'touchmove':\n\t\t\t\t\t\ttype = 'mousemove';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'touchend':\n\t\t\t\t\t\ttype = 'mouseup';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn;\n\t\t\t\t};\n\n\t\t\t\t// Dispatcher l'équivalent mouseEvent\n\t\t\t\tdispatchMouseEvent(type, touches[0]);\n\t\t\t}", "async tap(x, y) {\n // Touches appear to be lost during the first frame after navigation.\n // This waits a frame before sending the tap.\n // @see https://crbug.com/613219\n await this._client.send('Runtime.evaluate', {\n expression: 'new Promise(x => requestAnimationFrame(() => requestAnimationFrame(x)))',\n awaitPromise: true,\n });\n const touchPoints = [{ x: Math.round(x), y: Math.round(y) }];\n await this._client.send('Input.dispatchTouchEvent', {\n type: 'touchStart',\n touchPoints,\n modifiers: this._keyboard._modifiers,\n });\n await this._client.send('Input.dispatchTouchEvent', {\n type: 'touchEnd',\n touchPoints: [],\n modifiers: this._keyboard._modifiers,\n });\n }", "function CALCULATE_TOUCH_UP_OR_MOUSE_UP() {\r\n \r\n GLOBAL_CLICK.CLICK_PRESSED = false;\r\n \r\n }", "handletouchend() {\n var mouseEvent = new MouseEvent(\"mouseup\", {});\n this.canvas.dispatchEvent(mouseEvent);\n }", "handletouchstart(e) {\n var touch = e.touches[0];\n var mouseEvent = new MouseEvent(\"mousedown\", {\n clientX: touch.clientX,\n clientY: touch.clientY\n })\n this.canvas.dispatchEvent(mouseEvent);\n e.preventDefault();\n }", "function gestureStart(ev){// If we're already touched down, abort\n\tif(pointer)return;var now=+Date.now();// iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n\t// If <400ms have passed, don't allow an event of a different type than the previous event\n\tif(lastPointer&&!typesMatch(ev,lastPointer)&&now-lastPointer.endTime<1500){return;}pointer=makeStartPointer(ev);runHandlers('start',ev);}", "function simulateMobileClick() {\n $(\"#myEl\").trigger('click');\n $(\"#myEl\").trigger('touchstart');\n}", "function MdGesture($$MdGestureHandler,$$rAF,$timeout){var userAgent=navigator.userAgent||navigator.vendor||window.opera;var isIos=userAgent.match(/ipad|iphone|ipod/i);var isAndroid=userAgent.match(/android/i);var touchActionProperty=getTouchAction();var hasJQuery=typeof window.jQuery!=='undefined'&&angular.element===window.jQuery;var self={handler:addHandler,register:register,isIos:isIos,isAndroid:isAndroid,// On mobile w/out jQuery, we normally intercept clicks. Should we skip that?\n\tisHijackingClicks:(isIos||isAndroid)&&!hasJQuery&&!forceSkipClickHijack};if(self.isHijackingClicks){var maxClickDistance=6;self.handler('click',{options:{maxDistance:maxClickDistance},onEnd:checkDistanceAndEmit('click')});self.handler('focus',{options:{maxDistance:maxClickDistance},onEnd:function onEnd(ev,pointer){if(pointer.distance<this.state.options.maxDistance){if(canFocus(ev.target)){this.dispatchEvent(ev,'focus',pointer);ev.target.focus();}}function canFocus(element){var focusableElements=['INPUT','SELECT','BUTTON','TEXTAREA','VIDEO','AUDIO'];return element.getAttribute('tabindex')!='-1'&&!element.hasAttribute('DISABLED')&&(element.hasAttribute('tabindex')||element.hasAttribute('href')||element.isContentEditable||focusableElements.indexOf(element.nodeName)!=-1);}}});self.handler('mouseup',{options:{maxDistance:maxClickDistance},onEnd:checkDistanceAndEmit('mouseup')});self.handler('mousedown',{onStart:function onStart(ev){this.dispatchEvent(ev,'mousedown');}});}function checkDistanceAndEmit(eventName){return function(ev,pointer){if(pointer.distance<this.state.options.maxDistance){this.dispatchEvent(ev,eventName,pointer);}};}/*\n\t * Register an element to listen for a handler.\n\t * This allows an element to override the default options for a handler.\n\t * Additionally, some handlers like drag and hold only dispatch events if\n\t * the domEvent happens inside an element that's registered to listen for these events.\n\t *\n\t * @see GestureHandler for how overriding of default options works.\n\t * @example $mdGesture.register(myElement, 'drag', { minDistance: 20, horziontal: false })\n\t */function register(element,handlerName,options){var handler=HANDLERS[handlerName.replace(/^\\$md./,'')];if(!handler){throw new Error('Failed to register element with handler '+handlerName+'. '+'Available handlers: '+Object.keys(HANDLERS).join(', '));}return handler.registerElement(element,options);}/*\n\t * add a handler to $mdGesture. see below.\n\t */function addHandler(name,definition){var handler=new $$MdGestureHandler(name);angular.extend(handler,definition);HANDLERS[name]=handler;return self;}/*\n\t * Register handlers. These listen to touch/start/move events, interpret them,\n\t * and dispatch gesture events depending on options & conditions. These are all\n\t * instances of GestureHandler.\n\t * @see GestureHandler\n\t */return self/*\n\t * The press handler dispatches an event on touchdown/touchend.\n\t * It's a simple abstraction of touch/mouse/pointer start and end.\n\t */.handler('press',{onStart:function onStart(ev,pointer){this.dispatchEvent(ev,'$md.pressdown');},onEnd:function onEnd(ev,pointer){this.dispatchEvent(ev,'$md.pressup');}})/*\n\t * The hold handler dispatches an event if the user keeps their finger within\n\t * the same <maxDistance> area for <delay> ms.\n\t * The hold handler will only run if a parent of the touch target is registered\n\t * to listen for hold events through $mdGesture.register()\n\t */.handler('hold',{options:{maxDistance:6,delay:500},onCancel:function onCancel(){$timeout.cancel(this.state.timeout);},onStart:function onStart(ev,pointer){// For hold, require a parent to be registered with $mdGesture.register()\n\t// Because we prevent scroll events, this is necessary.\n\tif(!this.state.registeredParent)return this.cancel();this.state.pos={x:pointer.x,y:pointer.y};this.state.timeout=$timeout(angular.bind(this,function holdDelayFn(){this.dispatchEvent(ev,'$md.hold');this.cancel();//we're done!\n\t}),this.state.options.delay,false);},onMove:function onMove(ev,pointer){// Don't scroll while waiting for hold.\n\t// If we don't preventDefault touchmove events here, Android will assume we don't\n\t// want to listen to anymore touch events. It will start scrolling and stop sending\n\t// touchmove events.\n\tif(!touchActionProperty&&ev.type==='touchmove')ev.preventDefault();// If the user moves greater than <maxDistance> pixels, stop the hold timer\n\t// set in onStart\n\tvar dx=this.state.pos.x-pointer.x;var dy=this.state.pos.y-pointer.y;if(Math.sqrt(dx*dx+dy*dy)>this.options.maxDistance){this.cancel();}},onEnd:function onEnd(){this.onCancel();}})/*\n\t * The drag handler dispatches a drag event if the user holds and moves his finger greater than\n\t * <minDistance> px in the x or y direction, depending on options.horizontal.\n\t * The drag will be cancelled if the user moves his finger greater than <minDistance>*<cancelMultiplier> in\n\t * the perpendicular direction. Eg if the drag is horizontal and the user moves his finger <minDistance>*<cancelMultiplier>\n\t * pixels vertically, this handler won't consider the move part of a drag.\n\t */.handler('drag',{options:{minDistance:6,horizontal:true,cancelMultiplier:1.5},onSetup:function onSetup(element,options){if(touchActionProperty){// We check for horizontal to be false, because otherwise we would overwrite the default opts.\n\tthis.oldTouchAction=element[0].style[touchActionProperty];element[0].style[touchActionProperty]=options.horizontal===false?'pan-y':'pan-x';}},onCleanup:function onCleanup(element){if(this.oldTouchAction){element[0].style[touchActionProperty]=this.oldTouchAction;}},onStart:function onStart(ev){// For drag, require a parent to be registered with $mdGesture.register()\n\tif(!this.state.registeredParent)this.cancel();},onMove:function onMove(ev,pointer){var shouldStartDrag,shouldCancel;// Don't scroll while deciding if this touchmove qualifies as a drag event.\n\t// If we don't preventDefault touchmove events here, Android will assume we don't\n\t// want to listen to anymore touch events. It will start scrolling and stop sending\n\t// touchmove events.\n\tif(!touchActionProperty&&ev.type==='touchmove')ev.preventDefault();if(!this.state.dragPointer){if(this.state.options.horizontal){shouldStartDrag=Math.abs(pointer.distanceX)>this.state.options.minDistance;shouldCancel=Math.abs(pointer.distanceY)>this.state.options.minDistance*this.state.options.cancelMultiplier;}else{shouldStartDrag=Math.abs(pointer.distanceY)>this.state.options.minDistance;shouldCancel=Math.abs(pointer.distanceX)>this.state.options.minDistance*this.state.options.cancelMultiplier;}if(shouldStartDrag){// Create a new pointer representing this drag, starting at this point where the drag started.\n\tthis.state.dragPointer=makeStartPointer(ev);updatePointerState(ev,this.state.dragPointer);this.dispatchEvent(ev,'$md.dragstart',this.state.dragPointer);}else if(shouldCancel){this.cancel();}}else{this.dispatchDragMove(ev);}},// Only dispatch dragmove events every frame; any more is unnecessary\n\tdispatchDragMove:$$rAF.throttle(function(ev){// Make sure the drag didn't stop while waiting for the next frame\n\tif(this.state.isRunning){updatePointerState(ev,this.state.dragPointer);this.dispatchEvent(ev,'$md.drag',this.state.dragPointer);}}),onEnd:function onEnd(ev,pointer){if(this.state.dragPointer){updatePointerState(ev,this.state.dragPointer);this.dispatchEvent(ev,'$md.dragend',this.state.dragPointer);}}})/*\n\t * The swipe handler will dispatch a swipe event if, on the end of a touch,\n\t * the velocity and distance were high enough.\n\t */.handler('swipe',{options:{minVelocity:0.65,minDistance:10},onEnd:function onEnd(ev,pointer){var eventType;if(Math.abs(pointer.velocityX)>this.state.options.minVelocity&&Math.abs(pointer.distanceX)>this.state.options.minDistance){eventType=pointer.directionX=='left'?'$md.swipeleft':'$md.swiperight';this.dispatchEvent(ev,eventType);}else if(Math.abs(pointer.velocityY)>this.state.options.minVelocity&&Math.abs(pointer.distanceY)>this.state.options.minDistance){eventType=pointer.directionY=='up'?'$md.swipeup':'$md.swipedown';this.dispatchEvent(ev,eventType);}}});function getTouchAction(){var testEl=document.createElement('div');var vendorPrefixes=['','webkit','Moz','MS','ms','o'];for(var i=0;i<vendorPrefixes.length;i++){var prefix=vendorPrefixes[i];var property=prefix?prefix+'TouchAction':'touchAction';if(angular.isDefined(testEl.style[property])){return property;}}}}", "function bindAnchorsToTouch(){\t\t\t\r\n\tvar helper = null;//is probably a jquery object but testing will learn for sure\r\n\tvar link = null;//will be a wrapped jquery object of the original this \r\n\tvar startX = -1, leftOffset = -1;\r\n\tvar cancelLinkClick = false;\r\n\tunderlink = $(\"<div id='underlink' style='overflow:hidden;background-color:white;'>The content is here</div>\")\r\n\t\t.appendTo(\"body\")\r\n\t\t.hide();\r\n\t$(\"a\").bind({\r\n\t\t\"touchstart\": function(event){\r\n\t\t\t//lets start by only handing first touch\r\n\t\t\tvar e = event.originalEvent;\r\n\t\t\tlink = $(this);\r\n\t\t\t//can't prevent default here or it will never click the link\r\n\t\t\t//e.preventDefault();//need to block it from scrolling\r\n\t\t\tvar oldself = self;\r\n\t\t\tself = {pageXOffset:0,pageYOffset:0};\r\n\t\t\tvar offset = link.offset();\r\n\t\t\tstartX = offset.left;\r\n\t\t\tself = oldself;\r\n\t\t\tleftOffset = e.touches[0].pageX - startX;\r\n\t\t\tcancelLinkClick = false;//don't yet need to block from clicking\r\n\t\t},\r\n\t\t\"touchmove\": function(event){\r\n\t\t\tvar e = event.originalEvent;\r\n\t\t\te.preventDefault();\r\n\t\t\tvar pageX = e.targetTouches[0].pageX;\r\n\t\t\tcurX = pageX - leftOffset;\r\n\t\t\tif(curX > 5 && !cancelLinkClick){\r\n\t\t\t\tcancelLinkClick = true;\r\n\t\t\t\tvar oldself = self;\r\n\t\t\t\tself = {pageXOffset:0,pageYOffset:0};\r\n\t\t\t\tvar offset = link.offset();\r\n\t\t\t\thelper = link.clone();\r\n\t\t\t\t\thelper\r\n\t\t\t\t\t.appendTo(\"body\")\r\n\t\t\t\t\t.css({\"position\": \"absolute\",\r\n\t\t\t\t\t\t\"display\":\"block\",\r\n\t\t\t\t\t\t\"left\":offset.left.toString() + \"px\",\r\n\t\t\t\t\t\t\"top\":offset.top.toString() + \"px\",\r\n\t\t\t\t\t\t\"background-color\":\"white\",\r\n\t\t\t\t\t\t\"z-index\": \"20000\"\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t.offset(link.offset());\r\n\t\t\t\tlink.css(\"visibility\", \"hidden\");\r\n\t\t\t\tunderlink.text(this.href);\r\n\t\t\t\tunderlink.width(1);\r\n\t\t\t\tunderlink.show();\r\n\t\t\t\tunderlink.offset(offset);\r\n\t\t\t\tself = oldself;\t\r\n\t\t\t}\r\n\t\t\tif(cancelLinkClick && pageX > startX + leftOffset){\r\n\t\t\t\thelper.css(\"left\", function(val){\r\n\t\t\t\t\t\treturn val + curX;\r\n\t\t\t\t});\r\n\t\t\t\tunderlink.width(curX - startX);\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"touchend\": function(event){\r\n\t\tconsole.log(\"touch end\");\r\n\t\t\tevent.preventDefault();\r\n\t\t\tvar e = event.originalEvent;\r\n\t\t\tif(cancelLinkClick){\r\n\t\t\t\te.preventDefault();\r\n//\t\t\t\t\tconsole.log(\"default prevented!\");\r\n\t\t\t\thelper.animate({\"left\": startX}, 200, function(){\r\n\t\t\t\t\tif(helper != null){\r\n\t\t\t\t\t\thelper.remove();\r\n\t\t\t\t\t\thelper = null;\r\n\t\t\t\t\t\tlink.css(\"visibility\", \"visible\");\r\n\t\t\t\t\t\tlink = null;\r\n\t\t\t\t\t\tunderlink.hide();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}", "function hasTap() {\n //Enure we dont return 0 or null for false values\n return !!(options.tap);\n }", "function checkBadTouch(e, onClickEvent){\n\t\tif(device.platform == \"iOS\"){\n\t\t\tif(onClickEvent){\n\t\t\t\treturn e.type == \"touchstart\" || e.type == \"touchend\";\n\t\t\t}else{\n\t\t\t\treturn e.type == \"touchstart\";\n\t\t\t}\n\t\t}else{\n\t\t\treturn e.type == \"touchstart\" || e.type == \"touchend\";\n\t\t}\n\t}", "_onMapClick(e) {\r\n\t const targetElement = e.originalEvent.target;\r\n\t const element = this._element;\r\n\r\n\t if (\r\n\t this._handleClick &&\r\n\t (targetElement === element || element.contains(targetElement))\r\n\t ) {\r\n\t this._handleClick();\r\n\t }\r\n\t }", "_onContainerTouchStart(e){\n e.preventDefault();\n if(e.touches.length === 2){\n this.doubleTap = true;\n this.tapDistance = this._calcDistance(\n e.touches[0].pageX, e.touches[0].pageY,\n e.touches[1].pageX, e.touches[1].pageY\n );\n }\n let element = $(e.target);\n if(element.attr('handle') != undefined){\n let box = this.elements[element.attr('handle')];\n if(box != undefined){\n let x = e.touches[0].pageX - this.canvas.offsetLeft;\n let y = e.touches[0].pageY - this.canvas.offsetTop;\n this.onTouchStart(e, x, y, box);\n box.onTouchStart(e, x, y);\n }\n }\n }", "function hasTap() {\n //Enure we dont return 0 or null for false values\n return !!(options.tap) ;\n }", "onElementTouchStart(event) {\n const me = this;\n DomHelper.isTouchEvent = true;\n\n if (event.touches.length === 1) {\n me.longPressTimeout = me.setTimeout(() => {\n me.onElementLongPress(event);\n event.preventDefault();\n me.longPressPerformed = true;\n }, me.longPressTime);\n }\n }", "function tap ( event ) {\n\n\t\tvar location = event.calcPoint, total = 0, to;\n\n\t\t// The tap event shouldn't propagate up and cause 'edge' to run.\n\t\tevent.stopPropagation();\n\n\t\t// Add up the handle offsets.\n\t\t$.each( $Handles, function(){\n\t\t\ttotal += this.offset()[ options.style ];\n\t\t});\n\n\t\t// Find the handle closest to the tapped position.\n\t\ttotal = ( location < total/2 || $Handles.length === 1 ) ? 0 : 1;\n\n\t\tlocation -= $Base.offset()[ options.style ];\n\n\t\t// Calculate the new position.\n\t\tto = ( location * 100 ) / baseSize();\n\n\t\tif ( !options.events.snap ) {\n\t\t\t// Flag the slider as it is now in a transitional state.\n\t\t\t// Transition takes 300 ms, so re-enable the slider afterwards.\n\t\t\taddClassFor( $Target, Classes[14], 300 );\n\t\t}\n\n\t\t// Find the closest handle and calculate the tapped point.\n\t\t// The set handle to the new position.\n\t\tsetHandle( $Handles[total], to );\n\n\t\tfireEvents(['slide', 'set', 'change']);\n\n\t\tif ( options.events.snap ) {\n\t\t\tstart(event, { handles: [$Handles[total]] });\n\t\t}\n\t}", "function tap(event, Dt, Op) {\n\n var base = Dt.base, handle, to, point, size;\n\n // The tap event shouldn't propagate up to trigger 'edge'.\n event.stopPropagation();\n\n // Determine the direction of the slider.\n if (Op['orientation']) {\n point = event['pointY'];\n size = base.height();\n } else {\n point = event['pointX'];\n size = base.width();\n }\n\n // Find the closest handle and calculate the tapped point.\n handle = closestHandle(base.data('handles'), point, Op['style']);\n to = ((point - base.offset()[Op['style']]) * 100) / size;\n\n // The set handle to the new position.\n jump(base, handle, to, [Op['slide'], Op['set']]);\n }" ]
[ "0.6388834", "0.63887924", "0.63812184", "0.63665843", "0.63515943", "0.63515943", "0.6349454", "0.6349454", "0.61960065", "0.61768955", "0.613956", "0.60155743", "0.5928694", "0.5851225", "0.5848998", "0.5831584", "0.58311546", "0.5817547", "0.5781555", "0.5781555", "0.57556236", "0.5723784", "0.57106954", "0.5658239", "0.5654899", "0.5654121", "0.56292313", "0.56285274", "0.56285274", "0.56285274", "0.5627469", "0.5627469", "0.5627469", "0.5627469", "0.5627469", "0.5627469", "0.5627469", "0.5624439", "0.5619742", "0.5619742", "0.5619742", "0.5597504", "0.5595889", "0.55678076", "0.55579567", "0.5552616", "0.5532192", "0.5522623", "0.55077386", "0.5503815", "0.5491052", "0.54874986", "0.5486432", "0.54810315", "0.54810315", "0.54703516", "0.54441416", "0.5416496", "0.5416496", "0.5416496", "0.54060775", "0.5394511", "0.53866935", "0.53866935", "0.53866935", "0.53724647", "0.5368822", "0.536089", "0.534442", "0.534403", "0.53436506", "0.53393865", "0.5332259", "0.53255284", "0.53154826", "0.53115237", "0.53115237", "0.53115237", "0.53115237", "0.53115237", "0.53068465", "0.5294852", "0.5274755", "0.5274755", "0.5269532", "0.5242893", "0.5242535", "0.524203", "0.52336156", "0.5202191", "0.5189751", "0.51872605", "0.5186856", "0.5186326", "0.51630163", "0.5160551", "0.5160206", "0.5152303", "0.5137442", "0.5129421", "0.5126925" ]
0.0
-1
Checks a list of allowable regions against a click location. Returns true if the click should be allowed. Splices out the allowable region from the list after it has been used.
function checkAllowableRegions(touchCoordinates, x, y) { for (var i = 0; i < touchCoordinates.length; i += 2) { if (hit(touchCoordinates[i], touchCoordinates[i + 1], x, y)) { touchCoordinates.splice(i, i + 2); return true; // allowable region } } return false; // No allowable region; bust it. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkAllowableRegions(touchCoordinates, x, y) {\n for (var i = 0; i < touchCoordinates.length; i += 2) {\n if (hit(touchCoordinates[i], touchCoordinates[i+1], x, y)) {\n touchCoordinates.splice(i, i + 2);\n return true; // allowable region\n }\n }\n return false; // No allowable region; bust it.\n }", "function checkAllowableRegions(touchCoordinates, x, y) {\n for (var i = 0; i < touchCoordinates.length; i += 2) {\n if (hit(touchCoordinates[i], touchCoordinates[i + 1], x, y)) {\n touchCoordinates.splice(i, i + 2);\n return true; // allowable region\n }\n }\n return false; // No allowable region; bust it.\n }", "function checkAllowableRegions(touchCoordinates, x, y) {\n for (var i = 0; i < touchCoordinates.length; i += 2) {\n if (hit(touchCoordinates[i], touchCoordinates[i + 1], x, y)) {\n touchCoordinates.splice(i, i + 2);\n return true; // allowable region\n }\n }\n return false; // No allowable region; bust it.\n }", "function checkAllowableRegions(touchCoordinates, x, y) {\n for (var i = 0; i < touchCoordinates.length; i += 2) {\n if (hit(touchCoordinates[i], touchCoordinates[i + 1], x, y)) {\n touchCoordinates.splice(i, i + 2);\n return true; // allowable region\n }\n }\n return false; // No allowable region; bust it.\n }", "function checkAllowableRegions(touchCoordinates, x, y) {\n for (var i = 0; i < touchCoordinates.length; i += 2) {\n if (hit(touchCoordinates[i], touchCoordinates[i + 1], x, y)) {\n touchCoordinates.splice(i, i + 2);\n return true; // allowable region\n }\n }\n return false; // No allowable region; bust it.\n }", "function checkAllowableRegions(touchCoordinates, x, y) {\n for (var i = 0; i < touchCoordinates.length; i += 2) {\n if (hit(touchCoordinates[i], touchCoordinates[i + 1], x, y)) {\n touchCoordinates.splice(i, i + 2);\n return true; // allowable region\n }\n }\n return false; // No allowable region; bust it.\n }", "function checkAllowableRegions(touchCoordinates, x, y) {\n for (var i = 0; i < touchCoordinates.length; i += 2) {\n if (hit(touchCoordinates[i], touchCoordinates[i + 1], x, y)) {\n touchCoordinates.splice(i, i + 2);\n return true; // allowable region\n }\n }\n return false; // No allowable region; bust it.\n }", "canPlace(cursor, items) {\n return (\n items.length === 1 &&\n [29, 30, 39, 40].includes(items[0].tile) &&\n cursor.dir === items[0].dir\n );\n }", "clickWithinBoundsHandler(event){\n const offsetLeft = document.getElementById(\"canvas\").offsetLeft;\n const offsetTop = document.getElementById(\"canvas\").offsetTop;\n\n if (\n event.clientX-offsetLeft >= this.bounds.xMin\n && event.clientX-offsetLeft <= this.bounds.xMax\n && event.clientY-offsetTop >= this.bounds.yMin\n && event.clientY-offsetTop <= this.bounds.yMax\n ) {\n // executes the action that was registered for these boundaries, then resets them\n this.bounds.action();\n this.bounds = {};\n }\n }", "detectClicks() {\n if (\n hand.x > this.x &&\n hand.y > this.y &&\n hand.x < this.x + this.markerW &&\n hand.y < this.y + this.markerH\n ) {\n return true;\n } else {\n return false;\n }\n }", "function check_event_clicks(click) {\n for (var i = 0; i < event_array.length; i++) {\n var event = event_array[i];\n var yd = click.y - event.y;\n var xd = click.x - event.x;\n if ((yd < event_dimensions) && (xd < event_dimensions)) {\n if ((yd > (0-event_dimensions)) && (xd > (0-event_dimensions))) {\n click_event(event);\n }\n }\n }\n}", "function inAirOpRange(startZone) {\n var zonesOut = searchGrid.zoneDistance(startZone, selectedZone);\n if (zonesOut <= (AIROP_RANGE / 2)) {\n return true; // able to return from whence they came\n } else {\n for (var i = 0; i < landingZones.length; i++) {\n var zonesBack = searchGrid.zoneDistance(selectedZone, landingZones[i]);\n if (zonesOut + zonesBack <= AIROP_RANGE) return true; //able to land somewhere else\n }\n return false;\n }\n}", "function locationIsAccessable (dest, source, places) {\n if (dest === undefined) {\n return false\n }\n if (places[source.ahead] === dest) {\n return true\n }\n if (places[source.behind] === dest) {\n return true\n }\n if (places[source.right] === dest) {\n return true\n }\n if (places[source.left] === dest) {\n return true\n }\n if (places[source.above] === dest) {\n return true\n }\n if (places[source.below] === dest) {\n return true\n }\n return false\n}", "function confirmSlice(y1, x1, y2, x2) {\n\tsliceArray.push([y1, x1, y2, x2]);\n\t\n\t// set the values in the isInSlice array\n\tfor (let y = y1; y <= y2; y++) {\n\t\tfor (let x = x1; x <= x2; x++) {\n\t\t\tif (isInSlice[y][x] === false) {\n\t\t\t\t// everything has gone as planned\n\t\t\t\tisInSlice[y][x] = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.error(\"Uh oh, an invalid slice has been confirmed.\");\n\t\t\t}\n\t\t}\n\t}\n}", "boundsCheck(xM, yM, x, y, w, h){ \n if(xM > x && xM < x + w && yM > y && yM < y+ h){\n return true; //mouse in boundary \n }else{\n return false; //mouse not in boundary \n } \n}", "function checkRegion(regList, plReg) {\n return ~plReg.indexOf(regList);\n }", "function checkCoords(){\n if (parseInt($('#w').val())) return true;\n alert('Please select a crop region then press submit.');\n return false;\n }", "function blocksChecker(randomX, y) {\n blocks.forEach(block => {\n let firstCornerCheck = checkInside(block.x, block.y, block.bWidth, 40, randomX - 20, y + 25)\n let secondCornerCheck = checkInside(block.x, block.y, block.bWidth, 40, randomX + 40, y + 25)\n let thirdCornerCheck = checkInside(block.x, block.y, block.bWidth, 40, randomX - 20, y - 25)\n let fourthCornerCheck = checkInside(block.x, block.y, block.bWidth, 40, randomX + 40, y - 25)\n if (firstCornerCheck || secondCornerCheck || thirdCornerCheck || fourthCornerCheck) {\n return true\n }\n })\n}", "function checkBounds() {\n\t\t\t// Perform the check and return if OK\n\t\t\tif (allowedBounds.contains(map.getCenter())) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// It`s not OK, so find the nearest allowed point and move there\n\t\t\tvar C = map.getCenter();\n\t\t\tvar X = C.lng();\n\t\t\tvar Y = C.lat();\n\n\t\t\tvar AmaxX = allowedBounds.getNorthEast().lng();\n\t\t\tvar AmaxY = allowedBounds.getNorthEast().lat();\n\t\t\tvar AminX = allowedBounds.getSouthWest().lng();\n\t\t\tvar AminY = allowedBounds.getSouthWest().lat();\n\n\t\t\tif (X < AminX) {X = AminX;}\n\t\t\tif (X > AmaxX) {X = AmaxX;}\n\t\t\tif (Y < AminY) {Y = AminY;}\n\t\t\tif (Y > AmaxY) {Y = AmaxY;}\n\t\t\t//alert (\"Restricting \"+Y+\" \"+X);\n\t\t\tmap.setCenter(new GLatLng(Y,X));\n\t\t}", "function checkBounds() {\n // Perform the check and return if OK\n if (allowedBounds.contains(map.getCenter())) {\n return;\n }\n // It`s not OK, so find the nearest allowed point and move there\n var C = map.getCenter();\n var X = C.lng();\n var Y = C.lat();\n\n var AmaxX = allowedBounds.getNorthEast().lng();\n var AmaxY = allowedBounds.getNorthEast().lat();\n var AminX = allowedBounds.getSouthWest().lng();\n var AminY = allowedBounds.getSouthWest().lat();\n\n if (X < AminX) {X = AminX;}\n if (X > AmaxX) {X = AmaxX;}\n if (Y < AminY) {Y = AminY;}\n if (Y > AmaxY) {Y = AmaxY;}\n //alert (\"Restricting \"+Y+\" \"+X);\n map.setCenter(new GLatLng(Y,X));\n }", "boundsCheck(xM, yM, x, y, w, h){ \n if(xM > x && xM < x + w && yM > y && yM < y+ h){\n return true; //mouse in boundary \n }else{\n return false; //mouse not in boundary\n }\n }", "clickAble(x, y) {\n let d = dist(x, y, this.x, this.y);\n if (d < this.r) {\n return true;\n } else {\n return false;\n }\n }", "clickAble(x, y) {\n let d = dist(x, y, this.x, this.y);\n if (d < this.r) {\n return true;\n } else {\n return false;\n }\n }", "clickAble(x, y) {\n let d = dist(x, y, this.x, this.y);\n if (d < this.r) {\n return true;\n } else {\n return false;\n }\n }", "function checkByCoordinates(nodeList) {\n let approved = [];\n nodeList.forEach((nodeLocation) => {\n if (nodeLocation[0] >= 0 && nodeLocation[0] < height && nodeLocation[1] >= 0 && nodeLocation[1] < width) {\n let NodeId = nodeLocation[0] + '-' + nodeLocation[1]\n approved.push(nodeLocation);\n }\n });\n return approved;\n }", "function checkVictoryClick() {\n\t// Dazu muss die gesamte Matrix durchlaufen werden\n\tfor(var i = 0; i < arrayDimensionLine; i++) {\n\t\tfor(var j = 0; j < arrayDimensionColumn; j++) {\n\t\t\t// Und fuer jede Zelle muss geprueft werden, ob sie auf der Map ist\n\t\t\tif(hexatileOnMap(i,j))\n\t\t\t\t// Dann wird geprueft, ob diese Zelle noch verdeckt und keine Mine ist\n\t\t\t\tif(!gameField[i][j].isOpen && !gameField[i][j].isMine)\n\t\t\t\t\t// in diesem Fall hat man noch nicht durch aufdecken aller leeren Felder gewonnen\n\t\t\t\t\treturn false;\n\t\t}\n\t}\n\n\t// An dieser Stelle ist klar, dass alle leeren Felder aufgedeckt wurden \n\treturn true;\n}", "function checkBounds() {\n // return;\n // Perform the check and return if OK\n if (allowedBounds.contains(map.getCenter())) {\n return;\n }\n // It`s not OK, so find the nearest allowed point and move there\n var C = map.getCenter();\n var X = C.lng();\n var Y = C.lat();\n\n // var AmaxX = allowedBounds.getNorthEast().lng();\n var AmaxY = allowedBounds.getNorthEast().lat();\n // var AminX = allowedBounds.getSouthWest().lng();\n var AminY = allowedBounds.getSouthWest().lat();\n\n // if (X < AminX) {X = AminX;}\n // if (X > AmaxX) {X = AmaxX;}\n if (Y < AminY) {Y = AminY;}\n if (Y > AmaxY) {Y = AmaxY;}\n //alert (\"Restricting \"+Y+\" \"+X);\n map.setCenter(new google.maps.LatLng(Y,X));\n } // checkBounds", "function isBrushed(brush_coords, cx, cy) {\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 //console.log(cx);\n //console.log(cy2);\n return (\n x0 <= cx && cx <= x1 && y0 <= cy && cy <= y1 //|| (y0 <= cy2 && cy2 <= y1))\n ); // This return TRUE or FALSE depending on if the points is in the selected area\n }", "function isInside(refferenceItemCoordonates, itemCoordonates) {\n // Down reference y point\n const down_refferece_y_point = refferenceItemCoordonates[leftBottomCornerIndex][__y] > refferenceItemCoordonates[rightBottomCornerIndex][__y] ?\n refferenceItemCoordonates[leftBottomCornerIndex][__y] :\n refferenceItemCoordonates[rightBottomCornerIndex][__y];\n // Up reference y point\n const up_refferece_y_point = refferenceItemCoordonates[leftTopCornerIndex][__y] > refferenceItemCoordonates[rightTopCornerIndex][__y] ?\n refferenceItemCoordonates[leftTopCornerIndex][__y] :\n refferenceItemCoordonates[rightTopCornerIndex][__y];\n\n // Down item y point\n const down_item_y_point = itemCoordonates[leftBottomCornerIndex][__y] > itemCoordonates[rightBottomCornerIndex][__y] ?\n itemCoordonates[leftBottomCornerIndex][__y] :\n itemCoordonates[rightBottomCornerIndex][__y];\n // Up item y point\n const up_item_y_point = itemCoordonates[leftTopCornerIndex][__y] > itemCoordonates[rightTopCornerIndex][__y] ?\n itemCoordonates[leftTopCornerIndex][__y] :\n itemCoordonates[rightTopCornerIndex][__y];\n\n //check item position to the refference\n const isItemUpper = down_refferece_y_point >= down_item_y_point && up_refferece_y_point >= up_item_y_point;\n\n const isVerticeInBetween = (down_refferece_y_point >= down_item_y_point &&\n up_refferece_y_point <= down_item_y_point) ||\n (down_refferece_y_point >= up_item_y_point &&\n up_refferece_y_point <= up_item_y_point);\n\n const isItemLower = down_refferece_y_point <= down_item_y_point &&\n up_refferece_y_point <= up_item_y_point;\n\n const isItemInBetween = (down_refferece_y_point >= down_item_y_point &&\n up_refferece_y_point <= down_item_y_point &&\n down_refferece_y_point >= up_item_y_point &&\n up_refferece_y_point <= up_item_y_point);\n\n const isRefferenceInBetween = (down_refferece_y_point <= down_item_y_point &&\n up_refferece_y_point <= down_item_y_point &&\n down_refferece_y_point >= up_item_y_point &&\n up_refferece_y_point >= up_item_y_point);\n\n return ((isItemLower && isVerticeInBetween) || (isItemUpper && isVerticeInBetween) || isItemInBetween || isRefferenceInBetween);\n}", "function checkSlice(chkLoc, cakeGrid, possSlice) {\n let chkSlice = cakeGrid\n .slice(chkLoc[1], chkLoc[1] + possSlice[1])\n .map(row => row.slice(chkLoc[0], chkLoc[0] + possSlice[0]))\n let pattern = /[o]/g;\n chkRaisins = chkSlice.join('').match(pattern);\n if (!chkRaisins ||\n chkRaisins.length > 1 ||\n chkLoc[0] + possSlice[0] > cakeGrid[0].length ||\n chkLoc[1] + possSlice[1] > cakeGrid.length) {\n return false;\n } else {\n return true;\n }\n}", "function isClicked(clickedAbsolutePosition, targetRectangle, canvas, documentBody) {\n var x = getRelativePosition(clickedAbsolutePosition.x, canvas.offsetLeft, documentBody.scrollLeft);\n var y = getRelativePosition(clickedAbsolutePosition.y, canvas.offsetTop, documentBody.scrollTop);\n return isWithin(x, targetRectangle.minX, targetRectangle.maxX) && isWithin(y, targetRectangle.minY, targetRectangle.maxY);\n }", "isInBounds(x, y, r = 5)\n\t{\n\t\tlet camera = this.tree.camera;\n\t\tlet zoom = camera.zoomSmooth;\n\n\t\tlet pos = this.posSmooth.toScreen(camera);\n\t\tlet width = this.width * zoom;\n\t\tlet height = this.height * zoom;\n\n\t\treturn x >= pos.x - r && x < pos.x + width + r && y >= pos.y - r\n\t\t\t&& y < pos.y + height + r;\n\t}", "_inSelection(x, y) {\n const that = this,\n dimensionValues = that._coordinates;\n let validation = true,\n xDimension, yDimension, boundX, boundY;\n\n if (that.arrayIndexingMode === 'LabVIEW') {\n xDimension = that.dimensions - 1;\n yDimension = that.dimensions - 2;\n }\n else {\n xDimension = 0;\n yDimension = 1;\n }\n\n if (!that._oneDimensionSpecialCase) {\n boundX = x + dimensionValues[xDimension];\n boundY = y + dimensionValues[yDimension];\n }\n else {\n boundX = y + dimensionValues[xDimension];\n }\n\n if (that.dimensions === 1) {\n if (boundX >= that._absoluteSelectionStart[xDimension] && boundX <= that._absoluteSelectionEnd[xDimension]) {\n return true;\n }\n else {\n return false;\n }\n }\n\n if (boundX >= that._absoluteSelectionStart[xDimension] &&\n boundX <= that._absoluteSelectionEnd[xDimension] &&\n boundY >= that._absoluteSelectionStart[yDimension] &&\n boundY <= that._absoluteSelectionEnd[yDimension]) {\n validation = true;\n }\n else {\n validation = false;\n }\n\n if (that.arrayIndexingMode === 'LabVIEW') {\n for (let i = 0; i < yDimension; i++) {\n validation = validation && (dimensionValues[i] >= that._absoluteSelectionStart[i] && dimensionValues[i] <= that._absoluteSelectionEnd[i]);\n }\n }\n else {\n for (let j = 2; j < that.dimensions; j++) {\n validation = validation && (dimensionValues[j] >= that._absoluteSelectionStart[j] && dimensionValues[j] <= that._absoluteSelectionEnd[j]);\n }\n }\n\n return validation;\n }", "function canOccupySlice(decorations,start,end){for(var ii=start;ii<end;ii++){if(decorations[ii]!=null){return false;}}return true;}", "function checkcollectables(t_collectable)\n{\n\tif(dist(gameChar_world_x, gameChar_y -30 , t_collectable.x_pos, t_collectable.y_pos) < 30)\n\t{\n\t\tt_collectable.isFound = true;\n\t\tconsole.log(\"is true statement\", gameChar_world_x)\n\t}\n\t\n\n}", "function mousePosIsInSelectableArea(pos) {\n\t\tif(pos.x > leftMarg - 2 && pos.x <= leftMarg + drawW + 2 && pos.y > topMarg - 2 && pos.y <= topMarg + drawH + 2) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "is_clicked(image, event) {\n var width = image.width\n var height = image.height\n var begin_x = image.x\n var begin_y = image.y\n var end_x = begin_x + width\n var end_y = begin_y + height \n var buffer = 10\n var click_x = event.offsetX\n var click_y = event.offsetY\n var has_been_clicked = false\n\n if (click_x >= begin_x - buffer && click_x <= end_x + buffer && click_y >= begin_y - buffer && click_y <= end_y + buffer) {\n has_been_clicked = true\n } else {\n has_been_clicked = false\n }\n\n return has_been_clicked\n }", "function isInside(curs, dropTarget){\n\t // check for x, then y.\n\tvar dt_x = dropTarget.getX(), dt_y = dropTarget.getY();\n\t\n\treturn (curs.x >= dt_x && curs.x < dt_x + dropTarget.getWidth())\n\t\t&& // now check for y.\n\t\t(curs.y >= dt_y && curs.y < dt_y + dropTarget.getHeight());\n}", "function checkBoxIsWithinBounds(xml, coordinates) {\n\tif (xml.getAttribute('min_lat') * 1 > coordinates.getSouth(),\n\t\txml.getAttribute('min_lon') * 1 > coordinates.getWest(),\n\t\txml.getAttribute('max_lat') * 1 < coordinates.getNorth(),\n\t\txml.getAttribute('max_lon') * 1 < coordinates.getEast()) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "function inBounds(xMouse, yMouse, x,y,width, height){\r\n if(xMouse > x &&\r\n xMouse < x+width &&\r\n yMouse > y &&\r\n yMouse < y+height){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }", "isAllowed(...args) {\n const perimeter = this._sandbox.getPerimeter(this._name);\n\n return perimeter.hasOwnGoverness() ?\n perimeter.isAllowed(...args) :\n perimeter.purposeGoverness.isAllowed(...args);\n }", "function areCoordinatesInBounds (body) {\n var coordsValid = isMarkerInSFRectangleBoundary(parseFloat(body['loc_lat']), parseFloat(body['loc_long']))\n if (coordsValid) {\n console.log('coord in SF: pass')\n return true\n } else {\n console.log('coord in SF: fail')\n return false\n }\n}", "clickedOn(xPos, yPos) {\n return(xPos > this.x && xPos < this.x + this.w && yPos > this.y && yPos < this.y +this.w);\n }", "function checkAllShipsPlaced() {\n for (var p = 0; p < this.game.PLAYERS; p++) {\n for (var s = 0; s < fleet[p].length; s++) {\n\n if (fleet[p][s].length != fleet[p][s].coords.length) return false;\n\n for (var c = 0; c < fleet[p][s].coords.length; c++) {\n coords = fleet[p][s].coords[c];\n \n if (typeof layout[p][coords] == 'undefined') {\n return false;\n };\n }\n\n }\n }\n return true;\n }", "function getIsInPiecewiseRange(dataExtent, pieceList, selected) {\n var dataSpan = dataExtent[1] - dataExtent[0];\n pieceList = zrUtil.map(pieceList, function (piece) {\n return {\n interval: [(piece.interval[0] - dataExtent[0]) / dataSpan, (piece.interval[1] - dataExtent[0]) / dataSpan]\n };\n });\n var len = pieceList.length;\n var lastIndex = 0;\n return function (val) {\n // Try to find in the location of the last found\n for (var i = lastIndex; i < len; i++) {\n var interval = pieceList[i].interval;\n\n if (interval[0] <= val && val <= interval[1]) {\n lastIndex = i;\n break;\n }\n }\n\n if (i === len) {\n // Not found, back interation\n for (var i = lastIndex - 1; i >= 0; i--) {\n var interval = pieceList[i].interval;\n\n if (interval[0] <= val && val <= interval[1]) {\n lastIndex = i;\n break;\n }\n }\n }\n\n return i >= 0 && i < len && selected[i];\n };\n}", "function getIsInPiecewiseRange(dataExtent, pieceList, selected) {\n var dataSpan = dataExtent[1] - dataExtent[0];\n pieceList = zrUtil.map(pieceList, function (piece) {\n return {\n interval: [(piece.interval[0] - dataExtent[0]) / dataSpan, (piece.interval[1] - dataExtent[0]) / dataSpan]\n };\n });\n var len = pieceList.length;\n var lastIndex = 0;\n return function (val) {\n // Try to find in the location of the last found\n for (var i = lastIndex; i < len; i++) {\n var interval = pieceList[i].interval;\n\n if (interval[0] <= val && val <= interval[1]) {\n lastIndex = i;\n break;\n }\n }\n\n if (i === len) {\n // Not found, back interation\n for (var i = lastIndex - 1; i >= 0; i--) {\n var interval = pieceList[i].interval;\n\n if (interval[0] <= val && val <= interval[1]) {\n lastIndex = i;\n break;\n }\n }\n }\n\n return i >= 0 && i < len && selected[i];\n };\n}", "function getIsInPiecewiseRange(dataExtent, pieceList, selected) {\n var dataSpan = dataExtent[1] - dataExtent[0];\n pieceList = zrUtil.map(pieceList, function (piece) {\n return {\n interval: [(piece.interval[0] - dataExtent[0]) / dataSpan, (piece.interval[1] - dataExtent[0]) / dataSpan]\n };\n });\n var len = pieceList.length;\n var lastIndex = 0;\n return function (val) {\n // Try to find in the location of the last found\n for (var i = lastIndex; i < len; i++) {\n var interval = pieceList[i].interval;\n\n if (interval[0] <= val && val <= interval[1]) {\n lastIndex = i;\n break;\n }\n }\n\n if (i === len) {\n // Not found, back interation\n for (var i = lastIndex - 1; i >= 0; i--) {\n var interval = pieceList[i].interval;\n\n if (interval[0] <= val && val <= interval[1]) {\n lastIndex = i;\n break;\n }\n }\n }\n\n return i >= 0 && i < len && selected[i];\n };\n}", "function isBrushed(brush_coords, cx, cy) {\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 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 }", "function validClick(x,y){\n if (compArray[x][y] == 0 || compArray[x][y] == 2) return true;\n else return false \n}", "function inRange(cx, cy, r, mouseX, mouseY){\n\t//verifica se o mouse esta dentro da area(quadrada) do circulo\n\tif(cx-r <= mouseX && mouseX <= cx+r && cy-r <= mouseY && mouseY <= cy+r){\n\t\treturn true;\n\t}\n\treturn false;\n}", "function isBrushed(brush_coords, cx, cy) {\n if(brush_coords==null){\n return false;\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 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 }", "checkOptionsWithinRange (e) {\n // helper function to create our of range list of options and it's min and max value\n let maxAndMinInput = (option) => {\n let currOptionIndex = _.findIndex(this.state.itemOptions, {'name': `${option}`});\n return ` ${option}: min = ${this.state.itemOptions[currOptionIndex].min} max = ${this.state.itemOptions[currOptionIndex].max}`;\n };\n\n let copySelectionStorage = Object.assign({}, this.state.selectionStorage);\n let inRangeItemList = [];\n let outOfRangeOptionList = [];\n for (let key in copySelectionStorage) {\n let currMainOption = this.state.itemOptions[_.findIndex(this.state.itemOptions, {'name': `${key}`})];\n // check each option selection if it is with-in range\n if (copySelectionStorage[key].length <= currMainOption.max && copySelectionStorage[key].length >= currMainOption.min) {\n // if with-in rage, create the items list\n while (!copySelectionStorage[key].isEmpty()) {\n inRangeItemList.push(copySelectionStorage[key].dequeue());\n }\n // otherwise create the out of range item list\n } else {\n outOfRangeOptionList.push(key);\n }\n }\n // if there are items in the out of range list, aleart out of range options, otherwise log all option's item list\n return outOfRangeOptionList.length === 0 ? window.alert(`These are your selected items: [${inRangeItemList.toString()}]`) : window.alert(`You are not with-in rage for these options: [${_.map(outOfRangeOptionList, maxAndMinInput)}]`);\n }", "function isBrushed(brush_coords, cx, cy) {\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 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 }", "checkForClickedTiles(xoffset, yoffset)\n {\n var adjusted_mouse_position = {x: xoffset, y: yoffset};\n\n var bFoundObject = false;\n for (var i = 0; i < this.component_list.length; i++)\n {\n var elem = this.component_list[i];\n if (elem instanceof Entity)\n {\n /////////////////////////////////////////\n // Clicked a tile inside the component //\n // but not the scrollbars //\n /////////////////////////////////////////\n if (checkPointCollision(elem , adjusted_mouse_position)\n && !checkPointCollision(this.horizontal_scrollbar, adjusted_mouse_position)\n && !checkPointCollision(this.vertical_scrollbar , adjusted_mouse_position))\n {\n bFoundObject = true; \n this.selectedObject = elem;\n mouseselectedentity = addTile(mousepos.x, mousepos.y, getTileByName(this.selectedObject.name));\n mousedif = {x: mousepos.x - mouseselectedentity.pos.x, y: mousepos.y - mouseselectedentity.pos.y};\n break;\n }\n }\n else\n {\n elem.update();\n }\n }\n ///////////////////////////////////////////\n // Unclicked a tile inside the component //\n ///////////////////////////////////////////\n if (false == bFoundObject)\n {\n this.selectedObject = null;\n }\n }", "isInBounds() {\n\n if(this.position['x'] >= SnakeGame.NUM_COLS) {\n return false;\n }else if(this.position['x'] < 0) {\n return false;\n }else if(this.position['y'] >= SnakeGame.NUM_ROWS) {\n return false;\n }else if(this.position['y'] < 0) {\n return false;\n }\n\n return true;\n\n }", "function isBrushed(brush_coords, cx, cy) {\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 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 }", "function isBrushed(brush_coords, cx, cy) {\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 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 }", "inTileBounds () {\n let min = [ this.aabb[0], this.aabb[1] ];\n let max = [ this.aabb[2], this.aabb[3] ];\n\n if (!Utils.pointInTile(min) || !Utils.pointInTile(max)) {\n return false;\n }\n\n return true;\n }", "isCoveredBy(ranges: Interval[]): boolean {\n var remaining = this.clone();\n for (var i = 0; i < ranges.length; i++) {\n var r = ranges[i];\n if (i && r.start < ranges[i - 1].start) {\n throw 'isCoveredBy must be called with sorted ranges';\n }\n if (r.start > remaining.start) {\n return false; // A position has been missed and there's no going back.\n }\n remaining.start = r.stop + 1;\n if (remaining.length() <= 0) {\n return true;\n }\n }\n return false;\n }", "function inBounds(x, y){\r\n\t\t\t\tvar bounds = courseSlot.courseBox.getBoundingClientRect();\r\n\t\t\t\tif (x > bounds.left && x < bounds.right && y > bounds.top && y < bounds.bottom)\r\n\t\t\t\t\treturn true;\r\n\t\t\t\telse\r\n\t\t\t\t\treturn false;\r\n\t\t\t}", "function validate_click(posClicked) {\r\n for(var i = 0;i<$scope.movidasPosibles.length;i++){\r\n var pos = JSON.parse(\"[\" + posClicked + \"]\");\r\n if($scope.movidasPosibles[i][0]===pos[0] && $scope.movidasPosibles[i][1] ===pos[1]){\r\n $scope.http_request.body.x = pos[0];//guarda las posiciones clickeadas\r\n $scope.http_request.body.y = pos[1];//al final se va mantener siempre una posicion guardada\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "async isAddressAllowed() {\n try {\n await this.addressFilter(...arguments);\n return true;\n }\n catch(err) {\n if(err instanceof errors.AccessError) {\n return false;\n }\n\n throw err;\n }\n }", "isElementAllowed(parent, event) {\n if (this._overlayToIgnore?.size > 0) {\n for (const element of event.path) {\n if (element.id && this._overlayToIgnore.has(element.id)) {\n return true;\n }\n }\n }\n \n return this.isElementContained(parent, event);\n }", "intersects(bounds) {\n // Some size & offset adjustments to allow passage with bigger icon\n return this.sprite.offsetLeft + this.sprite.clientWidth - 20 > bounds.x\n && this.sprite.offsetLeft + 10 < bounds.x + bounds.width\n && this.sprite.offsetTop + this.sprite.clientHeight - 20 > bounds.y\n && this.sprite.offsetTop + 10 < bounds.y + bounds.height;\n }", "function isSelectionSpanAllowed(span) {\n\t\treturn isSpanAllowed(span, options.selectConstraint, options.selectOverlap);\n\t}", "function getIsInPiecewiseRange(dataExtent, pieceList, selected) {\n var dataSpan = dataExtent[1] - dataExtent[0];\n pieceList = util[\"H\" /* map */](pieceList, function (piece) {\n return {\n interval: [(piece.interval[0] - dataExtent[0]) / dataSpan, (piece.interval[1] - dataExtent[0]) / dataSpan]\n };\n });\n var len = pieceList.length;\n var lastIndex = 0;\n return function (val) {\n var i; // Try to find in the location of the last found\n\n for (i = lastIndex; i < len; i++) {\n var interval = pieceList[i].interval;\n\n if (interval[0] <= val && val <= interval[1]) {\n lastIndex = i;\n break;\n }\n }\n\n if (i === len) {\n // Not found, back interation\n for (i = lastIndex - 1; i >= 0; i--) {\n var interval = pieceList[i].interval;\n\n if (interval[0] <= val && val <= interval[1]) {\n lastIndex = i;\n break;\n }\n }\n }\n\n return i >= 0 && i < len && selected[i];\n };\n}", "function find_if_robot_is_present(loc, list) {\n for (var i = 0; i < list.length; i++) {\n if (list[i].x === loc[0] && list[i].y === loc[1]) {\n return false;\n }\n }\n return true;\n}", "checkSides() {\n return !( //Checks if any of the blocks hit the right side of the screen.\n this.x + this.activeshape[this.rotation][0].x >= this.canvaswidth / this.blockSize ||\n this.x + this.activeshape[this.rotation][1].x >= this.canvaswidth / this.blockSize ||\n this.x + this.activeshape[this.rotation][2].x >= this.canvaswidth / this.blockSize ||\n this.x + this.activeshape[this.rotation][3].x >= this.canvaswidth / this.blockSize ||\n\n //Checks if any of the blocks hit the left side of the screen.\n this.x + this.activeshape[this.rotation][0].x < 0 ||\n this.x + this.activeshape[this.rotation][1].x < 0 ||\n this.x + this.activeshape[this.rotation][2].x < 0 ||\n this.x + this.activeshape[this.rotation][3].x < 0\n );\n }", "function card_contains(card_loc,x,y) { //Returns whether (x,y) on the canvas is 'within' the card \r\n if (card_loc == 0) {\r\n curr_card_loc = left_card_loc; \r\n } else {\r\n curr_card_loc = right_card_loc; \r\n }\r\n return x >= curr_card_loc && x <= curr_card_loc + card_width && y >= card_offset && y <= card_offset + card_height; \r\n }", "function isFeatureClicked(rings, point) {\n for (let i = 0; i < rings.length; i++) {\n if (inside(point, rings[i])) {\n // Point is in an exterior ring\n // Check whether point is in any interior rings\n let inInteriorRing = false;\n while (i + 1 < rings.length && !isExteriorRing(rings[i + 1])) {\n i++;\n if (!inInteriorRing && inside(point, rings[i])) {\n inInteriorRing = true;\n // Don't break. Still need to iterate over the rest of the interior rings but don't do point-in-polygon tests on those\n }\n }\n // Point is in exterior ring, but not in any interior ring. Therefore point is in the feature region\n if (!inInteriorRing) {\n return true;\n }\n }\n }\n return false;\n}", "hit(meteor) {\n let corners = calculateCorners(meteor);\n for (let i = 0; i < 4; i++) {\n if (containsPoint(this, corners[i * 2], corners[i * 2 + 1])) {\n return true;\n }\n }\n return false;\n }", "inBounds() {\n if (this.pos.x <= -50 || this.pos.x > 690 || this.pos.y <= -50 || this.pos.y > 690) {\n this.active = false;\n }\n }", "function isBrushed(brush_coords, cx, cy) {\n if (brush_coords === null)\n {\n return false\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 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 }", "function isHowToClicked(x,y) {\n return x >= buttonX - buttonWidth/2 &&\n x <= buttonX + buttonWidth/2 &&\n y >= buttonY - buttonHeight/2 &&\n y <= buttonY + buttonHeight/2;\n\n}", "_isClickInSelection(event) {\n const coords = this._getMouseBufferCoords(event);\n const start = this._model.finalSelectionStart;\n const end = this._model.finalSelectionEnd;\n if (!start || !end || !coords) {\n return false;\n }\n return this._areCoordsInSelection(coords, start, end);\n }", "function selectionCheck(selections, left, right) {\n for (var i = 0; i < selections.length; i++) {\n var sl = selections[i][0];\n var sr = selections[i][1];\n\n if (sl <= left && left <= sr && sl <= right && right <= sr) return [\"inside\", [sl, sr]];\n\n if (sr < left || sl > right) continue;\n\n return [\"invalid\"];\n }\n return [\"valid\"];\n}", "function canMove(row, col) {\n if (!hasOppositeChecker(row, col, currentColor)) {\n if (isAKing(occupiedArray[row][col].id)) {\n if (!cellIsVacant(row + 1, col + 1) && !cellIsVacant(row + 1, col - 1) && !cellIsVacant(row - 1, col + 1) && !cellIsVacant(row - 1, col - 1)) {\n return false;\n }\n }\n else if (occupiedArray[row][col].classList.contains(\"black\")) {\n if (!cellIsVacant(row + 1, col - 1) && !cellIsVacant(row + 1, col + 1)) {\n return false;\n }\n }\n else if (occupiedArray[row][col].classList.contains(\"red\")) {\n if (!cellIsVacant(row - 1, col - 1) && !cellIsVacant(row - 1, col + 1)) {\n return false;\n }\n }\n return true;\n }\n}", "hitTest(mouseLoc) {\n if ( mouseLoc.x > this.loc.x &&\n mouseLoc.x < this.loc.x + this.myWidth &&\n mouseLoc.y > this.loc.y &&\n mouseLoc.y < this.loc.y + this.myHeight )\n return true;\n\n return false;\n}", "pointInBounds(x, y) {\n if (this.x1 < this.x2) {\n if ((x < this.x1) || (x > this.x2)) return false\n }\n else {\n if ((x < this.x2) || (x > this.x1)) return false\n }\n if (this.y1 < this.y2) {\n if ((y < this.y1) || (y > this.y2)) return false\n }\n else {\n if ((y < this.y2) || (y > this.y1)) return false\n }\n return true\n }", "function isPitfall(row, col)\n {\n //check if clicked row and col values are the same as a pitfall row/col values\n for (var i = 0; i < pitfall_row_val_array.length; i++)\n {\n if ((row == pitfall_row_val_array[i]) && (col == pitfall_col_val_array[i]))\n return true;\n }\n return false;\n }", "function isClicked(mouse) {\n for(var i=0;i<Object.keys(icons).length;i++) {\n curr_x = icons[Object.keys(icons)[i]][1];\n curr_y = icons[Object.keys(icons)[i]][2];\n curr_height = icons[Object.keys(icons)[i]][3];\n curr_width = icons[Object.keys(icons)[i]][4];\n if (mouse[0] < curr_x + curr_width && mouse[0] > curr_x - curr_width) {\n if (mouse[1] < curr_y + curr_height && mouse[1] > curr_y - curr_height) {\n return (icons[Object.keys(icons)[i]][0]);\n }\n }\n else {\n }\n }\n return false;\n }", "function checkWithinBounds(point, bounds) {\n for (let lim = 0; lim < 2; lim++) { // limit (0 = min; 1 = max)\n for (let dim = 0; dim < 2; dim++) { // dimension (0 = x; 1 = y)\n if (lim === 0 && point[dim] < bounds[lim][dim]) {\n return false\n } else if (lim === 1 && point[dim] > bounds[lim][dim]) {\n return false\n }\n }\n }\n return true\n}", "inRanges(results, ranges) {\n var i, j, k, len, min, pass, ref, result;\n pass = true;\n switch (false) {\n case !(this.isArray(results) && this.isArray(ranges)):\n min = Math.min(results.length, ranges.length); // Ony apply the ranges we ga\n for (i = j = 0, ref = min; (0 <= ref ? j < ref : j > ref); i = 0 <= ref ? ++j : --j) {\n pass = pass && this.inRange(results[i], ranges[i]);\n }\n break;\n case !this.isArray(results):\n for (k = 0, len = results.length; k < len; k++) {\n result = results[k];\n pass = pass && this.inRange(results, ranges);\n }\n break;\n default:\n pass = false;\n }\n return pass;\n }", "isValidRegionPlacement(row, column, value) {\n if (this.getCell(row, column)) {\n return false;\n } else {\n return isValidValue(this.getRegion(row, column), value);\n }\n }", "function allowUserClick() {\n blocks.forEach(function(i) {\n i.addEventListener('click', tileClicked);\n });\n\n function tileClicked() {\n this.classList.toggle('green');\n this.classList.toggle('blue');\n }\n }", "function isSupportRegion(assigneeText, regionText) {\n if (assigneeText.indexOf('- ' + regionText) != -1) {\n return true;\n }\n if (assigneeText.indexOf('/' + regionText + '/') != -1) {\n return true;\n }\n return false;\n}", "_isMovingToSubmenu() {\n const submenuPoints = this._getSubmenuBounds();\n if (!submenuPoints) {\n return false;\n }\n let numMoving = 0;\n const currPoint = this._points[this._points.length - 1];\n // start from the second last point and calculate the slope between each point and the last\n // point.\n for (let i = this._points.length - 2; i >= 0; i--) {\n const previous = this._points[i];\n const slope = getSlope(currPoint, previous);\n if (isWithinSubmenu(submenuPoints, slope, getYIntercept(currPoint, slope))) {\n numMoving++;\n }\n }\n return numMoving >= Math.floor(NUM_POINTS / 2);\n }", "function cursorInBounds() {\n var boundOb = $(event.currentTarget);\n try {boundOb.offset();} catch {return false;}\n var xTest = boundOb.offset().left;\n var yTest = boundOb.offset().top;\n\n if(event.pageX >= xTest && event.pageY >= yTest && event.pageX <= xTest+boundOb.width() && event.pageY <= yTest+boundOb.height()) {\n return true;\n }\n return false;\n}", "guard(e, view) {\n // handled as `contextmenu` type\n if (e.type === 'mousedown' && e.button === 2) {\n return true;\n }\n if (this.options.guard && this.options.guard(e, view)) {\n return true;\n }\n if (e.data && e.data.guarded !== undefined) {\n return e.data.guarded;\n }\n if (view && view.cell && Cell.isCell(view.cell)) {\n return false;\n }\n if (this.svg === e.target ||\n this.container === e.target ||\n JQuery.contains(this.svg, e.target)) {\n return false;\n }\n return true;\n }", "function isValidCoords( points, elem, complete, elem_type ) {\n for ( var n = 1; n < points.length; n++ )\n if ( points[n].x < 0 || points[n].y < 0 ||\n points[n].x > imgSize.W-1 || points[n].y > imgSize.H-1 ) {\n console.log('error: '+elem_type+'s have to be within image limits');\n return false;\n }\n if ( complete && points.length < 3 ) {\n console.log('error: '+elem_type+'s are required to have at least 3 points');\n return false;\n }\n return true;\n }", "isRegionInfoInside(regionInfo) {\n if (this.imageBuffer) {\n return regionInfo.checkIntersection(0, 0, this.imageBuffer.width, this.imageBuffer.height);\n }\n return false;\n }", "function checkCollectables(t_collectables)\n{\n //logic for collectable item\n //dist from item 529\n var dis=(dist(gameChar_world_x, gameChar_y, t_collectables.x_pos, t_collectables.y_pos)); \n if(dis<440 && dis > 420 && gameChar_y)\n {\n t_collectables.isFound = true;\n game_score +=1;\n }\n}", "static isVecInArea(p, a, s) {\n\t\tif(p.x < a.x) return false;\n\t\tif(p.y < a.y) return false;\n\t\tif(p.x > a.x + s.x ) return false;\n\t\tif(p.y > a.y + s.y ) return false;\n\t\treturn true;\n\t}", "function withinBounds(x, y, size_x, size_y) {\n if (x >= 0 && x <= size_x - 1 && y >= 0 && y <= size_y - 1) return true\n return false\n}", "function numbers_ranges(x, y) {\n if ((x >= 0 && x <= 15 && y >= 0 && y <= 15))\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "function isWithinSubmenu(submenuPoints, m, b) {\n const { left, right, top, bottom } = submenuPoints;\n // Check for intersection with each edge of the submenu (left, right, top, bottom)\n // by fixing one coordinate to that edge's coordinate (either x or y) and checking if the\n // other coordinate is within bounds.\n return ((m * left + b >= top && m * left + b <= bottom) ||\n (m * right + b >= top && m * right + b <= bottom) ||\n ((top - b) / m >= left && (top - b) / m <= right) ||\n ((bottom - b) / m >= left && (bottom - b) / m <= right));\n}", "function checkIfInSpecial(point) {\n let isSpecial = false;\n let special = [\"A410\", \"A411\", \"A412\", \"A413\", \"A414\", \"A415\", \"A416\", \"A417\"];\n for (let i = 0; i < special.length; i++) {\n if (point.includes(special[i])) {\n isSpecial = true;\n }\n }\n\n return isSpecial;\n}", "isWithinBounds(bbox) {\n return (\n this.mouseX >= bbox.left &&\n this.mouseX <= bbox.left + bbox.width &&\n this.mouseY >= bbox.top &&\n this.mouseY <= bbox.top + bbox.height\n );\n }", "function checkCoordinates (startCoordinate, direction, length) {\n let noOverlap = true\n for (let i = 0; i < length; i++) {\n let newCoordinate = [startCoordinate[0] + i * direction[0], startCoordinate[1] + i * direction[1]]\n this.reservedCoordinates.forEach(coordinate => {\n let reservedX = coordinate[0]\n let reservedY = coordinate[1]\n let newX = newCoordinate[0]\n let newY = newCoordinate[1]\n if (reservedX === newX && reservedY === newY) {\n noOverlap = false\n } \n })\n }\n return noOverlap\n}", "function isSelectionSpanAllowed(span) {\n\t\treturn isSpanAllowed(span, t.options.selectConstraint, t.options.selectOverlap);\n\t}" ]
[ "0.7172129", "0.716613", "0.716613", "0.716613", "0.716613", "0.7098247", "0.7098247", "0.5860332", "0.54755884", "0.5452438", "0.5442114", "0.54385376", "0.54334104", "0.54021597", "0.5362944", "0.5346568", "0.5315994", "0.5307606", "0.5306546", "0.5294208", "0.5279957", "0.52396905", "0.52396905", "0.52396905", "0.5231237", "0.5230976", "0.52308714", "0.52269745", "0.52253044", "0.5212609", "0.52116144", "0.5197092", "0.51951134", "0.519073", "0.51389015", "0.50806946", "0.5072235", "0.50712043", "0.5063973", "0.50628626", "0.5059532", "0.5059011", "0.5038516", "0.5036637", "0.50271416", "0.50271416", "0.50271416", "0.5024492", "0.50220567", "0.5020685", "0.5008804", "0.5004585", "0.5000801", "0.4989832", "0.49882865", "0.4968545", "0.4968545", "0.49557754", "0.49531144", "0.4945032", "0.49444848", "0.494126", "0.49390724", "0.49342722", "0.49315643", "0.49277928", "0.49195808", "0.4918963", "0.49154097", "0.4911558", "0.49104306", "0.4897351", "0.4896189", "0.48942927", "0.48919326", "0.48858747", "0.4885379", "0.4880978", "0.4878226", "0.48733354", "0.48730287", "0.48708266", "0.48681092", "0.48616442", "0.48596296", "0.4857664", "0.48475924", "0.4846374", "0.48433304", "0.4843091", "0.48408693", "0.48293826", "0.48290253", "0.48242006", "0.4819091", "0.48106012", "0.4802751", "0.48021615", "0.47957784", "0.47901496" ]
0.71449983
5
Global click handler that prevents the click if it's in a bustable zone and preventGhostClick was called recently.
function onClick(event) { if (Date.now() - lastPreventedTime > PREVENT_DURATION) { return; // Too old. } var touches = event.touches && event.touches.length ? event.touches : [event]; var x = touches[0].clientX; var y = touches[0].clientY; // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label // and on the input element). Depending on the exact browser, this second click we don't want // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label // click event if (x < 1 && y < 1) { return; // offscreen } if (lastLabelClickCoordinates && lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) { return; // input click triggered by label click } // reset label click coordinates on first subsequent click if (lastLabelClickCoordinates) { lastLabelClickCoordinates = null; } // remember label click coordinates to prevent click busting of trigger click event on input if (event.target.tagName.toLowerCase() === 'label') { lastLabelClickCoordinates = [x, y]; } // Look for an allowable region containing this click. // If we find one, that means it was created by touchstart and not removed by // preventGhostClick, so we don't bust it. if (checkAllowableRegions(touchCoordinates, x, y)) { return; } // If we didn't find an allowable region, bust the click. event.stopPropagation(); event.preventDefault(); // Blur focused form elements event.target && event.target.blur(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function gcb_clickBuster (event)\r\n{\r\n //console.log (\"Clicked \" + event.clientX + \", \" + event.clientY );\r\n if (gcb_ignoreClick(event.clientX, event.clientY))\r\n {\r\n //console.log (\"... and ignored it.\");\r\n event.stopPropagation();\r\n event.preventDefault();\r\n }\r\n}", "function disableClick() {\n //makes body non clickable\n body.style.pointerEvents = 'none';\n //makes body clickable again\n setTimeout( function() {body.style.pointerEvents = 'auto';}, 1000);\n}", "function clickPrevent() {\n\t$.trigger(\"clickPrevent\");\n}", "function disableClick() {\n //this makes our body unclickable\n body.style.pointerEvents = 'none';\n //this makes our body clickable again\n setTimeout(function () { body.style.pointerEvents = 'auto'; }, 1000);\n}", "function disableClick() {\n body.style.pointerEvents = 'none'; //this makes our body unclickable\n setTimeout(function() { body.style.pointerEvents = 'auto'; }, 1000); //Makes the body clickable again after 1 second\n}", "function preventTouchClick() {\n const onClick = function(event){\n event.preventDefault();\n\n document.removeEventListener('click', onClick);\n };\n document.addEventListener('click', onClick);\n setTimeout(function() {\n document.removeEventListener('click', onClick);\n }, 100);\n }", "capturesClicks() {\n return false;\n }", "function suppressClick(e) {\n\t e.preventDefault();\n\t e.stopPropagation();\n\t window.removeEventListener('click', suppressClick, true);\n\t}", "function suppressClick(e) {\n\t e.preventDefault();\n\t e.stopPropagation();\n\t window.removeEventListener('click', suppressClick, true);\n\t}", "function disableClick() {\n body.style.pointerEvents = 'none';\n setTimeout(function() {body.style.pointerEvents = 'auto';}, 1000);\n}", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (nodeName_(event.target) === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur && event.target.blur();\n }", "function disableClick(){\r\n body.style.pointerEvents='none';\r\n setTimeout(function() {body.style.pointerEvents='auto';},1000);\r\n}", "function clickHandler(e) {\n // Nur bei Linksklick\n if (e.button !== 0) return;\n clickAt(e.offsetX, e.offsetY);\n }", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (event.target.tagName.toLowerCase() === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur();\n }", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (nodeName_(event.target) === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n // event.target && event.target.blur && event.target.blur();\n }", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (nodeName_(event.target) === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur && event.target.blur();\n }", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (nodeName_(event.target) === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur && event.target.blur();\n }", "function suppressClick(e) {\n e.preventDefault();\n e.stopPropagation();\n window.removeEventListener('click', suppressClick, true);\n}", "function preventClicks(s, e) {\n if (!s._allowClick) {\n if (s.preventClicks) {\n e.preventDefault();\n }\n if (s.preventClicksPropagation && s._animating) {\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n }\n}", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (event.target.tagName.toLowerCase() === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur();\n }", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (event.target.tagName.toLowerCase() === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur();\n }", "function LocalClient__clickHandler(e) {\n\tif (e.button !== 0) { return; } // handle left-click only\n\ttrackFormSubmitter(e.target);\n\tvar request = extractRequest.fromAnchor(e.target);\n\tif (request && ['_top','_blank'].indexOf(request.target) !== -1) { return; }\n\tif (request) {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\tdispatchRequestEvent(e.target, request);\n\t\treturn false;\n\t}\n}", "handleClickSelf(event) {\n if (event.target.classList.contains('clicked')) {\n event.target.classList.remove('clicked');\n this.showBackSide(event.target);\n this.resetClicks();\n return true;\n }\n return false;\n }", "_click(event) {\n if (this.disabled) {\n event.preventDefault();\n }\n else {\n this._handleInteraction(event);\n event.stopPropagation();\n }\n }", "function vaadinRouterGlobalClickHandler(event) {\n // ignore the click if the default action is prevented\n if (event.defaultPrevented) {\n return;\n }\n\n // ignore the click if not with the primary mouse button\n if (event.button !== 0) {\n return;\n }\n\n // ignore the click if a modifier key is pressed\n if (event.shiftKey || event.ctrlKey || event.altKey || event.metaKey) {\n return;\n }\n\n // find the <a> element that the click is at (or within)\n let anchor = event.target;\n const path = event.composedPath\n ? event.composedPath()\n : (event.path || []);\n\n // FIXME(web-padawan): `Symbol.iterator` used by webcomponentsjs is broken for arrays\n // example to check: `for...of` loop here throws the \"Not yet implemented\" error\n for (let i = 0; i < path.length; i++) {\n const target = path[i];\n if (target.nodeName && target.nodeName.toLowerCase() === 'a') {\n anchor = target;\n break;\n }\n }\n\n while (anchor && anchor.nodeName.toLowerCase() !== 'a') {\n anchor = anchor.parentNode;\n }\n\n // ignore the click if not at an <a> element\n if (!anchor || anchor.nodeName.toLowerCase() !== 'a') {\n return;\n }\n\n // ignore the click if the <a> element has a non-default target\n if (anchor.target && anchor.target.toLowerCase() !== '_self') {\n return;\n }\n\n // ignore the click if the <a> element has the 'download' attribute\n if (anchor.hasAttribute('download')) {\n return;\n }\n\n // ignore the click if the <a> element has the 'router-ignore' attribute\n if (anchor.hasAttribute('router-ignore')) {\n return;\n }\n\n // ignore the click if the target URL is a fragment on the current page\n if (anchor.pathname === window.location.pathname && anchor.hash !== '') {\n return;\n }\n\n // ignore the click if the target is external to the app\n // In IE11 HTMLAnchorElement does not have the `origin` property\n const origin = anchor.origin || getAnchorOrigin(anchor);\n if (origin !== window.location.origin) {\n return;\n }\n\n // if none of the above, convert the click into a navigation event\n const {pathname, search, hash} = anchor;\n if (fireRouterEvent('go', {pathname, search, hash})) {\n event.preventDefault();\n }\n}", "function noCheat(){\n console.log(\"already clicked!\");\n }", "function clickable(e) {\n if (1 != which(e)) return;\n if (e.metaKey || e.ctrlKey || e.shiftKey) return;\n if (e.defaultPrevented) return;\n return true;\n}", "function clickTracker() {\n if (firstClick) {\n firstClick = false;\n clickUrl = getUrlParameter(\"click\");\n if (clickUrl == clickTrackerHolder || clickUrl == null) {\n return;\n }\n\n callClickTracker(clickUrl);\n }\n}", "function vaadinRouterGlobalClickHandler(event) {\n // ignore the click if the default action is prevented\n if (event.defaultPrevented) {\n return;\n }\n\n // ignore the click if not with the primary mouse button\n if (event.button !== 0) {\n return;\n }\n\n // ignore the click if a modifier key is pressed\n if (event.shiftKey || event.ctrlKey || event.altKey || event.metaKey) {\n return;\n }\n\n // find the <a> element that the click is at (or within)\n let anchor = event.target;\n const path = event.composedPath\n ? event.composedPath()\n : (event.path || []);\n\n // FIXME(web-padawan): `Symbol.iterator` used by webcomponentsjs is broken for arrays\n // example to check: `for...of` loop here throws the \"Not yet implemented\" error\n for (let i = 0; i < path.length; i++) {\n const target = path[i];\n if (target.nodeName && target.nodeName.toLowerCase() === 'a') {\n anchor = target;\n break;\n }\n }\n\n while (anchor && anchor.nodeName.toLowerCase() !== 'a') {\n anchor = anchor.parentNode;\n }\n\n // ignore the click if not at an <a> element\n if (!anchor || anchor.nodeName.toLowerCase() !== 'a') {\n return;\n }\n\n // ignore the click if the <a> element has a non-default target\n if (anchor.target && anchor.target.toLowerCase() !== '_self') {\n return;\n }\n\n // ignore the click if the <a> element has the 'download' attribute\n if (anchor.hasAttribute('download')) {\n return;\n }\n\n // ignore the click if the target URL is a fragment on the current page\n if (anchor.pathname === window.location.pathname && anchor.hash !== '') {\n return;\n }\n\n // ignore the click if the target is external to the app\n // In IE11 HTMLAnchorElement does not have the `origin` property\n const origin = anchor.origin || getAnchorOrigin(anchor);\n if (origin !== window.location.origin) {\n return;\n }\n\n // if none of the above, convert the click into a navigation event\n if (fireRouterEvent('go', {pathname: anchor.pathname})) {\n event.preventDefault();\n }\n }", "handleClick(e) {\n if (e) {e.preventDefault()};\n }", "handleClick () {\n super.handleClick();\n if (this.casting) {\n return this.stopCasting();\n } else {\n return this.doLaunch();\n }\n }", "function stopClicking(){\n\n // Add no clicking class on the main container (memory-game-blocks === blocksContainer)\n\n blocksContainer.classList.add( 'no-clicking' );\n\n\n // Remove no clicking class after 1 second\n setTimeout( () => {\n\n blocksContainer.classList.remove( 'no-clicking' );\n\n }, duration );\n\n}", "disableOnClickOutside() {\n if (document !== null) {\n document.removeEventListener('mousedown', this.boundHandler);\n document.removeEventListener('touchstart', this.boundHandler);\n }\n }", "function handleClickEvent() {\n event.preventDefault();\n}", "removeClickAwayEvent() {\n $('main').off('click.atkPanel');\n $(document).off('keyup.atkPanel');\n }", "function click() {\n d3_eventCancel();\n w.on(\"click.drag\", null);\n }", "clickHandler(state, e) {\n e.persist();\n e.preventDefault();\n this.clicks.push(new Date().getTime());\n window.clearTimeout(this.timeout);\n this.timeout = window.setTimeout(() => {\n if (\n this.clicks.length > 1 &&\n this.clicks[this.clicks.length - 1] -\n this.clicks[this.clicks.length - 2] <\n 200\n ) {\n this.openApp(state);\n }\n }, 250);\n }", "function trapClickAndEnd(event) {\n var untrap; // trap the click in case we are part of an active\n // drag operation. This will effectively prevent\n // the ghost click that cannot be canceled otherwise.\n\n if (context.active) {\n untrap = install(eventBus); // remove trap after minimal delay\n\n setTimeout(untrap, 400); // prevent default action (click)\n\n preventDefault(event);\n }\n\n end(event);\n }", "function disableClickToClose() {\n\n // Close the menu when a menu item is clicked.\n $(CSS_SELECTOR_MENU_ITEM).unbind(\"click\");\n }", "function no_pointer_events() {\n\tif (IE) $('*').not('html').off('click',shim).on('click',shim);\n\tfunction shim(event) {\n\t\tvar $this = $(this);\n\t\tif ($this.css('pointer-events') == 'none' || ($this.parent().css('pointer-events') == 'none' && $this.css('pointer-events') != 'all')) {\n\t\t\tevent.stopImmediatePropagation();\n\t\t\tevent.preventDefault();\n\t\t\treturn false;\n\t\t}\n\t}\n}", "clickHandler() {\n // Activate if not active\n if (this.active === 'safety') {\n // Button view press effect\n this.removeSafety();\n } else if (this.active === false) {\n // Button view press effect\n this.changeToActive();\n // Click action\n this.clickAction();\n }\n }", "onInternalClick(event) {\n const me = this,\n bEvent = {\n event\n };\n\n if (me.toggleable) {\n // Clicking the pressed button in a toggle group should do nothing\n if (me.toggleGroup && me.pressed) {\n return;\n }\n\n me.toggle(!me.pressed);\n }\n /**\n * User clicked button\n * @event click\n * @property {Core.widget.Button} button - Clicked button\n * @property {Event} event - DOM event\n */\n\n me.trigger('click', bEvent);\n /**\n * User performed the default action (clicked the button)\n * @event action\n * @property {Core.widget.Button} button - Clicked button\n * @property {Event} event - DOM event\n */\n // A handler may have resulted in destruction.\n\n if (!me.isDestroyed) {\n me.trigger('action', bEvent);\n } // since Widget has Events mixed in configured with 'callOnFunctions' this will also call onClick and onAction\n\n if (!this.href) {\n // stop the event since it has been handled\n event.preventDefault();\n event.stopPropagation();\n }\n }", "function disableMouse(clic) {\r\n document.addEventListener(\"click\", e => {\r\n if (clic) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n }, true);\r\n}", "function CALCULATE_TOUCH_UP_OR_MOUSE_UP() {\r\n \r\n GLOBAL_CLICK.CLICK_PRESSED = false;\r\n \r\n }", "function onHandleClick(event){\n\t\t\n\t\tevent.stopPropagation();\n\t\tevent.stopImmediatePropagation();\n\t\t\n\t\tif(g_functions.validateClickTouchstartEvent(event.type) == false)\n\t\t\treturn(true);\n\t\t\n\t\tif(g_panel.isPanelClosed())\n\t\t\tg_panel.openPanel();\n\t\telse\n\t\t\tg_panel.closePanel();\n\t}", "function vaadinRouterGlobalClickHandler(event) {\n // ignore the click if the default action is prevented\n if (event.defaultPrevented) {\n return;\n }\n\n // ignore the click if not with the primary mouse button\n if (event.button !== 0) {\n return;\n }\n\n // ignore the click if a modifier key is pressed\n if (event.shiftKey || event.ctrlKey || event.altKey || event.metaKey) {\n return;\n }\n\n // find the <a> element that the click is at (or within)\n let anchor = event.target;\n const path = event.composedPath ? event.composedPath() : event.path || [];\n\n // FIXME(web-padawan): `Symbol.iterator` used by webcomponentsjs is broken for arrays\n // example to check: `for...of` loop here throws the \"Not yet implemented\" error\n for (let i = 0; i < path.length; i++) {\n const target = path[i];\n if (target.nodeName && target.nodeName.toLowerCase() === \"a\") {\n anchor = target;\n break;\n }\n }\n\n while (anchor && anchor.nodeName.toLowerCase() !== \"a\") {\n anchor = anchor.parentNode;\n }\n\n // ignore the click if not at an <a> element\n if (!anchor || anchor.nodeName.toLowerCase() !== \"a\") {\n return;\n }\n\n // ignore the click if the <a> element has a non-default target\n if (anchor.target && anchor.target.toLowerCase() !== \"_self\") {\n return;\n }\n\n // ignore the click if the <a> element has the 'download' attribute\n if (anchor.hasAttribute(\"download\")) {\n return;\n }\n\n // ignore the click if the target URL is a fragment on the current page\n if (anchor.pathname === window.location.pathname && anchor.hash !== \"\") {\n return;\n }\n\n // ignore the click if the target is external to the app\n // In IE11 HTMLAnchorElement does not have the `origin` property\n const origin = anchor.origin || getAnchorOrigin(anchor);\n if (origin !== window.location.origin) {\n return;\n }\n\n // if none of the above, convert the click into a navigation event\n const { pathname, search, hash } = anchor;\n if (fireRouterEvent(\"go\", { pathname, search, hash })) {\n event.preventDefault();\n }\n}", "function nobubbleHandler(evt) {\n evt.originalEvent.stopPropagation();\n evt.originalEvent.preventDefault();\n}", "function onMouseUp(event){if(preventMouseUp){event.preventDefault();}}", "function box_touchendHandler(event) {\r\n // If the user hasn't been dragging the page and the box (me) is not revealed\r\n // And it doesn't contain the class \"js-direct-link\"\r\n if (!dragging && !$(this).hasClass('-is-revelead') && !$(this).hasClass('js-direct-link')) {\r\n\r\n // Prevents default action (so browser doesn't navigate to the URL)\r\n event.preventDefault();\r\n\r\n // Close all boxes except the box where the event happened (me)\r\n closeBox($('.panel').not(this));\r\n\r\n // Opens the clicked one\r\n openBox(this);\r\n }\r\n }", "function clickHandler(event){\n\t\t\tif(ignoreClick){\n\t\t\t\tignoreClick = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar offset = overlay.cumulativeOffset();\t\t\t\n\t\t\ttarget.fire('flotr:click', [{\n\t\t\t\tx: xaxis.min + (event.pageX - offset.left - plotOffset.left) / hozScale,\n\t\t\t\ty: yaxis.max - (event.pageY - offset.top - plotOffset.top) / vertScale\n\t\t\t}]);\n\t\t}", "function checkPointerDown(e) {\n if (container.contains(e.target)) return;\n if (config.clickOutsideDeactivates) {\n deactivate({\n returnFocus: !tabbable_1.isFocusable(e.target)\n });\n return;\n }\n // This is needed for mobile devices.\n // (If we'll only let `click` events through,\n // then on mobile they will be blocked anyways if `touchstart` is blocked.)\n if (config.allowOutsideClick && config.allowOutsideClick(e)) {\n return;\n }\n e.preventDefault();\n }", "_endClick() {\n const that = this;\n\n //Click Handler\n that._resizeHandler();\n\n if (that.disabled || that.readonly) {\n return;\n }\n\n if (that._isInactiveOn('click')) {\n return;\n }\n\n if (that.clickMode !== 'release' && that.clickMode !== 'pressAndRelease') {\n //event.preventDefault();\n //event.stopPropagation();\n }\n else {\n that._updateStateOnClick();\n }\n\n that.indeterminate = false;\n that._updateHidenInputNameAndValue();\n }", "function __clickhandler() {\n buttonfunc(elemnode); return false;\n }", "function allowUserClick() {\n blocks.forEach(function(i) {\n i.addEventListener('click', tileClicked);\n });\n\n function tileClicked() {\n this.classList.toggle('green');\n this.classList.toggle('blue');\n }\n }", "function onMouseClick(event) {\n freeze = !freeze;\n }", "function mouseClicked() {\n // Ignore clicks outside window\n if (!window.ev) {\n return;\n }\n \n if (!menu_toggles.forces.parameter) return;\n \n // Delete force\n for (var i = 1; i < forcePoints.length; i++) {\n // Check if hovering over fixed forcePoint\n if (forcePoints[i].hover) {\n forcePoints.splice(i, 1);\n return;\n }\n }\n \n // Create force\n forcePoints.push(new ForcePoint(cursorPoint.center, cursorPoint.forceFactor, cursorPoint.forceExp, cursorPoint.forceIntensity, \"CONTRACTING\"));\n}", "function preventClick() {\n $('.card').each(function( index ) {\n $('.card').addClass('preventclick');\n });\n /* $('.card').click(function( event ) {\n event.stopImmediatePropagation();\n }); */\n}", "function enable() {\n document.removeEventListener(\"click\", handler,true);\n function handler(e){\n e.stopPropagation();\n }\n}", "pageClicked(event)\n {\n let trigger = this.$refs.trigger ? this.$refs.trigger : this.$el;\n\n if (! this.hasUserAttention() || trigger === event.target) return;\n\n trigger.contains(event.target) ? null : this.lostUserAttention();\n }", "canvasMouseClickHandler (event) {\n this.mouseDownTimeDelta = (Date.now() - this.mouseDownTime) || 0;\n\n if (this.mouseDownTimeDelta < CLICK_DELAY_TIME) {\n this.mouseClickCounter += 1;\n\n switch (this.mouseClickCounter) {\n case 2:\n clearTimeout(this.mouseClickTimeout);\n this.canvasDblClickHandler();\n this.mouseClickCounter = 0;\n break;\n\n default:\n this.canvasClickHandler(event);\n this.mouseClickTimeout = setTimeout(() => {\n this.mouseClickCounter = 0;\n }, DBL_CLICK_DELAY_TIME);\n break;\n }\n } else {\n this.mouseClickCounter = 0;\n }\n }", "function gcb_ignoreClick (x, y, nopop, noadd)\r\n{\r\n for (var i=0;i<gcb_clickPointX.length;i++)\r\n {\r\n var testX = gcb_clickPointX[i];\r\n var testY = gcb_clickPointY[i];\r\n\t\t// Hack by Nex: we don't need threshold\r\n //if ( ( Math.abs(x - testX) < 15 ) && ( Math.abs(y - testY) < 15 ) )\r\n if ((x == testX) && (y == testY))\r\n return true;\r\n }\r\n\tif (!noadd)\r\n\t\tgcb_addClick (x, y, nopop);\r\n return false;\r\n}", "function trapClickAndEnd(event) {\n\n var untrap;\n\n // trap the click in case we are part of an active\n // drag operation. This will effectively prevent\n // the ghost click that cannot be canceled otherwise.\n if (context.active) {\n\n untrap = install(eventBus);\n\n // remove trap after minimal delay\n setTimeout(untrap, 400);\n\n // prevent default action (click)\n preventDefault(event);\n }\n\n end(event);\n }", "function clickWatcher(event) {\n var is_exist = $.contains(document, that.$wrapper[0]);\n if (is_exist) {\n var is_redirect = (this.href.indexOf(that.urls[\"backend_url\"]) >= 0);\n if (is_redirect && that.is_changed) {\n event.preventDefault();\n event.stopPropagation();\n var $link = $(this);\n showConfirm().then(function() {\n off();\n $link[0].click();\n });\n }\n } else {\n off();\n }\n }", "function disableClickZoom () {\n status.disableClickZoom = true;\n }", "static clickAttack() {\n var _a;\n // click attacks disabled and we already beat the starter\n if (App.game.challenges.list.disableClickAttack.active() && player.regionStarters[GameConstants.Region.kanto]() != GameConstants.Starter.None) {\n return;\n }\n // TODO: figure out a better way of handling this\n // Limit click attack speed, Only allow 1 attack per 50ms (20 per second)\n const now = Date.now();\n if (this.lastClickAttack > now - 50) {\n return;\n }\n this.lastClickAttack = now;\n if (!((_a = this.enemyPokemon()) === null || _a === void 0 ? void 0 : _a.isAlive())) {\n return;\n }\n GameHelper.incrementObservable(App.game.statistics.clickAttacks);\n this.enemyPokemon().damage(App.game.party.calculateClickAttack(true));\n if (!this.enemyPokemon().isAlive()) {\n this.defeatPokemon();\n }\n }", "function trapClickAndEnd(event) {\n\n var untrap;\n\n // trap the click in case we are part of an active\n // drag operation. This will effectively prevent\n // the ghost click that cannot be canceled otherwise.\n if (context.active) {\n\n untrap = installClickTrap(eventBus);\n\n // remove trap after minimal delay\n setTimeout(untrap, 400);\n\n // prevent default action (click)\n preventDefault(event);\n }\n\n end(event);\n }", "clickHandler() {\n // Activate if not active\n if (this.active === false) {\n // Button view press effect\n this.changeToActive();\n // No click 'action' for input - text is removed in visualEffectOnActivation\n }\n }", "if (event.defaultPrevented) {\n return;\n }", "function _click(d){\n \n }", "function vaadinRouterGlobalClickHandler(event){// ignore the click if the default action is prevented\nif(event.defaultPrevented){return}// ignore the click if not with the primary mouse button\nif(0!==event.button){return}// ignore the click if a modifier key is pressed\nif(event.shiftKey||event.ctrlKey||event.altKey||event.metaKey){return}// find the <a> element that the click is at (or within)\n// FIXME(web-padawan): `Symbol.iterator` used by webcomponentsjs is broken for arrays\n// example to check: `for...of` loop here throws the \"Not yet implemented\" error\nfor(var anchor=event.target,path=event.composedPath?event.composedPath():event.path||[],i=0,target;i<path.length;i++){target=path[i];if(target.nodeName&&\"a\"===target.nodeName.toLowerCase()){anchor=target;break}}while(anchor&&\"a\"!==anchor.nodeName.toLowerCase()){anchor=anchor.parentNode}// ignore the click if not at an <a> element\nif(!anchor||\"a\"!==anchor.nodeName.toLowerCase()){return}// ignore the click if the <a> element has a non-default target\nif(anchor.target&&\"_self\"!==anchor.target.toLowerCase()){return}// ignore the click if the <a> element has the 'download' attribute\nif(anchor.hasAttribute(\"download\")){return}// ignore the click if the target URL is a fragment on the current page\nif(anchor.pathname===window.location.pathname&&\"\"!==anchor.hash){return}// ignore the click if the target is external to the app\n// In IE11 HTMLAnchorElement does not have the `origin` property\nvar origin=anchor.origin||getAnchorOrigin(anchor);if(origin!==window.location.origin){return}// if none of the above, convert the click into a navigation event\nif((0,_utils.fireRouterEvent)(\"go\",{pathname:anchor.pathname})){event.preventDefault()}}", "function fake_click() {\n\tchrome.tabs.getCurrent(({id: tabId}) => {\n\t\tchrome.debugger.attach({tabId}, '1.1', () => {\n\t\t\t// mouse click: push button, then release it\n\t\t\tchrome.debugger.sendCommand({tabId}, 'Input.dispatchMouseEvent', {\n\t\t\t\ttype: 'mousePressed',\n\t\t\t\tx:50, y:50,\n\t\t\t\tbutton: 'left',\n\t\t\t\tclickCount: 1\n\t\t\t});\n\t\t\tchrome.debugger.sendCommand({tabId}, 'Input.dispatchMouseEvent', {\n\t\t\t\ttype: 'mouseReleased',\n\t\t\t\tx:50, y:50,\n\t\t\t\tbutton: 'left',\n\t\t\t\tclickCount: 1\n\t\t\t});\n\t\t\tchrome.debugger.detach({tabId});\n\t\t});\n\t});\n}", "function preventClicks() {\r\n \r\n let slideNums = document.querySelectorAll('.slideNums ul li');\r\n slideNums.forEach(number => {\r\n number.style.pointerEvents = 'none';\r\n setTimeout(() => number.style.pointerEvents = 'auto', 1200);\r\n });\r\n\r\n let navBtns = document.querySelectorAll('.btn');\r\n navBtns.forEach(btn => {\r\n btn.style.pointerEvents = 'none';\r\n setTimeout(() => btn.style.pointerEvents = 'auto', 1200);\r\n })\r\n\r\n}", "unclickingButton() {\n let that = this;\n if (this.renderStartPageButtons) {\n $(document).mouseup(function (e) {\n let container = $(\".btn-container\");\n // if clicking outside button container, re-renders startpage as is was\n if (!container.is(e.target) && container.has(e.target).length === 0) {\n that.render();\n }\n });\n }\n }", "function preventDoubleClickDefault(event){\n event.preventDefault();\n }", "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "function prevent(){\n $('.prevent, .mobile-menu .expanded, a[href=\"#\"]').on('click', function(event){\n event.preventDefault();\n });\n }", "function clickListener(event) {\n if (isPressHold) {\n // For Mobile Safari capture phase at least, returning false doesn't work; must use pD() and sP() explicitly.\n // Since it's wonky, do both for good measure.\n event.preventDefault();\n event.stopPropagation();\n isPressHold = false;\n return false;\n }\n\n return undefined;\n } // , on Chrome preventDefault on \"keyup\" will avoid triggering contextmenu event", "function _clickBehavior() {\n\t\t\tchildren.parent().find('.' + options.className + '-timeblock:not(.inactive) .' + options.className + '-dot').on('click', function(e) {\n\t\t\t\te.preventDefault();\n\n\t\t\t\tvar currYear = $(this).parent().parent().find('.' + options.className + '-timeblock.active').attr('data-year');\n\t\t\t\tvar nextYear = $(this).attr('data-year');\n\n\t\t\t\tif (currYear != nextYear) {\n\t\t\t\t\thook('onLeave', [currYear, nextYear]);\n\n\t\t\t\t\tchildren.removeClass('active');\n\t\t\t\t\t$(this).closest('.' + options.className + '-timeblock').addClass('active');\n\t\t\t\t}\n\n\t\t\t\t_updateTimelinePos('click');\n\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}", "function disableClick() {\n $(document).on('keydown', function(e) {\n if (e.which == Events.ENTER) {\n document.addEventListener('click', handler, true);\n }\n });\n}", "function onSafeClicked() {\n if (!gGame.isOn) return;\n if (gSafeClicks == 0) return;\n if (gIsFirstClick) return;\n var randSafeCellIdx = getRandomSafeCellIdx(gBoard);\n if (!randSafeCellIdx) return;\n var currCell = gBoard[randSafeCellIdx.i][randSafeCellIdx.j];\n gSafeClicks--;\n var elAvailableSafeClicks = document.querySelector('.safe-clicks-count');\n elAvailableSafeClicks.innerText = gSafeClicks + ' clicks available';\n var elCell = getElementByPosition(randSafeCellIdx.i, randSafeCellIdx.j);\n elCell.style.backgroundColor = '#FFE194';\n setTimeout(function () {\n if (!currCell.isShown) {\n elCell.style.backgroundColor = 'transparent';\n }\n }, 3000);\n if (gIsSoundOn) {\n var safeClickSound = new Audio('sound/safe-click.mp3');\n safeClickSound.volume = 0.3;\n safeClickSound.play();\n }\n saveGameState();\n}", "onAuxClick(event) {\n event.stopPropagation();\n event.preventDefault();\n return false;\n }", "function trapClickAndEnd(event) {\n var untrap;\n // trap the click in case we are part of an active\n // drag operation. This will effectively prevent\n // the ghost click that cannot be canceled otherwise.\n if (context.active) {\n untrap = Object(_util_ClickTrap__WEBPACK_IMPORTED_MODULE_4__[\"install\"])(eventBus);\n // remove trap after minimal delay\n setTimeout(untrap, 400);\n // prevent default action (click)\n preventDefault(event);\n }\n end(event);\n }", "function cancelClick(e)\r\n{\r\n if (!e) var e = window.event;\r\n e.cancelBubble = true;\r\n if (e.stopPropagation) e.stopPropagation();\r\n}", "function pressRightClick() { return false; }", "function denyRegistrationListener()\n{\n //Click deny\n $(document).on('click', '.deny', (function(e) {\n spawnBusyMessage(\"Denying Request\");\n e.preventDefault();\n var tempThis = $(this);\n var tempChildren = $(this).parent().parent().parent().parent().parent().children().length;\n $.ajax({\n type: \"post\",\n data: {\"staffID\" : $(this).parent().siblings('.userCol').find('.userID').find('.actualID').text()},\n url: \"/denyRequest\"\n }).then(function(jsonReturned) {\n if(jsonReturned != \"Request denied\"){\n window.scrollTo(0, 0);\n $('.featherlight').click();\n spawnErrorMessage(\"Unable to Deny Request: \" + jsonReturned);\n } else {\n //location.reload();\n $('.featherlight').click();\n tempThis.parent().parent().parent().parent().remove();\n if(tempChildren - 1 == 0){\n $(\"#requests\").append(getWarningMessage(\"No pending registration requests\"));\n }\n }\n });\n }));\n}", "_doNothing (e) { e.preventDefault(); return false; }", "function btnGoCrazyOnClickHandler(event) {\r\n\tkeepDrawing(true);\r\n }", "function disableClick(el) {\n el.classList.add('cant-click-this');\n}", "function instrumentClick() {\n\t\t// Capture clicks and wait 50ms to see if they result in DOM mutations\n\t\tBOOMR.subscribe(\"click\", function() {\n\t\t\tif (impl.singlePageApp) {\n\t\t\t\t// In a SPA scenario, only route changes (or events from the SPA\n\t\t\t\t// framework) trigger an interesting event.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar resource = { timing: {}, initiator: \"click\" };\n\n\t\t\tif (!BOOMR.orig_XMLHttpRequest ||\n\t\t\t BOOMR.orig_XMLHttpRequest === w.XMLHttpRequest) {\n\t\t\t\t// do nothing if we have un-instrumented XHR\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresource.timing.requestStart = BOOMR.now();\n\t\t\thandler.addEvent(resource);\n\t\t});\n\t}", "function clickHandler(){\n\t\taudioContext.resume();\n\t\tdocument.body.removeEventListener( \"click\", clickHandler );\n\t\tdocument.body.removeEventListener( \"touchend\", clickHandler);\n\t}", "function clicked(id){\n postLike(id);\n $(\"#\"+id).css(\"color\", \"blue\");\n $(\"#\"+id).prop(\"onclick\", null).off(\"click\");\n}" ]
[ "0.73478", "0.73478", "0.7347256", "0.7300218", "0.7300218", "0.7300218", "0.7300218", "0.7300218", "0.7221152", "0.65963066", "0.6553105", "0.6524485", "0.6498743", "0.64817595", "0.6480612", "0.6468255", "0.6468255", "0.6467821", "0.64113516", "0.6381518", "0.6345601", "0.631164", "0.6297526", "0.6291367", "0.6291367", "0.6263546", "0.6247692", "0.62408274", "0.62408274", "0.6131846", "0.61168426", "0.61128443", "0.609451", "0.608185", "0.6075483", "0.6064521", "0.6044628", "0.60224676", "0.6015273", "0.60061496", "0.5995825", "0.5984896", "0.59825015", "0.5970244", "0.5970099", "0.59566635", "0.59498715", "0.59454477", "0.5937231", "0.59057486", "0.5902768", "0.58595645", "0.5859358", "0.58522034", "0.5840557", "0.5828656", "0.581927", "0.58133847", "0.5810008", "0.58093095", "0.5807876", "0.580577", "0.57957697", "0.5795148", "0.5790719", "0.5789469", "0.5769771", "0.5755797", "0.57531565", "0.5737398", "0.5731915", "0.5729258", "0.57262564", "0.57247204", "0.5722998", "0.57143044", "0.5707954", "0.57072735", "0.5693971", "0.5670056", "0.56659764", "0.5662964", "0.5661684", "0.5661684", "0.5655168", "0.56486917", "0.564031", "0.56398815", "0.56387216", "0.5636854", "0.5636409", "0.5628011", "0.56242174", "0.56206614", "0.5613103", "0.56109315", "0.5607589", "0.56065637", "0.560249", "0.5596925" ]
0.64001596
19
Global touchstart handler that creates an allowable region for a click event. This allowable region can be removed by preventGhostClick if we want to bust it.
function onTouchStart(event) { var touches = event.touches && event.touches.length ? event.touches : [event]; var x = touches[0].clientX; var y = touches[0].clientY; touchCoordinates.push(x, y); $timeout(function() { // Remove the allowable region. for (var i = 0; i < touchCoordinates.length; i += 2) { if (touchCoordinates[i] == x && touchCoordinates[i + 1] == y) { touchCoordinates.splice(i, i + 2); return; } } }, PREVENT_DURATION, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function onTouchStart(event) {\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n touchCoordinates.push(x, y);\n\n $timeout(function() {\n // Remove the allowable region.\n for (var i = 0; i < touchCoordinates.length; i += 2) {\n if (touchCoordinates[i] == x && touchCoordinates[i + 1] == y) {\n touchCoordinates.splice(i, i + 2);\n return;\n }\n }\n }, PREVENT_DURATION, false);\n }", "function onTouchStart(event) {\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n touchCoordinates.push(x, y);\n\n $timeout(function () {\n // Remove the allowable region.\n for (var i = 0; i < touchCoordinates.length; i += 2) {\n if (touchCoordinates[i] == x && touchCoordinates[i + 1] == y) {\n touchCoordinates.splice(i, i + 2);\n return;\n }\n }\n }, PREVENT_DURATION, false);\n }", "function onTouchStart(event) {\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n touchCoordinates.push(x, y);\n\n $timeout(function() {\n // Remove the allowable region.\n for (var i = 0; i < touchCoordinates.length; i += 2) {\n if (touchCoordinates[i] == x && touchCoordinates[i+1] == y) {\n touchCoordinates.splice(i, i + 2);\n return;\n }\n }\n }, PREVENT_DURATION, false);\n }", "function onTouchStart(event) {\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n touchCoordinates.push(x, y);\n\n $timeout(function() {\n // Remove the allowable region.\n for (var i = 0; i < touchCoordinates.length; i += 2) {\n if (touchCoordinates[i] == x && touchCoordinates[i + 1] == y) {\n touchCoordinates.splice(i, i + 2);\n return;\n }\n }\n }, PREVENT_DURATION, false);\n }", "function onTouchStart(event) {\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n touchCoordinates.push(x, y);\n\n $timeout(function() {\n // Remove the allowable region.\n for (var i = 0; i < touchCoordinates.length; i += 2) {\n if (touchCoordinates[i] == x && touchCoordinates[i + 1] == y) {\n touchCoordinates.splice(i, i + 2);\n return;\n }\n }\n }, PREVENT_DURATION, false);\n }", "function onTouchStart(event) {\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n touchCoordinates.push(x, y);\n\n $timeout(function() {\n // Remove the allowable region.\n for (var i = 0; i < touchCoordinates.length; i += 2) {\n if (touchCoordinates[i] == x && touchCoordinates[i + 1] == y) {\n touchCoordinates.splice(i, i + 2);\n return;\n }\n }\n }, PREVENT_DURATION, false);\n }", "function onTouchStart(event) {\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n touchCoordinates.push(x, y);\n\n $timeout(function() {\n // Remove the allowable region.\n for (var i = 0; i < touchCoordinates.length; i += 2) {\n if (touchCoordinates[i] == x && touchCoordinates[i + 1] == y) {\n touchCoordinates.splice(i, i + 2);\n return;\n }\n }\n }, PREVENT_DURATION, false);\n }", "clickWithinBoundsHandler(event){\n const offsetLeft = document.getElementById(\"canvas\").offsetLeft;\n const offsetTop = document.getElementById(\"canvas\").offsetTop;\n\n if (\n event.clientX-offsetLeft >= this.bounds.xMin\n && event.clientX-offsetLeft <= this.bounds.xMax\n && event.clientY-offsetTop >= this.bounds.yMin\n && event.clientY-offsetTop <= this.bounds.yMax\n ) {\n // executes the action that was registered for these boundaries, then resets them\n this.bounds.action();\n this.bounds = {};\n }\n }", "_onContainerTouchStart(e){\n e.preventDefault();\n if(e.touches.length === 2){\n this.doubleTap = true;\n this.tapDistance = this._calcDistance(\n e.touches[0].pageX, e.touches[0].pageY,\n e.touches[1].pageX, e.touches[1].pageY\n );\n }\n let element = $(e.target);\n if(element.attr('handle') != undefined){\n let box = this.elements[element.attr('handle')];\n if(box != undefined){\n let x = e.touches[0].pageX - this.canvas.offsetLeft;\n let y = e.touches[0].pageY - this.canvas.offsetTop;\n this.onTouchStart(e, x, y, box);\n box.onTouchStart(e, x, y);\n }\n }\n }", "function touchHandler(e)\n {\n // preventDefault also disables pinching and scrolling while touching\n // on qml application\n e.preventDefault();\n var at = {\n layerX: e.touches[0].pageX - element.offsetLeft,\n layerY: e.touches[0].pageY - element.offsetTop,\n button: 1\n }\n element.onclick(at);\n\n }", "function touchHandler(e)\n {\n // preventDefault also disables pinching and scrolling while touching\n // on qml application\n e.preventDefault();\n var at = {\n layerX: e.touches[0].pageX - element.offsetLeft,\n layerY: e.touches[0].pageY - element.offsetTop,\n button: 1\n }\n element.onclick(at);\n\n }", "function onTouchStart(ev) {\n onClickCanvas(ev, true);\n}", "function handleStart(e) {\n self.pressed = true;\n e.preventDefault();\n self.fx = e.changedTouches[0].screenX;\n self.fy = e.changedTouches[0].screenY - topTouchOffset;\n if (self.allowOnClick && self.onClick !== null) self.onClick.call(self);\n }", "function box_touchstartHandler(event) {\r\n dragging = false;\r\n }", "function markTouch(event) {\n event && (event.zrByTouch = true);\n} // function markTriggeredFromLocal(event) {", "function markTouch(event) {\n event && (event.zrByTouch = true);\n} // function markTriggeredFromLocal(event) {", "function onControlTouchStart(e) {\r\n e.preventDefault();\r\n if (!touchIntervals[e.srcElement]) {\r\n e.srcElement.onclick.apply(e.srcElement);\r\n touchIntervals[e.srcElement] = window.setInterval(function() {e.srcElement.onclick.apply(e.srcElement)}, keydowntime);\r\n }\r\n}", "function touchStartHandler(e){\r\n\r\n //stopping the auto scroll to adjust to a section\r\n if(options.fitToSection){\r\n activeAnimation = false;\r\n }\r\n\r\n if(isReallyTouch(e)){\r\n var touchEvents = getEventsPage(e);\r\n touchStartY = touchEvents.y;\r\n touchStartX = touchEvents.x;\r\n }\r\n }", "function touchStartHandler(e){\r\n\r\n //stopping the auto scroll to adjust to a section\r\n if(options.fitToSection){\r\n activeAnimation = false;\r\n }\r\n\r\n if(isReallyTouch(e)){\r\n var touchEvents = getEventsPage(e);\r\n touchStartY = touchEvents.y;\r\n touchStartX = touchEvents.x;\r\n }\r\n }", "function n(t,e){\"use strict\";function a(t,e){return function(){return t.apply(e,arguments)}}var o;if(e=e||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=e.touchBoundary||10,this.layer=t,this.tapDelay=e.tapDelay||200,!n.notNeeded(t)){for(var r=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],s=this,l=0,c=r.length;c>l;l++)s[r[l]]=a(s[r[l]],s);i&&(t.addEventListener(\"mouseover\",this.onMouse,!0),t.addEventListener(\"mousedown\",this.onMouse,!0),t.addEventListener(\"mouseup\",this.onMouse,!0)),t.addEventListener(\"click\",this.onClick,!0),t.addEventListener(\"touchstart\",this.onTouchStart,!1),t.addEventListener(\"touchmove\",this.onTouchMove,!1),t.addEventListener(\"touchend\",this.onTouchEnd,!1),t.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(t.removeEventListener=function(e,n,i){var a=Node.prototype.removeEventListener;\"click\"===e?a.call(t,e,n.hijacked||n,i):a.call(t,e,n,i)},t.addEventListener=function(e,n,i){var a=Node.prototype.addEventListener;\"click\"===e?a.call(t,e,n.hijacked||(n.hijacked=function(t){t.propagationStopped||n(t)}),i):a.call(t,e,n,i)}),\"function\"==typeof t.onclick&&(o=t.onclick,t.addEventListener(\"click\",function(t){o(t)},!1),t.onclick=null)}}", "function touchStartHandler(e) {\n //stopping the auto scroll to adjust to a section\n if (options.fitToSection) {\n activeAnimation = false;\n }\n\n if (isReallyTouch(e)) {\n var touchEvents = getEventsPage(e);\n touchStartY = touchEvents.y;\n touchStartX = touchEvents.x;\n }\n }", "function touchstartHandle(e) {\n\tvar {\n\t\tclientX,\n\t\tclientY\n\t} = e.changedTouches[0];\n\tvar location = getLocation(canvas[2], clientX, clientY);\n\tvar i = whichCircle(location.x, w);\n\tvar j = whichCircle(location.y, h);\n\n\tif (!clicked[j * 3 + i]) {\n\t\tvar distance = getDistance(location.x, location.y, w * (i + 1) / 4, h * (j + 1) / 4);\n\t\tif (distance < touchRadius) {\n\t\t\tdrawCircle(canvas[2], w * (i + 1) / 4, h * (j + 1) / 4, 30, 0, 2 * Math.PI, false, \"#fff\", true);\n\t\t\tdrawCircle(canvas[2], w * (i + 1) / 4, h * (j + 1) / 4, 10, 0, 2 * Math.PI, false, \"red\", true);\n\t\t\tdrawCircle(canvas[2], w * (i + 1) / 4, h * (j + 1) / 4, 30, 0, 2 * Math.PI, false, \"red\", false);\n\t\t\tclicked[j * 3 + i] = true;\n\t\t\ttouchPoint.push(j * 3 + i);\n\t\t\tflag = true;\n\t\t\tstartPoint = [w * (i + 1) / 4, h * (j + 1) / 4];\n\t\t}\n\t}\n}", "handletouchstart(e) {\n var touch = e.touches[0];\n var mouseEvent = new MouseEvent(\"mousedown\", {\n clientX: touch.clientX,\n clientY: touch.clientY\n })\n this.canvas.dispatchEvent(mouseEvent);\n e.preventDefault();\n }", "function touchStartHandler(e){\n\n //stopping the auto scroll to adjust to a section\n if(options.fitToSection){\n activeAnimation = false;\n }\n\n if(isReallyTouch(e)){\n var touchEvents = getEventsPage(e);\n touchStartY = touchEvents.y;\n touchStartX = touchEvents.x;\n }\n }", "function touchStartHandler(e){\n\n //stopping the auto scroll to adjust to a section\n if(options.fitToSection){\n activeAnimation = false;\n }\n\n if(isReallyTouch(e)){\n var touchEvents = getEventsPage(e);\n touchStartY = touchEvents.y;\n touchStartX = touchEvents.x;\n }\n }", "function touchStartHandler(e){\n\n //stopping the auto scroll to adjust to a section\n if(options.fitToSection){\n activeAnimation = false;\n }\n\n if(isReallyTouch(e)){\n var touchEvents = getEventsPage(e);\n touchStartY = touchEvents.y;\n touchStartX = touchEvents.x;\n }\n }", "function touchStarted() {\n touch_start = true;\n mousePressed() \n mouseClicked()\n}", "onTouchStart(ray) {\n var self = this,\n touch = ray.e.changedTouches[0],\n isInside;\n\n ray.position = {\n x: touch.clientX,\n y: touch.clientY\n };\n\n isInside = isMenuPartClicked(ray, false);\n\n if (isInside) {\n // on tap, trigger the click handler\n this.dispatchInteraction(MenuEmitter.ON_TOUCH_START_INSIDE, ray);\n } else {\n this.dispatchInteraction(MenuEmitter.ON_TOUCH_START_OUTSIDE, ray, true);\n // after a delay (tap and hold) trigger the context menu handler\n touchTimeout = setTimeout(function() {\n // we're producing the 'onContextMenu' event on tap-and-hold\n // because of that, we might have tapped the drop-down button, which opened the menu\n // we're still within this timeout interval, waiting to dispatch ON_CONTEXT_MENU\n // however, if the button is in toggle mode, this action would close the menu\n // since we don't want this to happen, we are ignoring the toggle parts here\n isInside = isMenuPartClicked(ray, true); // include toggle parts\n if (!isInside) {\n self.dispatchInteraction(MenuEmitter.ON_CONTEXT_MENU_OUTSIDE, ray, true); // close menu\n }\n }, TAP_AND_HOLD_INTERVAL);\n }\n }", "function gestureStart(ev){// If we're already touched down, abort\n\tif(pointer)return;var now=+Date.now();// iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n\t// If <400ms have passed, don't allow an event of a different type than the previous event\n\tif(lastPointer&&!typesMatch(ev,lastPointer)&&now-lastPointer.endTime<1500){return;}pointer=makeStartPointer(ev);runHandlers('start',ev);}", "function touchStartHandler(event){\r\n var e = event.originalEvent;\r\n\r\n //stopping the auto scroll to adjust to a section\r\n if(options.fitToSection){\r\n $htmlBody.stop();\r\n }\r\n\r\n if(isReallyTouch(e)){\r\n var touchEvents = getEventsPage(e);\r\n touchStartY = touchEvents.y;\r\n touchStartX = touchEvents.x;\r\n }\r\n }", "function touchStartHandler(event){\r\n var e = event.originalEvent;\r\n\r\n //stopping the auto scroll to adjust to a section\r\n if(options.fitToSection){\r\n $htmlBody.stop();\r\n }\r\n\r\n if(isReallyTouch(e)){\r\n var touchEvents = getEventsPage(e);\r\n touchStartY = touchEvents.y;\r\n touchStartX = touchEvents.x;\r\n }\r\n }", "function touchStartHandler(event){\r\n var e = event.originalEvent;\r\n\r\n //stopping the auto scroll to adjust to a section\r\n if(options.fitToSection){\r\n $htmlBody.stop();\r\n }\r\n\r\n if(isReallyTouch(e)){\r\n var touchEvents = getEventsPage(e);\r\n touchStartY = touchEvents.y;\r\n touchStartX = touchEvents.x;\r\n }\r\n }", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (nodeName_(event.target) === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur && event.target.blur();\n }", "function handleStart(e) {\n document.getElementById(id).className = \"touchBtn pressed\";\n e.preventDefault();\n }", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (event.target.tagName.toLowerCase() === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur();\n }", "_onTouchStart(ev){\n\t\tif (!ev.touches || ev.touches.length === 0) {\n\t\t\tconsole.error('No touches on touch event', ev)\n\t\t\treturn\n\t\t}\n\t\t//save screen coordinates normalized to -1..1 (0,0 is at center and 1,1 is at top right)\n\t\tthis._tapEventData = [\n\t\t\tev.touches[0].clientX / window.innerWidth,\n\t\t\tev.touches[0].clientY / window.innerHeight\n\t\t]\n\t}", "function touchStartHandler(event) {\n var e = event.originalEvent;\n\n //stopping the auto scroll to adjust to a section\n if (options.fitToSection) {\n $htmlBody.stop();\n }\n\n if (isReallyTouch(e)) {\n var touchEvents = getEventsPage(e);\n touchStartY = touchEvents.y;\n touchStartX = touchEvents.x;\n }\n }", "function touchStartHandler(event){\n var e = event.originalEvent;\n\n //stopping the auto scroll to adjust to a section\n if(options.fitToSection){\n $htmlBody.stop();\n }\n\n if(isReallyTouch(e)){\n var touchEvents = getEventsPage(e);\n touchStartY = touchEvents.y;\n touchStartX = touchEvents.x;\n }\n }", "function touchStartHandler(event){\n var e = event.originalEvent;\n\n //stopping the auto scroll to adjust to a section\n if(options.fitToSection){\n $htmlBody.stop();\n }\n\n if(isReallyTouch(e)){\n var touchEvents = getEventsPage(e);\n touchStartY = touchEvents.y;\n touchStartX = touchEvents.x;\n }\n }", "function touchStartHandler(event){\n var e = event.originalEvent;\n\n //stopping the auto scroll to adjust to a section\n if(options.fitToSection){\n $htmlBody.stop();\n }\n\n if(isReallyTouch(e)){\n var touchEvents = getEventsPage(e);\n touchStartY = touchEvents.y;\n touchStartX = touchEvents.x;\n }\n }", "function touchStartHandler(event){\n var e = event.originalEvent;\n\n //stopping the auto scroll to adjust to a section\n if(options.fitToSection){\n $htmlBody.stop();\n }\n\n if(isReallyTouch(e)){\n var touchEvents = getEventsPage(e);\n touchStartY = touchEvents.y;\n touchStartX = touchEvents.x;\n }\n }", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (event.target.tagName.toLowerCase() === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur();\n }", "touchHandler(e) {\n var touches = e.changedTouches, first = touches[0], type = \"\";\n switch (e.type){\n case \"touchstart\":\n type = \"mousedown\";\n break;\n case \"touchmove\":\n type = \"mousemove\";\n break;\n case \"touchend\":\n type = \"mouseup\";\n break;\n case \"touchcancel\":\n type = \"mouseup\";\n break;\n default:\n return;\n }\n var simulatedEvent = document.createEvent(\"MouseEvent\");\n simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0/*left*/, null);\n first.target.dispatchEvent(simulatedEvent);\n e.preventDefault();\n }", "function FastClick(a){function b(a,b){return function(){return a.apply(b,arguments)}}var c;this.trackingClick=!1;this.trackingClickStart=0;this.targetElement=null;this.lastTouchIdentifier=this.touchStartY=this.touchStartX=0;this.touchBoundary=10;this.layer=a;FastClick.notNeeded(a)||(deviceIsAndroid&&(a.addEventListener(\"mouseover\",b(this.onMouse,this),!0),a.addEventListener(\"mousedown\",b(this.onMouse,this),!0),a.addEventListener(\"mouseup\",b(this.onMouse,this),!0)),a.addEventListener(\"click\",b(this.onClick,\nthis),!0),a.addEventListener(\"touchstart\",b(this.onTouchStart,this),!1),a.addEventListener(\"touchmove\",b(this.onTouchMove,this),!1),a.addEventListener(\"touchend\",b(this.onTouchEnd,this),!1),a.addEventListener(\"touchcancel\",b(this.onTouchCancel,this),!1),Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(b,c,e){var f=Node.prototype.removeEventListener;\"click\"===b?f.call(a,b,c.hijacked||c,e):f.call(a,b,c,e)},a.addEventListener=function(b,c,e){var f=Node.prototype.addEventListener;\n\"click\"===b?f.call(a,b,c.hijacked||(c.hijacked=function(a){a.propagationStopped||c(a)}),e):f.call(a,b,c,e)}),\"function\"===typeof a.onclick&&(c=a.onclick,a.addEventListener(\"click\",function(a){c(a)},!1),a.onclick=null))}", "function clickListener(event) {\n if (isPressHold) {\n // For Mobile Safari capture phase at least, returning false doesn't work; must use pD() and sP() explicitly.\n // Since it's wonky, do both for good measure.\n event.preventDefault();\n event.stopPropagation();\n isPressHold = false;\n return false;\n }\n\n return undefined;\n } // , on Chrome preventDefault on \"keyup\" will avoid triggering contextmenu event", "function FastClick(a,h){function f(a,f){return function(){return a.apply(f,arguments)}}var v;h=h||{};this.trackingClick=!1;this.trackingClickStart=0;this.targetElement=null;this.lastTouchIdentifier=this.touchStartY=this.touchStartX=0;this.touchBoundary=h.touchBoundary||10;this.layer=a;this.tapDelay=h.tapDelay||200;if(!FastClick.notNeeded(a)){for(var t=\"onMouse onClick onTouchStart onTouchMove onTouchEnd onTouchCancel\".split(\" \"),n=0,u=t.length;n<u;n++)this[t[n]]=f(this[t[n]],this);deviceIsAndroid&&\n(a.addEventListener(\"mouseover\",this.onMouse,!0),a.addEventListener(\"mousedown\",this.onMouse,!0),a.addEventListener(\"mouseup\",this.onMouse,!0));a.addEventListener(\"click\",this.onClick,!0);a.addEventListener(\"touchstart\",this.onTouchStart,!1);a.addEventListener(\"touchmove\",this.onTouchMove,!1);a.addEventListener(\"touchend\",this.onTouchEnd,!1);a.addEventListener(\"touchcancel\",this.onTouchCancel,!1);Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(f,h,q){var n=Node.prototype.removeEventListener;\n\"click\"===f?n.call(a,f,h.hijacked||h,q):n.call(a,f,h,q)},a.addEventListener=function(f,h,q){var n=Node.prototype.addEventListener;\"click\"===f?n.call(a,f,h.hijacked||(h.hijacked=function(a){a.propagationStopped||h(a)}),q):n.call(a,f,h,q)});\"function\"===typeof a.onclick&&(v=a.onclick,a.addEventListener(\"click\",function(a){v(a)},!1),a.onclick=null)}}", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (event.target.tagName.toLowerCase() === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur();\n }", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (event.target.tagName.toLowerCase() === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur();\n }", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (nodeName_(event.target) === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur && event.target.blur();\n }", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (nodeName_(event.target) === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur && event.target.blur();\n }", "function callbackTouchStart(e) {\n this.isMove = false;\n var control = this.getOwnerControl(/** @type {Node} */ (e.target));\n // Highlight the menu item.\n control.handleMouseDown(e);\n }", "function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (nodeName_(event.target) === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n // event.target && event.target.blur && event.target.blur();\n }", "function canvasTouchHandler(){\n canvas.addEventListener('touchstart', function(event){\n event.preventDefault();},false);\n canvas.addEventListener('touchmove', function(event){\n event.preventDefault();},false);\n}", "function touchStartHandler(e) {\n startPos = e.touches[0].pageY;\n }", "function preventTouchClick() {\n const onClick = function(event){\n event.preventDefault();\n\n document.removeEventListener('click', onClick);\n };\n document.addEventListener('click', onClick);\n setTimeout(function() {\n document.removeEventListener('click', onClick);\n }, 100);\n }", "_onTouchStart(event) {\n if (!this.props.disabled && event.touches.length === 1) {\n this.setState({ active: true });\n }\n\n if (this.props.onTouchStart) {\n this.props.onTouchStart(event);\n }\n }", "control(){\n document.addEventListener(\"mousemove\", (e) => {\n this.mouse_x = e.clientX;\n this.mouse_y = e.clientY;\n })\n\n document.addEventListener(\"touchmove\", (e) => {\n this.mouse_x = e.touches[0].clientX+30; //Ajuste para a nave ficar a frente do dedo\n this.mouse_y = e.touches[0].clientY;\n })\n\n document.addEventListener(\"click\", (e) => {\n if(e.button == 0){\n this.shotFire();\n }\n })\n\n document.addEventListener(\"touchstart\", (e) => {\n this.shotFire();\n })\n }", "function onTouchStarted(eventData)\n{\n isTouching = true;\n}", "function FastClick(a,b){function c(a,b){return function(){return a.apply(b,arguments)}}var d;if(b=b||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=b.touchBoundary||10,this.layer=a,this.tapDelay=b.tapDelay||200,!FastClick.notNeeded(a)){for(var e=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],f=this,g=0,h=e.length;h>g;g++)f[e[g]]=c(f[e[g]],f);deviceIsAndroid&&(a.addEventListener(\"mouseover\",this.onMouse,!0),a.addEventListener(\"mousedown\",this.onMouse,!0),a.addEventListener(\"mouseup\",this.onMouse,!0)),a.addEventListener(\"click\",this.onClick,!0),a.addEventListener(\"touchstart\",this.onTouchStart,!1),a.addEventListener(\"touchmove\",this.onTouchMove,!1),a.addEventListener(\"touchend\",this.onTouchEnd,!1),a.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(b,c,d){var e=Node.prototype.removeEventListener;\"click\"===b?e.call(a,b,c.hijacked||c,d):e.call(a,b,c,d)},a.addEventListener=function(b,c,d){var e=Node.prototype.addEventListener;\"click\"===b?e.call(a,b,c.hijacked||(c.hijacked=function(a){a.propagationStopped||c(a)}),d):e.call(a,b,c,d)}),\"function\"==typeof a.onclick&&(d=a.onclick,a.addEventListener(\"click\",function(a){d(a)},!1),a.onclick=null)}}", "_setupTouches () {\n const body = document.querySelector('body')\n this._events['touchmove'] = {event: this._handleTouchMove, disable: document, context: body}\n this._events['touchstart'] = {event: this._handleTouchStart, disable: document, context: body}\n this._events['touchend'] = {event: this._handleTouchEnd, disable: document, context: body}\n }", "function touchstartForCanvas(event)\n{\n //console.log('touchstart event on canvas');\n \n event.preventDefault();\n}", "function FastClick(a){var b,c=this;this.trackingClick=!1;this.trackingClickStart=0;this.targetElement=null;this.lastTouchIdentifier=this.touchStartY=this.touchStartX=0;this.touchBoundary=10;this.layer=a;if(!a||!a.nodeType)throw new TypeError(\"Layer must be a document node\");this.onClick=function(){return FastClick.prototype.onClick.apply(c,arguments)};this.onMouse=function(){return FastClick.prototype.onMouse.apply(c,arguments)};this.onTouchStart=function(){return FastClick.prototype.onTouchStart.apply(c,\narguments)};this.onTouchEnd=function(){return FastClick.prototype.onTouchEnd.apply(c,arguments)};this.onTouchCancel=function(){return FastClick.prototype.onTouchCancel.apply(c,arguments)};FastClick.notNeeded(a)||(this.deviceIsAndroid&&(a.addEventListener(\"mouseover\",this.onMouse,!0),a.addEventListener(\"mousedown\",this.onMouse,!0),a.addEventListener(\"mouseup\",this.onMouse,!0)),a.addEventListener(\"click\",this.onClick,!0),a.addEventListener(\"touchstart\",this.onTouchStart,!1),a.addEventListener(\"touchend\",\nthis.onTouchEnd,!1),a.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(b,c,e){var f=Node.prototype.removeEventListener;\"click\"===b?f.call(a,b,c.hijacked||c,e):f.call(a,b,c,e)},a.addEventListener=function(b,c,e){var f=Node.prototype.addEventListener;\"click\"===b?f.call(a,b,c.hijacked||(c.hijacked=function(a){a.propagationStopped||c(a)}),e):f.call(a,b,c,e)}),\"function\"===typeof a.onclick&&(b=a.onclick,a.addEventListener(\"click\",\nfunction(a){b(a)},!1),a.onclick=null))}", "handletouchend() {\n var mouseEvent = new MouseEvent(\"mouseup\", {});\n this.canvas.dispatchEvent(mouseEvent);\n }", "onDocumentTouchStart(event) {\n event.preventDefault();\n event.clientX = event.touches[0].clientX;\n event.clientY = event.touches[0].clientY;\n this.onDocumentMouseDown(event);\n }", "function handleTouchStart(event) {\n var touches = event.changedTouches[0];\n startX = touches.pageX;\n startY = touches.pageY;\n event.preventDefault();\n}", "function touchStartHandler(event){\n var e = event.originalEvent;\n\n if(isReallyTouch(e)){\n var touchEvents = getEventsPage(e);\n touchStartY = touchEvents.y;\n touchStartX = touchEvents.x;\n }\n }", "function FastClick(a, c) {\n function b(a, b) {\n return function() {\n return a.apply(b, arguments)\n }\n }\n var g;\n c = c || {};\n this.trackingClick = !1;\n this.trackingClickStart = 0;\n this.targetElement = null;\n this.lastTouchIdentifier = this.touchStartY = this.touchStartX = 0;\n this.touchBoundary = c.touchBoundary || 10;\n this.layer = a;\n this.tapDelay = c.tapDelay || 200;\n if (!FastClick.notNeeded(a)) {\n for (var d = \"onMouse onClick onTouchStart onTouchMove onTouchEnd onTouchCancel\".split(\" \"), f = 0, m = d.length; f < m; f++) this[d[f]] = b(this[d[f]], this);\n deviceIsAndroid &&\n (a.addEventListener(\"mouseover\", this.onMouse, !0), a.addEventListener(\"mousedown\", this.onMouse, !0), a.addEventListener(\"mouseup\", this.onMouse, !0));\n a.addEventListener(\"click\", this.onClick, !0);\n a.addEventListener(\"touchstart\", this.onTouchStart, !1);\n a.addEventListener(\"touchmove\", this.onTouchMove, !1);\n a.addEventListener(\"touchend\", this.onTouchEnd, !1);\n a.addEventListener(\"touchcancel\", this.onTouchCancel, !1);\n Event.prototype.stopImmediatePropagation || (a.removeEventListener = function(b, c, d) {\n var g = Node.prototype.removeEventListener;\n \"click\" === b ? g.call(a, b, c.hijacked || c, d) : g.call(a, b, c, d)\n }, a.addEventListener = function(b, c, d) {\n var g = Node.prototype.addEventListener;\n \"click\" === b ? g.call(a, b, c.hijacked || (c.hijacked = function(a) {\n a.propagationStopped || c(a)\n }), d) : g.call(a, b, c, d)\n });\n \"function\" === typeof a.onclick && (g = a.onclick, a.addEventListener(\"click\", function(a) {\n g(a)\n }, !1), a.onclick = null)\n }\n}", "function FastClick(t,e){function n(t,e){return function(){return t.apply(e,arguments)}}var i;if(e=e||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=e.touchBoundary||10,this.layer=t,this.tapDelay=e.tapDelay||200,!FastClick.notNeeded(t)){for(var s=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],r=this,o=0,a=s.length;a>o;o++)r[s[o]]=n(r[s[o]],r);deviceIsAndroid&&(t.addEventListener(\"mouseover\",this.onMouse,!0),t.addEventListener(\"mousedown\",this.onMouse,!0),t.addEventListener(\"mouseup\",this.onMouse,!0)),t.addEventListener(\"click\",this.onClick,!0),t.addEventListener(\"touchstart\",this.onTouchStart,!1),t.addEventListener(\"touchmove\",this.onTouchMove,!1),t.addEventListener(\"touchend\",this.onTouchEnd,!1),t.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(t.removeEventListener=function(e,n,i){var s=Node.prototype.removeEventListener;\"click\"===e?s.call(t,e,n.hijacked||n,i):s.call(t,e,n,i)},t.addEventListener=function(e,n,i){var s=Node.prototype.addEventListener;\"click\"===e?s.call(t,e,n.hijacked||(n.hijacked=function(t){t.propagationStopped||n(t)}),i):s.call(t,e,n,i)}),\"function\"==typeof t.onclick&&(i=t.onclick,t.addEventListener(\"click\",function(t){i(t)},!1),t.onclick=null)}}", "function FastClick(a, c) {\n function b(a, b) {\n return function() {\n return a.apply(b, arguments)\n }\n }\n var e;\n c = c || {};\n this.trackingClick = !1;\n this.trackingClickStart = 0;\n this.targetElement = null;\n this.lastTouchIdentifier = this.touchStartY = this.touchStartX = 0;\n this.touchBoundary = c.touchBoundary || 10;\n this.layer = a;\n this.tapDelay = c.tapDelay || 200;\n if (!FastClick.notNeeded(a)) {\n for (var d = \"onMouse onClick onTouchStart onTouchMove onTouchEnd onTouchCancel\".split(\" \"), g = 0, m = d.length; g < m; g++) this[d[g]] = b(this[d[g]], this);\n deviceIsAndroid &&\n (a.addEventListener(\"mouseover\", this.onMouse, !0), a.addEventListener(\"mousedown\", this.onMouse, !0), a.addEventListener(\"mouseup\", this.onMouse, !0));\n a.addEventListener(\"click\", this.onClick, !0);\n a.addEventListener(\"touchstart\", this.onTouchStart, !1);\n a.addEventListener(\"touchmove\", this.onTouchMove, !1);\n a.addEventListener(\"touchend\", this.onTouchEnd, !1);\n a.addEventListener(\"touchcancel\", this.onTouchCancel, !1);\n Event.prototype.stopImmediatePropagation || (a.removeEventListener = function(b, c, d) {\n var e = Node.prototype.removeEventListener;\n \"click\" === b ? e.call(a, b, c.hijacked || c, d) : e.call(a, b, c, d)\n }, a.addEventListener = function(b, c, d) {\n var e = Node.prototype.addEventListener;\n \"click\" === b ? e.call(a, b, c.hijacked || (c.hijacked = function(a) {\n a.propagationStopped || c(a)\n }), d) : e.call(a, b, c, d)\n });\n \"function\" === typeof a.onclick && (e = a.onclick, a.addEventListener(\"click\", function(a) {\n e(a)\n }, !1), a.onclick = null)\n }\n}", "function touchHandler() {\n this.tstate = null;\n this.cMenu = false;\n this.moving = false; \n this.startx = 0;\n this.starty = 0;\n }", "function FastClick(t,e){\"use strict\";function i(t,e){return function(){return t.apply(e,arguments)}}var n;if(e=e||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=e.touchBoundary||10,this.layer=t,this.tapDelay=e.tapDelay||200,!FastClick.notNeeded(t)){for(var o=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],s=this,r=0,c=o.length;c>r;r++)s[o[r]]=i(s[o[r]],s);deviceIsAndroid&&(t.addEventListener(\"mouseover\",this.onMouse,!0),t.addEventListener(\"mousedown\",this.onMouse,!0),t.addEventListener(\"mouseup\",this.onMouse,!0)),t.addEventListener(\"click\",this.onClick,!0),t.addEventListener(\"touchstart\",this.onTouchStart,!1),t.addEventListener(\"touchmove\",this.onTouchMove,!1),t.addEventListener(\"touchend\",this.onTouchEnd,!1),t.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(t.removeEventListener=function(e,i,n){var o=Node.prototype.removeEventListener;\"click\"===e?o.call(t,e,i.hijacked||i,n):o.call(t,e,i,n)},t.addEventListener=function(e,i,n){var o=Node.prototype.addEventListener;\"click\"===e?o.call(t,e,i.hijacked||(i.hijacked=function(t){t.propagationStopped||i(t)}),n):o.call(t,e,i,n)}),\"function\"==typeof t.onclick&&(n=t.onclick,t.addEventListener(\"click\",function(t){n(t)},!1),t.onclick=null)}}", "function FastClick(t,e){\"use strict\";function i(t,e){return function(){return t.apply(e,arguments)}}var n;if(e=e||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=e.touchBoundary||10,this.layer=t,this.tapDelay=e.tapDelay||200,!FastClick.notNeeded(t)){for(var o=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],s=this,r=0,c=o.length;c>r;r++)s[o[r]]=i(s[o[r]],s);deviceIsAndroid&&(t.addEventListener(\"mouseover\",this.onMouse,!0),t.addEventListener(\"mousedown\",this.onMouse,!0),t.addEventListener(\"mouseup\",this.onMouse,!0)),t.addEventListener(\"click\",this.onClick,!0),t.addEventListener(\"touchstart\",this.onTouchStart,!1),t.addEventListener(\"touchmove\",this.onTouchMove,!1),t.addEventListener(\"touchend\",this.onTouchEnd,!1),t.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(t.removeEventListener=function(e,i,n){var o=Node.prototype.removeEventListener;\"click\"===e?o.call(t,e,i.hijacked||i,n):o.call(t,e,i,n)},t.addEventListener=function(e,i,n){var o=Node.prototype.addEventListener;\"click\"===e?o.call(t,e,i.hijacked||(i.hijacked=function(t){t.propagationStopped||i(t)}),n):o.call(t,e,i,n)}),\"function\"==typeof t.onclick&&(n=t.onclick,t.addEventListener(\"click\",function(t){n(t)},!1),t.onclick=null)}}", "touchHandler(event) {\n const touches = event.changedTouches\n const first = touches[0]\n let type = ''\n switch (event.type) {\n case 'touchstart':\n type = 'mousedown'\n break\n case 'touchmove':\n type = 'mousemove'\n break\n case 'touchend':\n type = 'mouseup'\n break\n default:\n return\n }\n // initMouseEvent(type, canBubble, cancelable, view, clickCount, \n // screenX, screenY, clientX, clientY, ctrlKey, \n // altKey, shiftKey, metaKey, button, relatedTarget)\n const simulatedEvent = document.createEvent('MouseEvent')\n simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0, null)\n first.target.dispatchEvent(simulatedEvent)\n event.preventDefault()\n }", "function touchStart(event) {\n if ( options.fLog ) options.fLog('touchStart');\n \n // disable the standard ability to select the touched object\n event.preventDefault();\n // get the total number of fingers touching the screen\n fingerCount = event.touches.length;\n if ( options.fLog ) options.fLog('touchStart> fingerCount : ' + fingerCount);\n // since we're looking for a swipe (single finger) and not a gesture (multiple fingers),\n // check that only one finger was used\n if ( fingerCount == 1 ) {\n // get the coordinates of the touch\n startX = event.touches[0].pageX;\n startY = event.touches[0].pageY;\n // store the triggering element ID\n //triggerElementID = passedName;\n } else {\n // more than one finger touched so cancel\n touchCancel(event);\n }\n }", "function touchStart(event)\n\t\t\t{\n\t\t\t\toriginalCoord.x = (settings.touch_capable) ? event.targetTouches[0].pageX : event.pageX;\n\t\t\t\toriginalCoord.y = (settings.touch_capable) ? event.targetTouches[0].pageY : event.pageY;\n\t\t\t\tfinalCoord.x = originalCoord.x;\n\t\t\t\tfinalCoord.y = originalCoord.y;\n\t\t\t\tstarted = true;\n\t\t\t}", "function FastClick(e,t){\"use strict\";function n(e,t){return function(){return e.apply(t,arguments)}}var r;if(t=t||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=t.touchBoundary||10,this.layer=e,this.tapDelay=t.tapDelay||200,!FastClick.notNeeded(e)){for(var i=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],s=this,o=0,u=i.length;u>o;o++)s[i[o]]=n(s[i[o]],s);deviceIsAndroid&&(e.addEventListener(\"mouseover\",this.onMouse,!0),e.addEventListener(\"mousedown\",this.onMouse,!0),e.addEventListener(\"mouseup\",this.onMouse,!0)),e.addEventListener(\"click\",this.onClick,!0),e.addEventListener(\"touchstart\",this.onTouchStart,!1),e.addEventListener(\"touchmove\",this.onTouchMove,!1),e.addEventListener(\"touchend\",this.onTouchEnd,!1),e.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(e.removeEventListener=function(t,n,r){var i=Node.prototype.removeEventListener;\"click\"===t?i.call(e,t,n.hijacked||n,r):i.call(e,t,n,r)},e.addEventListener=function(t,n,r){var i=Node.prototype.addEventListener;\"click\"===t?i.call(e,t,n.hijacked||(n.hijacked=function(e){e.propagationStopped||n(e)}),r):i.call(e,t,n,r)}),\"function\"==typeof e.onclick&&(r=e.onclick,e.addEventListener(\"click\",function(e){r(e)},!1),e.onclick=null)}}", "function start(e){\n e.preventDefault();\n touched = true;\n if(!Android){\n offsetX = e.pageX - X;\n offsetY = e.pageY - Y;\n }\n else{\n offsetX = e.changedTouches[0].pageX - X;\n offsetY = e.changedTouches[0].pageY - Y;\n }\n document.addEventListener( events['move'], move, false);\n document.addEventListener( events['end'], stop, false);\n initAnim();\n }", "onElementTouchStart(event) {\n const me = this;\n\n DomHelper.isTouchEvent = true;\n\n if (event.touches.length === 1) {\n me.longPressTimeout = setTimeout(() => {\n me.onElementLongPress(event);\n event.preventDefault();\n me.longPressPerformed = true;\n }, me.longPressTime);\n }\n }", "function onCanvasTouchStart(event) {\n window.mouseDown = true;\n var touch = event.changedTouches[0];\n clickCell(touch.pageX, touch.pageY);\n event.preventDefault();\n}", "startMenu() {\n this.isInPlay = false;\n document.addEventListener(\"mousedown\", this.onMouseDown, false);\n document.addEventListener(\"touchstart\", this.onTouchStart, {\n passive: false\n });\n document.addEventListener(\"mouseup\", this.onMouseUp, false);\n document.addEventListener(\"touchend\", this.onTouchEnd, { passive: false });\n document.addEventListener(\"mousemove\", this.onMouseMove, false);\n document.addEventListener(\"touchmove\", this.onTouchMove, {\n passive: false\n });\n this.clear();\n }", "onElementTouchStart(event) {\n const me = this;\n DomHelper.isTouchEvent = true;\n\n if (event.touches.length === 1) {\n me.longPressTimeout = me.setTimeout(() => {\n me.onElementLongPress(event);\n event.preventDefault();\n me.longPressPerformed = true;\n }, me.longPressTime);\n }\n }", "function touchstart(e) {\n\tx_finger_bak = e.changedTouches[0].screenX\n\ty_finger_bak = e.changedTouches[0].screenY\n\tshow_ctrl(true)\n\treturn false\n}", "function FastClick(e,t){function n(e,t){return function(){return e.apply(t,arguments)}}var i;if(t=t||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=t.touchBoundary||10,this.layer=e,this.tapDelay=t.tapDelay||200,!FastClick.notNeeded(e)){for(var r=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],s=this,a=0,o=r.length;o>a;a++)s[r[a]]=n(s[r[a]],s);deviceIsAndroid&&(e.addEventListener(\"mouseover\",this.onMouse,!0),e.addEventListener(\"mousedown\",this.onMouse,!0),e.addEventListener(\"mouseup\",this.onMouse,!0)),e.addEventListener(\"click\",this.onClick,!0),e.addEventListener(\"touchstart\",this.onTouchStart,!1),e.addEventListener(\"touchmove\",this.onTouchMove,!1),e.addEventListener(\"touchend\",this.onTouchEnd,!1),e.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(e.removeEventListener=function(t,n,i){var r=Node.prototype.removeEventListener;\"click\"===t?r.call(e,t,n.hijacked||n,i):r.call(e,t,n,i)},e.addEventListener=function(t,n,i){var r=Node.prototype.addEventListener;\"click\"===t?r.call(e,t,n.hijacked||(n.hijacked=function(e){e.propagationStopped||n(e)}),i):r.call(e,t,n,i)}),\"function\"==typeof e.onclick&&(i=e.onclick,e.addEventListener(\"click\",function(e){i(e)},!1),e.onclick=null)}}", "function touchStart(e) {\n $this = $(e.currentTarget);\n $this.data('callee1', touchStart);\n originalCoord.x = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageX : e.pageX;\n originalCoord.y = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageY : e.pageY;\n finalCoord.x = originalCoord.x;\n finalCoord.y = originalCoord.y;\n started = true;\n var origEvent = e.originalEvent;\n // Read event data into our startEvt:\n startEvnt = {\n 'position': {\n 'x': (settings.touch_capable) ? origEvent.touches[0].screenX : e.screenX,\n 'y': (settings.touch_capable) ? origEvent.touches[0].screenY : e.screenY\n },\n 'offset': {\n 'x': (settings.touch_capable) ? Math.round(origEvent.changedTouches[0].pageX - ($this.offset() ? $this.offset().left : 0)) : Math.round(e.pageX - ($this.offset() ? $this.offset().left : 0)),\n 'y': (settings.touch_capable) ? Math.round(origEvent.changedTouches[0].pageY - ($this.offset() ? $this.offset().top : 0)) : Math.round(e.pageY - ($this.offset() ? $this.offset().top : 0))\n },\n 'time': Date.now(),\n 'target': e.target\n };\n }", "onLongPress_() {\n // Swallow any click that occurs on this element without an intervening\n // touch start event. This simple click-busting technique should be\n // sufficient here since a real click should have a touchstart first.\n this.swallowNextClick_ = true;\n this.disableTap_ = true;\n\n // Dispatch to the LONG_PRESS\n assert(typeof this.startTouchX_ === 'number');\n assert(typeof this.startTouchY_ === 'number');\n this.dispatchEventXY_(\n TouchHandler.EventType.LONG_PRESS, this.element_,\n /** @type {number} */ (this.startTouchX_),\n /** @type {number} */ (this.startTouchY_));\n }", "function touchHandler(event){\n var touches = event.changedTouches,\n first = touches[0],\n type = \"\";\n switch(event.type)\n {\n case \"touchstart\": type = \"mousedown\"; break;\n case \"touchmove\": type=\"mousemove\"; break; \n case \"touchend\": type=\"mouseup\"; break;\n default: return;\n }\n\n //initMouseEvent(type, canBubble, cancelable, view, clickCount, \n // screenX, screenY, clientX, clientY, ctrlKey, \n // altKey, shiftKey, metaKey, button, relatedTarget);\n \n var simulatedEvent = document.createEvent(\"MouseEvent\");\n simulatedEvent.initMouseEvent(type, true, true, window, 1, \n first.screenX, first.screenY, \n first.clientX, first.clientY, false, \n false, false, false, 0/*left*/, null);\n first.target.dispatchEvent(simulatedEvent);\n event.preventDefault();\n}", "function gestureStart(ev) {\n // If we're already touched down, abort\n if (pointer) return;\n\n var now = +Date.now();\n\n // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n // If <400ms have passed, don't allow an event of a different type than the previous event\n if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) {\n return;\n }\n\n pointer = makeStartPointer(ev);\n\n runHandlers('start', ev);\n }", "function CALCULATE_TOUCH_UP_OR_MOUSE_UP() {\r\n \r\n GLOBAL_CLICK.CLICK_PRESSED = false;\r\n \r\n }", "function touchBegan (event, point) {\n\t\t_capturedTouches = [point];\n\t}", "function dragStart(e) {\n //setting the initial position of our pointer\n if (e.type === \"touchstart\") { // is it a touch event?\n initialX = e.touches[0].clientX - xOffset;\n initialY = e.touches[0].clientY - yOffset;\n } else { // if not...\n initialX = e.clientX - xOffset;\n initialY = e.clientY - yOffset;\n }\n\n //check if the element we are clicking on is the element we would like to drag\n //Why? we are listening for our various mouse and touch events on the container, NOT the element we are dragging\n if (e.target === dragItem) {\n active = true;\n }\n }", "function onDocumentTouchStart( event ) {\n\tevent.preventDefault();\n\tevent.clientX = event.touches[0].clientX;\n\tevent.clientY = event.touches[0].clientY;\n\tonDocumentMouseDown( event );\n}", "function gestureStart(ev) {\n // If we're already touched down, abort\n if (pointer) return;\n\n var now = +Date.now();\n\n // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n // If <400ms have passed, don't allow an event of a different type than the previous event\n if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) {\n return;\n }\n\n pointer = makeStartPointer(ev);\n\n runHandlers('start', ev);\n }" ]
[ "0.6798322", "0.677365", "0.677365", "0.6706802", "0.6706802", "0.6706802", "0.6706802", "0.6706802", "0.6563468", "0.6549607", "0.6542408", "0.65337837", "0.65337837", "0.65337837", "0.65337837", "0.6296588", "0.62336236", "0.61802274", "0.61802274", "0.6155774", "0.6122053", "0.6104764", "0.60756654", "0.60756654", "0.60606194", "0.604596", "0.604596", "0.60438097", "0.6033258", "0.6017642", "0.6012761", "0.6010761", "0.6010761", "0.6010761", "0.6000112", "0.5979411", "0.5965904", "0.5946918", "0.5946918", "0.5946918", "0.5936634", "0.5934506", "0.5932884", "0.5932609", "0.5919925", "0.5896302", "0.5896302", "0.5896302", "0.5896302", "0.58945763", "0.5870078", "0.58598", "0.5844454", "0.57980746", "0.57902706", "0.57902706", "0.5788979", "0.5788979", "0.57753515", "0.57744855", "0.57694817", "0.5756326", "0.5753129", "0.5741394", "0.5718803", "0.57173043", "0.57170755", "0.5702816", "0.5700208", "0.5698524", "0.5693588", "0.56885374", "0.5679519", "0.567869", "0.56773746", "0.5671126", "0.5655129", "0.5651974", "0.5651491", "0.5651491", "0.5651228", "0.5645034", "0.56435287", "0.5631818", "0.5629664", "0.5623535", "0.5616766", "0.5591969", "0.5590845", "0.558791", "0.5587426", "0.55803245", "0.5532809", "0.55228835", "0.5520393", "0.5502415", "0.549928", "0.54983646", "0.54904", "0.548806" ]
0.65789163
8
On the first call, attaches some event handlers. Then whenever it gets called, it creates a zone around the touchstart where clicks will get busted.
function preventGhostClick(x, y) { if (!touchCoordinates) { $rootElement[0].addEventListener('click', onClick, true); $rootElement[0].addEventListener('touchstart', onTouchStart, true); touchCoordinates = []; } lastPreventedTime = Date.now(); checkAllowableRegions(touchCoordinates, x, y); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n document.addEventListener(\"touchstart\", touchHandler, true);\n document.addEventListener(\"touchmove\", touchHandler, true);\n document.addEventListener(\"touchend\", touchHandler, true);\n document.addEventListener(\"touchcancel\", touchHandler, true);\n }", "_setupTouches () {\n const body = document.querySelector('body')\n this._events['touchmove'] = {event: this._handleTouchMove, disable: document, context: body}\n this._events['touchstart'] = {event: this._handleTouchStart, disable: document, context: body}\n this._events['touchend'] = {event: this._handleTouchEnd, disable: document, context: body}\n }", "function initTouchHandlers() {\n\n $('.done-button').bind('touchstart', function(e){\n nextTurn();\n })\n\n $('.mode-button').bind('touchstart', function(e){\n const myIndex = $(e.target).data(\"index\");\n const myName = $(e.target).data(\"name\");\n const myPlayer = $(e.target).data(\"player\");\n buttonSelected = player.buttons[myName];\n if (buttonSelected.mode.onModeStart) buttonSelected.mode.onModeStart();\n updateButtons();\n })\n\n $('.mode-button').bind('touchend', function(e){\n if (buttonSelected && buttonSelected.mode.onModeEnd) {\n buttonSelected.mode.onModeEnd();\n }\n updateButtons();\n })\n\n $('#container').bind('touchstart', function(e){\n e.preventDefault();\n const touch = e.targetTouches[0];\n touchX = touch.pageX;\n touchY = touch.pageY;\n if (buttonSelected && buttonSelected.mode.onTouchStart) {\n buttonSelected.mode.onTouchStart();\n }\n updateButtons();\n })\n\n $('#container').bind('touchmove', function(e){\n e.preventDefault();\n const touch = e.targetTouches[0];\n touchX = touch.pageX;\n touchY = touch.pageY;\n if (buttonSelected && buttonSelected.mode.onTouchMove) {\n buttonSelected.mode.onTouchMove();\n }\n updateButtons();\n })\n\n $('#container').bind('touchend touchcancel', function(e){\n e.preventDefault();\n if (buttonSelected && buttonSelected.mode.onTouchEnd) {\n buttonSelected.mode.onTouchEnd();\n }\n updateButtons();\n })\n }", "function init() {\n\t\tsetOnclicks();\n\t}", "function touchStarted() {\n touch_start = true;\n mousePressed() \n mouseClicked()\n}", "function Initialization() {\n document.addEventListener(isTouch ? 'touchend' : 'mouseup', handleUp);\n document.addEventListener(isTouch ? 'touchmove' : 'mousemove', handleMove);\n }", "function startEvents(){\r\n if (!startIsClicked){\r\n startIsClicked = true;\r\n eventLoop(0);\r\n }\r\n}", "function n(t,e){\"use strict\";function a(t,e){return function(){return t.apply(e,arguments)}}var o;if(e=e||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=e.touchBoundary||10,this.layer=t,this.tapDelay=e.tapDelay||200,!n.notNeeded(t)){for(var r=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],s=this,l=0,c=r.length;c>l;l++)s[r[l]]=a(s[r[l]],s);i&&(t.addEventListener(\"mouseover\",this.onMouse,!0),t.addEventListener(\"mousedown\",this.onMouse,!0),t.addEventListener(\"mouseup\",this.onMouse,!0)),t.addEventListener(\"click\",this.onClick,!0),t.addEventListener(\"touchstart\",this.onTouchStart,!1),t.addEventListener(\"touchmove\",this.onTouchMove,!1),t.addEventListener(\"touchend\",this.onTouchEnd,!1),t.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(t.removeEventListener=function(e,n,i){var a=Node.prototype.removeEventListener;\"click\"===e?a.call(t,e,n.hijacked||n,i):a.call(t,e,n,i)},t.addEventListener=function(e,n,i){var a=Node.prototype.addEventListener;\"click\"===e?a.call(t,e,n.hijacked||(n.hijacked=function(t){t.propagationStopped||n(t)}),i):a.call(t,e,n,i)}),\"function\"==typeof t.onclick&&(o=t.onclick,t.addEventListener(\"click\",function(t){o(t)},!1),t.onclick=null)}}", "function onTouchStart(ev) {\n onClickCanvas(ev, true);\n}", "attach() {\n document.addEventListener('touchstart', this[onTouchStart]);\n }", "_bindMouseAndTouchEvents() {\n var self = this;\n\n /* Mouse events */\n this._element.addEventListener(\"mousedown\", (ev) => {\n self._onMouseDown(ev);\n }, false);\n this._element.addEventListener(\"mouseup\", (ev) => {\n self._onMouseUp(ev);\n }, false);\n this._element.addEventListener(\"mouseleave\", (ev) => {\n self._onMouseUp(ev);\n }, false);\n this._element.addEventListener(\"mousemove\", (ev) => {\n self._onMouseMove(ev);\n }, false);\n\n /* Scroll event */\n this._element.addEventListener(\"wheel\", (ev) => {\n self._onWheel(ev);\n }, false);\n\n /* Touch events */\n this._element.addEventListener(\"touchstart\", (ev) => {\n self._onTouchStart(ev);\n }, false);\n this._element.addEventListener(\"touchend\", (ev) => {\n self._onTouchEnd(ev);\n }, false);\n this._element.addEventListener(\"touchmove\", (ev) => {\n self._onTouchMove(ev);\n }, false);\n\n /* Context menu event, this will cause the context menu\n to no longer pop up on right clicks. */\n this._element.oncontextmenu = (ev) => {\n ev.preventDefault();\n return false;\n }\n }", "function addclickEvents(){\n document.getElementById(\"flask\").addEventListener(\"click\", function() {\n callFlask();\n }, false);\n document.getElementById(\"magnet\").addEventListener(\"click\", function() {\n \tcallMagnet();\n }, false);\n document.getElementById(\"heater_button\").addEventListener(\"click\", function() {\n \tcallHeater();\n }, false);\n document.getElementById(\"stir_button\").addEventListener(\"click\", function() {\n \tcallStir();\n }, false);\n document.getElementById(\"pipette\").addEventListener(\"click\", function() {\n \tcallPipette();\n }, false);\n}", "setupUI () {\n this.html.canvas.width = this.canvasWidth\n this.html.canvas.height = this.canvasHeight\n \n if (window.PointerEvent) {\n this.html.canvas.addEventListener('pointerdown', this.onPointerDown.bind(this))\n this.html.canvas.addEventListener('pointermove', this.onPointerMove.bind(this))\n this.html.canvas.addEventListener('pointerup', this.onPointerUp.bind(this))\n this.html.canvas.addEventListener('pointercancel', this.onPointerUp.bind(this))\n } else {\n this.html.canvas.addEventListener('mousedown', this.onPointerDown.bind(this))\n this.html.canvas.addEventListener('mousemove', this.onPointerMove.bind(this))\n this.html.canvas.addEventListener('mouseup', this.onPointerUp.bind(this))\n }\n \n // Prevent \"touch and hold to open context menu\" menu on touchscreens.\n this.html.canvas.addEventListener('touchstart', stopEvent)\n this.html.canvas.addEventListener('touchmove', stopEvent)\n this.html.canvas.addEventListener('touchend', stopEvent)\n this.html.canvas.addEventListener('touchcancel', stopEvent)\n \n this.html.buttonHome.addEventListener('click', this.buttonHome_onClick.bind(this))\n this.html.buttonFullscreen.addEventListener('click', this.buttonFullscreen_onClick.bind(this))\n this.html.buttonReload.addEventListener('click', this.buttonReload_onClick.bind(this))\n \n window.addEventListener('resize', this.updateUI.bind(this))\n this.updateUI()\n this.hideUI() // Hide until all assets are loaded\n }", "_onContainerTouchStart(e){\n e.preventDefault();\n if(e.touches.length === 2){\n this.doubleTap = true;\n this.tapDistance = this._calcDistance(\n e.touches[0].pageX, e.touches[0].pageY,\n e.touches[1].pageX, e.touches[1].pageY\n );\n }\n let element = $(e.target);\n if(element.attr('handle') != undefined){\n let box = this.elements[element.attr('handle')];\n if(box != undefined){\n let x = e.touches[0].pageX - this.canvas.offsetLeft;\n let y = e.touches[0].pageY - this.canvas.offsetTop;\n this.onTouchStart(e, x, y, box);\n box.onTouchStart(e, x, y);\n }\n }\n }", "function setupEvents() {\r\n var element = frontCanvas;\r\n\r\n // Needed this to override context menu behavior\r\n element.bind('contextmenu', function(evt) { evt.preventDefault(); });\r\n\r\n // Wheel should zoom across browsers\r\n element.bind('DOMMouseScroll mousewheel', function (evt) {\r\n var x = (-evt.originalEvent.wheelDeltaY || evt.originalEvent.detail);\r\n\r\n lastLocation = getRelativeLocation(frontCanvas, evt);\r\n handleZoom((x > 0 ? wheelZoom : x < 0 ? -wheelZoom : 0));\r\n evt.preventDefault();\r\n\r\n // Redraw the image in the canvas\r\n redrawImage();\r\n });\r\n\r\n // Handle mobile\r\n attachTouchListener(element);\r\n element.bind('mouse', function(e){\r\n // action: mouseAction,\r\n // current_button: current_button,\r\n // charCode: '',\r\n // altKey: false,\r\n // ctrlKey: false,\r\n // shiftKey: false,\r\n // metaKey: false,\r\n // delegateTarget: target,\r\n // pageX: posX,\r\n // pageY: posY\r\n var action = e.action,\r\n altKey = e.altKey,\r\n shiftKey = e.shiftKey,\r\n ctrlKey = e.ctrlKey,\r\n x = e.pageX,\r\n y = e.pageY,\r\n current_button = e.current_button;\r\n\r\n if(action === 'down') {\r\n if (e.altKey) {\r\n current_button = 2;\r\n e.altKey = false;\r\n } else if (e.shiftKey) {\r\n current_button = 3;\r\n e.shiftKey = false;\r\n }\r\n // Detect interaction mode\r\n switch(current_button) {\r\n case 2: // middle mouse down = pan\r\n mouseMode = modePan;\r\n break;\r\n case 3: // right mouse down = zoom\r\n mouseMode = modeZoom;\r\n break;\r\n default:\r\n mouseMode = modeRotation;\r\n break;\r\n }\r\n\r\n // Store mouse location\r\n lastLocation = [x, y];\r\n\r\n e.preventDefault();\r\n } else if(action === 'up') {\r\n mouseMode = modeNone;\r\n e.preventDefault();\r\n } else if(action === 'move') {\r\n if(mouseMode != modeNone) {\r\n var loc = [x,y];\r\n\r\n // Can NOT use switch as (modeRotation == modePan) is\r\n // possible when Pan should take over rotation as\r\n // rotation is not possible\r\n if(mouseMode === modePan) {\r\n handlePan(loc);\r\n } else if (mouseMode === modeZoom) {\r\n var deltaY = loc[1] - lastLocation[1];\r\n handleZoom(deltaY * dzScale);\r\n\r\n // Update mouse location\r\n lastLocation = loc;\r\n } else {\r\n handleRotation(loc);\r\n }\r\n\r\n // Redraw the image in the canvas\r\n redrawImage();\r\n }\r\n }\r\n });\r\n\r\n // Zoom and pan events with mouse buttons and drag\r\n element.bind('mousedown', function(evt) {\r\n var current_button = evt.which;\r\n\r\n // alt+click simulates center button, shift+click simulates right\r\n if (evt.altKey) {\r\n current_button = 2;\r\n evt.altKey = false;\r\n } else if (evt.shiftKey) {\r\n current_button = 3;\r\n evt.shiftKey = false;\r\n }\r\n\r\n // Detect interaction mode\r\n switch(current_button) {\r\n case 2: // middle mouse down = pan\r\n mouseMode = modePan;\r\n break;\r\n case 3: // right mouse down = zoom\r\n mouseMode = modeZoom;\r\n break;\r\n default:\r\n mouseMode = modeRotation;\r\n break;\r\n }\r\n\r\n // Store mouse location\r\n lastLocation = getRelativeLocation(frontCanvas, evt);\r\n\r\n evt.preventDefault();\r\n });\r\n\r\n // Send mouse movement event to the forwarding function\r\n element.bind('mousemove', function(e) {\r\n if(mouseMode != modeNone) {\r\n var loc = getRelativeLocation(frontCanvas, e);\r\n\r\n // Can NOT use switch as (modeRotation == modePan) is\r\n // possible when Pan should take over rotation as\r\n // rotation is not possible\r\n if(mouseMode === modePan) {\r\n handlePan(loc);\r\n } else if (mouseMode === modeZoom) {\r\n var deltaY = loc[1] - lastLocation[1];\r\n handleZoom(deltaY * dzScale);\r\n\r\n // Update mouse location\r\n lastLocation = loc;\r\n } else {\r\n handleRotation(loc);\r\n }\r\n\r\n // Redraw the image in the frontCanvas\r\n redrawImage();\r\n }\r\n });\r\n\r\n // Stop any zoom or pan events\r\n element.bind('mouseup', function(evt) {\r\n mouseMode = modeNone;\r\n evt.preventDefault();\r\n });\r\n }", "addEvents() {\n var self = this;\n\n this.canvas.oncontextmenu = function () { return false; };\n\n this.canvas.addEventListener(\"touchstart\", onTouchStart);\n\n /**\n * @param {Event} evt\n * @private\n */\n function onTouchStart(evt) {\n // remove the focus of the controls\n window.focus();\n document.activeElement.blur();\n\n self.click = 1;\n self.evaluator.setVariable(self.id + \".mouse_pressed\", 1);\n\n // deactivate the graphic controls\n self.parent.deactivateGraphicControls();\n\n self.posAnte = descartesJS.getCursorPosition(evt, self.container);\n self.oldMouse.x = self.getRelativeX(self.posAnte.x);\n self.oldMouse.y = self.getRelativeY(self.posAnte.y);\n\n onSensitiveToMouseMovements(evt);\n\n window.addEventListener(\"touchmove\", onMouseMove);\n window.addEventListener(\"touchend\", onTouchEnd);\n\n // if ((!self.fixed) || (self.sensitive_to_mouse_movements)) {\n evt.preventDefault();\n // }\n }\n\n /**\n *\n * @param {Event} evt\n * @private\n */\n function onTouchEnd(evt) {\n // remove the focus of the controls\n window.focus();\n document.activeElement.blur();\n\n self.click = 0;\n self.evaluator.setVariable(self.id + \".mouse_pressed\", 0);\n\n window.removeEventListener(\"touchmove\", onMouseMove, false);\n window.removeEventListener(\"touchend\", onTouchEnd, false);\n\n evt.preventDefault();\n\n self.parent.update();\n }\n\n ///////////////////////////////////////////////////////////////////////////\n //\n ///////////////////////////////////////////////////////////////////////////\n this.canvas.addEventListener(\"mousedown\", onMouseDown);\n\n /**\n *\n * @param {Event} evt\n * @private\n */\n function onMouseDown(evt) {\n // remove the focus of the controls\n document.body.focus();\n\n self.click = 1;\n\n // deactivate the graphic controls\n self.parent.deactivateGraphicControls();\n\n self.whichBtn = descartesJS.whichBtn(evt);\n\n if (self.whichBtn === \"R\") {\n window.addEventListener(\"mouseup\", onMouseUp);\n\n self.posObserver = (descartesJS.getCursorPosition(evt, self.container)).x;\n self.posObserverNew = self.posObserver;\n\n self.posZoom = (descartesJS.getCursorPosition(evt, self.container)).y;\n self.posZoomNew = self.posZoom;\n\n // if fixed add a zoom manager\n if (!self.fixed) {\n self.tempScale = self.scale;\n self.tempObserver = self.observer;\n window.addEventListener(\"mousemove\", onMouseMoveZoom);\n }\n }\n\n else if (self.whichBtn == \"L\") {\n self.evaluator.setVariable(self.id + \".mouse_pressed\", 1);\n\n self.posAnte = descartesJS.getCursorPosition(evt, self.container);\n self.oldMouse.x = self.getRelativeX(self.posAnte.x);\n self.oldMouse.y = self.getRelativeY(self.posAnte.y);\n\n onSensitiveToMouseMovements(evt);\n\n window.addEventListener(\"mousemove\", onMouseMove);\n window.addEventListener(\"mouseup\", onMouseUp);\n }\n\n evt.preventDefault();\n }\n\n /**\n *\n * @param {Event} evt\n * @private\n */\n function onMouseUp(evt) {\n // remove the focus of the controls\n document.body.focus();\n\n self.click = 0;\n self.evaluator.setVariable(self.id + \".mouse_pressed\", 0);\n evt.preventDefault();\n\n if (self.whichBtn === \"R\") {\n window.removeEventListener(\"mousemove\", onMouseMoveZoom, false);\n\n // show the external space\n if ((self.posZoom == self.posZoomNew) && (descartesJS.showConfig)) {\n self.parent.externalSpace.show();\n }\n }\n\n window.removeEventListener(\"mousemove\", onMouseMove, false);\n window.removeEventListener(\"mouseup\", onMouseUp, false);\n\n self.parent.update();\n }\n\n /**\n *\n * @param {Event} evt\n * @private\n */\n function onSensitiveToMouseMovements(evt) {\n self.posAnte = descartesJS.getCursorPosition(evt, self.container);\n self.mouse_x = self.getRelativeX(self.posAnte.x);\n self.mouse_y = self.getRelativeY(self.posAnte.y);\n self.evaluator.setVariable(self.id + \".mouse_x\", self.mouse_x);\n self.evaluator.setVariable(self.id + \".mouse_y\", self.mouse_y);\n\n // limit the number of updates in the lesson\n self.parent.update();\n }\n\n /**\n *\n * @param {Event} evt\n * @private\n */\n function onMouseMoveZoom(evt) {\n evt.preventDefault();\n\n self.posZoomNew = (descartesJS.getCursorPosition(evt, self.container)).y;\n self.evaluator.setVariable(self.scaleStr, self.tempScale + (self.tempScale/45)*((self.posZoom-self.posZoomNew)/10));\n\n self.posObserverNew = (descartesJS.getCursorPosition(evt, self.container)).x;\n self.evaluator.setVariable(self.obsStr, self.tempObserver - (self.posObserver-self.posObserverNew)*2.5);\n\n self.parent.update();\n }\n\n this.disp = {x: 0, y: 0};\n\n /**\n *\n * @param {Event} evt\n * @private\n */\n function onMouseMove(evt) {\n if ((!self.fixed) && (self.click)) {\n dispX = (self.getAbsoluteX(self.oldMouse.x) - self.getAbsoluteX(self.mouse_x))/4;\n dispY = (-self.getAbsoluteY(self.oldMouse.y) + self.getAbsoluteY(self.mouse_y))/4;\n\n if ((dispX !== self.disp.x) || (dispY !== self.disp.y)) {\n self.alpha = descartesJS.degToRad( self.evaluator.getVariable(self.rotZStr));\n self.beta = descartesJS.degToRad(-self.evaluator.getVariable(self.rotYStr));\n\n self.alpha = descartesJS.radToDeg(self.alpha) - dispX;\n self.beta = descartesJS.radToDeg(self.beta) - dispY;\n\n // set the value to the rotation variables\n self.evaluator.setVariable(self.rotZStr, self.alpha);\n self.evaluator.setVariable(self.rotYStr, -self.beta);\n\n self.disp.x = dispX;\n self.disp.y = dispY;\n\n self.oldMouse.x = self.getRelativeX(self.posAnte.x);\n self.oldMouse.y = self.getRelativeY(self.posAnte.y);\n }\n\n onSensitiveToMouseMovements(evt);\n\n evt.preventDefault();\n }\n }\n\n document.addEventListener(\"visibilitychange\", function(evt) {\n onMouseUp(evt);\n });\n\n document.addEventListener(\"mouseleave\", function(evt) {\n onMouseUp(evt);\n });\n }", "_initTouchObserver() {\n this.__onTouchEventWrapper = qx.lang.Function.listener(\n this._onTouchEvent,\n this\n );\n\n this.__touchEventNames = [\n \"touchstart\",\n \"touchmove\",\n \"touchend\",\n \"touchcancel\"\n ];\n\n if (qx.core.Environment.get(\"event.mspointer\")) {\n var engineVersion = parseInt(\n qx.core.Environment.get(\"engine.version\"),\n 10\n );\n\n if (engineVersion == 10) {\n // IE 10\n this.__touchEventNames = [\n \"MSPointerDown\",\n \"MSPointerMove\",\n \"MSPointerUp\",\n \"MSPointerCancel\"\n ];\n } else {\n // IE 11+\n this.__touchEventNames = [\n \"pointerdown\",\n \"pointermove\",\n \"pointerup\",\n \"pointercancel\"\n ];\n }\n }\n\n for (var i = 0; i < this.__touchEventNames.length; i++) {\n qx.bom.Event.addNativeListener(\n this.__target,\n this.__touchEventNames[i],\n this.__onTouchEventWrapper\n );\n }\n }", "function setDefaultEvents() {\n var elmTopSquare = document.querySelector(\"#toucharea-swatch-top\"),\n elmBotSquare = document.querySelector(\"#toucharea-swatch-bot\"),\n elmleftSquare = document.querySelector(\"#toucharea-swatch-left\"),\n elmStopwatchStart = document.querySelector(\"#button-swatch-start\"),\n elmStopwatchExit = document.querySelector(\"#button-swatch-exit\"),\n \telmSelectYes = document.querySelector(\"#select-yes\"),\n \telmSelectNo = document.querySelector(\"#select-no\");\n \t\n \n\n // Set initial date and refresh timer\n updateDate(0);\n\n //Set/determine Script refills\n setRefillsEvents();\n \n // buildScriptReminder();\n \n // Add an event listener to update the screen immediately when the device wakes up\n document.addEventListener(\"visibilitychange\", function() {\n if (!document.hidden) {\n updateDate(0);\n }\n });\n // Add an event listener to update the screen immediately when the device wakes up\n tizen.time.setTimezoneChangeListener(function() {\n updateDate(0);\n });\n\n // Add event listeners to buttons and touch areas\n elmTopSquare.addEventListener(\"click\", function() {\n \tdecrementRefillCount();\n });\n elmleftSquare.addEventListener(\"click\", function() {\n \tconsole.log(\"i clicked it\");\n \tchangeMode(\"Reminder\");\n \t//confirmationFlag = true;\n \t//loopForNextDosage();\n });\n elmSelectYes.addEventListener(\"click\", function() {\n \tconsole.log(\"I took my pill\");\n \tconfirmationFlag = true;\n \tapplyStyleTransition(elmInnerSecond, NEEDLE_DATA, \"START\", \"END\", 0);\n \tloopForNextDosage();\n \tchangeMode(\"Main\");\n });\n elmSelectNo.addEventListener(\"click\", function() {\n \tconsole.log(\"click No\");\n \telmInnerSecond.classList.remove(\"spin-timer\");\n \tchangeMode(\"Main\");\n \t\n });\n elmBotSquare.addEventListener(\"click\", function() {\n changeMode(\"Stopwatch\");\n });\n elmStopwatchExit.addEventListener(\"click\", function() {\n \t\n changeMode(\"Main\");\n });\n elmStopwatchStart.addEventListener(\"click\", function() {\n \ttoggleStopwatch();\n \t});\n }", "function setup_event_handlers()\n{\n var canvas = document.getElementById( \"game_canvas\" );\n \n if( !mobile_version )\n {\n canvas.addEventListener( \"mousemove\", on_mouse_move );\n canvas.addEventListener( \"mouseout\", on_mouse_out );\n canvas.addEventListener( \"mouseover\", on_mouse_over );\n }\n else\n {\n if( is_mobile.windows() )\n {\n canvas.addEventListener( 'pointerdown', on_mouse_move );\n canvas.addEventListener( 'pointermove', on_mouse_move );\n canvas.addEventListener( 'pointerup', on_mouse_move );\n }\n \n canvas.addEventListener( 'touchstart', function(e)\n {\n mouse_x = e.changedTouches[0].pageX;\n mouse_y = e.changedTouches[0].pageY;\n //e.preventDefault();\n mouse_click = true;\n }, false );\n canvas.addEventListener( 'touchmove', function(e)\n {\n mouse_x = e.changedTouches[0].pageX;\n mouse_y = e.changedTouches[0].pageY;\n e.preventDefault();\n }, false );\n canvas.addEventListener( 'touchend', function(e)\n {\n mouse_x = e.changedTouches[0].pageX;\n mouse_y = e.changedTouches[0].pageY;\n e.preventDefault();\n }, false );\n \n }\n}", "function setup(){if(GestureDetector.READY){return;}// find what eventtypes we add listeners to\nEvent.determineEventTypes();// Register all gestures inside GestureDetector.gestures\nUtils.each(GestureDetector.gestures,function(gesture){Detection.register(gesture);});// Add touch events on the document\nEvent.onTouch(GestureDetector.DOCUMENT,EVENT_MOVE,Detection.detect);Event.onTouch(GestureDetector.DOCUMENT,EVENT_END,Detection.detect);// GestureDetector is ready...!\nGestureDetector.READY=true;}", "function FastClick(a,b){function c(a,b){return function(){return a.apply(b,arguments)}}var d;if(b=b||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=b.touchBoundary||10,this.layer=a,this.tapDelay=b.tapDelay||200,!FastClick.notNeeded(a)){for(var e=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],f=this,g=0,h=e.length;h>g;g++)f[e[g]]=c(f[e[g]],f);deviceIsAndroid&&(a.addEventListener(\"mouseover\",this.onMouse,!0),a.addEventListener(\"mousedown\",this.onMouse,!0),a.addEventListener(\"mouseup\",this.onMouse,!0)),a.addEventListener(\"click\",this.onClick,!0),a.addEventListener(\"touchstart\",this.onTouchStart,!1),a.addEventListener(\"touchmove\",this.onTouchMove,!1),a.addEventListener(\"touchend\",this.onTouchEnd,!1),a.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(b,c,d){var e=Node.prototype.removeEventListener;\"click\"===b?e.call(a,b,c.hijacked||c,d):e.call(a,b,c,d)},a.addEventListener=function(b,c,d){var e=Node.prototype.addEventListener;\"click\"===b?e.call(a,b,c.hijacked||(c.hijacked=function(a){a.propagationStopped||c(a)}),d):e.call(a,b,c,d)}),\"function\"==typeof a.onclick&&(d=a.onclick,a.addEventListener(\"click\",function(a){d(a)},!1),a.onclick=null)}}", "setupUI () {\n this.html.canvas.width = this.canvasWidth\n this.html.canvas.height = this.canvasHeight\n \n // Prevent \"touch and hold to open context menu\" menu on touchscreens.\n this.html.canvas.addEventListener('touchstart', stopEvent)\n this.html.canvas.addEventListener('touchmove', stopEvent)\n this.html.canvas.addEventListener('touchend', stopEvent)\n this.html.canvas.addEventListener('touchcancel', stopEvent)\n \n this.html.buttonHome.addEventListener('click', this.buttonHome_onClick.bind(this))\n this.html.buttonReload.addEventListener('click', this.buttonReload_onClick.bind(this))\n this.html.buttonLeft.addEventListener('click', this.buttonLeft_onClick.bind(this))\n this.html.buttonRight.addEventListener('click', this.buttonRight_onClick.bind(this))\n \n this.html.main.addEventListener('keydown', this.onKeyDown.bind(this))\n \n window.addEventListener('resize', this.updateUI.bind(this))\n this.updateUI()\n this.hideUI() // Hide until all assets are loaded\n \n this.html.main.focus()\n }", "function FastClick(a){var b,c=this;this.trackingClick=!1;this.trackingClickStart=0;this.targetElement=null;this.lastTouchIdentifier=this.touchStartY=this.touchStartX=0;this.touchBoundary=10;this.layer=a;if(!a||!a.nodeType)throw new TypeError(\"Layer must be a document node\");this.onClick=function(){return FastClick.prototype.onClick.apply(c,arguments)};this.onMouse=function(){return FastClick.prototype.onMouse.apply(c,arguments)};this.onTouchStart=function(){return FastClick.prototype.onTouchStart.apply(c,\narguments)};this.onTouchEnd=function(){return FastClick.prototype.onTouchEnd.apply(c,arguments)};this.onTouchCancel=function(){return FastClick.prototype.onTouchCancel.apply(c,arguments)};FastClick.notNeeded(a)||(this.deviceIsAndroid&&(a.addEventListener(\"mouseover\",this.onMouse,!0),a.addEventListener(\"mousedown\",this.onMouse,!0),a.addEventListener(\"mouseup\",this.onMouse,!0)),a.addEventListener(\"click\",this.onClick,!0),a.addEventListener(\"touchstart\",this.onTouchStart,!1),a.addEventListener(\"touchend\",\nthis.onTouchEnd,!1),a.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(b,c,e){var f=Node.prototype.removeEventListener;\"click\"===b?f.call(a,b,c.hijacked||c,e):f.call(a,b,c,e)},a.addEventListener=function(b,c,e){var f=Node.prototype.addEventListener;\"click\"===b?f.call(a,b,c.hijacked||(c.hijacked=function(a){a.propagationStopped||c(a)}),e):f.call(a,b,c,e)}),\"function\"===typeof a.onclick&&(b=a.onclick,a.addEventListener(\"click\",\nfunction(a){b(a)},!1),a.onclick=null))}", "function FastClick(a){function b(a,b){return function(){return a.apply(b,arguments)}}var c;this.trackingClick=!1;this.trackingClickStart=0;this.targetElement=null;this.lastTouchIdentifier=this.touchStartY=this.touchStartX=0;this.touchBoundary=10;this.layer=a;FastClick.notNeeded(a)||(deviceIsAndroid&&(a.addEventListener(\"mouseover\",b(this.onMouse,this),!0),a.addEventListener(\"mousedown\",b(this.onMouse,this),!0),a.addEventListener(\"mouseup\",b(this.onMouse,this),!0)),a.addEventListener(\"click\",b(this.onClick,\nthis),!0),a.addEventListener(\"touchstart\",b(this.onTouchStart,this),!1),a.addEventListener(\"touchmove\",b(this.onTouchMove,this),!1),a.addEventListener(\"touchend\",b(this.onTouchEnd,this),!1),a.addEventListener(\"touchcancel\",b(this.onTouchCancel,this),!1),Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(b,c,e){var f=Node.prototype.removeEventListener;\"click\"===b?f.call(a,b,c.hijacked||c,e):f.call(a,b,c,e)},a.addEventListener=function(b,c,e){var f=Node.prototype.addEventListener;\n\"click\"===b?f.call(a,b,c.hijacked||(c.hijacked=function(a){a.propagationStopped||c(a)}),e):f.call(a,b,c,e)}),\"function\"===typeof a.onclick&&(c=a.onclick,a.addEventListener(\"click\",function(a){c(a)},!1),a.onclick=null))}", "function FastClick(a,h){function f(a,f){return function(){return a.apply(f,arguments)}}var v;h=h||{};this.trackingClick=!1;this.trackingClickStart=0;this.targetElement=null;this.lastTouchIdentifier=this.touchStartY=this.touchStartX=0;this.touchBoundary=h.touchBoundary||10;this.layer=a;this.tapDelay=h.tapDelay||200;if(!FastClick.notNeeded(a)){for(var t=\"onMouse onClick onTouchStart onTouchMove onTouchEnd onTouchCancel\".split(\" \"),n=0,u=t.length;n<u;n++)this[t[n]]=f(this[t[n]],this);deviceIsAndroid&&\n(a.addEventListener(\"mouseover\",this.onMouse,!0),a.addEventListener(\"mousedown\",this.onMouse,!0),a.addEventListener(\"mouseup\",this.onMouse,!0));a.addEventListener(\"click\",this.onClick,!0);a.addEventListener(\"touchstart\",this.onTouchStart,!1);a.addEventListener(\"touchmove\",this.onTouchMove,!1);a.addEventListener(\"touchend\",this.onTouchEnd,!1);a.addEventListener(\"touchcancel\",this.onTouchCancel,!1);Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(f,h,q){var n=Node.prototype.removeEventListener;\n\"click\"===f?n.call(a,f,h.hijacked||h,q):n.call(a,f,h,q)},a.addEventListener=function(f,h,q){var n=Node.prototype.addEventListener;\"click\"===f?n.call(a,f,h.hijacked||(h.hijacked=function(a){a.propagationStopped||h(a)}),q):n.call(a,f,h,q)});\"function\"===typeof a.onclick&&(v=a.onclick,a.addEventListener(\"click\",function(a){v(a)},!1),a.onclick=null)}}", "function handleStart(e) {\n self.pressed = true;\n e.preventDefault();\n self.fx = e.changedTouches[0].screenX;\n self.fy = e.changedTouches[0].screenY - topTouchOffset;\n if (self.allowOnClick && self.onClick !== null) self.onClick.call(self);\n }", "_onTouchStart(ev){\n\t\tif (!ev.touches || ev.touches.length === 0) {\n\t\t\tconsole.error('No touches on touch event', ev)\n\t\t\treturn\n\t\t}\n\t\t//save screen coordinates normalized to -1..1 (0,0 is at center and 1,1 is at top right)\n\t\tthis._tapEventData = [\n\t\t\tev.touches[0].clientX / window.innerWidth,\n\t\t\tev.touches[0].clientY / window.innerHeight\n\t\t]\n\t}", "function dnd_TouchStart()\n{\n\tvar e;\n\tvar rect;\n\n\tvar i;\n\n\tvar tx;\n\tvar ty;\n\t\n\tif (DD_Canvas == null)\treturn;\n\n\te = event;\n//\talert (e);\n\trect = DD_Canvas.getBoundingClientRect();\n\n\tfor (i = 0; i < e.targetTouches.length; i++)\n\t{\n\t\ttx = Math.floor (e.targetTouches[i].pageX) - rect.left;\n\t\tty = Math.floor (e.targetTouches[i].pageY) - rect.top;\n\n\t\t// TO DO : CALLBACK HERE.\t\n\t\tDD_EventFuncDown (tx, ty);\n\t}\n\te.preventDefault();\n}", "function FastClick(a, c) {\n function b(a, b) {\n return function() {\n return a.apply(b, arguments)\n }\n }\n var e;\n c = c || {};\n this.trackingClick = !1;\n this.trackingClickStart = 0;\n this.targetElement = null;\n this.lastTouchIdentifier = this.touchStartY = this.touchStartX = 0;\n this.touchBoundary = c.touchBoundary || 10;\n this.layer = a;\n this.tapDelay = c.tapDelay || 200;\n if (!FastClick.notNeeded(a)) {\n for (var d = \"onMouse onClick onTouchStart onTouchMove onTouchEnd onTouchCancel\".split(\" \"), g = 0, m = d.length; g < m; g++) this[d[g]] = b(this[d[g]], this);\n deviceIsAndroid &&\n (a.addEventListener(\"mouseover\", this.onMouse, !0), a.addEventListener(\"mousedown\", this.onMouse, !0), a.addEventListener(\"mouseup\", this.onMouse, !0));\n a.addEventListener(\"click\", this.onClick, !0);\n a.addEventListener(\"touchstart\", this.onTouchStart, !1);\n a.addEventListener(\"touchmove\", this.onTouchMove, !1);\n a.addEventListener(\"touchend\", this.onTouchEnd, !1);\n a.addEventListener(\"touchcancel\", this.onTouchCancel, !1);\n Event.prototype.stopImmediatePropagation || (a.removeEventListener = function(b, c, d) {\n var e = Node.prototype.removeEventListener;\n \"click\" === b ? e.call(a, b, c.hijacked || c, d) : e.call(a, b, c, d)\n }, a.addEventListener = function(b, c, d) {\n var e = Node.prototype.addEventListener;\n \"click\" === b ? e.call(a, b, c.hijacked || (c.hijacked = function(a) {\n a.propagationStopped || c(a)\n }), d) : e.call(a, b, c, d)\n });\n \"function\" === typeof a.onclick && (e = a.onclick, a.addEventListener(\"click\", function(a) {\n e(a)\n }, !1), a.onclick = null)\n }\n}", "function FastClick(a, c) {\n function b(a, b) {\n return function() {\n return a.apply(b, arguments)\n }\n }\n var g;\n c = c || {};\n this.trackingClick = !1;\n this.trackingClickStart = 0;\n this.targetElement = null;\n this.lastTouchIdentifier = this.touchStartY = this.touchStartX = 0;\n this.touchBoundary = c.touchBoundary || 10;\n this.layer = a;\n this.tapDelay = c.tapDelay || 200;\n if (!FastClick.notNeeded(a)) {\n for (var d = \"onMouse onClick onTouchStart onTouchMove onTouchEnd onTouchCancel\".split(\" \"), f = 0, m = d.length; f < m; f++) this[d[f]] = b(this[d[f]], this);\n deviceIsAndroid &&\n (a.addEventListener(\"mouseover\", this.onMouse, !0), a.addEventListener(\"mousedown\", this.onMouse, !0), a.addEventListener(\"mouseup\", this.onMouse, !0));\n a.addEventListener(\"click\", this.onClick, !0);\n a.addEventListener(\"touchstart\", this.onTouchStart, !1);\n a.addEventListener(\"touchmove\", this.onTouchMove, !1);\n a.addEventListener(\"touchend\", this.onTouchEnd, !1);\n a.addEventListener(\"touchcancel\", this.onTouchCancel, !1);\n Event.prototype.stopImmediatePropagation || (a.removeEventListener = function(b, c, d) {\n var g = Node.prototype.removeEventListener;\n \"click\" === b ? g.call(a, b, c.hijacked || c, d) : g.call(a, b, c, d)\n }, a.addEventListener = function(b, c, d) {\n var g = Node.prototype.addEventListener;\n \"click\" === b ? g.call(a, b, c.hijacked || (c.hijacked = function(a) {\n a.propagationStopped || c(a)\n }), d) : g.call(a, b, c, d)\n });\n \"function\" === typeof a.onclick && (g = a.onclick, a.addEventListener(\"click\", function(a) {\n g(a)\n }, !1), a.onclick = null)\n }\n}", "control(){\n document.addEventListener(\"mousemove\", (e) => {\n this.mouse_x = e.clientX;\n this.mouse_y = e.clientY;\n })\n\n document.addEventListener(\"touchmove\", (e) => {\n this.mouse_x = e.touches[0].clientX+30; //Ajuste para a nave ficar a frente do dedo\n this.mouse_y = e.touches[0].clientY;\n })\n\n document.addEventListener(\"click\", (e) => {\n if(e.button == 0){\n this.shotFire();\n }\n })\n\n document.addEventListener(\"touchstart\", (e) => {\n this.shotFire();\n })\n }", "_events() {\n \tthis._addKeyHandler();\n \tthis._addClickHandler();\n }", "function CreateEvents() {\n mc.on('press panstart panmove', function(e) {\n ShadowOpacity(0, 0.1);\n\n // TODO: add smooth scale animation, problems with transition\n UpdateCardPos(currCard, e);\n });\n\n mc.on('pressup panend', function(e) {\n var dist = Math.abs(e.deltaX);\n var dir = Math.sign(e.deltaX);\n\n // Do we take action or snap back\n if(dist >= bp) {\n if(dir > 0) {\n SnapRight(currCard, e);\n }\n else if(dir < 0) {\n SnapLeft(currCard, e);\n }\n }\n else {\n SnapBack(currCard);\n ShadowOpacity(maxOpacity, 0.3);\n }\n });\n\n heart.addEventListener(\"click\", function() {\n ToggleLiked();\n });\n}", "addEvents()\n {\n if (!this.interactionDOMElement)\n {\n return;\n }\n\n ticker.shared.add(this.update, this);\n\n if (window.navigator.msPointerEnabled)\n {\n this.interactionDOMElement.style['-ms-content-zooming'] = 'none';\n this.interactionDOMElement.style['-ms-touch-action'] = 'none';\n }\n else if (this.supportsPointerEvents)\n {\n this.interactionDOMElement.style['touch-action'] = 'none';\n }\n\n window.document.addEventListener('mousemove', this.onMouseMove, true);\n this.interactionDOMElement.addEventListener('mousedown', this.onMouseDown, true);\n this.interactionDOMElement.addEventListener('mouseout', this.onMouseOut, true);\n this.interactionDOMElement.addEventListener('mouseover', this.onMouseOver, true);\n window.addEventListener('mouseup', this.onMouseUp, true);\n\n if (this.supportsTouchEvents)\n {\n this.interactionDOMElement.addEventListener('touchstart', this.onTouchStart, true);\n this.interactionDOMElement.addEventListener('touchend', this.onTouchEnd, true);\n this.interactionDOMElement.addEventListener('touchmove', this.onTouchMove, true);\n }\n\n if (this.supportsPointerEvents)\n {\n window.document.addEventListener('pointermove', this.onPointerMove, true);\n this.interactionDOMElement.addEventListener('pointerdown', this.onPointerDown, true);\n this.interactionDOMElement.addEventListener('pointerout', this.onPointerOut, true);\n this.interactionDOMElement.addEventListener('pointerover', this.onPointerOver, true);\n window.addEventListener('pointerup', this.onPointerUp, true);\n }\n else\n {\n /**\n * If pointer events aren't available on a device, this will turn either the touch or\n * mouse events into pointer events. This allows a developer to just listen for emitted\n * pointer events on interactive sprites\n */\n if (this.normalizeTouchEvents)\n {\n this.interactionDOMElement.addEventListener('touchstart', this.onPointerDown, true);\n this.interactionDOMElement.addEventListener('touchend', this.onPointerUp, true);\n this.interactionDOMElement.addEventListener('touchmove', this.onPointerMove, true);\n }\n\n if (this.normalizeMouseEvents)\n {\n window.document.addEventListener('mousemove', this.onPointerMove, true);\n this.interactionDOMElement.addEventListener('mousedown', this.onPointerDown, true);\n this.interactionDOMElement.addEventListener('mouseout', this.onPointerOut, true);\n this.interactionDOMElement.addEventListener('mouseover', this.onPointerOver, true);\n window.addEventListener('mouseup', this.onPointerUp, true);\n }\n }\n\n this.eventsAdded = true;\n }", "function initEvents() {\n var bind = _this.h.addEventListener;\n var eventTarget = params.eventTarget === 'wrapper' ? _this.wrapper : _this.container;\n //Touch Events\n if (! (_this.browser.ie10 || _this.browser.ie11)) {\n if (_this.support.touch) {\n bind(eventTarget, 'touchstart', onTouchStart);\n bind(eventTarget, 'touchmove', onTouchMove);\n bind(eventTarget, 'touchend', onTouchEnd);\n }\n if (params.simulateTouch) {\n bind(eventTarget, 'mousedown', onTouchStart);\n bind(document, 'mousemove', onTouchMove);\n bind(document, 'mouseup', onTouchEnd);\n }\n }\n else {\n bind(eventTarget, _this.touchEvents.touchStart, onTouchStart);\n bind(document, _this.touchEvents.touchMove, onTouchMove);\n bind(document, _this.touchEvents.touchEnd, onTouchEnd);\n }\n\n //Resize Event\n if (params.autoResize) {\n bind(window, 'resize', _this.resizeFix);\n }\n //Slide Events\n addSlideEvents();\n //Mousewheel\n _this._wheelEvent = false;\n if (params.mousewheelControl) {\n if (document.onmousewheel !== undefined) {\n _this._wheelEvent = 'mousewheel';\n }\n if (!_this._wheelEvent) {\n try {\n new WheelEvent('wheel');\n _this._wheelEvent = 'wheel';\n } catch (e) {}\n }\n if (!_this._wheelEvent) {\n _this._wheelEvent = 'DOMMouseScroll';\n }\n if (_this._wheelEvent) {\n bind(_this.container, _this._wheelEvent, handleMousewheel);\n }\n }\n\n //Keyboard\n function _loadImage(img) {\n var image, src;\n var onReady = function () {\n if (typeof _this === 'undefined' || _this === null) return;\n if (_this.imagesLoaded !== undefined) _this.imagesLoaded++;\n if (_this.imagesLoaded === _this.imagesToLoad.length) {\n _this.reInit();\n if (params.onImagesReady) _this.fireCallback(params.onImagesReady, _this);\n }\n };\n\n if (!img.complete) {\n src = (img.currentSrc || img.getAttribute('src'));\n if (src) {\n image = new Image();\n image.onload = onReady;\n image.onerror = onReady;\n image.src = src;\n } else {\n onReady();\n }\n\n } else {//image already loaded...\n onReady();\n }\n }\n\n if (params.keyboardControl) {\n bind(document, 'keydown', handleKeyboardKeys);\n }\n if (params.updateOnImagesReady) {\n _this.imagesToLoad = $$('img', _this.container);\n\n for (var i = 0; i < _this.imagesToLoad.length; i++) {\n _loadImage(_this.imagesToLoad[i]);\n }\n }\n }", "function initEventHandlersDev(){\n // Computer user requires keyboard presses\n document.onkeydown = respondToKeyPress;\n document.onkeyup = respondToKeyRelease;\n initTouchEventHandlers();\n // initButtonEventHandlers();\n initMobileEventHandlers();\n}", "initClickHandlers() {\n this.domElements.tabSelected = $('.tabBars');\n this.domElements.containerSelected = $('.businessContainer');\n $('.eventsContainer').on('click', '.event', this.domClickHandler);\n $('.businessContainer').on('click', '.business', this.domClickHandler);\n $('.mapContainer').on('click', '.addLocation', this.addLocationClickHandler);\n $('.calculateRoute').on('click', this.apiList.map.calculateAndDisplayRoute);\n $('.tabContainer').on('click', '.tab', this.tabClickHandler);\n }", "function FastClick(t,e){function n(t,e){return function(){return t.apply(e,arguments)}}var i;if(e=e||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=e.touchBoundary||10,this.layer=t,this.tapDelay=e.tapDelay||200,!FastClick.notNeeded(t)){for(var s=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],r=this,o=0,a=s.length;a>o;o++)r[s[o]]=n(r[s[o]],r);deviceIsAndroid&&(t.addEventListener(\"mouseover\",this.onMouse,!0),t.addEventListener(\"mousedown\",this.onMouse,!0),t.addEventListener(\"mouseup\",this.onMouse,!0)),t.addEventListener(\"click\",this.onClick,!0),t.addEventListener(\"touchstart\",this.onTouchStart,!1),t.addEventListener(\"touchmove\",this.onTouchMove,!1),t.addEventListener(\"touchend\",this.onTouchEnd,!1),t.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(t.removeEventListener=function(e,n,i){var s=Node.prototype.removeEventListener;\"click\"===e?s.call(t,e,n.hijacked||n,i):s.call(t,e,n,i)},t.addEventListener=function(e,n,i){var s=Node.prototype.addEventListener;\"click\"===e?s.call(t,e,n.hijacked||(n.hijacked=function(t){t.propagationStopped||n(t)}),i):s.call(t,e,n,i)}),\"function\"==typeof t.onclick&&(i=t.onclick,t.addEventListener(\"click\",function(t){i(t)},!1),t.onclick=null)}}", "setupEventAction() {\n let hasTouch = fn.hasTouch();\n let eventAction = this.eventAction = new EventAction();\n if (hasTouch) {\n // In mobile phone, bind Gesture-tap which listen to touchstart/touchend event\n // istanbul ignore next\n this._gesture.on('tap', event => {\n eventAction.execute('tap', event.target, event);\n });\n }\n else {\n // In personal computer, bind click event, then trigger event. eg. `on=tap:sidebar.open`, when click, trigger open() function of #sidebar\n document.addEventListener('click', event => {\n eventAction.execute('tap', event.target, event);\n }, false);\n }\n\n document.addEventListener('click', event => {\n eventAction.execute('click', event.target, event);\n }, false);\n\n // istanbul ignore next\n event.delegate(document, 'input', 'change', event => {\n eventAction.execute('change', event.target, event);\n });\n }", "attachEvents() {\n // Keep track pointer hold and dragging distance\n this.pointerDown = false;\n this.drag = {\n startX: 0,\n endX: 0,\n startY: 0,\n letItGo: null,\n preventClick: false,\n transformX: 0,\n transformY: 0\n };\n }", "createTouchHook() {\n var this$1 = this;\n var hookDiv = document.createElement('button');\n hookDiv.style.width = AccessibilityManager.DIV_HOOK_SIZE + \"px\";\n hookDiv.style.height = AccessibilityManager.DIV_HOOK_SIZE + \"px\";\n hookDiv.style.position = 'absolute';\n hookDiv.style.top = AccessibilityManager.DIV_HOOK_POS_X + \"px\";\n hookDiv.style.left = AccessibilityManager.DIV_HOOK_POS_Y + \"px\";\n hookDiv.style.zIndex = AccessibilityManager.DIV_HOOK_ZINDEX.toString();\n hookDiv.style.backgroundColor = '#FF0000';\n hookDiv.title = 'HOOK DIV';\n hookDiv.addEventListener('focus', function () {\n this$1.isMobileAccessibility = true;\n this$1.activate();\n this$1.destroyTouchHook();\n });\n document.body.appendChild(hookDiv);\n this._hookDiv = hookDiv;\n }", "function initEvents() {\n var bind = _this.h.addEventListener;\n var eventTarget = params.eventTarget === 'wrapper' ? _this.wrapper : _this.container;\n //Touch Events\n if (! (_this.browser.ie10 || _this.browser.ie11)) {\n if (_this.support.touch) {\n bind(eventTarget, 'touchstart', onTouchStart);\n bind(eventTarget, 'touchmove', onTouchMove);\n bind(eventTarget, 'touchend', onTouchEnd);\n }\n if (params.simulateTouch) {\n bind(eventTarget, 'mousedown', onTouchStart);\n bind(document, 'mousemove', onTouchMove);\n bind(document, 'mouseup', onTouchEnd);\n }\n }\n else {\n bind(eventTarget, _this.touchEvents.touchStart, onTouchStart);\n bind(document, _this.touchEvents.touchMove, onTouchMove);\n bind(document, _this.touchEvents.touchEnd, onTouchEnd);\n }\n\n //Resize Event\n if (params.autoResize) {\n bind(window, 'resize', _this.resizeFix);\n }\n //Slide Events\n addSlideEvents();\n //Mousewheel\n _this._wheelEvent = false;\n if (params.mousewheelControl) {\n if (document.onmousewheel !== undefined) {\n _this._wheelEvent = 'mousewheel';\n }\n if (!_this._wheelEvent) {\n try {\n new WheelEvent('wheel');\n _this._wheelEvent = 'wheel';\n } catch (e) {}\n }\n if (!_this._wheelEvent) {\n _this._wheelEvent = 'DOMMouseScroll';\n }\n if (_this._wheelEvent) {\n bind(_this.container, _this._wheelEvent, handleMousewheel);\n }\n }\n\n //Keyboard\n\t\tfunction _loadImage(img) {\n\t\t\tvar image, src;\n\t\t\tvar onReady = function () {\n\t\t\t\tif (typeof _this === 'undefined' || _this === null) return;\n\t\t\t\tif (_this.imagesLoaded !== undefined) _this.imagesLoaded++;\n\t\t\t\tif (_this.imagesLoaded === _this.imagesToLoad.length) {\n\t\t\t\t\t_this.reInit();\n\t\t\t\t\tif (params.onImagesReady) _this.fireCallback(params.onImagesReady, _this);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tif(!img.complete){\n\t\t\t\tsrc = (img.currentSrc || img.getAttribute('src'))\n\t\t\t\tif( src ){\n\t\t\t\t\timage = new Image();\n\t\t\t\t\timage.onload = onReady;\n\t\t\t\t\timage.onerror = onReady;\n\t\t\t\t\timage.src = src;\n\t\t\t\t} else {\n\t\t\t\t\tonReady();\n\t\t\t\t}\n\n\t\t\t} else {//image already loaded...\n\t\t\t\tonReady();\n\t\t\t}\n\t\t}\n\n\t\tif (params.keyboardControl) {\n\t\t\tbind(document, 'keydown', handleKeyboardKeys);\n\t\t}\n\t\tif (params.updateOnImagesReady) {\n\t\t\t_this.imagesToLoad = $$('img', _this.container);\n\n\t\t\tfor (var i = 0; i < _this.imagesToLoad.length; i++) {\n\t\t\t\t_loadImage(_this.imagesToLoad[i]);\n\t\t\t}\n\t\t}\n }", "function gestureStart(ev){// If we're already touched down, abort\n\tif(pointer)return;var now=+Date.now();// iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n\t// If <400ms have passed, don't allow an event of a different type than the previous event\n\tif(lastPointer&&!typesMatch(ev,lastPointer)&&now-lastPointer.endTime<1500){return;}pointer=makeStartPointer(ev);runHandlers('start',ev);}", "function initTouch() {\n\tfunction eventLog(e) {\n\t\tconsole.log(`Event \"${e.type}\" on target \"${e.target.tagName}\"`);\n\t}\n\n\tconst configSwipeHorizontal = {\n\t\tevent: \"swipe-horizontal\",\n\t\tpointers: 3,\n\t\tdirection: Hammer.DIRECTION_HORIZONTAL\n\t}\n\tconst configSwipeVertical = {\n\t\tevent: \"swipe-vertical\",\n\t\tpointers: 3,\n\t\tdirection: Hammer.DIRECTION_VERTICAL\n\t}\n\n\t// Node Link Diagram\n\tconst graphManager = new Hammer.Manager(graphContainer);\n\tgraphManager.add(new Hammer.Swipe(configSwipeHorizontal));\n\tgraphManager.add(new Hammer.Swipe(configSwipeVertical));\n\tgraphManager.on(\"swipe-vertical\", () => rotateYear(1));\n\tgraphManager.on(\"swipe-horizontal\", () => toggleMode());\n\tgraphManager.get(\"swipe-horizontal\").requireFailure(\"swipe-vertical\");\n\n\t// Adjacency Matrix\n\tconst matrixManager = new Hammer.Manager(matrixContainer);\n\tmatrixManager.add(new Hammer.Swipe(configSwipeHorizontal));\n\tmatrixManager.on(\"swipe-horizontal\", () => toggleMode());\n}", "function initTouch()\n {\n var startX,\n startY,\n touchStartX,\n touchStartY,\n moved,\n moving = false;\n\n container.unbind('touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick').bind(\n 'touchstart.jsp',\n function(e)\n {\n var touch = e.originalEvent.touches[0];\n startX = contentPositionX();\n startY = contentPositionY();\n touchStartX = touch.pageX;\n touchStartY = touch.pageY;\n moved = false;\n moving = true;\n }\n ).bind(\n 'touchmove.jsp',\n function(ev)\n {\n if(!settings.enabled){ev.preventDefault();return true;}\n if(!moving) {\n return;\n }\n\n var touchPos = ev.originalEvent.touches[0],\n dX = horizontalDragPosition, dY = verticalDragPosition;\n\n jsp.scrollTo(startX + touchStartX - touchPos.pageX, startY + touchStartY - touchPos.pageY);\n\n moved = moved || Math.abs(touchStartX - touchPos.pageX) > 5 || Math.abs(touchStartY - touchPos.pageY) > 5;\n\n // return true if there was no movement so rest of screen can scroll\n return dX == horizontalDragPosition && dY == verticalDragPosition;\n }\n ).bind(\n 'touchend.jsp',\n function(e)\n {\n moving = false;\n /*if(moved) {\n return false;\n }*/\n }\n ).bind(\n 'click.jsp-touchclick',\n function(e)\n {\n if(moved) {\n moved = false;\n return false;\n }\n }\n );\n }", "function init(){\n platform = navigator.userAgent.match('Android') ? \"android\" : \"ios\";\n $('body').addClass(platform);\n $('#launchreview').on(\"touchstart\", launchreview);\n $('#launchrating').on(\"touchstart\", launchrating);\n $('#isRatingSupported').on(\"touchstart\", isRatingSupported);\n}", "function addInitialPointerMoveListeners(){document.addEventListener('mousemove',onInitialPointerMove);document.addEventListener('mousedown',onInitialPointerMove);document.addEventListener('mouseup',onInitialPointerMove);document.addEventListener('pointermove',onInitialPointerMove);document.addEventListener('pointerdown',onInitialPointerMove);document.addEventListener('pointerup',onInitialPointerMove);document.addEventListener('touchmove',onInitialPointerMove);document.addEventListener('touchstart',onInitialPointerMove);document.addEventListener('touchend',onInitialPointerMove);}", "_setupPointerEnterEventsIfNeeded() {\n // Optimization: Defer hooking up events if there's no message or the tooltip is disabled.\n if (this._disabled || !this.message || !this._viewInitialized ||\n this._passiveListeners.length) {\n return;\n }\n // The mouse events shouldn't be bound on mobile devices, because they can prevent the\n // first tap from firing its click event or can cause the tooltip to open for clicks.\n if (this._platformSupportsMouseEvents()) {\n this._passiveListeners\n .push(['mouseenter', () => {\n this._setupPointerExitEventsIfNeeded();\n this.show();\n }]);\n }\n else if (this.touchGestures !== 'off') {\n this._disableNativeGesturesIfNecessary();\n this._passiveListeners\n .push(['touchstart', () => {\n // Note that it's important that we don't `preventDefault` here,\n // because it can prevent click events from firing on the element.\n this._setupPointerExitEventsIfNeeded();\n clearTimeout(this._touchstartTimeout);\n this._touchstartTimeout = setTimeout(() => this.show(), LONGPRESS_DELAY);\n }]);\n }\n this._addListeners(this._passiveListeners);\n }", "startMenu() {\n this.isInPlay = false;\n document.addEventListener(\"mousedown\", this.onMouseDown, false);\n document.addEventListener(\"touchstart\", this.onTouchStart, {\n passive: false\n });\n document.addEventListener(\"mouseup\", this.onMouseUp, false);\n document.addEventListener(\"touchend\", this.onTouchEnd, { passive: false });\n document.addEventListener(\"mousemove\", this.onMouseMove, false);\n document.addEventListener(\"touchmove\", this.onTouchMove, {\n passive: false\n });\n this.clear();\n }", "function _setEventHandlers(){\n\t\tvar eventType = _eventTypes(DP.isTouchDevice),\n\t\tevents = eventType.down + \" \" + eventType.move + \" \" + eventType.up + \" \" + eventType.out;\n\t\t\n\t\twindow.onunload = function(e) {\n\t\t\tDP.thisObj.socket.emit('deleteSharedById', {id : DP.thisObj.id});\n\t\t};\n\t\t\n\t\t$(\".toolbar li\").tooltip(options);\n\t\t\n\t\t//events for tool bar\n\t\t$(\".toolbar\").find(\".sprite\").click(function(){\n\t\t\tDP.isDrawing = false;\n\t\t\tDP.isLineDrawing = false;\n\t\t\tDP.isType = false;\n\t\t\t//clear selected\n\t\t\t$(\".sprite\").removeClass(\"selected\");\n\t\t\tif($(this).hasClass(tools[0])){\t\t//draw\n\t\t\t\t$(this).addClass(\"selected\");\n\t\t\t\tDP.isDrawing = true;\n\t\t\t\tDP.isErase = false;\n\t\t\t\tDP.thisObj[DP.thisObj.id].ctx.lineWidth = 1;\n\t\t\t} else if($(this).hasClass(tools[1])){\t\t//line\n\t\t\t\t$(this).addClass(\"selected\");\n\t\t\t\tDP.isLineDrawing = true;\n\t\t\t} else if($(this).hasClass(tools[2])){\n\t\t\t\tDP.thisObj.socket.emit(\"eraseRequestById\",{id : DP.thisObj.id});\n\t\t\t} else if($(this).hasClass(tools[3])){\n\t\t\t\t$(this).addClass(\"selected\");\n\t\t\t\tDP.isDrawing = true;\n\t\t\t\tDP.isErase = true;\n\t\t\t\tDP.thisObj[DP.thisObj.id].ctx.lineWidth = 30;\n\t\t\t}\n\t\t}).hover(function(){\n\t\t\t$(this).addClass(\"hover\");\n\t\t},function(){\n\t\t\t$(this).removeClass(\"hover\");\n\t\t});\n\t\t\n\t\tDP.thisObj.find(\".myCanvas\").bind(events, function(e){\n\t\t\te.preventDefault();\n\t\t\tif(DP.isDrawing || DP.isLineDrawing) {\n\t\t\t\tvar coords = _getCoords(DP.isTouchDevice?e.originalEvent:e),\n\t\t\t\tdata = {\n\t\t\t\t\tx: coords.x,\n\t\t\t\t\ty: coords.y,\n\t\t\t\t\ttype: e.type,\n\t\t\t\t\tisTouchDevice : DP.isTouchDevice,\n\t\t\t\t\tcolor: DP.thisObj[DP.thisObj.id].ctx.strokeStyle,\n\t\t\t\t\tstroke : DP.thisObj[DP.thisObj.id].ctx.lineWidth,\n\t\t\t\t\tisLineDrawing : DP.isLineDrawing,\n\t\t\t\t\tisErase : DP.isErase,\n\t\t\t\t\tid : DP.thisObj.id\n\t\t\t\t};\n\t\t\t\t//draw(data, true);\n\t\t\t\t\n\t\t\t\t/*if(DP.okToDraw || e.type === eventType.up) {\n\t\t\t\t\tDP.thisObj.socket.emit('drawRequest', data)\n\t\t\t\t}*/\n\t\t\t\tDP.thisObj.socket.emit('drawRequest', data)\n\n\t\t\t}\n\t\t});\n\t\t\n\t}", "function FastClick(t,e){\"use strict\";function i(t,e){return function(){return t.apply(e,arguments)}}var n;if(e=e||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=e.touchBoundary||10,this.layer=t,this.tapDelay=e.tapDelay||200,!FastClick.notNeeded(t)){for(var o=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],s=this,r=0,c=o.length;c>r;r++)s[o[r]]=i(s[o[r]],s);deviceIsAndroid&&(t.addEventListener(\"mouseover\",this.onMouse,!0),t.addEventListener(\"mousedown\",this.onMouse,!0),t.addEventListener(\"mouseup\",this.onMouse,!0)),t.addEventListener(\"click\",this.onClick,!0),t.addEventListener(\"touchstart\",this.onTouchStart,!1),t.addEventListener(\"touchmove\",this.onTouchMove,!1),t.addEventListener(\"touchend\",this.onTouchEnd,!1),t.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(t.removeEventListener=function(e,i,n){var o=Node.prototype.removeEventListener;\"click\"===e?o.call(t,e,i.hijacked||i,n):o.call(t,e,i,n)},t.addEventListener=function(e,i,n){var o=Node.prototype.addEventListener;\"click\"===e?o.call(t,e,i.hijacked||(i.hijacked=function(t){t.propagationStopped||i(t)}),n):o.call(t,e,i,n)}),\"function\"==typeof t.onclick&&(n=t.onclick,t.addEventListener(\"click\",function(t){n(t)},!1),t.onclick=null)}}", "function FastClick(t,e){\"use strict\";function i(t,e){return function(){return t.apply(e,arguments)}}var n;if(e=e||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=e.touchBoundary||10,this.layer=t,this.tapDelay=e.tapDelay||200,!FastClick.notNeeded(t)){for(var o=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],s=this,r=0,c=o.length;c>r;r++)s[o[r]]=i(s[o[r]],s);deviceIsAndroid&&(t.addEventListener(\"mouseover\",this.onMouse,!0),t.addEventListener(\"mousedown\",this.onMouse,!0),t.addEventListener(\"mouseup\",this.onMouse,!0)),t.addEventListener(\"click\",this.onClick,!0),t.addEventListener(\"touchstart\",this.onTouchStart,!1),t.addEventListener(\"touchmove\",this.onTouchMove,!1),t.addEventListener(\"touchend\",this.onTouchEnd,!1),t.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(t.removeEventListener=function(e,i,n){var o=Node.prototype.removeEventListener;\"click\"===e?o.call(t,e,i.hijacked||i,n):o.call(t,e,i,n)},t.addEventListener=function(e,i,n){var o=Node.prototype.addEventListener;\"click\"===e?o.call(t,e,i.hijacked||(i.hijacked=function(t){t.propagationStopped||i(t)}),n):o.call(t,e,i,n)}),\"function\"==typeof t.onclick&&(n=t.onclick,t.addEventListener(\"click\",function(t){n(t)},!1),t.onclick=null)}}", "function initTouch()\n {\n var startX,\n startY,\n touchStartX,\n touchStartY,\n moved,\n moving = false;\n\n container.unbind('touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick').bind(\n 'touchstart.jsp',\n function(e)\n {\n var touch = e.originalEvent.touches[0];\n startX = contentPositionX();\n startY = contentPositionY();\n touchStartX = touch.pageX;\n touchStartY = touch.pageY;\n moved = false;\n moving = true;\n }\n ).bind(\n 'touchmove.jsp',\n function(ev)\n {\n if(!moving) {\n return;\n }\n\n var touchPos = ev.originalEvent.touches[0],\n dX = horizontalDragPosition, dY = verticalDragPosition;\n\n jsp.scrollTo(startX + touchStartX - touchPos.pageX, startY + touchStartY - touchPos.pageY);\n\n moved = moved || Math.abs(touchStartX - touchPos.pageX) > 5 || Math.abs(touchStartY - touchPos.pageY) > 5;\n\n // return true if there was no movement so rest of screen can scroll\n return dX == horizontalDragPosition && dY == verticalDragPosition;\n }\n ).bind(\n 'touchend.jsp',\n function(e)\n {\n moving = false;\n /*if(moved) {\n return false;\n }*/\n }\n ).bind(\n 'click.jsp-touchclick',\n function(e)\n {\n if(moved) {\n moved = false;\n return false;\n }\n }\n );\n }", "function addListeners() {\n var canvas = getCanvas();\n\n //add event handlers for Document\n document.addEventListener(\"keypress\", onKeyPress, false);\n document.addEventListener(\"keydown\", onKeyDown, false);\n document.addEventListener(\"keyup\", onKeyUp, false);\n document.addEventListener(\"selectstart\", stopselection, false);\n\n //add event handlers for Canvas\n canvas.addEventListener(\"mousemove\", onMouseMove, false);\n canvas.addEventListener(\"mousedown\", onMouseDown, false);\n canvas.addEventListener(\"mouseup\", onMouseUp, false);\n canvas.addEventListener(\"dblclick\", onDblClick, false);\n\n\n if (false) {\n //add listeners for iPad/iPhone\n //As this was only an experiment (for now) it is not well supported nor optimized\n ontouchstart = \"touchStart(event);\";\n ontouchmove = \"touchMove(event);\";\n ontouchend = \"touchEnd(event);\";\n ontouchcancel = \"touchCancel(event);\";\n }\n\n}", "attach() {\n this.listeners.push(addListener(this.element, 'resize', this._windowMath, this));\n this.listeners.push(addListener(this.element, 'mousewheel', this._mouseWheel, this));\n this.listeners.push(addListener(this.element, 'contextmenu', this._contextMenu, this));\n this.listeners.push(addListener(this.element.parentElement, 'fullscreenchange', this._onFullscreenChange, this));\n this.listeners.push(addListener(document, 'pointerlockchange', this._pointerLock, this));\n this.listeners.push(addListener(window, 'keydown', this._key, this));\n this.listeners.push(addListener(window, 'keyup', this._key, this));\n this.listeners.push(addListener(window, 'resize', this._windowMath, this));\n this.listeners.push(addListener(window, 'resize', this._resizeStart, this));\n\n // Gamepad support\n this.listeners.push(addListener(window, 'gamepadconnected', this._gamepadConnected, this));\n this.listeners.push(addListener(window, 'gamepaddisconnected', this._gamepadDisconnect, this));\n\n if ('ontouchstart' in window) {\n this.listeners.push(addListener(window, 'touchstart', this._touch, this));\n this.listeners.push(addListener(this.element, 'touchend', this._touch, this));\n this.listeners.push(addListener(this.element, 'touchmove', this._touch, this));\n\n console.log(\"Enabling mouse pointer display for touch devices.\");\n this.send(\"p,1\");\n } else {\n this.listeners.push(addListener(this.element, 'mousemove', this._mouseButtonMovement, this));\n this.listeners.push(addListener(this.element, 'mousedown', this._mouseButtonMovement, this));\n this.listeners.push(addListener(this.element, 'mouseup', this._mouseButtonMovement, this));\n }\n\n // Adjust for scroll offset\n this.listeners.push(addListener(window, 'scroll', () => {\n this.m.scrollX = window.scrollX;\n this.m.scrollY = window.scrollY;\n }, this));\n\n // Using guacamole keyboard because it has the keysym translations.\n this.keyboard = new Guacamole.Keyboard(window);\n this.keyboard.onkeydown = (keysym) => {\n this.send(\"kd,\" + keysym);\n };\n this.keyboard.onkeyup = (keysym) => {\n this.send(\"ku,\" + keysym);\n };\n\n this._windowMath();\n }", "function FastClick(e,t){\"use strict\";function n(e,t){return function(){return e.apply(t,arguments)}}var r;if(t=t||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=t.touchBoundary||10,this.layer=e,this.tapDelay=t.tapDelay||200,!FastClick.notNeeded(e)){for(var i=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],s=this,o=0,u=i.length;u>o;o++)s[i[o]]=n(s[i[o]],s);deviceIsAndroid&&(e.addEventListener(\"mouseover\",this.onMouse,!0),e.addEventListener(\"mousedown\",this.onMouse,!0),e.addEventListener(\"mouseup\",this.onMouse,!0)),e.addEventListener(\"click\",this.onClick,!0),e.addEventListener(\"touchstart\",this.onTouchStart,!1),e.addEventListener(\"touchmove\",this.onTouchMove,!1),e.addEventListener(\"touchend\",this.onTouchEnd,!1),e.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(e.removeEventListener=function(t,n,r){var i=Node.prototype.removeEventListener;\"click\"===t?i.call(e,t,n.hijacked||n,r):i.call(e,t,n,r)},e.addEventListener=function(t,n,r){var i=Node.prototype.addEventListener;\"click\"===t?i.call(e,t,n.hijacked||(n.hijacked=function(e){e.propagationStopped||n(e)}),r):i.call(e,t,n,r)}),\"function\"==typeof e.onclick&&(r=e.onclick,e.addEventListener(\"click\",function(e){r(e)},!1),e.onclick=null)}}", "_onTouchStart(event) {\n if (!this._target.rippleDisabled) {\n // Some browsers fire mouse events after a `touchstart` event. Those synthetic mouse\n // events will launch a second ripple if we don't ignore mouse events for a specific\n // time after a touchstart event.\n this._lastTouchStartEvent = Date.now();\n this._isPointerDown = true;\n // Use `changedTouches` so we skip any touches where the user put\n // their finger down, but used another finger to tap the element again.\n const touches = event.changedTouches;\n for (let i = 0; i < touches.length; i++) {\n this.fadeInRipple(touches[i].clientX, touches[i].clientY, this._target.rippleConfig);\n }\n }\n }", "function addTouchHandler(){\n if(isTouchDevice || isTouch){\n //Microsoft pointers\n var MSPointer = getMSPointer();\n\n $(WRAPPER_SEL).off('touchstart ' + MSPointer.down).on('touchstart ' + MSPointer.down, touchStartHandler);\n $(WRAPPER_SEL).off('touchmove ' + MSPointer.move).on('touchmove ' + MSPointer.move, touchMoveHandler);\n }\n }", "function addTouchHandler(){\n if(isTouchDevice || isTouch){\n //Microsoft pointers\n var MSPointer = getMSPointer();\n\n $(WRAPPER_SEL).off('touchstart ' + MSPointer.down).on('touchstart ' + MSPointer.down, touchStartHandler);\n $(WRAPPER_SEL).off('touchmove ' + MSPointer.move).on('touchmove ' + MSPointer.move, touchMoveHandler);\n }\n }", "function gestureStart(ev) {\n // If we're already touched down, abort\n if (pointer) return;\n\n var now = +Date.now();\n\n // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n // If <400ms have passed, don't allow an event of a different type than the previous event\n if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) {\n return;\n }\n\n pointer = makeStartPointer(ev);\n\n runHandlers('start', ev);\n }", "function gestureStart(ev) {\n // If we're already touched down, abort\n if (pointer) return;\n\n var now = +Date.now();\n\n // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n // If <400ms have passed, don't allow an event of a different type than the previous event\n if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) {\n return;\n }\n\n pointer = makeStartPointer(ev);\n\n runHandlers('start', ev);\n }", "function FastClick(e,t){function n(e,t){return function(){return e.apply(t,arguments)}}var i;if(t=t||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=t.touchBoundary||10,this.layer=e,this.tapDelay=t.tapDelay||200,!FastClick.notNeeded(e)){for(var r=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],s=this,a=0,o=r.length;o>a;a++)s[r[a]]=n(s[r[a]],s);deviceIsAndroid&&(e.addEventListener(\"mouseover\",this.onMouse,!0),e.addEventListener(\"mousedown\",this.onMouse,!0),e.addEventListener(\"mouseup\",this.onMouse,!0)),e.addEventListener(\"click\",this.onClick,!0),e.addEventListener(\"touchstart\",this.onTouchStart,!1),e.addEventListener(\"touchmove\",this.onTouchMove,!1),e.addEventListener(\"touchend\",this.onTouchEnd,!1),e.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(e.removeEventListener=function(t,n,i){var r=Node.prototype.removeEventListener;\"click\"===t?r.call(e,t,n.hijacked||n,i):r.call(e,t,n,i)},e.addEventListener=function(t,n,i){var r=Node.prototype.addEventListener;\"click\"===t?r.call(e,t,n.hijacked||(n.hijacked=function(e){e.propagationStopped||n(e)}),i):r.call(e,t,n,i)}),\"function\"==typeof e.onclick&&(i=e.onclick,e.addEventListener(\"click\",function(e){i(e)},!1),e.onclick=null)}}", "function setupTouchControlls() {\n\t// Set up touch events for mobile, etc\n\tcanvas.addEventListener(\"touchstart\", function (e) {\n\t\t\t\t\tmousePos = getTouchPos(canvas, e);\n\t\tvar touch = e.touches[0];\n\t\tvar mouseEvent = new MouseEvent(\"mousedown\", {\n\t\t\tclientX: touch.clientX,\n\t\t\tclientY: touch.clientY\n\t\t});\n\t\tcanvas.dispatchEvent(mouseEvent);\n\t}, false);\n\tcanvas.addEventListener(\"touchend\", function (e) {\n\t\tvar mouseEvent = new MouseEvent(\"mouseup\", {});\n\t\tcanvas.dispatchEvent(mouseEvent);\n\t}, false);\n\tcanvas.addEventListener(\"touchmove\", function (e) {\n\t\tvar touch = e.touches[0];\n\t\tvar mouseEvent = new MouseEvent(\"mousemove\", {\n\t\t\tclientX: touch.clientX,\n\t\t\tclientY: touch.clientY\n\t\t});\n\t\tcanvas.dispatchEvent(mouseEvent);\n\t}, false);\n\n\t// Get the position of a touch relative to the canvas\n\tfunction getTouchPos(canvasDom, touchEvent) {\n\t\tvar rect = canvasDom.getBoundingClientRect();\n\t\treturn {\n\t\t\tx: touchEvent.touches[0].clientX - rect.left,\n\t\t\ty: touchEvent.touches[0].clientY - rect.top\n\t\t};\n\t}\n}", "function start(e){\n e.preventDefault();\n touched = true;\n if(!Android){\n offsetX = e.pageX - X;\n offsetY = e.pageY - Y;\n }\n else{\n offsetX = e.changedTouches[0].pageX - X;\n offsetY = e.changedTouches[0].pageY - Y;\n }\n document.addEventListener( events['move'], move, false);\n document.addEventListener( events['end'], stop, false);\n initAnim();\n }", "_onTouchStart(event) {\n if (!this._target.rippleDisabled && !(0,_angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_3__.isFakeTouchstartFromScreenReader)(event)) {\n // Some browsers fire mouse events after a `touchstart` event. Those synthetic mouse\n // events will launch a second ripple if we don't ignore mouse events for a specific\n // time after a touchstart event.\n this._lastTouchStartEvent = Date.now();\n this._isPointerDown = true;\n // Use `changedTouches` so we skip any touches where the user put\n // their finger down, but used another finger to tap the element again.\n const touches = event.changedTouches;\n for (let i = 0; i < touches.length; i++) {\n this.fadeInRipple(touches[i].clientX, touches[i].clientY, this._target.rippleConfig);\n }\n }\n }", "function addTouchHandler(){\n if(isTouch){\n //Microsoft pointers\n var MSPointer = getMSPointer();\n\n container.off('touchstart ' + MSPointer.down).on('touchstart ' + MSPointer.down, touchStartHandler);\n container.off('touchmove ' + MSPointer.move).on('touchmove ' + MSPointer.move, touchMoveHandler);\n }\n }", "function postDraw() {\n this.eventCanvas._ctx.canvas.ontouchstart = touchToMouse;\n this.eventCanvas._ctx.canvas.ontouchmove = touchToMouse;\n this.eventCanvas._ctx.canvas.ontouchend = touchToMouse;\n }", "Start(){\n let div = document.createElement(\"div\")\n div.innerHTML = this.GetCss()\n\n let Button = document.createElement(\"button\")\n Button.setAttribute(\"id\", this._HtmlId)\n Button.setAttribute(\"style\", \"right: 0px; display: inline; z-index: 999\")\n Button.setAttribute(\"class\", \"CoreXActionMenuButton\")\n //Button.innerHTML = \"&#9733\"\n Button.innerHTML = \"&#x2630\"\n Button.addEventListener(\"click\", this.OnClickCoreXActionButton.bind(this))\n Button.addEventListener(\"mouseover\", this.OnMouseOverCoreXActionButton.bind(this))\n Button.addEventListener(\"mouseout\", this.OnMouseOutCoreXActionButton.bind(this))\n div.appendChild(Button)\n document.body.appendChild(div)\n document.addEventListener(\"touchstart\", this.DoubleTouchEventFct.bind(this))\n }", "function gestureStart(ev) {\n // If we're already touched down, abort\n if (pointer) return;\n\n var now = +Date.now();\n\n // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n // If <400ms have passed, don't allow an event of a different type than the previous event\n if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) {\n return;\n }\n\n pointer = makeStartPointer(ev);\n\n runHandlers('start', ev);\n }", "function gestureStart(ev) {\n // If we're already touched down, abort\n if (pointer) return;\n\n var now = +Date.now();\n\n // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n // If <400ms have passed, don't allow an event of a different type than the previous event\n if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) {\n return;\n }\n\n pointer = makeStartPointer(ev);\n\n runHandlers('start', ev);\n }", "function gestureStart(ev) {\n // If we're already touched down, abort\n if (pointer) return;\n\n var now = +Date.now();\n\n // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n // If <400ms have passed, don't allow an event of a different type than the previous event\n if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) {\n return;\n }\n\n pointer = makeStartPointer(ev);\n\n runHandlers('start', ev);\n }", "function touchHandler(e)\n {\n // preventDefault also disables pinching and scrolling while touching\n // on qml application\n e.preventDefault();\n var at = {\n layerX: e.touches[0].pageX - element.offsetLeft,\n layerY: e.touches[0].pageY - element.offsetTop,\n button: 1\n }\n element.onclick(at);\n\n }", "function touchHandler(e)\n {\n // preventDefault also disables pinching and scrolling while touching\n // on qml application\n e.preventDefault();\n var at = {\n layerX: e.touches[0].pageX - element.offsetLeft,\n layerY: e.touches[0].pageY - element.offsetTop,\n button: 1\n }\n element.onclick(at);\n\n }", "createTouchHook()\n {\n const hookDiv = document.createElement('button');\n\n hookDiv.style.width = `${DIV_HOOK_SIZE}px`;\n hookDiv.style.height = `${DIV_HOOK_SIZE}px`;\n hookDiv.style.position = 'absolute';\n hookDiv.style.top = `${DIV_HOOK_POS_X}px`;\n hookDiv.style.left = `${DIV_HOOK_POS_Y}px`;\n hookDiv.style.zIndex = DIV_HOOK_ZINDEX;\n hookDiv.style.backgroundColor = '#FF0000';\n hookDiv.title = 'HOOK DIV';\n\n hookDiv.addEventListener('focus', () =>\n {\n this.isMobileAccessabillity = true;\n this.activate();\n document.body.removeChild(hookDiv);\n });\n\n document.body.appendChild(hookDiv);\n }", "function addTouchHandler() {\n if (isTouchDevice || isTouch) {\n if (options.autoScrolling) {\n $body.off(events.touchmove).on(events.touchmove, preventBouncing);\n }\n\n $(WRAPPER_SEL)\n .off(events.touchstart).on(events.touchstart, touchStartHandler)\n .off(events.touchmove).on(events.touchmove, touchMoveHandler);\n }\n }", "function initializeApp() {\n //adding click functionality to the page\n addHandlers();\n}", "function bindAnchorsToTouch(){\t\t\t\r\n\tvar helper = null;//is probably a jquery object but testing will learn for sure\r\n\tvar link = null;//will be a wrapped jquery object of the original this \r\n\tvar startX = -1, leftOffset = -1;\r\n\tvar cancelLinkClick = false;\r\n\tunderlink = $(\"<div id='underlink' style='overflow:hidden;background-color:white;'>The content is here</div>\")\r\n\t\t.appendTo(\"body\")\r\n\t\t.hide();\r\n\t$(\"a\").bind({\r\n\t\t\"touchstart\": function(event){\r\n\t\t\t//lets start by only handing first touch\r\n\t\t\tvar e = event.originalEvent;\r\n\t\t\tlink = $(this);\r\n\t\t\t//can't prevent default here or it will never click the link\r\n\t\t\t//e.preventDefault();//need to block it from scrolling\r\n\t\t\tvar oldself = self;\r\n\t\t\tself = {pageXOffset:0,pageYOffset:0};\r\n\t\t\tvar offset = link.offset();\r\n\t\t\tstartX = offset.left;\r\n\t\t\tself = oldself;\r\n\t\t\tleftOffset = e.touches[0].pageX - startX;\r\n\t\t\tcancelLinkClick = false;//don't yet need to block from clicking\r\n\t\t},\r\n\t\t\"touchmove\": function(event){\r\n\t\t\tvar e = event.originalEvent;\r\n\t\t\te.preventDefault();\r\n\t\t\tvar pageX = e.targetTouches[0].pageX;\r\n\t\t\tcurX = pageX - leftOffset;\r\n\t\t\tif(curX > 5 && !cancelLinkClick){\r\n\t\t\t\tcancelLinkClick = true;\r\n\t\t\t\tvar oldself = self;\r\n\t\t\t\tself = {pageXOffset:0,pageYOffset:0};\r\n\t\t\t\tvar offset = link.offset();\r\n\t\t\t\thelper = link.clone();\r\n\t\t\t\t\thelper\r\n\t\t\t\t\t.appendTo(\"body\")\r\n\t\t\t\t\t.css({\"position\": \"absolute\",\r\n\t\t\t\t\t\t\"display\":\"block\",\r\n\t\t\t\t\t\t\"left\":offset.left.toString() + \"px\",\r\n\t\t\t\t\t\t\"top\":offset.top.toString() + \"px\",\r\n\t\t\t\t\t\t\"background-color\":\"white\",\r\n\t\t\t\t\t\t\"z-index\": \"20000\"\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t.offset(link.offset());\r\n\t\t\t\tlink.css(\"visibility\", \"hidden\");\r\n\t\t\t\tunderlink.text(this.href);\r\n\t\t\t\tunderlink.width(1);\r\n\t\t\t\tunderlink.show();\r\n\t\t\t\tunderlink.offset(offset);\r\n\t\t\t\tself = oldself;\t\r\n\t\t\t}\r\n\t\t\tif(cancelLinkClick && pageX > startX + leftOffset){\r\n\t\t\t\thelper.css(\"left\", function(val){\r\n\t\t\t\t\t\treturn val + curX;\r\n\t\t\t\t});\r\n\t\t\t\tunderlink.width(curX - startX);\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"touchend\": function(event){\r\n\t\tconsole.log(\"touch end\");\r\n\t\t\tevent.preventDefault();\r\n\t\t\tvar e = event.originalEvent;\r\n\t\t\tif(cancelLinkClick){\r\n\t\t\t\te.preventDefault();\r\n//\t\t\t\t\tconsole.log(\"default prevented!\");\r\n\t\t\t\thelper.animate({\"left\": startX}, 200, function(){\r\n\t\t\t\t\tif(helper != null){\r\n\t\t\t\t\t\thelper.remove();\r\n\t\t\t\t\t\thelper = null;\r\n\t\t\t\t\t\tlink.css(\"visibility\", \"visible\");\r\n\t\t\t\t\t\tlink = null;\r\n\t\t\t\t\t\tunderlink.hide();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}", "_onTouchStart(event) {\n if (!this._target.rippleDisabled && !Object(_angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_1__[\"isFakeTouchstartFromScreenReader\"])(event)) {\n // Some browsers fire mouse events after a `touchstart` event. Those synthetic mouse\n // events will launch a second ripple if we don't ignore mouse events for a specific\n // time after a touchstart event.\n this._lastTouchStartEvent = Date.now();\n this._isPointerDown = true;\n // Use `changedTouches` so we skip any touches where the user put\n // their finger down, but used another finger to tap the element again.\n const touches = event.changedTouches;\n for (let i = 0; i < touches.length; i++) {\n this.fadeInRipple(touches[i].clientX, touches[i].clientY, this._target.rippleConfig);\n }\n }\n }", "bind() {\n this.window.addEventListener('resize', this.onResize, false);\n this.window.addEventListener('keyup', this.onKeyUp, false);\n\n // Binding both touch and click results in popup getting shown and then immediately get hidden.\n // Adding the check to not bind the click event if the touch is supported i.e. on mobile devices\n // Issue: https://github.com/kamranahmedse/driver.js/issues/150\n if (!('ontouchstart' in document.documentElement)) {\n this.window.addEventListener('click', this.onClick, false);\n }\n\n this.window.addEventListener('touchstart', this.onClick, false);\n }", "onTouchStart(ray) {\n var self = this,\n touch = ray.e.changedTouches[0],\n isInside;\n\n ray.position = {\n x: touch.clientX,\n y: touch.clientY\n };\n\n isInside = isMenuPartClicked(ray, false);\n\n if (isInside) {\n // on tap, trigger the click handler\n this.dispatchInteraction(MenuEmitter.ON_TOUCH_START_INSIDE, ray);\n } else {\n this.dispatchInteraction(MenuEmitter.ON_TOUCH_START_OUTSIDE, ray, true);\n // after a delay (tap and hold) trigger the context menu handler\n touchTimeout = setTimeout(function() {\n // we're producing the 'onContextMenu' event on tap-and-hold\n // because of that, we might have tapped the drop-down button, which opened the menu\n // we're still within this timeout interval, waiting to dispatch ON_CONTEXT_MENU\n // however, if the button is in toggle mode, this action would close the menu\n // since we don't want this to happen, we are ignoring the toggle parts here\n isInside = isMenuPartClicked(ray, true); // include toggle parts\n if (!isInside) {\n self.dispatchInteraction(MenuEmitter.ON_CONTEXT_MENU_OUTSIDE, ray, true); // close menu\n }\n }, TAP_AND_HOLD_INTERVAL);\n }\n }", "function init() {\r\n\t\r\n\t\ttry {\r\n\t\t\tdocument.createEvent('TouchEvent');\r\n\t\t\tstartEvent = 'touchstart';\r\n\t\t\tendEvent = 'touchend';\r\n\t\t\ttouchDevice = true;\r\n\t\t} catch(e) {}\r\n\t//startGratiiSession(\"XXIV\"); //brian said include this\r\n\tdrawSplash();\r\n\tdocument.addEventListener(startEvent, splashScreenPressed, false);\r\n\tdocument.addEventListener(endEvent, splashScreenReleased, false);\r\n}", "function setup() {\n if(ionic.Gestures.READY) {\n return;\n }\n\n // find what eventtypes we add listeners to\n ionic.Gestures.event.determineEventTypes();\n\n // Register all gestures inside ionic.Gestures.gestures\n for(var name in ionic.Gestures.gestures) {\n if(ionic.Gestures.gestures.hasOwnProperty(name)) {\n ionic.Gestures.detection.register(ionic.Gestures.gestures[name]);\n }\n }\n\n // Add touch events on the document\n ionic.Gestures.event.onTouch(ionic.Gestures.DOCUMENT, ionic.Gestures.EVENT_MOVE, ionic.Gestures.detection.detect);\n ionic.Gestures.event.onTouch(ionic.Gestures.DOCUMENT, ionic.Gestures.EVENT_END, ionic.Gestures.detection.detect);\n\n // ionic.Gestures is ready...!\n ionic.Gestures.READY = true;\n }", "function setup() {\n if(ionic.Gestures.READY) {\n return;\n }\n\n // find what eventtypes we add listeners to\n ionic.Gestures.event.determineEventTypes();\n\n // Register all gestures inside ionic.Gestures.gestures\n for(var name in ionic.Gestures.gestures) {\n if(ionic.Gestures.gestures.hasOwnProperty(name)) {\n ionic.Gestures.detection.register(ionic.Gestures.gestures[name]);\n }\n }\n\n // Add touch events on the document\n ionic.Gestures.event.onTouch(ionic.Gestures.DOCUMENT, ionic.Gestures.EVENT_MOVE, ionic.Gestures.detection.detect);\n ionic.Gestures.event.onTouch(ionic.Gestures.DOCUMENT, ionic.Gestures.EVENT_END, ionic.Gestures.detection.detect);\n\n // ionic.Gestures is ready...!\n ionic.Gestures.READY = true;\n }", "function setup() {\n if(Hammer.READY) {\n return;\n }\n\n // find what eventtypes we add listeners to\n Hammer.event.determineEventTypes();\n\n // Register all gestures inside Hammer.gestures\n for(var name in Hammer.gestures) {\n if(Hammer.gestures.hasOwnProperty(name)) {\n Hammer.detection.register(Hammer.gestures[name]);\n }\n }\n\n // Add touch events on the document\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_MOVE, Hammer.detection.detect);\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_END, Hammer.detection.detect);\n\n // Hammer is ready...!\n Hammer.READY = true;\n}", "function setup() {\n if(Hammer.READY) {\n return;\n }\n\n // find what eventtypes we add listeners to\n Hammer.event.determineEventTypes();\n\n // Register all gestures inside Hammer.gestures\n for(var name in Hammer.gestures) {\n if(Hammer.gestures.hasOwnProperty(name)) {\n Hammer.detection.register(Hammer.gestures[name]);\n }\n }\n\n // Add touch events on the document\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_MOVE, Hammer.detection.detect);\n Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_END, Hammer.detection.detect);\n\n // Hammer is ready...!\n Hammer.READY = true;\n}", "function iPadTouchStart(event) {\n\tvar touches = event.changedTouches,\n\t\tfirst = touches[0],\n\t\ttype = \"mouseover\",\n\t\tsimulatedEvent = document.createEvent(\"MouseEvent\");\n\t//\n\t// Mouse over first - I have live events attached on mouse over\n\t//\n\tsimulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0, null);\n\tfirst.target.dispatchEvent(simulatedEvent);\n\n\ttype = \"mousedown\";\n\tsimulatedEvent = document.createEvent(\"MouseEvent\");\n\n\tsimulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0, null);\n\tfirst.target.dispatchEvent(simulatedEvent);\n\n\n\tif (!tapValid) {\n\t\tlastTap = first.target;\n\t\ttapValid = true;\n\t\ttapTimeout = window.setTimeout(\"cancelTap();\", 600);\n\t\tstartHold(event);\n\t}\n\telse {\n\t\twindow.clearTimeout(tapTimeout);\n\n\t\t//\n\t\t// If a double tap is still a possibility and the elements are the same\n\t\t//\tThen perform a double click\n\t\t//\n\t\tif (first.target == lastTap) {\n\t\t\tlastTap = null;\n\t\t\ttapValid = false;\n\n\t\t\ttype = \"click\";\n\t\t\tsimulatedEvent = document.createEvent(\"MouseEvent\");\n\n\t\t\tsimulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0/*left*/, null);\n\t\t\tfirst.target.dispatchEvent(simulatedEvent);\n\n\t\t\ttype = \"dblclick\";\n\t\t\tsimulatedEvent = document.createEvent(\"MouseEvent\");\n\n\t\t\tsimulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0/*left*/, null);\n\t\t\tfirst.target.dispatchEvent(simulatedEvent);\n\t\t}\n\t\telse {\n\t\t\tlastTap = first.target;\n\t\t\ttapValid = true;\n\t\t\ttapTimeout = window.setTimeout(\"cancelTap();\", 600);\n\t\t\tstartHold(event);\n\t\t}\n\t}\n}", "function initTouch()\n {\n var startX,\n startY,\n touchStartX,\n touchStartY,\n moved,\n moving = false;\n \n container.unbind('touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick').bind(\n 'touchstart.jsp',\n function(e)\n {\n var touch = e.originalEvent.touches[0];\n startX = contentPositionX();\n startY = contentPositionY();\n touchStartX = touch.pageX;\n touchStartY = touch.pageY;\n moved = false;\n moving = true;\n }\n ).bind(\n 'touchmove.jsp',\n function(ev)\n {\n if(!moving) {\n return;\n }\n \n var touchPos = ev.originalEvent.touches[0],\n dX = horizontalDragPosition, dY = verticalDragPosition;\n \n jsp.scrollTo(startX + touchStartX - touchPos.pageX, startY + touchStartY - touchPos.pageY);\n \n moved = moved || Math.abs(touchStartX - touchPos.pageX) > 5 || Math.abs(touchStartY - touchPos.pageY) > 5;\n \n // return true if there was no movement so rest of screen can scroll\n return dX == horizontalDragPosition && dY == verticalDragPosition;\n }\n ).bind(\n 'touchend.jsp',\n function(e)\n {\n moving = false;\n /*if(moved) {\n return false;\n }*/\n }\n ).bind(\n 'click.jsp-touchclick',\n function(e)\n {\n if(moved) {\n moved = false;\n return false;\n }\n }\n );\n }", "function attachEventHandlers() {\n // TODO arrow: attach events for functionality like in assignment-document described\n var clicked;\n $(\"#\"+_this.id).click(function(event){\n clicked = true;\n diagram.selectArrow(_this);\n });\n $(\"#\"+_this.id).contents().on(\"dblclick contextmenu\", function(event){\n clicked = true;\n event.preventDefault();\n });\n\n // TODO arrow optional: attach events for bonus points for 'TAB' to switch between arrows and to select arrow\n $(\"#\"+_this.id).contents().attr(\"tabindex\",\"0\");\n\n $(\"#\"+_this.id).keydown(function(event){\n if(event.which == \"13\"){\n diagram.selectArrow(_this);\n }\n if(event.which == \"9\"){\n clicked = false;\n }\n })\n $(\"#\"+_this.id).contents().focusin(function(event){\n if(!clicked){\n setActive(true);\n }\n });\n $(\"#\"+_this.id).contents().focusout(function(event){\n setActive(false);\n });\n }", "function handleStart(e) {\n document.getElementById(id).className = \"touchBtn pressed\";\n e.preventDefault();\n }", "function startup() {\n for(var i = 0; i < 9; i++) { // loop through the divs containing images and add event listeners\n var el = document.getElementById(\"image\"+i);\n el.addEventListener(\"touchstart\", handleStart, false);\n el.addEventListener(\"touchend\", handleEnd, false);\n el.addEventListener(\"touchcancel\", handleCancel, false);\n el.addEventListener(\"touchmove\", handleMove, false);\n }\n for(var i = 0; i < 9; i++) { // loop through the divs containing images and add event listeners\n var el = document.getElementById(\"image\"+i);\n el.addEventListener(\"mousedown\", handleMouseDown);\n el.addEventListener(\"mouseup\", handleMouseUp);\n }\n\n document.addEventListener('keydown', handleKeyDown); //add listener for keyboard input\n document.addEventListener('keyup', handleKeyUp); //add listener for keyboard input\n\n}", "function initTouch()\n\t\t\t{\n\t\t\t\tvar startX,\n\t\t\t\t\tstartY,\n\t\t\t\t\ttouchStartX,\n\t\t\t\t\ttouchStartY,\n\t\t\t\t\tmoved,\n\t\t\t\t\tmoving = false;\n \n\t\t\t\tcontainer.unbind('touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick').bind(\n\t\t\t\t\t'touchstart.jsp',\n\t\t\t\t\tfunction(e)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar touch = e.originalEvent.touches[0];\n\t\t\t\t\t\tstartX = contentPositionX();\n\t\t\t\t\t\tstartY = contentPositionY();\n\t\t\t\t\t\ttouchStartX = touch.pageX;\n\t\t\t\t\t\ttouchStartY = touch.pageY;\n\t\t\t\t\t\tmoved = false;\n\t\t\t\t\t\tmoving = true;\n\t\t\t\t\t}\n\t\t\t\t).bind(\n\t\t\t\t\t'touchmove.jsp',\n\t\t\t\t\tfunction(ev)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!moving) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar touchPos = ev.originalEvent.touches[0],\n\t\t\t\t\t\t\tdX = horizontalDragPosition, dY = verticalDragPosition;\n\t\t\t\t\t\t\n\t\t\t\t\t\tjsp.scrollTo(startX + touchStartX - touchPos.pageX, startY + touchStartY - touchPos.pageY);\n\t\t\t\t\t\t\n\t\t\t\t\t\tmoved = moved || Math.abs(touchStartX - touchPos.pageX) > 5 || Math.abs(touchStartY - touchPos.pageY) > 5;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// return true if there was no movement so rest of screen can scroll\n\t\t\t\t\t\treturn dX == horizontalDragPosition && dY == verticalDragPosition;\n\t\t\t\t\t}\n\t\t\t\t).bind(\n\t\t\t\t\t'touchend.jsp',\n\t\t\t\t\tfunction(e)\n\t\t\t\t\t{\n\t\t\t\t\t\tmoving = false;\n\t\t\t\t\t\t/*if(moved) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}*/\n\t\t\t\t\t}\n\t\t\t\t).bind(\n\t\t\t\t\t'click.jsp-touchclick',\n\t\t\t\t\tfunction(e)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(moved) {\n\t\t\t\t\t\t\tmoved = false;\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}", "function initTouch()\n\t\t\t{\n\t\t\t\tvar startX,\n\t\t\t\t\tstartY,\n\t\t\t\t\ttouchStartX,\n\t\t\t\t\ttouchStartY,\n\t\t\t\t\tmoved,\n\t\t\t\t\tmoving = false;\n \n\t\t\t\tcontainer.unbind('touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick').bind(\n\t\t\t\t\t'touchstart.jsp',\n\t\t\t\t\tfunction(e)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar touch = e.originalEvent.touches[0];\n\t\t\t\t\t\tstartX = contentPositionX();\n\t\t\t\t\t\tstartY = contentPositionY();\n\t\t\t\t\t\ttouchStartX = touch.pageX;\n\t\t\t\t\t\ttouchStartY = touch.pageY;\n\t\t\t\t\t\tmoved = false;\n\t\t\t\t\t\tmoving = true;\n\t\t\t\t\t}\n\t\t\t\t).bind(\n\t\t\t\t\t'touchmove.jsp',\n\t\t\t\t\tfunction(ev)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!moving) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar touchPos = ev.originalEvent.touches[0],\n\t\t\t\t\t\t\tdX = horizontalDragPosition, dY = verticalDragPosition;\n\t\t\t\t\t\t\n\t\t\t\t\t\tjsp.scrollTo(startX + touchStartX - touchPos.pageX, startY + touchStartY - touchPos.pageY);\n\t\t\t\t\t\t\n\t\t\t\t\t\tmoved = moved || Math.abs(touchStartX - touchPos.pageX) > 5 || Math.abs(touchStartY - touchPos.pageY) > 5;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// return true if there was no movement so rest of screen can scroll\n\t\t\t\t\t\treturn dX == horizontalDragPosition && dY == verticalDragPosition;\n\t\t\t\t\t}\n\t\t\t\t).bind(\n\t\t\t\t\t'touchend.jsp',\n\t\t\t\t\tfunction(e)\n\t\t\t\t\t{\n\t\t\t\t\t\tmoving = false;\n\t\t\t\t\t\t/*if(moved) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}*/\n\t\t\t\t\t}\n\t\t\t\t).bind(\n\t\t\t\t\t'click.jsp-touchclick',\n\t\t\t\t\tfunction(e)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(moved) {\n\t\t\t\t\t\t\tmoved = false;\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}", "function setClickHandlers() {\n\tvar link = document.getElementById('btnStart');\n link.addEventListener('click', function(e) {\n\n \t\t// if the childWindow is already open, don't allow user to click the button\n \t\tif (childWindow !== null) {\n \t\t\treturn false;\n \t\t}\n\n \te.preventDefault();\n \ttoast('Contacting Foursquare...');\n \tsetTimeout(function(){ startOAuth(); }, 500);\n \t});\n}", "function addTouchHandler(){\n if(isTouchDevice || isTouch){\n if(options.autoScrolling){\n $body.off(events.touchmove).on(events.touchmove, preventBouncing);\n }\n\n $(WRAPPER_SEL)\n .off(events.touchstart).on(events.touchstart, touchStartHandler)\n .off(events.touchmove).on(events.touchmove, touchMoveHandler);\n }\n }", "function addTouchHandler(){\n if(isTouchDevice || isTouch){\n if(options.autoScrolling){\n $body.off(events.touchmove).on(events.touchmove, preventBouncing);\n }\n\n $(WRAPPER_SEL)\n .off(events.touchstart).on(events.touchstart, touchStartHandler)\n .off(events.touchmove).on(events.touchmove, touchMoveHandler);\n }\n }", "function iPadTouchStart(event) {\n\t\tvar touches = event.changedTouches,\n\t\t\tfirst = touches[0],\n\t\t\ttype = \"mouseover\",\n\t\t\tsimulatedEvent = document.createEvent(\"MouseEvent\");\n\t\t//\n\t\t// Mouse over first - I have live events attached on mouse over\n\t\t//\n\t\tsimulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,\n\t\t\t\t\t\t\t\tfalse, false, false, false, 0, null);\n\t\tfirst.target.dispatchEvent(simulatedEvent);\n\t\n\t\ttype = \"mousedown\";\n\t\tsimulatedEvent = document.createEvent(\"MouseEvent\");\n\t\n\t\tsimulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,\n\t\t\t\t\t\t\t\tfalse, false, false, false, 0, null);\n\t\tfirst.target.dispatchEvent(simulatedEvent);\n\t\n\t\n\t\tif (!tapValid) {\n\t\t\tlastTap = first.target;\n\t\t\ttapValid = true;\n\t\t\ttapTimeout = window.setTimeout(\"cancelTap();\", 600);\n\t\t\tstartHold(event);\n\t\t}\n\t\telse {\n\t\t\twindow.clearTimeout(tapTimeout);\n\t\n\t\t\t//\n\t\t\t// If a double tap is still a possibility and the elements are the same\n\t\t\t//\tThen perform a double click\n\t\t\t//\n\t\t\tif (first.target == lastTap) {\n\t\t\t\tlastTap = null;\n\t\t\t\ttapValid = false;\n\t\n\t\t\t\ttype = \"click\";\n\t\t\t\tsimulatedEvent = document.createEvent(\"MouseEvent\");\n\t\n\t\t\t\tsimulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,\n\t\t\t\t\t\t\t\tfalse, false, false, false, 0/*left*/, null);\n\t\t\t\tfirst.target.dispatchEvent(simulatedEvent);\n\t\n\t\t\t\ttype = \"dblclick\";\n\t\t\t\tsimulatedEvent = document.createEvent(\"MouseEvent\");\n\t\n\t\t\t\tsimulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,\n\t\t\t\t\t\t\t\tfalse, false, false, false, 0/*left*/, null);\n\t\t\t\tfirst.target.dispatchEvent(simulatedEvent);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlastTap = first.target;\n\t\t\t\ttapValid = true;\n\t\t\t\ttapTimeout = window.setTimeout(\"cancelTap();\", 600);\n\t\t\t\tstartHold(event);\n\t\t\t}\n\t\t}\n\t}", "function setup() {\n if(Hammer.READY) {\n return;\n }\n\n // find what eventtypes we add listeners to\n Event.determineEventTypes();\n\n // Register all gestures inside Hammer.gestures\n Utils.each(Hammer.gestures, function(gesture) {\n Detection.register(gesture);\n });\n\n // Add touch events on the document\n Event.onTouch(Hammer.DOCUMENT, EVENT_MOVE, Detection.detect);\n Event.onTouch(Hammer.DOCUMENT, EVENT_END, Detection.detect);\n\n // Hammer is ready...!\n Hammer.READY = true;\n }", "function addTouchHandler(){\n \t\t\tif(isTouchDevice || isTouch){\n \t\t\t\t//Microsoft pointers\n \t\t\t\tMSPointer = getMSPointer();\n\n \t\t\t\t$(document).off('touchstart ' + MSPointer.down).on('touchstart ' + MSPointer.down, touchStartHandler);\n \t\t\t\t$(document).off('touchmove ' + MSPointer.move).on('touchmove ' + MSPointer.move, touchMoveHandler);\n \t\t\t}\n \t\t}", "function clickonStartManager() {\n $('main').on('click', '#start', function(event) {\n console.log('i hear you');\n questionnaire.quizStarted = true;\n render();\n });\n}", "function setup(opts) {\n if (GestureDetector.READY) {\n return;\n } // find what eventtypes we add listeners to\n\n\n Event$1.determineEventTypes(); // Register all gestures inside GestureDetector.gestures\n\n Utils.each(GestureDetector.gestures, function (gesture) {\n Detection.register(gesture);\n }); // Add touch events on the document\n\n Event$1.onTouch(GestureDetector.DOCUMENT, EVENT_MOVE, Detection.detect, opts);\n Event$1.onTouch(GestureDetector.DOCUMENT, EVENT_END, Detection.detect, opts); // GestureDetector is ready...!\n\n GestureDetector.READY = true;\n }", "function initTouchEventHandlers(){\n // HAMMER JS\n if(typeof hammerDev === 'undefined'){ // The hammer has not yet been made\n hammerDev = new Hammer(canvasDev);\n // SET SWIPE DETECTION TO AL DIRECTIONS\n hammerDev.get('swipe').set({ direction: Hammer.DIRECTION_ALL });\n\n hammerDev.on('swiperight', function(event) {\n console.log(\"swiped right\");\n if (playerShipDev.dirSpaceship !== \"right\") {\n // kill current ship\n killShipCells();\n // alter coordinates for fluid direction change\n if (playerShipDev.dirSpaceship === \"left\") {\n playerShipDev.xSpaceship += 3;\n } else if (playerShipDev.dirSpaceship === \"up\") {\n playerShipDev.ySpaceship += 2;\n }\n playerShipDev.dirSpaceship = \"right\";\n }\n forceMove = true;\n });\n\n hammerDev.on('swipeleft', function(event) {\n console.log(\"swiped left\");\n if (playerShipDev.dirSpaceship !== \"left\") {\n // kill current ship\n killShipCells();\n // alter coordinates for fluid direction change\n if (playerShipDev.dirSpaceship === \"right\") {\n playerShipDev.xSpaceship -= 3;\n } else if (playerShipDev.dirSpaceship === \"down\"){\n playerShipDev.xSpaceship -= 2;\n } else if (playerShipDev.dirSpaceship === \"up\"){\n playerShipDev.xSpaceship -= 2;\n playerShipDev.ySpaceship += 2;\n }\n playerShipDev.dirSpaceship = \"left\";\n }\n forceMove = true;\n });\n\n hammerDev.on('swipeup', function(event) {\n console.log(\"swiped up\");\n if (playerShipDev.dirSpaceship !== \"up\") {\n // kill current ship\n killShipCells();\n // alter coordinates for fluid direction change\n if (playerShipDev.dirSpaceship === \"right\") {\n playerShipDev.ySpaceship -= 2;\n } else if (playerShipDev.dirSpaceship === \"down\") {\n playerShipDev.ySpaceship -= 3;\n } else if (playerShipDev.dirSpaceship === \"left\") {\n playerShipDev.xSpaceship += 2;\n playerShipDev.ySpaceship -= 2;\n }\n playerShipDev.dirSpaceship = \"up\";\n }\n forceMove = true;\n });\n hammerDev.on('swipedown', function(event) {\n console.log(\"swiped down\");\n if (playerShipDev.dirSpaceship !== \"down\") {\n // kill current ship\n killShipCells();\n // alter coordinates for fluid direction change\n if (playerShipDev.dirSpaceship === \"left\") {\n playerShipDev.xSpaceship += 2;\n } else if (playerShipDev.dirSpaceship === \"up\") {\n playerShipDev.ySpaceship += 3;\n }\n playerShipDev.dirSpaceship = \"down\";\n }\n forceMove = true;\n });\n }\n\n canvasDev.onclick = function(event) {\n console.log(\"tapped the screen\");\n // SHOOT A BULLET FROM THE TIP OF THE SHIP\n if (bulletsConsumed < bulletLimitDev) {\n if (playerShipDev.dirSpaceship === \"up\") {\n if (currentMutedState() !== true)\n bulletFireAudio.play();\n dirBulletDev = \"up\"\n velBulletDev = 2 * playerShipDev.velSpaceship;\n xBulletDev = playerShipDev.xSpaceship + 2;\n yBulletDev = playerShipDev.ySpaceship;\n } else if (playerShipDev.dirSpaceship === \"right\") {\n if (currentMutedState() !== true)\n bulletFireAudio.play();\n dirBulletDev = \"right\"\n velBulletDev = 2 * playerShipDev.velSpaceship;\n xBulletDev = playerShipDev.xSpaceship + 7;\n yBulletDev = playerShipDev.ySpaceship + 2;\n } else if (playerShipDev.dirSpaceship === \"down\") {\n if (currentMutedState() !== true)\n bulletFireAudio.play();\n dirBulletDev = \"down\"\n velBulletDev = 2 * playerShipDev.velSpaceship;\n xBulletDev = playerShipDev.xSpaceship + 2;\n yBulletDev = playerShipDev.ySpaceship + 7;\n } else if (playerShipDev.dirSpaceship === \"left\") {\n if (currentMutedState() !== true)\n bulletFireAudio.play();\n dirBulletDev = \"left\"\n velBulletDev = 2 * playerShipDev.velSpaceship;\n xBulletDev = playerShipDev.xSpaceship;\n yBulletDev = playerShipDev.ySpaceship + 2;\n }\n\n bulletDev = new bullet(xBulletDev, yBulletDev, dirBulletDev, velBulletDev);\n // SET THE BULLET INTO THE ARRAY OF BULLETS\n bulletListDev.push(bulletDev);\n bulletsConsumed++;\n }\n else {\n console.log(\"No bullets remaining\");\n }\n }\n}" ]
[ "0.6721086", "0.66993153", "0.64145917", "0.63741803", "0.6339568", "0.63016623", "0.627593", "0.6262629", "0.62365746", "0.62236446", "0.6200184", "0.61970556", "0.6183574", "0.6171448", "0.61657757", "0.6165187", "0.61530447", "0.6147171", "0.6140859", "0.6123443", "0.6102783", "0.6101793", "0.60824156", "0.60819656", "0.6076399", "0.6072049", "0.60650176", "0.60626936", "0.6057623", "0.60410327", "0.6018713", "0.60107756", "0.60092926", "0.60081947", "0.5997199", "0.59827304", "0.5963474", "0.5951667", "0.5946133", "0.5945631", "0.59343034", "0.5934281", "0.59221905", "0.59174085", "0.59156775", "0.59092975", "0.5909191", "0.59074134", "0.59025824", "0.59018224", "0.58955437", "0.58955437", "0.587903", "0.5876141", "0.5865636", "0.5857619", "0.5852367", "0.58499765", "0.58499765", "0.58451426", "0.58450335", "0.5843462", "0.5840305", "0.5834466", "0.5832958", "0.5831653", "0.58257776", "0.58248454", "0.5824613", "0.5824613", "0.5824613", "0.5819436", "0.5819436", "0.58065397", "0.5804902", "0.5804673", "0.5801906", "0.5797662", "0.57960415", "0.57851714", "0.5783109", "0.5779272", "0.5779272", "0.57778895", "0.57778895", "0.5777762", "0.5776403", "0.5775718", "0.57718396", "0.57688934", "0.5760422", "0.5760422", "0.5759578", "0.5747973", "0.5747973", "0.57456887", "0.57383406", "0.5732962", "0.573244", "0.5724892", "0.5722345" ]
0.0
-1
like _.indexBy when you know that your index values will be unique, or you want lastonein to win
function indexBy(array, propName) { var result = {}; forEach(array, function(item) { result[item[propName]] = item; }); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "onlyUnique(value, index, self) {\r\n return self.indexOf(value) === index; \r\n }", "function makeIndex(a, b) {\n let index = Object.create(null);\n\n ((a || []).concat(b ||[])).forEach(function(a) {\n index[a] = true;\n });\n\n return index;\n}", "index(key) {\n let initial;\n if (this._keyMap[key])\n initial = this._keyMap[key].index;\n else\n initial = ((Object.entries(this.value) || []).find(([index, item]) => this.keyfunc(item) == key)\n || [-1, undefined])[0];\n return group(value(initial), group(this.changes, this.reemit).to(map(() => (this._keyMap[key] || { index: -1 }).index))).to(pipe(distinctUntilKeyChanged('value')));\n }", "function to_idx(combined, x, y) {\n\treturn y * combined.size.x + x;\n}", "mostOwed(arr) {\n let index = 0;\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] < arr[index]) {\n index = i;\n }\n }\n return index;\n }", "key(index) {\n return this._key(index) || this._keyPlus(index)\n }", "static findIndex() {\n let users = [\n { 'user': 'barney', 'active': false },\n { 'user': 'fred', 'active': false },\n { 'user': 'pebbles', 'active': true }\n ];\n\n console.log(_.findIndex(users, o => o.user === 'barney'));\n // → 0\n\n // The `_.matches` iteratee shorthand.\n console.log(_.findIndex(users, { 'user': 'fred', 'active': false }));\n // → 1\n\n // The `_.matchesProperty` iteratee shorthand.\n console.log(_.findIndex(users, ['active', false]));\n // → 0\n\n // The `_.property` iteratee shorthand.\n console.log(_.findIndex(users, 'active'));\n // → 2\n\n let numbers = [1, 2, 6, 1];\n let numberObjs = [{1: {a: {b: false, c: true}}}, {2: 'som'}, {6: false}, {1: a => a}];\n console.log(_.findIndex(numbers, num => num === 6));\n\n console.log(_.findIndex(numberObjs, {'b': false})); // -1\n console.log(_.findIndex(numberObjs, ['b', false])); // -1\n console.log(_.findIndex(numberObjs, ['b'])); // -1\n\n console.log(_.findIndex(numberObjs, {'1.a.b': false})); // -1\n console.log(_.findIndex(numberObjs, ['1.a.b', false])); // 0\n console.log(_.findIndex(numberObjs, ['1.a.c'])); // -1\n\n // only _.mathcesProperty can lookup deeply nested objects in array\n\n console.log(_.findIndex(numberObjs, [6, false])); // 2\n }", "uniqueElement (value, index, self) {\n return self.indexOf(value) === index\n }", "function removeDuplicateUsingLinearSearch(a, key) {\n var index = [];\n return a.filter(function(item) {\n var k = key(item);\n return index.indexof(k) ? false : index.push(k);\n });\n\n}", "function onlyUnique(value, index, self) { return self.indexOf(value) === index; }", "function byDistance(a, b) {\n a = distance(a.index, internal.index);\n b = distance(b.index, internal.index);\n\n if (a === b) {\n return 0;\n } else if (a > b) {\n return 1;\n } else {\n return -1;\n }\n }", "buscarIndex(id,array){\r\n return array.findIndex((elem) => elem.getId() === id);\r\n }", "calAllIndex() {\n for (let i = 0; i < this.length; i++) {\n for (let j = 0; j < this.breath; j++) {\n let index = i + \"-\" + j;\n this.indexes.push(index);\n }\n }\n return this.indexes;\n }", "function suite_w_duplicate(indices) {\n let suite_w_duplicate = [];\n for (let i = 0; i < indices.length; i++) {\n if (indices[i] === indices[i + 1] - 1) {\n suite_w_duplicate.push(indices[i], indices[i + 1]);\n }\n }\n return suite_w_duplicate;\n }", "getUnique(arr, comp) {\n const unique = arr\n //store the comparison values in array\n .map(e => e[comp])\n\n // store the keys of the unique objects\n .map((e, i, final) => final.indexOf(e) === i && i)\n\n // eliminate the dead keys & store unique objects\n .filter(e => arr[e])\n\n .map(e => arr[e]);\n\n return unique;\n }", "function indexBy(iterator, context) {\n var memo = new Hash();\n \n this.each(function(item) {\n var k = iterator(item),\n v = memo.get(k) || [];\n v.push(item);\n memo.set(k, v);\n }, context);\n \n return memo;\n }", "function findIdx(table, val) {\n }", "updateIndex (oplog, added) {\n added.reverse().reduce((handled, item) => {\n if (handled.indexOf(item.payload.key) === -1) {\n handled.push(item.payload.key)\n if (item.payload.op === 'INSERT') {\n this._index[item.payload.id] = item.payload.value\n }\n }\n return handled\n }, [])\n }", "static async getAdjacentIndices(index, revisionIndex) {\n\n let previous = await this.findOne({ _deleted: false })\n .lte('_revisionIndex', revisionIndex || getLatestRevisionIndex())\n .lt('index', index)\n .sort('-index -_revisionIndex')\n\n if (!previous) previous = await this.findOne({ _deleted: false })\n .lte('_revisionIndex', revisionIndex || getLatestRevisionIndex())\n .sort('-index -_revisionIndex')\n\n let next = await this.findOne({ _deleted: false })\n .lte('_revisionIndex', revisionIndex || getLatestRevisionIndex())\n .gt('index', index)\n .sort('index -_revisionIndex')\n\n if (!next) next = await this.findOne({ _deleted: false })\n .lte('_revisionIndex', revisionIndex || getLatestRevisionIndex())\n .sort('index -_revisionIndex')\n\n let lastUsedDecimal = await this.findOne({ _deleted: false })\n .lte('_revisionIndex', revisionIndex || getLatestRevisionIndex())\n .gte('index', index)\n .lt('index', Math.ceil(+index) === +index ? (+index) + 1 : Math.ceil(+index))\n .sort('-index -_revisionIndex')\n\n return {\n previous: previous ? previous.index : null,\n next: next ? next.index : null,\n lastUsedDecimal: lastUsedDecimal ? lastUsedDecimal.index : null,\n }\n\n }", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "function _index(objects) {\n var index = {};\n for (var i=0; i < objects.length; i++) {\n var n = objects[i];\n n.uuid = \"a\" + uuid();\n index[n.id] = n;\n }\n return index;\n }", "idx(element, array) {\n let cont=0;\n for (let i of array) {\n if (i === element) {\n return cont;\n }\n cont += 1;\n }\n return cont;\n }", "rebuildIndices() {\n const me = this,\n isFiltered = me.isFiltered,\n indices = me._indices || (me._indices = {}),\n keyProps = Object.keys(indices),\n indexCount = keyProps.length,\n values = me._values,\n count = values.length;\n\n let i, j;\n\n // First, clear indices.\n if (isFiltered) {\n indices[filteredIndicesProperty] = {};\n }\n for (i = 0; i < indexCount; i++) {\n indices[keyProps[i]] = {};\n if (isFiltered) {\n indices[filteredIndicesProperty][keyProps[i]] = {};\n }\n }\n\n /*\n * Rebuild the indices object.\n * Loop through all items adding an entry for each one to each index.\n * So collection.add({id : foo, name : 'Nige'}, {id : 'bar', name : 'Faye'}) where collection has had an index\n * added for the \"name\" property would result in:\n *\n * {\n * id : {\n * foo : 0,\n * bar : 1\n * },\n * name : {\n * Nige : 0,\n * Faye : 1\n * }\n * }\n */\n for (i = 0; i < count; i++) {\n const item = values[i];\n\n for (j = 0; j < indexCount; j++) {\n const keyProp = keyProps[j];\n // This does indices.name['Nige'] = 0\n indices[keyProp][safeIndexKey(item[keyProp])] = i;\n }\n }\n\n // Create a parallel lookup structure into the _filteredValues\n if (isFiltered) {\n const values = me._filteredValues,\n count = values.length,\n indices = me._indices[filteredIndicesProperty];\n\n for (i = 0; i < count; i++) {\n const item = values[i];\n\n for (j = 0; j < indexCount; j++) {\n const keyProp = keyProps[j];\n // This does indices[filteredIndicesProperty].name['Nige'] = 0\n indices[keyProp][safeIndexKey(item[keyProp])] = i;\n }\n }\n }\n\n me._indicesInvalid = false;\n }", "function onlyUnique(val, idx, array) {// console.log(\"onlyUnique \", array.indexOf(val) === idx);\n return array.indexOf(val) === idx;\n }", "function firstDuplicate(a) {\n const items = {};\n\n for (let i = 0; i < a.length; i++) {\n\n const currValue = a[i];\n const currIndex = i;\n if (items[currValue] >= 0) {\n return currValue;\n } else {\n items[currValue] = currIndex;\n }\n }\n return -1;\n}", "function SortedIndex() {\n var index = Object(__WEBPACK_IMPORTED_MODULE_0__arrays__[\"b\" /* array32 */])(0),\n value = [],\n size = 0;\n\n function insert(key, data, base) {\n if (!data.length) return [];\n\n var n0 = size,\n n1 = data.length,\n addv = Array(n1),\n addi = Object(__WEBPACK_IMPORTED_MODULE_0__arrays__[\"b\" /* array32 */])(n1),\n oldv, oldi, i;\n\n for (i=0; i<n1; ++i) {\n addv[i] = key(data[i]);\n addi[i] = i;\n }\n addv = sort(addv, addi);\n\n if (n0) {\n oldv = value;\n oldi = index;\n value = Array(n0 + n1);\n index = Object(__WEBPACK_IMPORTED_MODULE_0__arrays__[\"b\" /* array32 */])(n0 + n1);\n merge(base, oldv, oldi, n0, addv, addi, n1, value, index);\n } else {\n if (base > 0) for (i=0; i<n1; ++i) {\n addi[i] += base;\n }\n value = addv;\n index = addi;\n }\n size = n0 + n1;\n\n return {index: addi, value: addv};\n }\n\n function remove(num, map) {\n // map: index -> remove\n var n = size,\n idx, i, j;\n\n // seek forward to first removal\n for (i=0; !map[index[i]] && i<n; ++i);\n\n // condense index and value arrays\n for (j=i; i<n; ++i) {\n if (!map[idx=index[i]]) {\n index[j] = idx;\n value[j] = value[i];\n ++j;\n }\n }\n\n size = n - num;\n }\n\n function reindex(map) {\n for (var i=0, n=size; i<n; ++i) {\n index[i] = map[index[i]];\n }\n }\n\n function bisect(range, array) {\n var n;\n if (array) {\n n = array.length;\n } else {\n array = value;\n n = size;\n }\n return [\n Object(__WEBPACK_IMPORTED_MODULE_1_d3_array__[\"a\" /* bisectLeft */])(array, range[0], 0, n),\n Object(__WEBPACK_IMPORTED_MODULE_1_d3_array__[\"b\" /* bisectRight */])(array, range[1], 0, n)\n ];\n }\n\n return {\n insert: insert,\n remove: remove,\n bisect: bisect,\n reindex: reindex,\n index: function() { return index; },\n size: function() { return size; }\n };\n}", "objectedIndex(data, get) {\n let i = 0;\n\n for(let key in data) {\n // return int, search by key\n if(typeof get === 'string' && key == get) {\n return i;\n } // return object, search by index\n else if(typeof get === 'number' && i === get) {\n return data[key];\n }\n\n i++;\n }\n }", "mostOwned(arr) {\n let index = 0;\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] > arr[index]) {\n index = i;\n }\n }\n return index;\n }", "[indx](person) {\r\n // returns -1 if not found\r\n return this.members.indexOf(person);\r\n }", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "function onlyUnique (value, index, self) {\n return self.indexOf(value) === index\n}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "function elemIndex(x, xs){\r\n return findIndex(function(e){ return Eq.eq(x) }, xs);\r\n}", "function looseIndexOf(arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i]))\n return i;\n }\n return -1;\n }", "function onlyUnique(value, index, self) { \n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) { \n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) { \n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) { \n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) { \n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) {\r\n\treturn self.indexOf(value) === index;\r\n}", "function SortedIndex() {\n var index = array32(0),\n value = [],\n size = 0;\n\n function insert(key, data, base) {\n if (!data.length) return [];\n\n var n0 = size,\n n1 = data.length,\n addv = Array(n1),\n addi = array32(n1),\n oldv, oldi, i;\n\n for (i=0; i<n1; ++i) {\n addv[i] = key(data[i]);\n addi[i] = i;\n }\n addv = sort(addv, addi);\n\n if (n0) {\n oldv = value;\n oldi = index;\n value = Array(n0 + n1);\n index = array32(n0 + n1);\n merge$6(base, oldv, oldi, n0, addv, addi, n1, value, index);\n } else {\n if (base > 0) for (i=0; i<n1; ++i) {\n addi[i] += base;\n }\n value = addv;\n index = addi;\n }\n size = n0 + n1;\n\n return {index: addi, value: addv};\n }\n\n function remove(num, map) {\n // map: index -> remove\n var n = size,\n idx, i, j;\n\n // seek forward to first removal\n for (i=0; !map[index[i]] && i<n; ++i);\n\n // condense index and value arrays\n for (j=i; i<n; ++i) {\n if (!map[idx=index[i]]) {\n index[j] = idx;\n value[j] = value[i];\n ++j;\n }\n }\n\n size = n - num;\n }\n\n function reindex(map) {\n for (var i=0, n=size; i<n; ++i) {\n index[i] = map[index[i]];\n }\n }\n\n function bisect(range$$1, array) {\n var n;\n if (array) {\n n = array.length;\n } else {\n array = value;\n n = size;\n }\n return [\n bisectLeft(array, range$$1[0], 0, n),\n bisectRight(array, range$$1[1], 0, n)\n ];\n }\n\n return {\n insert: insert,\n remove: remove,\n bisect: bisect,\n reindex: reindex,\n index: function() { return index; },\n size: function() { return size; }\n };\n }", "key(i) { return this.#offset + this.#key[i]; }", "function re(idx) {return {row: Math.floor(idx/elesPerRow), ele: idx%elesPerRow}}", "function onlyUnique(value, index, self) { \r\n return self.indexOf(value) === index;\r\n}", "function SortedIndex() {\n var index = (0,_arrays__WEBPACK_IMPORTED_MODULE_0__.array32)(0),\n value = [],\n size = 0;\n\n function insert(key, data, base) {\n if (!data.length) return [];\n\n var n0 = size,\n n1 = data.length,\n addv = Array(n1),\n addi = (0,_arrays__WEBPACK_IMPORTED_MODULE_0__.array32)(n1),\n oldv, oldi, i;\n\n for (i=0; i<n1; ++i) {\n addv[i] = key(data[i]);\n addi[i] = i;\n }\n addv = sort(addv, addi);\n\n if (n0) {\n oldv = value;\n oldi = index;\n value = Array(n0 + n1);\n index = (0,_arrays__WEBPACK_IMPORTED_MODULE_0__.array32)(n0 + n1);\n merge(base, oldv, oldi, n0, addv, addi, n1, value, index);\n } else {\n if (base > 0) for (i=0; i<n1; ++i) {\n addi[i] += base;\n }\n value = addv;\n index = addi;\n }\n size = n0 + n1;\n\n return {index: addi, value: addv};\n }\n\n function remove(num, map) {\n // map: index -> remove\n var n = size,\n idx, i, j;\n\n // seek forward to first removal\n for (i=0; !map[index[i]] && i<n; ++i);\n\n // condense index and value arrays\n for (j=i; i<n; ++i) {\n if (!map[idx=index[i]]) {\n index[j] = idx;\n value[j] = value[i];\n ++j;\n }\n }\n\n size = n - num;\n }\n\n function reindex(map) {\n for (var i=0, n=size; i<n; ++i) {\n index[i] = map[index[i]];\n }\n }\n\n function bisect(range, array) {\n var n;\n if (array) {\n n = array.length;\n } else {\n array = value;\n n = size;\n }\n return [\n (0,d3_array__WEBPACK_IMPORTED_MODULE_1__.bisectLeft)(array, range[0], 0, n),\n (0,d3_array__WEBPACK_IMPORTED_MODULE_1__.bisectRight)(array, range[1], 0, n)\n ];\n }\n\n return {\n insert: insert,\n remove: remove,\n bisect: bisect,\n reindex: reindex,\n index: function() { return index; },\n size: function() { return size; }\n };\n}", "withSame(prop, asIdx=-1) {\n\t\tif (this.lastResult === false) return this; //do nothing\n\t\tif (!this.workingList || !this.workingList.length) {\n\t\t\tthis.lastResult = false;\n\t\t\treturn this;\n\t\t}\n\t\tif (asIdx < 0) asIdx = this.matchedItems.length + asIdx;\n\t\tlet list = this.workingList;\n\t\tlet asList = this.matchedItems[asIdx];\n\t\tthis.matchedItems[asIdx] = [];\n\t\tlet keep = new Set();\n\t\tfor (let asItem of asList) {\n\t\t\tlet keepAs = false;\n\t\t\tfor (let item of list) {\n\t\t\t\tif (item === asItem) continue; //skip comparing to itself\n\t\t\t\tif (asItem[prop] === item[prop]) {\n\t\t\t\t\tkeep.add(item);\n\t\t\t\t\tkeepAs = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (keepAs) {\n\t\t\t\tthis.matchedItems[asIdx].push(asItem);\n\t\t\t}\n\t\t}\n\t\tthis.workingList = Array.from(keep);\n\t\tthis.lastResult = (this.workingList.length > 0 && this.matchedItems[asIdx].length > 0);\n\t\treturn this;\n\t}", "function in_data_set(target_data, data_set_2d, index) {\n var target_index = 1;\n\n for (data of data_set_2d) {\n if (target_data == data[index]) {\n return target_index;\n }\n target_index++;\n }\n return -1;\n}", "function index(obj,i) {return obj[i]}", "function index(value) {\n var match = this.detect(function(pair) { \n return pair.value === value; \n });\n return match && match.key;\n }", "getUnique(arr, comp) {\n const unique = arr\n .map(e => e[comp])\n\n // store the keys of the unique objects\n .map((e, i, final) => final.indexOf(e) === i && i)\n\n // eliminate the dead keys & store unique objects\n .filter(e => arr[e])\n .map(e => arr[e]);\n\n return unique;\n }", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n}", "function unique(value, index, self) {\n return self.indexOf(value) === index;\n}", "function unique(value, index, self) {\n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "function lkup_exhaustive_m(table,column,index){\r\n\t\tvar list = eval(table);\r\n\t\tvar result = new Object();\r\n\t\tresult.data = [];\r\n\t\tresult.data.push(list[0]);\r\n\t\tresult.found = false;\r\n\t\tfor (var i = 0; i < list.length; i++){\r\n\t\t\tif ((list[i])[column] == index){\r\n\t\t\t\tresult.data[0] = list[i];\r\n\t\t\t\tresult.found = true;\r\n\t\t\t\tvar j = 1;\r\n\t \t\twhile ((i+j)<list.length){\r\n\t \t\t\tif ((list[i+j])[column] == index){\r\n\t \t\t\t\tresult.data.push(list[i+j]);\r\n\t \t\t\tj++;\r\n\t \t\t\t} else \r\n\t \t\t\t\tbreak;\r\n\t \t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "function getUnique(arr, comp) {\n // store the comparison values in array\n const unique = arr\n .map((e) => e[comp])\n // store the indexes of the unique objects\n .map((e, i, final) => final.indexOf(e) === i && i)\n // delete the false indexes & return unique objects\n .filter((e) => arr[e])\n .map((e) => arr[e]);\n return unique;\n}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n}", "getKey(value, index) {\n return index;\n }", "function magicIndex(arr) {\n let mIndex = [];\n for(let i = 0; i < arr.length; i++) {\n if(arr[i] === i) {\n mIndex.push(i)\n }\n }\n return console.log(mIndex)\n}", "getLastIndex() {\n return (this.maxIndex - Math.floor(this.index) - 1) % this.maxIndex;\n }", "uniqueFilter(e, i, arr) {\n return arr.lastIndexOf(e) === i\n }", "_dedupe(ary) {\n return ary.sort().filter((item, ndx, _ary)=>{\n if (ndx!=0 && item == ary[ndx-1]) return false;\n return true;\n });\n }", "get index() { return this._index; }", "getDistinctIndexes(element, size, number, seed) {\n if (seed === undefined) {\n seed = getDefaultSeed();\n }\n let n = 0;\n const indexes = new Set();\n let hashes = this.hashTwice(element, seed);\n // let cycle = 0\n while(indexes.size < number){\n const ind = hashes.first % size;\n if (!indexes.has(ind)) {\n indexes.add(ind);\n }\n hashes.first = (hashes.first + hashes.second) % size;\n hashes.second = (hashes.second + n) % size;\n n++;\n if (n > size) {\n // Enhanced double hashing stops cycles of length less than `size` in the case where\n // size is coprime with the second hash. But you still get cycles of length `size`.\n // So if we reach there and haven't finished, append a prime to the input and\n // rehash.\n seed++;\n hashes = this.hashTwice(element, seed);\n }\n }\n return [\n ...indexes.values()\n ];\n }", "static findLastIndex() {\n let users = [\n { 'user': 'barney', 'active': true },\n { 'user': 'fred', 'active': false },\n { 'user': 'pebbles', 'active': false }\n ];\n\n console.log(_.findLastIndex(users, o => o.user === 'pebbles'));\n // → 2\n\n // The `_.matches` iteratee shorthand.\n console.log(_.findLastIndex(users, { 'user': 'barney', 'active': true }));\n // → 0\n\n // The `_.matchesProperty` iteratee shorthand.\n console.log(_.findLastIndex(users, ['active', false]));\n // → 2\n\n // The `_.property` iteratee shorthand.\n console.log(_.findLastIndex(users, 'active'));\n // → 0\n }", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "_findIndex(target, metric) {\n const index = metric === 'lat' ? this._latIndex : this._lonIndex;\n\n // check edge cases\n if (index.length === 0 || index[0][metric] > target) {\n return 0;\n } else if (index[index.length - 1][metric] < target) {\n return index.length;\n }\n\n // modified binary search with the base case being arr[index - 1] < target <= arr[index]\n let first = 0;\n let last = index.length - 1;\n let mid = Math.floor((first + last) / 2);\n while (first < last) {\n if (index[mid][metric] === target) {\n return mid;\n } else if (index[mid][metric] > target) {\n if (index[mid - 1][metric] < target) {\n return mid;\n } else {\n last = mid;\n mid = Math.floor((first + last) / 2);\n }\n } else if (mid < index.length - 1 && index[mid + 1][metric] > target) {\n return mid + 1;\n } else {\n first = mid;\n mid = Math.floor((first + last) / 2);\n }\n }\n }", "function remainingIndex(indexList) {\t// index list order unknown, gaps unkown\n\tvar n = indexList.length\n\tvar indexFinder = new Array(n)\n\tindexFinder.fill(-1)\n\tfor ( var i = 0; i < n; i++ ) { // set the value of the indexed position to the index\n\t\tvar j = indexList[i]\t\t // but only if it is a set value\n\t\tif ( j >= 0 ) {\n\t\t\tindexFinder[j] = j\n\t\t}\n\t}\n\t\n\tfor ( var k = 0; k < n; k++ ) {\t// index finder ordered and gaps marked\n\t\tif ( indexFinder[k] < 0 ) {\t// return the first one\n\t\t\treturn(k)\n\t\t}\n\t}\n\t\n\treturn(-1)\n}", "function index(value) {\n var match = this.detect(function(pair) {\n return pair.value === value;\n });\n return match && match.key;\n }", "function keyFunction(opts) {\n return opts._index;\n}", "getFirstIndex() {\n // index of the top item\n return (this.maxIndex - Math.floor(this.index)) % this.maxIndex; \n }", "function sortedIndex(array, obj, iteratee, context) {\n iteratee = cb(iteratee, context, 1);\n var value = iteratee(obj);\n var low = 0, high = getLength(array);\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n }\n return low;\n }", "function sortedIndex(array, obj, iteratee, context) {\n iteratee = cb(iteratee, context, 1);\n var value = iteratee(obj);\n var low = 0, high = getLength(array);\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n }\n return low;\n }", "function sortedIndex(array, obj, iteratee, context) {\n iteratee = cb(iteratee, context, 1);\n var value = iteratee(obj);\n var low = 0, high = getLength(array);\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n }\n return low;\n }", "function sortedIndex(array, obj, iteratee, context) {\n iteratee = cb(iteratee, context, 1);\n var value = iteratee(obj);\n var low = 0, high = getLength(array);\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n }\n return low;\n }", "function sortedIndex(array, obj, iteratee, context) {\n iteratee = cb(iteratee, context, 1);\n var value = iteratee(obj);\n var low = 0, high = getLength(array);\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n }\n return low;\n }", "function sortedIndex(array, obj, iteratee, context) {\n iteratee = cb(iteratee, context, 1);\n var value = iteratee(obj);\n var low = 0, high = getLength(array);\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n }\n return low;\n }", "function sortedIndex(array, obj, iteratee, context) {\n iteratee = cb(iteratee, context, 1);\n var value = iteratee(obj);\n var low = 0, high = getLength(array);\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n }\n return low;\n }", "function sortedIndex(array, obj, iteratee, context) {\n iteratee = cb(iteratee, context, 1);\n var value = iteratee(obj);\n var low = 0, high = getLength(array);\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n }\n return low;\n }", "function sortedIndex(array, obj, iteratee, context) {\n iteratee = cb(iteratee, context, 1);\n var value = iteratee(obj);\n var low = 0, high = getLength(array);\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n }\n return low;\n }", "function findGroup(item, index) {\r\n\t\t\t\tvar j = 0, ret = true, i;\r\n\t\t\t\tfor(i in item) {\r\n\t\t\t\t\tif(item[i] != this[j]) {\r\n\t\t\t\t\t\tret = false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tj++;\r\n\t\t\t\t\tif(j>=this.length) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(ret) {\r\n\t\t\t\t\trowindex = index;\r\n\t\t\t\t}\r\n\t\t\t\treturn ret;\r\n\t\t\t}", "unique() {\n var arr = [];\n for(var i = 0; i < this.length; i++) {\n if(!arr.contains(this[i])) {\n arr.push(this[i]);\n }\n }\n return arr; \n}", "function getDistinctIndices(element, size, number, seed) {\n if (seed === undefined) {\n seed = getDefaultSeed();\n }\n function getDistinctIndicesBis(n, elem, size, count, indexes) {\n if (indexes === void 0) { indexes = []; }\n if (indexes.length === count) {\n return indexes;\n }\n else {\n var hashes = hashTwice(elem, true, seed + size % n);\n var ind = doubleHashing(n, hashes.first, hashes.second, size);\n if (indexes.includes(ind)) {\n // console.log('generate index: %d for %s', ind, elem)\n return getDistinctIndicesBis(n + 1, elem, size, count, indexes);\n }\n else {\n // console.log('already found: %d for %s', ind, elem)\n indexes.push(ind);\n return getDistinctIndicesBis(n + 1, elem, size, count, indexes);\n }\n }\n }\n return getDistinctIndicesBis(1, element, size, number);\n}", "function keyFunction(opts) {\n return opts._index;\n}", "function keyFunction(opts) {\n return opts._index;\n}" ]
[ "0.56644523", "0.5603295", "0.5581381", "0.55462104", "0.5529172", "0.547712", "0.54611886", "0.5445555", "0.5402955", "0.53769135", "0.53650635", "0.53463954", "0.5329929", "0.5325894", "0.5314388", "0.5276721", "0.525718", "0.5250147", "0.52394223", "0.523288", "0.52271163", "0.5221128", "0.5221055", "0.52207416", "0.5216979", "0.5205138", "0.5204061", "0.5201382", "0.51902944", "0.5184116", "0.5183411", "0.51813054", "0.5180103", "0.51780736", "0.5172614", "0.51718885", "0.51718885", "0.51718885", "0.51718885", "0.51718885", "0.5169104", "0.5167332", "0.51644725", "0.51510715", "0.5146397", "0.51429886", "0.513795", "0.5121513", "0.5121383", "0.5120801", "0.51148534", "0.5103065", "0.5103065", "0.5103065", "0.5103065", "0.51020014", "0.51020014", "0.5101504", "0.5101504", "0.5101504", "0.5101504", "0.5101504", "0.5099022", "0.5098501", "0.50833124", "0.5079104", "0.5079104", "0.5079104", "0.5079104", "0.5079104", "0.5079104", "0.5079104", "0.50554657", "0.5049092", "0.50415206", "0.5029233", "0.50157386", "0.5014997", "0.5012685", "0.5010652", "0.50063366", "0.50063366", "0.500421", "0.50004613", "0.4998578", "0.49945563", "0.49943152", "0.49888557", "0.49888557", "0.49888557", "0.49888557", "0.49888557", "0.49888557", "0.49888557", "0.49888557", "0.49888557", "0.49873936", "0.49867114", "0.4985472", "0.49836233", "0.49836233" ]
0.0
-1
extracted from underscore.js Return a copy of the object only containing the whitelisted properties.
function pick(obj) { var copy = {}; var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1)); forEach(keys, function(key) { if (key in obj) copy[key] = obj[key]; }); return copy; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copy(obj, exclude) {\n var newObj = {};\n $.each(obj, function(key, value) {\n if ($.inArray(key, exclude) === -1) {\n // exclude array doesnt contain key so\n // we need to add it to our newObj\n newObj[key] = value;\n }\n });\n return newObj;\n}", "function extraProperties(obj, allowed) {\n\tmod_assert.ok((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && obj !== null, 'obj argument must be a non-null object');\n\tmod_assert.ok(Array.isArray(allowed), 'allowed argument must be an array of strings');\n\tfor (var i = 0; i < allowed.length; i++) {\n\t\tmod_assert.ok(typeof allowed[i] === 'string', 'allowed argument must be an array of strings');\n\t}\n\n\treturn Object.keys(obj).filter(function (key) {\n\t\treturn allowed.indexOf(key) === -1;\n\t});\n}", "function Object$prototype$filter(pred) {\n var result = {};\n forEachKey (this, function(k) {\n if (pred (this[k])) result[k] = this[k];\n });\n return result;\n }", "function whiteList(sensitiveObject, allowedKeys) {\n let finalObject = {}\n\n for(let i = 0; i < allowedKeys.length; i++) {\n let currentKeyName = allowedKeys[i]\n\n if (sensitiveObject.hasOwnProperty(currentKeyName)) {\n finalObject[`${currentKeyName}`] = sensitiveObject[`${currentKeyName}`]\n }\n }\n return finalObject\n }", "getFilteredAttributes() {\n const attributes = this._attributes;\n if (Object.keys(attributes).length) {\n const attr = Object.entries(attributes).\n filter(([key, value]) => {\n return value !== undefined;\n }).\n reduce((obj, [key, value]) => {\n obj[key] = attributes[key];\n return obj;\n }, {});\n\n if (Object.keys(attr).length) {\n return attr;\n }\n }\n return;\n }", "function extraProperties(obj, allowed)\n{\n\tmod_assert.ok(typeof (obj) === 'object' && obj !== null,\n\t 'obj argument must be a non-null object');\n\tmod_assert.ok(Array.isArray(allowed),\n\t 'allowed argument must be an array of strings');\n\tfor (var i = 0; i < allowed.length; i++) {\n\t\tmod_assert.ok(typeof (allowed[i]) === 'string',\n\t\t 'allowed argument must be an array of strings');\n\t}\n\n\treturn (Object.keys(obj).filter(function (key) {\n\t\treturn (allowed.indexOf(key) === -1);\n\t}));\n}", "function extraProperties(obj, allowed)\n{\n\tmod_assert.ok(typeof (obj) === 'object' && obj !== null,\n\t 'obj argument must be a non-null object');\n\tmod_assert.ok(Array.isArray(allowed),\n\t 'allowed argument must be an array of strings');\n\tfor (var i = 0; i < allowed.length; i++) {\n\t\tmod_assert.ok(typeof (allowed[i]) === 'string',\n\t\t 'allowed argument must be an array of strings');\n\t}\n\n\treturn (Object.keys(obj).filter(function (key) {\n\t\treturn (allowed.indexOf(key) === -1);\n\t}));\n}", "function extraProperties(obj, allowed)\n{\n\tmod_assert.ok(typeof (obj) === 'object' && obj !== null,\n\t 'obj argument must be a non-null object');\n\tmod_assert.ok(Array.isArray(allowed),\n\t 'allowed argument must be an array of strings');\n\tfor (var i = 0; i < allowed.length; i++) {\n\t\tmod_assert.ok(typeof (allowed[i]) === 'string',\n\t\t 'allowed argument must be an array of strings');\n\t}\n\n\treturn (Object.keys(obj).filter(function (key) {\n\t\treturn (allowed.indexOf(key) === -1);\n\t}));\n}", "function extraProperties(obj, allowed)\n{\n\tmod_assert.ok(typeof (obj) === 'object' && obj !== null,\n\t 'obj argument must be a non-null object');\n\tmod_assert.ok(Array.isArray(allowed),\n\t 'allowed argument must be an array of strings');\n\tfor (var i = 0; i < allowed.length; i++) {\n\t\tmod_assert.ok(typeof (allowed[i]) === 'string',\n\t\t 'allowed argument must be an array of strings');\n\t}\n\n\treturn (Object.keys(obj).filter(function (key) {\n\t\treturn (allowed.indexOf(key) === -1);\n\t}));\n}", "function extraProperties(obj, allowed)\n{\n\tmod_assert.ok(typeof (obj) === 'object' && obj !== null,\n\t 'obj argument must be a non-null object');\n\tmod_assert.ok(Array.isArray(allowed),\n\t 'allowed argument must be an array of strings');\n\tfor (var i = 0; i < allowed.length; i++) {\n\t\tmod_assert.ok(typeof (allowed[i]) === 'string',\n\t\t 'allowed argument must be an array of strings');\n\t}\n\n\treturn (Object.keys(obj).filter(function (key) {\n\t\treturn (allowed.indexOf(key) === -1);\n\t}));\n}", "function extraProperties(obj, allowed)\n{\n\tmod_assert.ok(typeof (obj) === 'object' && obj !== null,\n\t 'obj argument must be a non-null object');\n\tmod_assert.ok(Array.isArray(allowed),\n\t 'allowed argument must be an array of strings');\n\tfor (var i = 0; i < allowed.length; i++) {\n\t\tmod_assert.ok(typeof (allowed[i]) === 'string',\n\t\t 'allowed argument must be an array of strings');\n\t}\n\n\treturn (Object.keys(obj).filter(function (key) {\n\t\treturn (allowed.indexOf(key) === -1);\n\t}));\n}", "function extraProperties(obj, allowed)\n{\n\tmod_assert.ok(typeof (obj) === 'object' && obj !== null,\n\t 'obj argument must be a non-null object');\n\tmod_assert.ok(Array.isArray(allowed),\n\t 'allowed argument must be an array of strings');\n\tfor (var i = 0; i < allowed.length; i++) {\n\t\tmod_assert.ok(typeof (allowed[i]) === 'string',\n\t\t 'allowed argument must be an array of strings');\n\t}\n\n\treturn (Object.keys(obj).filter(function (key) {\n\t\treturn (allowed.indexOf(key) === -1);\n\t}));\n}", "function extraProperties(obj, allowed)\n{\n\tmod_assert.ok(typeof (obj) === 'object' && obj !== null,\n\t 'obj argument must be a non-null object');\n\tmod_assert.ok(Array.isArray(allowed),\n\t 'allowed argument must be an array of strings');\n\tfor (var i = 0; i < allowed.length; i++) {\n\t\tmod_assert.ok(typeof (allowed[i]) === 'string',\n\t\t 'allowed argument must be an array of strings');\n\t}\n\n\treturn (Object.keys(obj).filter(function (key) {\n\t\treturn (allowed.indexOf(key) === -1);\n\t}));\n}", "function extraProperties(obj, allowed)\n{\n\tmod_assert.ok(typeof (obj) === 'object' && obj !== null,\n\t 'obj argument must be a non-null object');\n\tmod_assert.ok(Array.isArray(allowed),\n\t 'allowed argument must be an array of strings');\n\tfor (var i = 0; i < allowed.length; i++) {\n\t\tmod_assert.ok(typeof (allowed[i]) === 'string',\n\t\t 'allowed argument must be an array of strings');\n\t}\n\n\treturn (Object.keys(obj).filter(function (key) {\n\t\treturn (allowed.indexOf(key) === -1);\n\t}));\n}", "function extraProperties(obj, allowed)\n{\n\tmod_assert.ok(typeof (obj) === 'object' && obj !== null,\n\t 'obj argument must be a non-null object');\n\tmod_assert.ok(Array.isArray(allowed),\n\t 'allowed argument must be an array of strings');\n\tfor (var i = 0; i < allowed.length; i++) {\n\t\tmod_assert.ok(typeof (allowed[i]) === 'string',\n\t\t 'allowed argument must be an array of strings');\n\t}\n\n\treturn (Object.keys(obj).filter(function (key) {\n\t\treturn (allowed.indexOf(key) === -1);\n\t}));\n}", "function extraProperties(obj, allowed)\n{\n\tmod_assert.ok(typeof (obj) === 'object' && obj !== null,\n\t 'obj argument must be a non-null object');\n\tmod_assert.ok(Array.isArray(allowed),\n\t 'allowed argument must be an array of strings');\n\tfor (var i = 0; i < allowed.length; i++) {\n\t\tmod_assert.ok(typeof (allowed[i]) === 'string',\n\t\t 'allowed argument must be an array of strings');\n\t}\n\n\treturn (Object.keys(obj).filter(function (key) {\n\t\treturn (allowed.indexOf(key) === -1);\n\t}));\n}", "function extraProperties(obj, allowed)\n{\n\tmod_assert.ok(typeof (obj) === 'object' && obj !== null,\n\t 'obj argument must be a non-null object');\n\tmod_assert.ok(Array.isArray(allowed),\n\t 'allowed argument must be an array of strings');\n\tfor (var i = 0; i < allowed.length; i++) {\n\t\tmod_assert.ok(typeof (allowed[i]) === 'string',\n\t\t 'allowed argument must be an array of strings');\n\t}\n\n\treturn (Object.keys(obj).filter(function (key) {\n\t\treturn (allowed.indexOf(key) === -1);\n\t}));\n}", "function extraProperties(obj, allowed)\n{\n\tmod_assert.ok(typeof (obj) === 'object' && obj !== null,\n\t 'obj argument must be a non-null object');\n\tmod_assert.ok(Array.isArray(allowed),\n\t 'allowed argument must be an array of strings');\n\tfor (var i = 0; i < allowed.length; i++) {\n\t\tmod_assert.ok(typeof (allowed[i]) === 'string',\n\t\t 'allowed argument must be an array of strings');\n\t}\n\n\treturn (Object.keys(obj).filter(function (key) {\n\t\treturn (allowed.indexOf(key) === -1);\n\t}));\n}", "ownKeys(target) {\r\n let keys = Object.keys(target);\r\n // filter properties starts with '_'\r\n let properties = keys.filter((p, i) => {\r\n return p[0] !== '_';\r\n });\r\n return properties;\r\n }", "ownKeys(target) {\r\n let keys = Object.keys(target);\r\n // filter properties starts with '_'\r\n let properties = keys.filter((p, i) => {\r\n return p[0] !== '_';\r\n });\r\n return properties;\r\n }", "ownKeys(target) {\r\n let keys = Object.keys(target);\r\n // filter properties starts with '_'\r\n let properties = keys.filter((p, i) => {\r\n return p[0] !== '_';\r\n });\r\n return properties;\r\n }", "function sanitizeTestObject(payload, keysToFreeze, ignore) {\n return Object.keys(payload).reduce((sanitizedObj, field) => {\n if (ignore.indexOf(field) !== -1) {\n return sanitizedObj;\n }\n\n const value = payload[field];\n const sanitizedValue = sanitizeValue(value, field, keysToFreeze);\n\n return {\n ...sanitizedObj,\n [field]: sanitizedValue,\n };\n }, {});\n}", "function filteredAssign(isAllowed, target) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n target = target || {};\r\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\r\n var sourceObject = args_1[_a];\r\n if (sourceObject) {\r\n for (var propName in sourceObject) {\r\n if (sourceObject.hasOwnProperty(propName) && (!isAllowed || isAllowed(propName))) {\r\n target[propName] = sourceObject[propName];\r\n }\r\n }\r\n }\r\n }\r\n return target;\r\n}", "function filteredAssign(isAllowed, target) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n target = target || {};\r\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\r\n var sourceObject = args_1[_a];\r\n if (sourceObject) {\r\n for (var propName in sourceObject) {\r\n if (sourceObject.hasOwnProperty(propName) && (!isAllowed || isAllowed(propName))) {\r\n target[propName] = sourceObject[propName];\r\n }\r\n }\r\n }\r\n }\r\n return target;\r\n}", "filteredCheck() {\n const { filteredItems, localItems, localFilter } = this\n return { filteredItems, localItems, localFilter }\n }", "function filteredAssign(isAllowed, target) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n target = target || {};\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var sourceObject = args_1[_a];\n if (sourceObject) {\n for (var propName in sourceObject) {\n if (sourceObject.hasOwnProperty(propName) && (!isAllowed || isAllowed(propName))) {\n target[propName] = sourceObject[propName];\n }\n }\n }\n }\n return target;\n}", "function filteredAssign(isAllowed, target) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n target = target || {};\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var sourceObject = args_1[_a];\n if (sourceObject) {\n for (var propName in sourceObject) {\n if (sourceObject.hasOwnProperty(propName) && (!isAllowed || isAllowed(propName))) {\n target[propName] = sourceObject[propName];\n }\n }\n }\n }\n return target;\n}", "function filteredAssign(isAllowed, target) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n target = target || {};\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var sourceObject = args_1[_a];\n if (sourceObject) {\n for (var propName in sourceObject) {\n if (sourceObject.hasOwnProperty(propName) && (!isAllowed || isAllowed(propName))) {\n target[propName] = sourceObject[propName];\n }\n }\n }\n }\n return target;\n}", "function filteredAssign(isAllowed, target) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n target = target || {};\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var sourceObject = args_1[_a];\n if (sourceObject) {\n for (var propName in sourceObject) {\n if (sourceObject.hasOwnProperty(propName) && (!isAllowed || isAllowed(propName))) {\n target[propName] = sourceObject[propName];\n }\n }\n }\n }\n return target;\n}", "function filteredAssign(isAllowed, target) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n target = target || {};\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var sourceObject = args_1[_a];\n if (sourceObject) {\n for (var propName in sourceObject) {\n if (sourceObject.hasOwnProperty(propName) &&\n !isAllowed || isAllowed(propName)) {\n target[propName] = sourceObject[propName];\n }\n }\n }\n }\n return target;\n}", "function whitelist(oObj, aAllowed){\n\tObject.keys(oObj).forEach(function(currentValue, index, array){\n\t\tif (aAllowed.indexOf(currentValue) == -1){\n\t\t\tdelete oObj[currentValue];\n\t\t}\n\t});\n}", "static filter(data) {\n const copy = { ...data };\n copy.a = copy.newA;\n delete copy['newA'];\n return copy;\n }", "function noteFilter(obj) {\n return _.pick(obj, ['notebookId', 'title', 'content']);\n}", "function filterByKeys(inputObject, keep) {\n if (!Array.isArray(keep) || keep.length === 0) {\n return inputObject;\n }\n var result = {};\n for (var i = 0, len = keep.length; i < len; i++) {\n var key = keep[i];\n if (inputObject.hasOwnProperty(key)) {\n result[key] = inputObject[key];\n }\n }\n return result;\n}", "filter() {\n let new_attr = {}\n\n Object.entries(this.attr).forEach(([key, value]) => {\n if (value.length > 0) {\n new_attr[key] = value\n }\n })\n\n return new_attr\n }", "function filterKeys(keys) {\n return _.filter(keys, (key) => !_.includes(exports.options.ignore, key));\n}", "static restrict(o, p) {\n for(let prop in o) { // For all props in o\n if (!(prop in p)) delete o[prop]; // Delete if not in p\n }\n return o;\n }", "function softCopyProperties(source, target) {\n _Object__WEBPACK_IMPORTED_MODULE_6__[\"each\"](source, function (key, value) {\n // only if value is set\n if (_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"hasValue\"](value) && !(_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"hasValue\"](target[key]))) {\n target[key] = value;\n }\n });\n return target;\n}", "static get whitelist() {\n return Document.whitelist.concat(whitelist);\n }", "function _filteredDeepCopy(src, dst) {\n if (Array.isArray(src)) {\n src.forEach(function (item) {\n switch (typeof item) {\n case 'function':\n ABeamer.throwI8n(ABeamer.Msgs.NoCode);\n break;\n case 'object':\n dst.push(_filteredDeepCopy(item, Array.isArray(item) ? [] : {}));\n break;\n default:\n dst.push(item);\n }\n });\n }\n else {\n Object.keys(src).forEach(function (key) {\n if (key[0] !== '_') {\n var item = src[key];\n switch (typeof item) {\n case 'function':\n ABeamer.throwI8n(ABeamer.Msgs.NoCode);\n break;\n case 'object':\n dst[key] = Array.isArray(item) ? [] : {};\n _filteredDeepCopy(item, dst[key]);\n break;\n default:\n dst[key] = item;\n }\n }\n });\n }\n return dst;\n }", "function find (properties) {\n return _.cloneDeep(_.filter(data, properties));\n}", "function whitelist(transformer, opts) {\n\t var whitelist = opts.whitelist;\n\t if (whitelist) return _lodashCollectionIncludes2[\"default\"](whitelist, transformer.key);\n\t}", "function whitelist(transformer, opts) {\n\t var whitelist = opts.whitelist;\n\t if (whitelist) return _lodashCollectionIncludes2[\"default\"](whitelist, transformer.key);\n\t}", "function _pickBy(test, obj) {\n var copy = {};\n var prop;\n var props = keysIn(obj);\n var len = props.length;\n var idx = -1;\n while (++idx < len) {\n prop = props[idx];\n if (test(obj[prop], prop, obj)) {\n copy[prop] = obj[prop];\n }\n }\n return copy;\n }", "function filterAttributes(a, prop) {\n var trimmedAttribute = {}\n a.filter((attribute) => (\n trimmedAttribute.hasOwnProperty(attribute[prop]) ? false : (trimmedAttribute[attribute[prop]] = true)\n ));\n return trimmedAttribute;\n }", "function whitelist(transformer, opts) {\n var whitelist = opts.whitelist;\n if (whitelist) return _lodashCollectionIncludes2[\"default\"](whitelist, transformer.key);\n}", "function filterObject(obj, filter) {\n // returns a key/value object of all of the k/v from the obj that are true for the filter\n var filtered = {};\n\n $.each(instance, function (k, v) {\n if (filter(k, v)) {\n filtered[k] = v;\n }\n });\n\n return filtered;\n }", "function without_fields(obj, fields) {\n var newObj = {}\n for (var key in obj) {\n if (!fields || fields.indexOf(key) < 0) {\n newObj[key] = obj[key];\n }\n }\n return newObj;\n}", "matchAttributes(context, obj) {\n return this.attribute_whitelist(context).intersect(Object.keys(obj));\n }", "function filterValues(object, filter) {\n filter = filter || _.identity;\n return Object.keys(object).reduce(function(x, key) {\n var value = object[key];\n if (filter(value)) {\n x[key] = value;\n }\n return x;\n }, {});\n}", "function omit(keys, source) {\n const filtered = {};\n Object.keys(source).forEach(key => {\n if (keys.indexOf(key) === -1) {\n filtered[key] = source[key];\n }\n });\n return filtered;\n}", "getPreferencesProperties(userProperties = false) {\n if (userProperties) {\n var userArray = this.preferenceProperties.slice();\n userArray = userArray.filter(x => !this.nonUserProperties.includes(x) )\n return userArray;\n }\n return this.preferenceProperties.slice();\n }", "function createPropsRestProxy(props, excludedKeys) {\n const ret = {};\n for (const key in props) {\n if (!excludedKeys.includes(key)) {\n Object.defineProperty(ret, key, {\n enumerable: true,\n get: () => props[key]\n });\n }\n }\n return ret;\n}", "function createPropsRestProxy(props, excludedKeys) {\n const ret = {};\n for (const key in props) {\n if (!excludedKeys.includes(key)) {\n Object.defineProperty(ret, key, {\n enumerable: true,\n get: () => props[key]\n });\n }\n }\n return ret;\n}", "function createPropsRestProxy(props, excludedKeys) {\n const ret = {};\n for (const key in props) {\n if (!excludedKeys.includes(key)) {\n Object.defineProperty(ret, key, {\n enumerable: true,\n get: () => props[key]\n });\n }\n }\n return ret;\n}", "function noFilter(filterObj) {\n return Object.\n keys(filterObj).\n every(function (key) {\n return !filterObj[key];\n });\n }", "function noFilter(filterObj) {\n return Object.\n keys(filterObj).\n every(function (key) {\n return !filterObj[key];\n });\n }", "function noFilter(filterObj) {\n return Object.\n keys(filterObj).\n every(function (key) {\n return !filterObj[key];\n });\n }", "function noFilter(filterObj) {\n return Object.\n keys(filterObj).\n every(function (key) {\n return !filterObj[key];\n });\n }", "static get whitelist() {\n return Document.whitelist.concat([\n 'abbreviation',\n 'categories',\n 'links',\n 'organization',\n ]);\n }", "function filterObjectByKeys(object, filterKeys = []) {\n let newObject = {};\n filterKeys.forEach((key) => {\n if (object.hasOwnProperty(key)) {\n newObject[key] = object[key];\n }\n });\n return newObject;\n}", "skipProperties() {\n return [];\n }", "function objectFilter(obj, kvPredicate) {\r\n var result = {};\r\n for (var key in obj) {\r\n if (hasOwnProperty.call(obj, key)) {\r\n var value = obj[key];\r\n if (kvPredicate(key, value)) {\r\n result[key] = value;\r\n }\r\n }\r\n }\r\n return result;\r\n }", "function createPropsRestProxy(props, excludedKeys) {\n const ret = {\n };\n for(const key in props)if (!excludedKeys.includes(key)) Object.defineProperty(ret, key, {\n enumerable: true,\n get: ()=>props[key]\n });\n return ret;\n}", "function constructFilter(data) {\n var f = angular.copy(data);\n var ret = angular.copy(f);\n angular.forEach(Object.keys(f), function (key, value) {\n //deletes null value fields \n if (ret[key] == null || ret[key] == undefined || ret[key] == '') {\n delete ret[key];\n }\n //if from date and fromdate != null apply stringify policy by timezone\n if (key == 'FromDate' && ret[key] != undefined) {\n var addHours = -1 * new Date().getTimezoneOffset() / 60;\n var zax = moment(ret[key]).startOf('hour').add(addHours, 'hours');\n ret[key] = zax.toISOString();\n }\n })\n return ret;\n }", "function omit(input) {\n var filter = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n filter[_i - 1] = arguments[_i];\n }\n var output = {};\n for (var key in input) {\n /* istanbul ignore else */\n if ({}.hasOwnProperty.call(input, key)) {\n if (!filter.includes(key)) {\n output[key] = input[key];\n }\n }\n }\n return output;\n }", "censor_props(obj, props = ['apikey', 'secret']) {\n if (!this.is_object(obj)) return false;\n for (var key in obj) {\n if (!obj.hasOwnProperty(key))\n continue;\n if (props.includes(key)) \n obj[key] = '**********'\n else \n if (typeof obj[key] === 'object' && obj[key] !== null)\n obj[key] = this.censor_props(obj[key], props);\n }\n return obj;\n }", "function shallowCopy(src, dst) {\n\t\tdst = dst || {};\n\n\t\tfor (var key in src) {\n\t\t\tif (src.hasOwnProperty(key) && key.substr(0, 2) !== '$$') {\n\t\t\t\tdst[key] = src[key];\n\t\t\t}\n\t\t}\n\n\t\treturn dst;\n\t}", "function WhiteList(from) {\n if (from)\n this._list = from._list, this.length = Object.keys(from._list).length;\n else\n this._list = {}, this.length = 0;\n}", "get allProperties() {\r\n return this.clone(SharePointQueryableInstance, \"allproperties\");\r\n }", "function filterNullInObject(object) {\n let newObject = {};\n\n let keys = Object.keys(object);\n\n for (var key of keys) {\n if (object[key] || object[key] == false) {\n newObject[key] = object[key];\n }\n }\n\n return newObject;\n}", "set whitelist(vals){\n this._whitelist = vals;\n }", "getAllowedAttributes () {\n\t\treturn {\n\t\t\tstring: ['name', 'purpose'],\n\t\t\tobject: ['$addToSet', '$push', '$pull'],\n\t\t\tboolean: ['isArchived']\n\t\t};\n\t}", "get filtered() {\n return this._filtered;\n }", "function omit(obj, exclusions) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var result = {};\n for (var key in obj) {\n if (exclusions.indexOf(key) === -1 && obj.hasOwnProperty(key)) {\n result[key] = obj[key];\n }\n }\n return result;\n}", "function omit(obj, exclusions) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var result = {};\n for (var key in obj) {\n if (exclusions.indexOf(key) === -1 && obj.hasOwnProperty(key)) {\n result[key] = obj[key];\n }\n }\n return result;\n}", "function getProperties() { return $.extend(true, {}, properties); }", "only(fields) {\n // Empty the included fields.\n this.includes = new Set();\n if (typeof fields === 'string' && this.fields.indexOf(fields) !== -1) {\n this.includes.add(fields);\n this.validateIncludes();\n return this;\n }\n const toInclude = [];\n for (const field of fields) {\n // @ts-ignore\n if (this.fields.indexOf(field) !== -1) {\n // @ts-ignore\n toInclude.push(field);\n }\n }\n if (toInclude.length) {\n this.includes = new Set(toInclude);\n }\n this.validateIncludes();\n return this;\n }", "function _pickAll(names, obj) {\n var copy = {};\n forEach(function(name) {\n copy[name] = obj[name];\n }, names);\n return copy;\n }", "cleanJson (json, properties) {\n let cleanedJson = {}\n cleanedJson = object.assign(cleanedJson, object.pick(json, properties))\n return cleanedJson\n }", "clean() {\n let clone = {};\n Object.assign(clone, this);\n\n for (const i in clone) {\n if (typeof clone[i] === 'undefined') {\n delete clone[i];\n }\n }\n\n return clone;\n }", "function shallowClearAndCopy(src, dst) {\n\t dst = dst || {};\n\n\t angular.forEach(dst, function (value, key) {\n\t delete dst[key];\n\t });\n\n\t for (var key in src) {\n\t if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n\t dst[key] = src[key];\n\t }\n\t }\n\n\t return dst;\n\t }", "function shallowCopy(src, dst) {\n dst = dst || {};\n\n for(var key in src) {\n if (src.hasOwnProperty(key) && key.substr(0, 2) !== '$$') {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "function shallowCopy(src, dst) {\n dst = dst || {};\n\n for(var key in src) {\n if (src.hasOwnProperty(key) && key.substr(0, 2) !== '$$') {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "function shallowCopy(src, dst) {\n dst = dst || {};\n\n for(var key in src) {\n if (src.hasOwnProperty(key) && key.substr(0, 2) !== '$$') {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "function filterValues(data) \r\n{\r\n data = data.filter(isEligible);\r\n return data;\r\n}", "function _filterObject(object)\n {\n return _.transform(object, function(results, value, key)\n {\n if(_.isPlainObject(value))\n {\n results[key] = _filterObject(value);\n }\n else if(!(typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$'))\n {\n results[key] = value;\n } // end if\n\n return results;\n });\n } // end _filterObject", "_excludeFields(doc, fields) {\n\t\t\tconst res = _.cloneDeep(doc);\n\t\t\tfields.forEach(field => {\n\t\t\t\t_.unset(res, field);\n\t\t\t});\n\t\t\treturn res;\n\t\t}", "function filterAttributes(data){\n let filtered_data = {};\n {conditionalFilter}\n return filtered_data;\n}", "function omit(obj, var_keys){\n\t var keys = typeof arguments[1] !== 'string'? arguments[1] : slice(arguments, 1),\n\t out = {};\n\n\t for (var property in obj) {\n\t if (obj.hasOwnProperty(property) && !contains(keys, property)) {\n\t out[property] = obj[property];\n\t }\n\t }\n\t return out;\n\t }", "extract_props(obj, keys = []) {\n if (!this.is_object(obj)) return false;\n var result = [];\n if (typeof(keys) === 'string') {\n keys = [keys];\n }\n keys.forEach(key => {\n var key = key.toLowerCase();\n if (obj.hasOwnProperty(key)) {\n result.push(obj[key]);\n } else {\n result.push(undefined);\n }\n });\n if (result.length == 1) {\n return result[0];\n }\n return result;\n }", "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key){\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && key.substr(0, 2) !== '$$') {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "function redacted (object, publishable) {\n const clone = JSON.parse(JSON.stringify(object))\n Object.keys(clone).forEach(key => {\n if (!publishable.includes(key)) delete clone[key]\n })\n return clone\n}", "function myOmit(oneObject, propertyToDelete) {\n\tlet result = {};\n\tfor (let key in oneObject) { // Key= a, b, c\n\t\tfor (let i=0; i<propertyToDelete.length; i++) {\n\t\t\tif (key === propertyToDelete[i]) {\n\t\t\t\tdelete oneObject[propertyToDelete[i]];\n\t\t\t}\n\t\t}\n\t}\n\treturn oneObject;\n}", "function filterObject(filter, type, data) { \n filter = _.filter(filter, function(item) {\n return (item !== false) ? item : false;\n }); \n if (filter.length < 1) { return data }\n return _.filter(data, function(item) {\n var boo = false;\n for(var i in filter) { \n if(_.contains(item[type], filter[i])) {\n boo = true;\n } else {\n boo = false;\n break; \n } \n }\n return (boo === true) ? item : false; \n }); \n }", "function pick(obj) {\n\t\tvar copy = {};\n\t\tvar keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n\t\tforEach(keys, function(key) {\n\t\t\tif (key in obj) copy[key] = obj[key];\n\t\t});\n\t\treturn copy;\n\t}", "filterAttr(attrs, attrNames) {\n let filteredArr = {};\n if (attrNames === void 0) {\n for (let attrName in attrs) {\n filteredArr[attrName] = attrs[attrName];\n }\n }\n else {\n if (attrNames.length === 0) {\n return filteredArr;\n }\n attrNames.forEach((attrName) => filteredArr[attrName] = attrs[attrName]);\n }\n return filteredArr;\n }", "function shallow_copy(src) {\n if ((typeof src === 'undefined' ? 'undefined' : _typeof(src)) === 'object') {\n var dst = {};\n for (var k in src) {\n if (Object.prototype.hasOwnProperty.call(src, k)) {\n dst[k] = src[k];\n }\n }\n return dst;\n }\n return src;\n }", "function shallow_copy(src) {\n if ((typeof src === 'undefined' ? 'undefined' : _typeof(src)) === 'object') {\n var dst = {};\n for (var k in src) {\n if (Object.prototype.hasOwnProperty.call(src, k)) {\n dst[k] = src[k];\n }\n }\n return dst;\n }\n return src;\n }", "getAll(filter) {\n\t\t// this flattens the hash into an array\n\t\tlet result = _.map(this._cache);\n\n\t\tif (typeof filter === 'object') {\n\t\t\tresult = _.where(result, filter);\n\t\t}\n\n\t\treturn result;\n\t}", "function copyWithoutUrlOrConfig(props){\n const result = {};\n for(const k in props){\n if(k !== 'url' && k !== 'config'){\n result[k] = props[k];\n }\n }\n return result;\n}" ]
[ "0.61777925", "0.6115211", "0.60742235", "0.6065222", "0.59896004", "0.59632075", "0.59632075", "0.59632075", "0.59632075", "0.59632075", "0.59632075", "0.59632075", "0.59632075", "0.59632075", "0.59632075", "0.59632075", "0.59632075", "0.59632075", "0.5946799", "0.5946799", "0.5946799", "0.5930744", "0.5909815", "0.5909815", "0.59032464", "0.588901", "0.588901", "0.588901", "0.588901", "0.58714086", "0.57873", "0.5667642", "0.56149244", "0.5600204", "0.55976486", "0.55565727", "0.5538192", "0.55298704", "0.55290884", "0.54748076", "0.54535323", "0.5448482", "0.5448482", "0.5445589", "0.54424286", "0.54252845", "0.5422132", "0.54070234", "0.5375832", "0.53735936", "0.5349641", "0.5342302", "0.5312972", "0.5312972", "0.5312972", "0.5310903", "0.5310903", "0.5310903", "0.5310903", "0.5265391", "0.5265251", "0.5261203", "0.5258236", "0.52187693", "0.5212326", "0.52066314", "0.5203867", "0.5199409", "0.51910645", "0.51908654", "0.5169734", "0.5167248", "0.5166235", "0.5160483", "0.5148987", "0.5148987", "0.5145419", "0.51448464", "0.5129958", "0.5123205", "0.51214695", "0.5118407", "0.51137483", "0.51137483", "0.51137483", "0.5109525", "0.5103015", "0.50983393", "0.50902", "0.5082657", "0.50790393", "0.5071848", "0.506291", "0.5060219", "0.5059072", "0.5057506", "0.5038448", "0.5036848", "0.5036848", "0.5035226", "0.5033032" ]
0.0
-1
extracted from underscore.js Return a copy of the object omitting the blacklisted properties.
function omit(obj) { var copy = {}; var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1)); for (var key in obj) { if (indexOf(keys, key) == -1) copy[key] = obj[key]; } return copy; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copy(obj, exclude) {\n var newObj = {};\n $.each(obj, function(key, value) {\n if ($.inArray(key, exclude) === -1) {\n // exclude array doesnt contain key so\n // we need to add it to our newObj\n newObj[key] = value;\n }\n });\n return newObj;\n}", "clean() {\n let clone = {};\n Object.assign(clone, this);\n\n for (const i in clone) {\n if (typeof clone[i] === 'undefined') {\n delete clone[i];\n }\n }\n\n return clone;\n }", "function omit(obj, keyToOmit) {\n if (!obj) return;\n var _ = obj[keyToOmit],\n rest = objectWithoutProperties(obj, [keyToOmit]);\n\n return rest;\n}", "static filter(data) {\n const copy = { ...data };\n copy.a = copy.newA;\n delete copy['newA'];\n return copy;\n }", "function Object$prototype$filter(pred) {\n var result = {};\n forEachKey (this, function(k) {\n if (pred (this[k])) result[k] = this[k];\n });\n return result;\n }", "function redacted (object, publishable) {\n const clone = JSON.parse(JSON.stringify(object))\n Object.keys(clone).forEach(key => {\n if (!publishable.includes(key)) delete clone[key]\n })\n return clone\n}", "function without_fields(obj, fields) {\n var newObj = {}\n for (var key in obj) {\n if (!fields || fields.indexOf(key) < 0) {\n newObj[key] = obj[key];\n }\n }\n return newObj;\n}", "skipProperties() {\n return [];\n }", "function sanitizeTestObject(payload, keysToFreeze, ignore) {\n return Object.keys(payload).reduce((sanitizedObj, field) => {\n if (ignore.indexOf(field) !== -1) {\n return sanitizedObj;\n }\n\n const value = payload[field];\n const sanitizedValue = sanitizeValue(value, field, keysToFreeze);\n\n return {\n ...sanitizedObj,\n [field]: sanitizedValue,\n };\n }, {});\n}", "function omit(input) {\n var filter = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n filter[_i - 1] = arguments[_i];\n }\n var output = {};\n for (var key in input) {\n /* istanbul ignore else */\n if ({}.hasOwnProperty.call(input, key)) {\n if (!filter.includes(key)) {\n output[key] = input[key];\n }\n }\n }\n return output;\n }", "function omit(obj) {\n\t\tvar copy = {};\n\t\tvar keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n\t\tfor (var key in obj) {\n\t\t\tif (indexOf(keys, key) == -1) copy[key] = obj[key];\n\t\t}\n\t\treturn copy;\n\t}", "function whitelist(oObj, aAllowed){\n\tObject.keys(oObj).forEach(function(currentValue, index, array){\n\t\tif (aAllowed.indexOf(currentValue) == -1){\n\t\t\tdelete oObj[currentValue];\n\t\t}\n\t});\n}", "function omit(obj) {\n\t var copy = {};\n\t var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n\t for (var key in obj) {\n\t if (indexOf(keys, key) == -1) copy[key] = obj[key];\n\t }\n\t return copy;\n\t}", "function omit(obj) {\n\t var copy = {};\n\t var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n\t for (var key in obj) {\n\t if (indexOf(keys, key) == -1) copy[key] = obj[key];\n\t }\n\t return copy;\n\t}", "function omit(obj, exclusions) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var result = {};\n for (var key in obj) {\n if (exclusions.indexOf(key) === -1 && obj.hasOwnProperty(key)) {\n result[key] = obj[key];\n }\n }\n return result;\n}", "function omit(obj, exclusions) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var result = {};\n for (var key in obj) {\n if (exclusions.indexOf(key) === -1 && obj.hasOwnProperty(key)) {\n result[key] = obj[key];\n }\n }\n return result;\n}", "ownKeys(target) {\r\n let keys = Object.keys(target);\r\n // filter properties starts with '_'\r\n let properties = keys.filter((p, i) => {\r\n return p[0] !== '_';\r\n });\r\n return properties;\r\n }", "ownKeys(target) {\r\n let keys = Object.keys(target);\r\n // filter properties starts with '_'\r\n let properties = keys.filter((p, i) => {\r\n return p[0] !== '_';\r\n });\r\n return properties;\r\n }", "ownKeys(target) {\r\n let keys = Object.keys(target);\r\n // filter properties starts with '_'\r\n let properties = keys.filter((p, i) => {\r\n return p[0] !== '_';\r\n });\r\n return properties;\r\n }", "function omit(obj) {\n\t var notInArray = function (array, item) { return !exports.inArray(array, item); };\n\t return pickOmitImpl.apply(null, [notInArray].concat(restArgs(arguments)));\n\t}", "_excludeFields(doc, fields) {\n\t\t\tconst res = _.cloneDeep(doc);\n\t\t\tfields.forEach(field => {\n\t\t\t\t_.unset(res, field);\n\t\t\t});\n\t\t\treturn res;\n\t\t}", "getFilteredAttributes() {\n const attributes = this._attributes;\n if (Object.keys(attributes).length) {\n const attr = Object.entries(attributes).\n filter(([key, value]) => {\n return value !== undefined;\n }).\n reduce((obj, [key, value]) => {\n obj[key] = attributes[key];\n return obj;\n }, {});\n\n if (Object.keys(attr).length) {\n return attr;\n }\n }\n return;\n }", "function copyWithoutUrlOrConfig(props){\n const result = {};\n for(const k in props){\n if(k !== 'url' && k !== 'config'){\n result[k] = props[k];\n }\n }\n return result;\n}", "function omit(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n for (var key in obj) {\n if (indexOf(keys, key) == -1) copy[key] = obj[key];\n }\n return copy;\n }", "function Pagination_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Pagination_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }", "function noFilter(filterObj) {\n return Object.\n keys(filterObj).\n every(function (key) {\n return !filterObj[key];\n });\n }", "function noFilter(filterObj) {\n return Object.\n keys(filterObj).\n every(function (key) {\n return !filterObj[key];\n });\n }", "function noFilter(filterObj) {\n return Object.\n keys(filterObj).\n every(function (key) {\n return !filterObj[key];\n });\n }", "function noFilter(filterObj) {\n return Object.\n keys(filterObj).\n every(function (key) {\n return !filterObj[key];\n });\n }", "function myOmit(oneObject, propertyToDelete) {\n\tlet result = {};\n\tfor (let key in oneObject) { // Key= a, b, c\n\t\tfor (let i=0; i<propertyToDelete.length; i++) {\n\t\t\tif (key === propertyToDelete[i]) {\n\t\t\t\tdelete oneObject[propertyToDelete[i]];\n\t\t\t}\n\t\t}\n\t}\n\treturn oneObject;\n}", "function omit(obj, var_keys){\n\t var keys = typeof arguments[1] !== 'string'? arguments[1] : slice(arguments, 1),\n\t out = {};\n\n\t for (var property in obj) {\n\t if (obj.hasOwnProperty(property) && !contains(keys, property)) {\n\t out[property] = obj[property];\n\t }\n\t }\n\t return out;\n\t }", "get Ignore() {}", "function clean(obj) {\n var res = {};\n\n _underscoreWrapper.default.each(obj, function (value, key) {\n if (!_underscoreWrapper.default.isNull(value)) {\n res[key] = value;\n }\n });\n\n return res;\n}", "function filteredAssign(isAllowed, target) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n target = target || {};\r\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\r\n var sourceObject = args_1[_a];\r\n if (sourceObject) {\r\n for (var propName in sourceObject) {\r\n if (sourceObject.hasOwnProperty(propName) && (!isAllowed || isAllowed(propName))) {\r\n target[propName] = sourceObject[propName];\r\n }\r\n }\r\n }\r\n }\r\n return target;\r\n}", "function filteredAssign(isAllowed, target) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n target = target || {};\r\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\r\n var sourceObject = args_1[_a];\r\n if (sourceObject) {\r\n for (var propName in sourceObject) {\r\n if (sourceObject.hasOwnProperty(propName) && (!isAllowed || isAllowed(propName))) {\r\n target[propName] = sourceObject[propName];\r\n }\r\n }\r\n }\r\n }\r\n return target;\r\n}", "function remove_falsy_values(obj) {\n var new_obj = {};\n for (var key in obj) {\n if (obj[key]) {\n new_obj[key] = obj[key];\n }\n }\n return new_obj;\n}", "function omit(obj, key) {\n var copy = {};\n\n Object.keys(obj, function (k) {\n if (k !== key) {\n copy[k] = obj[k];\n }\n });\n\n return copy;\n}", "function filteredAssign(isAllowed, target) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n target = target || {};\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var sourceObject = args_1[_a];\n if (sourceObject) {\n for (var propName in sourceObject) {\n if (sourceObject.hasOwnProperty(propName) && (!isAllowed || isAllowed(propName))) {\n target[propName] = sourceObject[propName];\n }\n }\n }\n }\n return target;\n}", "function filteredAssign(isAllowed, target) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n target = target || {};\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var sourceObject = args_1[_a];\n if (sourceObject) {\n for (var propName in sourceObject) {\n if (sourceObject.hasOwnProperty(propName) && (!isAllowed || isAllowed(propName))) {\n target[propName] = sourceObject[propName];\n }\n }\n }\n }\n return target;\n}", "function filteredAssign(isAllowed, target) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n target = target || {};\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var sourceObject = args_1[_a];\n if (sourceObject) {\n for (var propName in sourceObject) {\n if (sourceObject.hasOwnProperty(propName) && (!isAllowed || isAllowed(propName))) {\n target[propName] = sourceObject[propName];\n }\n }\n }\n }\n return target;\n}", "function filteredAssign(isAllowed, target) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n target = target || {};\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var sourceObject = args_1[_a];\n if (sourceObject) {\n for (var propName in sourceObject) {\n if (sourceObject.hasOwnProperty(propName) && (!isAllowed || isAllowed(propName))) {\n target[propName] = sourceObject[propName];\n }\n }\n }\n }\n return target;\n}", "static restrict(o, p) {\n for(let prop in o) { // For all props in o\n if (!(prop in p)) delete o[prop]; // Delete if not in p\n }\n return o;\n }", "function omitPrivate(doc, obj) {\n delete obj.__v;\n return obj;\n}", "function filteredAssign(isAllowed, target) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n target = target || {};\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var sourceObject = args_1[_a];\n if (sourceObject) {\n for (var propName in sourceObject) {\n if (sourceObject.hasOwnProperty(propName) &&\n !isAllowed || isAllowed(propName)) {\n target[propName] = sourceObject[propName];\n }\n }\n }\n }\n return target;\n}", "function omit(keys, source) {\n const filtered = {};\n Object.keys(source).forEach(key => {\n if (keys.indexOf(key) === -1) {\n filtered[key] = source[key];\n }\n });\n return filtered;\n}", "function omitPrivate(doc, obj) {\n delete obj.__v;\n delete obj.id;\n return obj;\n}", "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key){\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && key.substr(0, 2) !== '$$') {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "function shallowClearAndCopy(src, dst) {\n\t dst = dst || {};\n\n\t angular.forEach(dst, function (value, key) {\n\t delete dst[key];\n\t });\n\n\t for (var key in src) {\n\t if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n\t dst[key] = src[key];\n\t }\n\t }\n\n\t return dst;\n\t }", "function omit(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n for (var key in obj) {\n if (indexOf(keys, key) == -1) copy[key] = obj[key];\n }\n return copy;\n}", "function omit(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n for (var key in obj) {\n if (indexOf(keys, key) == -1) copy[key] = obj[key];\n }\n return copy;\n}", "function omit(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n for (var key in obj) {\n if (indexOf(keys, key) == -1) copy[key] = obj[key];\n }\n return copy;\n}", "function omit(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n for (var key in obj) {\n if (indexOf(keys, key) == -1) copy[key] = obj[key];\n }\n return copy;\n}", "function omit(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n for (var key in obj) {\n if (indexOf(keys, key) == -1) copy[key] = obj[key];\n }\n return copy;\n}", "function omit(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n for (var key in obj) {\n if (indexOf(keys, key) == -1) copy[key] = obj[key];\n }\n return copy;\n}", "function omit(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n for (var key in obj) {\n if (indexOf(keys, key) == -1) copy[key] = obj[key];\n }\n return copy;\n}", "function omit(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n for (var key in obj) {\n if (indexOf(keys, key) == -1) copy[key] = obj[key];\n }\n return copy;\n}", "function omit(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n for (var key in obj) {\n if (indexOf(keys, key) == -1) copy[key] = obj[key];\n }\n return copy;\n}", "function omit(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n for (var key in obj) {\n if (indexOf(keys, key) == -1) copy[key] = obj[key];\n }\n return copy;\n}", "function omit(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n for (var key in obj) {\n if (indexOf(keys, key) == -1) copy[key] = obj[key];\n }\n return copy;\n}", "function omit(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n for (var key in obj) {\n if (indexOf(keys, key) == -1) copy[key] = obj[key];\n }\n return copy;\n}", "function omit(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n for (var key in obj) {\n if (indexOf(keys, key) == -1) copy[key] = obj[key];\n }\n return copy;\n}", "function omit(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n for (var key in obj) {\n if (indexOf(keys, key) == -1) copy[key] = obj[key];\n }\n return copy;\n}", "function omit(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n for (var key in obj) {\n if (indexOf(keys, key) == -1) copy[key] = obj[key];\n }\n return copy;\n}", "function omit(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n for (var key in obj) {\n if (indexOf(keys, key) == -1) copy[key] = obj[key];\n }\n return copy;\n}", "function omit(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n for (var key in obj) {\n if (indexOf(keys, key) == -1) copy[key] = obj[key];\n }\n return copy;\n}", "function omit(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n for (var key in obj) {\n if (indexOf(keys, key) == -1) copy[key] = obj[key];\n }\n return copy;\n}", "function omit(obj, props) {\n var copy = duplicate(obj);\n props.forEach(function (prop) {\n delete copy[prop];\n });\n return copy;\n}", "doBlacklist() {\n let me = this;\n this.autoInit(this.options);\n const BLACKLIST = me.getDict(\"BLACKLIST\" /* EnumDictDatabase.BLACKLIST */);\n const TABLE = me.getDictDatabase(\"TABLE\" /* EnumDictDatabase.TABLE */);\n Object.entries(BLACKLIST)\n .forEach(function ([key, bool]) {\n bool && TABLE.remove(key);\n });\n return this;\n }", "function omit(object, keysToOmit) {\n var result = {};\n\n Object.keys(object).forEach(function (key) {\n if (keysToOmit.indexOf(key) === -1) {\n result[key] = object[key];\n }\n });\n\n return result;\n}", "function softCopyProperties(source, target) {\n _Object__WEBPACK_IMPORTED_MODULE_6__[\"each\"](source, function (key, value) {\n // only if value is set\n if (_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"hasValue\"](value) && !(_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"hasValue\"](target[key]))) {\n target[key] = value;\n }\n });\n return target;\n}", "function omit(obj, prop1,prop2) {\r\n if (!obj) {\r\n return null;\r\n }\r\n var result = mixin({},obj);\r\n for(var i=1;i<arguments.length;i++) {\r\n var pn = arguments[i];\r\n if (pn in obj) {\r\n delete result[pn];\r\n }\r\n }\r\n return result;\r\n\r\n }", "function specWithStrippedDebug(spec) {\n var copiedSpec = $.extend(true, {}, spec),\n objects = copiedSpec.objects;\n\n for (var key in objects) {\n if (objects.hasOwnProperty(key)) {\n objects[key].debug = undefined;\n }\n }\n return copiedSpec;\n }", "function _filteredDeepCopy(src, dst) {\n if (Array.isArray(src)) {\n src.forEach(function (item) {\n switch (typeof item) {\n case 'function':\n ABeamer.throwI8n(ABeamer.Msgs.NoCode);\n break;\n case 'object':\n dst.push(_filteredDeepCopy(item, Array.isArray(item) ? [] : {}));\n break;\n default:\n dst.push(item);\n }\n });\n }\n else {\n Object.keys(src).forEach(function (key) {\n if (key[0] !== '_') {\n var item = src[key];\n switch (typeof item) {\n case 'function':\n ABeamer.throwI8n(ABeamer.Msgs.NoCode);\n break;\n case 'object':\n dst[key] = Array.isArray(item) ? [] : {};\n _filteredDeepCopy(item, dst[key]);\n break;\n default:\n dst[key] = item;\n }\n }\n });\n }\n return dst;\n }", "copy() {\n let listCopy = new SuspendedList(thjs._serializer);\n listCopy._list = this._list.slice();\n listCopy._rules = this._rules.copy();\n return listCopy;\n }", "set Ignore(value) {}", "function noteFilter(obj) {\n return _.pick(obj, ['notebookId', 'title', 'content']);\n}", "function cleanCopy(t) {\n const r = { ...t };\n return clean(r);\n}", "function omit(obj, omitKeys) {\n\t var result = {};\n\t Object.keys(obj).forEach(function (key) {\n\t if (omitKeys.indexOf(key) === -1) {\n\t result[key] = obj[key];\n\t }\n\t });\n\t return result;\n\t}", "function omit(obj, omitKeys) {\n\t var result = {};\n\t Object.keys(obj).forEach(function (key) {\n\t if (omitKeys.indexOf(key) === -1) {\n\t result[key] = obj[key];\n\t }\n\t });\n\t return result;\n\t}", "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key){\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key){\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key){\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key){\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key){\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "unlike() {\r\n return this.clone(Item, \"unlike\").postCore();\r\n }", "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "function filterNullInObject(object) {\n let newObject = {};\n\n let keys = Object.keys(object);\n\n for (var key of keys) {\n if (object[key] || object[key] == false) {\n newObject[key] = object[key];\n }\n }\n\n return newObject;\n}", "function myFunction(obj) {\n delete obj.country;\n return obj\n}", "function getCleansedConfig() {\n\t\tvar clonedSite = $.extend(true, {}, site);\n\t\trecurse(clonedSite, deleteBlacklistedProperties);\n\t\treturn clonedSite;\n\t}", "function shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function (value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n }", "function whiteList(sensitiveObject, allowedKeys) {\n let finalObject = {}\n\n for(let i = 0; i < allowedKeys.length; i++) {\n let currentKeyName = allowedKeys[i]\n\n if (sensitiveObject.hasOwnProperty(currentKeyName)) {\n finalObject[`${currentKeyName}`] = sensitiveObject[`${currentKeyName}`]\n }\n }\n return finalObject\n }", "function undeletablePropertiesStrict() {\n 'use strict';\n delete Object.prototype; // throws type error in strict\n}", "function filterKeys(keys) {\n return _.filter(keys, (key) => !_.includes(exports.options.ignore, key));\n}" ]
[ "0.6473454", "0.6243247", "0.5993544", "0.5979618", "0.5927921", "0.5903837", "0.586694", "0.58561397", "0.58508164", "0.58476645", "0.5813823", "0.5811763", "0.5811041", "0.5811041", "0.57224035", "0.57224035", "0.57090896", "0.57090896", "0.57090896", "0.5705768", "0.5695343", "0.56856716", "0.56839216", "0.5674333", "0.5673358", "0.56222445", "0.56222445", "0.56222445", "0.56222445", "0.5611749", "0.5579626", "0.5563956", "0.5560517", "0.55593336", "0.55593336", "0.55537105", "0.553686", "0.553128", "0.553128", "0.553128", "0.553128", "0.55235845", "0.55223334", "0.55171293", "0.5512654", "0.5508921", "0.5507107", "0.54919666", "0.54577065", "0.54577065", "0.54577065", "0.54577065", "0.54577065", "0.54577065", "0.54577065", "0.54577065", "0.54577065", "0.54577065", "0.54577065", "0.54577065", "0.54577065", "0.54577065", "0.54577065", "0.54577065", "0.54577065", "0.54577065", "0.54556596", "0.5449506", "0.5434335", "0.54340345", "0.5424956", "0.5415996", "0.5409987", "0.5394617", "0.5389365", "0.53875023", "0.53790444", "0.536207", "0.536207", "0.5339783", "0.5339783", "0.5339783", "0.5339783", "0.5339783", "0.53368735", "0.53314507", "0.53314507", "0.53314507", "0.53314507", "0.53314507", "0.53314507", "0.53314507", "0.53314507", "0.5330159", "0.5326425", "0.5323502", "0.53204405", "0.53190875", "0.53135234", "0.53120834" ]
0.5688911
21
plan is all that's required
function isResolve(value) { return isObject(value) && value.then && value.$$promises; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_plan( ) {\n\n\t\t// initialize, or we will have problems planning multiple times\n\t\tObject.keys( this.stages ).forEach( s => { this.stages[s].next = []; } );\n\n\t\t// build out \"plan\". note we are pushing onto the * prereq's * next array\n\t\tObject.keys( this.stages ).forEach( s => {\n\t\t\tif( this.stages[s].prereqs.length > 0 ) {\n\t\t\t\tthis.stages[s].prereqs.forEach( (p,j) => { this.stages[p].next.push( s ); } );\n\t\t\t}\n\t\t} );\n\n\t\t// set flag, if it isn't already set\n\t\tif( ! this.planned ) { this.planned = true; }\n\n\t\t// note we still have to set this.stages[s].ready for stages with prereqs \n\t\t// before we can run again\n\n\t}", "plan(program, state, callback) {\n const result = plan(program.arguments[0], state, []);\n\n // console.log(\"done planning\", result[0].plan);\n\n if (callback) {\n\n if (result[0].plan && result[0].plan.length > 0) {\n // execute the plan\n executeActions(result[0].plan, state, callback);\n // TODO: update state\n return [{ program: null, state, plan: [] }];\n } else {\n throw new Error('no plan found', 'no plan found');\n }\n\n } else {\n // else: offline we just ignore the 'plan' construct, because we are\n // already in planning mode.\n return result;\n }\n }", "function calculatePlan(actor) \n{\n var teamColor = actor.getKnowledge(\"team_color\");\n var otherFlag = teamColor == \"red\" ? flag_green.position : flag_red.position;\n var ownFlag = teamColor == \"red\" ? flag_red.position : flag_green.position;\n\n var planner = new Planner();\n var actionSet = [new MoveToFlagAction(teamColor, ownFlag), \n \t\t\t\t new MoveToFlagAction(teamColor, otherFlag),\n \t\t\t\t new ReloadAction(),\n \t\t\t\t new ShootAction()]\n\n var allActions = {}\n \tvar preconditionSet = []\n\tfor(var i = 0; i < actionSet.length; ++i) {\n\t\tvar action = actionSet[i]\n\t planner.addAction(action.precondition,\n\t action.postcondition,\n\t action.cost,\n\t action.perform, \n\t action.name);\n\n\t allActions[action.name] = action\n\t preconditionSet = preconditionSet.concat(action.preconditions)\n }\n\n //var tree = [\"[L3\",\"[S2\",\"s\",\"r\",\"[S4\",{\"enemy_in_range\":true},\"t\",\"[S2\",\"s\",\"r\",\"s\",\"[S2\",\"g\",\"r\"]\n //printTree(treeFromString(tree,0,allActions).root)\n\n testApproachRandom(10);\n //testApproachRandom(0, allActions, {\"made_points\" : true});\n}", "async createPlan() {\n return await this.testrail.addPlan(this.projectId, {\n name: \"[#ccid - test plan]\",\n milestone_id: this.milestone_id,\n entries: [\n { suite_id: 24, name: \"[#ccid] - test suite config\" },\n { suite_id: 25, name: \"[#ccid] - test suite - user\" }\n ]\n });\n }", "function test_simple() {\n // Plan\n var plan1 = tasks(\"ns:identity\").plan({\n x: [1, 2]\n });\n var plan2 = tasks(\"ns:mult\").plan({\n x: plan1,\n y: [3, 5]\n });\n\n // Optimize and run\n // Should be an array of XML values 3, 6, 5, 10\n var result = plan2();\n check_array(result, [3, 5, 6, 10]);\n}", "function testMultiPlan() {\n asyncTestCase.waitForAsync('testMultiPlan');\n assertEquals(0, cache.getCount());\n\n rows = [];\n for (var i = 0; i < ROW_COUNT; ++i) {\n var job = lf.testing.hrSchemaSampleData.generateSampleJobData(db);\n job.setId('jobId' + i.toString());\n rows.push(job);\n }\n\n var newTitle = 'Quantum Physicist';\n var deletedId = 'jobId2';\n\n var insertQuery = /** @type {!lf.query.InsertBuilder} */ (\n db.insert().into(j).values(rows)).getTaskItem();\n var updateQuery = /** @type {!lf.query.UpdateBuilder} */ (\n db.update(j).set(j.title, newTitle)).getTaskItem();\n var removeQuery = /** @type {!lf.query.DeleteBuilder} */ (\n db.delete().from(j).where(j.id.eq(deletedId))).getTaskItem();\n\n var queryTask = new lf.proc.UserQueryTask(\n hr.db.getGlobal(), [insertQuery, updateQuery, removeQuery]);\n\n queryTask.exec().then(function() {\n assertEquals(ROW_COUNT - 1, cache.getCount());\n\n return lf.testing.util.selectAll(global, j);\n }).then(function(results) {\n assertEquals(ROW_COUNT - 1, results.length);\n for (var i = 0; i < results.length; ++i) {\n assertEquals(newTitle, results[i].payload()[j.title.getName()]);\n assertFalse(results[i].payload()[j.id.getName()] == deletedId);\n }\n asyncTestCase.continueTesting();\n });\n}", "async function getStatisticToPlan() {\n\n}", "generatePlan(planType, data) {\n if(planType === \"random\")\n return Algorithms.randomAlgorithm(data);\n else if(planType === \"best random\")\n return Algorithms.bestRandom(data);\n else if(planType === \"greedy\")\n return Algorithms.greedyAlgorithm(data);\n else if(planType === \"knapsack\")\n return Algorithms.knapsackAlgorithm(data);\n }", "function planFormCaller() {\n plan.planForm();\n}", "function Plan(plan) {\n this.uid = Math.round(Math.random() * 10000 );\n if (plan)\n angular.extend(this, plan);\n\n updateComputedValues(this);\n }", "function test_product() {\n var plan1 = tasks(\"ns:identity\").plan({\n x: [2, 3]\n });\n var plan2 = tasks(\"ns:plus\").plan({\n x: plan1,\n y: plan1.copy(),\n });\n var result = plan2();\n check_array(result, [4, 5, 5, 6]);\n}", "function testcases () {\n\n\tif ( !fs.existsSync(paymentsdonedir) ) {\n\t\tfs.mkdirSync(paymentsdonedir, 0744)\n\t\tgetpayqueue(start);\n\t}\n\telse if ( !fs.existsSync(paymentqueuefile) ) {\n\t\tconsole.log(\"Missing file \" + paymentqueuefile + \"! Run collector session first. Goodbye\")\n\t}\n\telse if ( JSON.parse(fs.readFileSync(paymentqueuefile)).length == 0 ) {\n\t\tconsole.log(\"Empty payqueue! Nothing to pay, goodbye :-)\")\n\t}\n\telse {\n\t\tgetpayqueue(start);\n\t}\n}", "function runnablePlan(step) {\n if (step === 'ResourceFlexibility') {\n return true;\n } else {\n return false;\n }\n }", "get plan() {\n\t\treturn this.__plan;\n\t}", "function testSinglePlan_Insert() {\n asyncTestCase.waitForAsync('testSinglePlan_Insert');\n assertEquals(0, cache.getCount());\n\n var queryTask = new lf.proc.UserQueryTask(\n hr.db.getGlobal(), [getSampleQuery()]);\n queryTask.exec().then(function() {\n return lf.testing.util.selectAll(global, j);\n }).then(function(results) {\n assertEquals(ROW_COUNT, results.length);\n assertEquals(ROW_COUNT, cache.getCount());\n for (var i = 0; i < ROW_COUNT; ++i) {\n assertEquals(rows[i].id(), results[i].id());\n assertObjectEquals(rows[i].payload(), results[i].payload());\n }\n asyncTestCase.continueTesting();\n }, fail);\n}", "function test_add() {\n var plan = tasks(\"ns:plus\").plan({ x: [1, 2], y: 3 });\n plan.add({ x: [4, 5], y: 2});\n \n var result = plan();\n check_array(result, [4, 5, 6, 7]);\n}", "function test_join() {\n var plan1 = tasks(\"ns:identity\").plan({\n x: [1, 2]\n });\n var plan2 = tasks(\"ns:mult\").plan({\n x: plan1,\n y: [3, 5]\n });\n var plan3 = tasks(\"ns:plus\").plan(\n {\n x: plan1,\n y: plan2\n }\n );\n \n var result = plan3.run();\n check_array(result, [4, 6, 8, 12]);\n}", "function plan(program, state, prefix = []) {\n if (!isFinal(program, state)) {\n const result = trans_one(program, state);\n if (result.length == 0) {\n return [];\n } else {\n // try all (depth first for now); return when first plan found\n for (let i = 0; i < result.length; i++) {\n const r = result[i];\n const sub = plan(r.program, r.state, prefix.concat(r.plan));\n if (sub.length > 0) {\n return sub;\n }\n }\n }\n } else {\n // this is a successful branch\n return [{program, state, plan: prefix}];\n }\n}", "drawPlan(plan, numRowCols) {\n let block_width = this.canvas.width / numRowCols;\n let block_height = this.canvas.height / numRowCols;\n for (var i=0; i<plan.length; ++i) {\n var placement = plan[i];\n var p = this.p5_object;\n let x = placement.col * block_width + block_width/2;\n let y = placement.row * block_height + block_height/2;\n let diameter_inner = block_height/4;\n p.fill(255, 255, 255);\n p.circle(x, y, diameter_inner*2);\n p.fill(0, 0, 200);\n p.circle(x, y, diameter_inner);\n }\n }", "function run() {\n\n // connection.connect(function (err) {\n // if (err) throw err;\n\n // //run basic start program function to display bamazon table \n // start();\n // // purchase();\n // });\n start();\n}", "function analyzePlan(plan, lists) {\n\n if (!lists)\n lists = {buckets : {}, fields : {}, indexes: {}, aliases: [], total_time: 0.0};\n\n // make\n\n if (!plan || _.isString(plan))\n return(null);\n\n // special case: prepared queries are marked by an \"operator\" field\n\n if (plan.operator)\n return(analyzePlan(plan.operator,null));\n\n //console.log(\"Inside analyzePlan: \" + JSON.stringify(plan,null,true));\n\n // iterate over fields, look for \"#operator\" field\n var operatorName;\n var fields = [];\n\n _.forIn(plan,function(value,key) {\n if (key === '#operator')\n operatorName = value;\n\n var type;\n if (_.isString(value)) type = 'string';\n else if (_.isArray(value)) type = 'array';\n else if (_.isObject(value)) type = 'object';\n else if (_.isNumber(value)) type = 'number';\n else if (_.isNull(value)) type = 'null';\n else type = 'unknown';\n\n var field = {};\n field[key] = type;\n fields.push(field);\n });\n\n // at this point we should have an operation name and a field array\n //console.log(\" after analyze, got op name: \" + operatorName);\n // we had better have an operator name at this point\n\n if (!operatorName) {\n console.log(\"Error, no operator found for item: \" + JSON.stringify(plan));\n return(lists);\n }\n //else\n // console.log(\"Got operator: \" + operatorName + \", stats: \" + plan['#stats']);\n\n // if the operator has timing information, convert to readable and analyzable forms:\n if (plan['#time'] ||\n (plan['#stats'] && (plan['#stats'].execTime || plan['#stats'].servTime))) {\n var parsedValue = 0.0;\n if (plan['#time'])\n parsedValue = convertTimeStringToFloat(plan['#time']);\n else if (plan['#stats']) {\n if (plan['#stats'].execTime)\n parsedValue += convertTimeStringToFloat(plan['#stats'].execTime);\n if (plan['#stats'].servTime)\n parsedValue += convertTimeStringToFloat(plan['#stats'].servTime);\n }\n\n plan['#time_normal'] = convertTimeFloatToFormattedString(parsedValue);\n plan['#time_absolute'] = parsedValue;\n lists.total_time += parsedValue;\n //console.log(\"Got time:\" + plan['#time'] + \", parsed: \" + plan['#time_normal'] + ', abs: ' + plan['#time_absolute']);\n }\n\n\n // if we have a sequence, we analyze the children in order\n if (operatorName === \"Sequence\" && plan['~children']) {\n // a sequence may have aliases that rename buckets, but those aliases become invalid after\n // the sequence. Remember how long the sequence was at the beginning.\n var initialAliasLen = lists.aliases.length;\n\n for (var i = 0; i < plan['~children'].length; i++) {\n // if we see a fetch, remember the keyspace for subsequent projects\n if (plan['~children'][i]['#operator'] == \"Fetch\")\n lists.currentKeyspace = plan['~children'][i].keyspace;\n analyzePlan(plan['~children'][i], lists);\n }\n\n // remove any new aliases\n lists.aliases.length = initialAliasLen;\n return(lists);\n }\n\n // parallel groups are like sequences, but with only one child\n else if (operatorName === \"Parallel\" && plan['~child']) {\n analyzePlan(plan['~child'],lists);\n return(lists);\n }\n\n\n\n\n\n // Prepare operators have their plan inside prepared.operator\n else if (operatorName === \"Prepare\" && plan.prepared && plan.prepared.operator) {\n analyzePlan(plan.prepared.operator,lists);\n return(lists);\n }\n\n // ExceptAll and IntersectAll have 'first' and 'second' subqueries\n else if (operatorName === \"ExceptAll\" || operatorName === \"IntersectAll\") {\n if (plan['first'])\n analyzePlan(plan['first'],lists);\n\n if (plan['second'])\n analyzePlan(plan['second'],lists);\n\n return(lists);\n }\n\n // Merge has two children: 'delete' and 'update'\n else if (operatorName === \"Merge\") {\n if (plan.as)\n lists.aliases.push({keyspace: plan.keyspace, as: plan.as});\n\n if (plan['delete'])\n analyzePlan(plan['delete'],lists);\n\n if (plan['update'])\n analyzePlan(plan['update'],lists);\n\n if (plan.keyspace)\n getFieldsFromExpression(plan.keyspace,lists);\n\n if (plan.key)\n getFieldsFromExpression(plan.key,lists);\n\n return(lists);\n }\n\n // Authorize operators have a single child called 'child'\n else if (operatorName === \"Authorize\" && plan['~child']) {\n analyzePlan(plan['~child'],lists);\n return(lists);\n }\n\n // DistinctScan operators have a single child called 'scan'\n else if (operatorName === \"DistinctScan\" && plan['scan']) {\n analyzePlan(plan['scan'],lists);\n return(lists);\n }\n\n // Similar to UNIONs, IntersectScan, UnionScan group a number of different scans\n // have an array of 'scan' that are merged together\n\n else if ((operatorName == \"UnionScan\") || (operatorName == \"IntersectScan\")) {\n for (var i = 0; i < plan['scans'].length; i++)\n analyzePlan(plan['scans'][i],lists);\n\n return(lists);\n }\n\n\n\n\n\n\n\n // UNION operators will have an array of predecessors drawn from their \"children\".\n // we expect predecessor to be null if we see a UNION\n else if ((operatorName == \"Union\" || operatorName === \"UnionAll\") && plan['~children']) {\n for (var i = 0; i < plan['~children'].length; i++)\n analyzePlan(plan['~children'][i],lists);\n\n return(lists);\n }\n else if ((operatorName == \"Union\" || operatorName === \"UnionAll\") && plan['children']) {\n for (var i = 0; i < plan['children'].length; i++)\n analyzePlan(plan['children'][i],lists);\n\n return(lists);\n }\n\n // for all other operators, certain fields will tell us stuff:\n // - keyspace is a bucket name\n // - index is an index name\n // - condition is a string containing an expression, fields there are of the form (`keyspace`.`field`)\n // - expr is the same as condition\n // - on_keys is an expression\n // - group_keys is an array of fields\n\n if (plan.keyspace)\n lists.buckets[plan.keyspace] = true;\n if (plan.index && plan.keyspace)\n lists.indexes[plan.keyspace + \".\" + plan.index] = true;\n else if (plan.index)\n lists.indexes[plan.index] = true;\n if (plan.group_keys) for (var i=0; i < plan.group_keys.length; i++)\n lists.fields[plan.group_keys[i]] = true;\n if (plan.condition)\n getFieldsFromExpression(plan.condition,lists);\n if (plan.expr)\n getFieldsFromExpression(plan.expr,lists);\n if (plan.on_keys)\n getFieldsFromExpression(plan.on_keys,lists);\n if (plan.as && plan.keyspace)\n lists.aliases.push({keyspace: plan.keyspace, as: plan.as});\n if (plan.result_terms && _.isArray(plan.result_terms))\n for (var i=0; i< plan.result_terms.length; i++) if (plan.result_terms[i].expr )\n if (plan.result_terms[i].expr == \"self\" && plan.result_terms[i].star &&\n lists.currentKeyspace)\n lists.fields[lists.currentKeyspace + '.*'] = true;\n else\n getFieldsFromExpression(plan.result_terms[i].expr,lists);\n\n return(lists);\n }", "function step_plan(steps) {\n // if exactly 0 steps left, found a successful plan! didn't if less than 0\n if (steps === 0) return 1;\n if (steps < 0) return 0;\n // each time can take 1, 2, or 3 steps\n return step_plan(steps-1) + step_plan(steps-2) + step_plan(steps-3); \n}", "function Plan(response) {\r\n this.init(response);\r\n}", "getPlan(req, res) {\n const planId = req.query.planId;\n\n Plan.findById(planId).then(plan => {\n if (!plan.length) return helper.retError(res, '400', true, '','No matching results getPlan',plan);\n return helper.retSuccess(res,'200',true,'','Sucess',plan);\n }).catch(err => {\n return helper.retError(res,'500',false,err,'Error getPlan','');\n });\n }", "function testSinglePlan_Delete() {\n asyncTestCase.waitForAsync('testSinglePlan_Delete');\n assertEquals(0, cache.getCount());\n\n var queryTask = new lf.proc.UserQueryTask(\n hr.db.getGlobal(), [getSampleQuery()]);\n queryTask.exec().then(function() {\n assertEquals(ROW_COUNT, cache.getCount());\n var query = /** @type {!lf.query.DeleteBuilder} */ (\n db.delete().from(j)).getTaskItem();\n var deleteQueryTask = new lf.proc.UserQueryTask(\n hr.db.getGlobal(), [query]);\n return deleteQueryTask.exec();\n }).then(function() {\n return lf.testing.util.selectAll(global, j);\n }).then(function(results) {\n assertEquals(0, results.length);\n assertEquals(0, cache.getCount());\n asyncTestCase.continueTesting();\n });\n}", "function fetchPlanResults() {\n // Request URL for test plans\n var planAPI = testRailURL + \"/index.php?/api/v2/get_plans/\" + projectList[plIndex][0];\n var params = setTestRailHeaders();\n\n // Proxy the request through the container server\n gadgets.io.makeRequest(planAPI, handlePlanResponse, params);\n}", "function showPlan(plan) {\n removeCurrentPlanLayers();\n\n var planBounds = new L.LatLngBounds();\n function extendPlanBounds(latlng) { planBounds.extend(latlng) }\n\n for (var i = 0; i < plan.length; i++) {\n var step = plan[i]\n , type = step.type\n , gml = step.gml;\n if (type === undefined) continue;\n\n var latlng, layer = null;\n\n if (type == 'StartWalking' || type == 'FinishWalking') {\n latlng = getLatLngFromGmlPoint(gml);\n // TODO Este marker debería ser un chaboncito caminando =D\n layer = new L.Marker(latlng);\n extendPlanBounds(latlng);\n }\n else if (type == 'Board') {\n latlng = getLatLngFromGmlPoint(gml);\n var markerIcon = getMarkerIconForService(step.service);\n // TODO Este marker debería usar el markerIcon =D\n layer = new L.Marker(latlng);\n extendPlanBounds(latlng);\n }\n else if (type == 'Bus' || type == 'SubWay' || type == 'Street') {\n // TODO add path style\n // var pathStyle = getPathStyleForType(type);\n\n var latLngList = getLatLngListFromGml(gml);\n layer = new L.Polyline(latLngList, {color: 'red'});\n latLngList.forEach(extendPlanBounds);\n }\n else if (type == 'SubWayConnection') {\n // TODO do this\n // Code stolen from usig.MapaInteractivo.min.js\n// if (H.type == \"SubWayConnection\") {\n// switch (H.service_to) {\n// case\"Línea A\":\n// H.gml[1] = H.gml[1].replace(\"connection\", \"subwayA\");\n// break;\n// case\"Línea B\":\n// H.gml[1] = H.gml[1].replace(\"connection\", \"subwayB\");\n// break;\n// case\"Línea C\":\n// H.gml[1] = H.gml[1].replace(\"connection\", \"subwayC\");\n// break;\n// case\"Línea D\":\n// H.gml[1] = H.gml[1].replace(\"connection\", \"subwayD\");\n// break;\n// case\"Línea E\":\n// H.gml[1] = H.gml[1].replace(\"connection\", \"subwayE\");\n// break;\n// case\"Línea H\":\n// H.gml[1] = H.gml[1].replace(\"connection\", \"subwayH\");\n// break\n// }\n// G.addMarker(H.gml[1]);\n// G.addEdges(H.gml)\n// }\n }\n\n if (layer) {\n map.addLayer(layer);\n currentPlanLayers.push(layer);\n }\n } // for\n\n // Fits the plan on the map =D\n// map.fitBounds(planBounds);\n }", "function test_join_union() {\n // Join plan1 of plan2 with plan1 (within plan2)\n\t// note that because x in plan2 has an extra input\n\t// this gives a cartesian product with results\n\t// plus([-3, -5], [1, 2]\n\n var plan1 = tasks(\"ns:identity\").plan({\n x: [1, 2]\n });\n var plan2 = tasks(\"ns:mult\").plan({\n x: [plan1, -1],\n y: [3, 5]\n });\n var plan3 = tasks(\"ns:plus\").plan(\n {\n x: plan1,\n y: plan2\n }\n );\n \n var result = plan3.run();\n check_array(result, [-4, -3, -2, -1, 4, 6, 8, 12]);\n}", "function main() {\n let config = {\n \"timeBegin\": new Date(Date.UTC(2016, 8, 17, 0, 0, 0)),\n \"timeEnd\": new Date(Date.UTC(2016, 8, 17, 23, 0, 0)),\n \"goalPattern\": {\n \"metric\": \"invidi.webapp.localhost_localdomain.request.total_response_time.mean\",\n \"timeBegin\": 1474106851,\n \"timeEnd\": 1474153707\n },\n \"iterationCount\": 10000,\n \"initialReward\": -1000.0,\n \"reinforcementLearning\": {\n \"stepSize\": 0.1,\n \"discountRate\": 0.9\n },\n \"resultFile\": \"/tmp/result.json\"\n };\n\n let result = (new RLAdapter).train(config);\n\n // todo: move this job to c++\n result = result.filter(r => r.reward != null);\n result = result.sort((a, b) => {\n return b.reward - a.reward;\n });\n\n result = result.slice(0, 40);\n\n var timeBeginUTC = moment(timeBegin).utc().format('YYYY-MM-DD HH:mm:ss');\n var timeEndUTC = moment(timeEnd).utc().format('YYYY-MM-DD HH:mm:ss');\n let dashboardOptions = {\n title: 'Reinforcement Learning Model for response time',\n from: timeBeginUTC,\n to: timeEndUTC,\n rows: []\n };\n dashboardOptions.rows = result.map(r => {\n return {\n title: `${r.sourcePattern.metric} - ${r.reward}`,\n targetName: r.sourcePattern.metric\n };\n });\n\n dashboardOptions.rows.unshift({\n title: \"invidi.webapp.localhost_localdomain.request.total_response_time.mean\",\n targetName: \"invidi.webapp.localhost_localdomain.request.total_response_time.mean\"\n });\n\n fs.writeFileSync(\n 'dashboard.json',\n JSON.stringify(generateDashboard(dashboardOptions))\n );\n}", "addPlan(name, percents){\n this.plans[name] = createCommissionPlan(name, percents);\n }", "constructor (plans = null) {\n this.plans = plans ? plans : []; // If plans is null, make an empty array.\n this.index = this.plans.length - 1; // This isn't simply 0 because the last plan in the list has to be \"updated\" in order for the 0th index plan to execute first. Not sure why.\n }", "function createPlan (plan) {\n // create an empty array\n var poiArray = [];\n // create a Parse Object that will be table header\n var dbObject = {\n // create property: value pairs to be able to store it in this way on Parse\n \"planName\": plan.name,\n \"destination\": plan.destination,\n \"totalPlanMins\": 0,\n \"planDate\": {\n \"__type\": \"Date\",\n \"iso\": plan.date,\n },\n \"status\": \"private\",\n \"notes\": \"\",\n \"comments\": \"\",\n \"author\": currentUser.username,\n // create array column in db inside of Plans object for pois\n pois: poiArray,\n // create relationship between user and Plan Object\n \"user\": {\n \"__type\": \"Pointer\",\n \"className\": \"_User\",\n \"objectId\": currentUser.objectId\n },\n }\n // save Plan object to Parse\n $http.post(planUrl, dbObject, PARSE_HEADERS).success( function (data) {\n // take user to the plan view\n $location.path('/profile');\n });\n }", "function fetchPlanResults() {\n // Request URL for test plans\n var planAPI = testRailURL + \"/index.php?/api/v2/get_plans/\" + projectID + \"&milestone_id=\" + milestoneID;\n var params = setTestRailHeaders();\n\n // Proxy the request through the container server\n gadgets.io.makeRequest(planAPI, handlePlanResponse, params);\n}", "function testSinglePlan_ParametrizedQuery() {\n asyncTestCase.waitForAsync('testSinglePlan_ParametrizedQuery');\n\n var selectQueryBuilder = /** @type {!lf.query.SelectBuilder} */ (\n db.select().from(j).where(j.id.between(lf.bind(0), lf.bind(1))));\n\n var observerCallback = function(changes) {\n // Expecting one \"change\" record for each of rows with IDs jobId2, jobId3,\n // jobId4.\n assertEquals(3, changes.length);\n changes.forEach(function(change) {\n assertEquals(1, change['addedCount']);\n });\n\n db.unobserve(selectQueryBuilder, observerCallback);\n asyncTestCase.continueTesting();\n };\n\n var insertQueryTask = new lf.proc.UserQueryTask(\n hr.db.getGlobal(), [getSampleQuery()]);\n\n insertQueryTask.exec().then(function() {\n // Start observing.\n db.observe(selectQueryBuilder, observerCallback);\n\n // Bind parameters to some values.\n selectQueryBuilder.bind(['jobId2', 'jobId4']);\n\n var selectQueryTask = new lf.proc.UserQueryTask(\n hr.db.getGlobal(), [selectQueryBuilder.getTaskItem()]);\n return selectQueryTask.exec();\n }, fail);\n}", "prepare() {}", "execute() {}", "execute() {}", "async function load(req, res, next) {\n req.plan = await Plan.get(req.params.planId);\n return next();\n}", "static planRoute () {\n return new NavComputer({\n route: sample(ROUTES),\n invert: sample([true, false])\n })\n }", "function testSinglePlan_Update() {\n asyncTestCase.waitForAsync('testSinglePlan_Update');\n assertEquals(0, cache.getCount());\n\n var newTitle = 'Quantum Physicist';\n var queryTask = new lf.proc.UserQueryTask(\n hr.db.getGlobal(), [getSampleQuery()]);\n queryTask.exec().then(function() {\n assertEquals(ROW_COUNT, cache.getCount());\n var query = /** @type {!lf.query.UpdateBuilder} */ (\n db.update(j).set(j.title, newTitle)).getTaskItem();\n var updateQueryTask = new lf.proc.UserQueryTask(\n hr.db.getGlobal(), [query]);\n return updateQueryTask.exec();\n }).then(function() {\n return lf.testing.util.selectAll(global, j);\n }).then(function(results) {\n assertEquals(ROW_COUNT, results.length);\n assertEquals(ROW_COUNT, cache.getCount());\n for (var i = 0; i < ROW_COUNT; ++i) {\n assertEquals(newTitle, results[i].payload()[j.title.getName()]);\n var id = rows[i].id();\n assertEquals(newTitle, cache.get(id).payload()[j.title.getName()]);\n }\n asyncTestCase.continueTesting();\n });\n}", "function run () {\n\n // //Test Case 1\n address = \"809 Thomas Ave, San Diego, CA 92109\"\n var frmtAddr = addressSearch(address);\n var frmtName = formatInput(\"The Local\");\n dbAddr = formatInput(address);\n\n // Test Case 2\n // address =\"8970 University Center Ln, San Diego, CA 92122\";\n // var frmtAddr = addressSearch(address);\n // var frmtName = formatInput(\"Fleming's\");\n // dbAddr = formatInput(address);\n \n\n //Make API calls\n yelpAPIcall(frmtName,frmtAddr,ratingsobjectarray,zomatoAPIcall);\n\n // .then(zomatoAPIcall(frmtName,frmtAddr))\n // .then(googleAPIcall(frmtName,frmtAddr))\n // .then(dbfind(frmtName,dbAddr,callbacklog))\n // .then(dbrating(dbAddr)); \n // runwhendone(yelprating,zomatorating,googlerating,internalrating);\n}", "function PlanNode(predecessor, operator, subsequence, total_query_time) {\n this.predecessor = predecessor; // might be an array if this is a Union node\n this.operator = operator; // object from the actual plan\n this.subsequence = subsequence; // for parallel ops, arrays of plan nodes done in parallel\n if (total_query_time && operator['#time_absolute'])\n this.time_percent = Math.round(operator['#time_absolute']*1000/total_query_time)/10;\n }", "all(step, plan) {\n if (plan <= 0) {\n throw new Error(`${plan} is not a valid 'plan' value.`);\n }\n if (this.targetMiniSteps && this.targetMiniSteps !== plan) {\n throw new Error(`The plan count (${plan}) does not match with previous value (${this.targetMiniSteps}).`);\n }\n if (this.isValidStep('all', [step], plan)) {\n if (this.targetMiniSteps === undefined) {\n this.targetMiniSteps = plan;\n this.miniSteps = 0;\n this.moveNext({\n all: [step]\n });\n }\n this.miniSteps++;\n if (plan === this.miniSteps) {\n this.moveNext();\n this.nextStep++;\n this.targetMiniSteps = undefined;\n }\n return this.miniSteps;\n }\n else {\n throw new Error(this.getErrorMessage('all', step));\n }\n }", "function parseplan (planstring) {\n //Map for implicit links\n var implicitSrcMap = {};\n var g = new dagreD3.Digraph();\n //Produce 2D array (3 x M): [[0:majorMinor] [1:] [2:opName]] / [[<major>-<minor>, \"<indent>\", opName]]\n let opPlanArray = planstring.trim().split(\"\\n\");\n var operatorRegex = new RegExp(\"^([0-9-]+)( *)([a-zA-Z]*)\");\n //Regex to capture source operator \n var srcOpRegex = new RegExp(\"srcOp=[0-9-]+\");\n var opTuple = $.map(opPlanArray, \n function (lineStr) { \n //Tokenize via Regex\n let opToken = operatorRegex.exec(lineStr).slice(1);\n //Extract Implicit Source via Regex\n let implicitSrc = srcOpRegex.exec(lineStr);\n let srcOp = null;\n let tgtOp = opToken[0];\n if (implicitSrc != null) {\n srcOp = implicitSrc.toString().split(\"=\")[1];\n implicitSrcMap[tgtOp]=srcOp;\n }\n return [opToken];\n });\n\n\n // parse, build & inject nodes\n for (var i = 0; i < opTuple.length; i++) {\n let majorMinor = opTuple[i][0];\n let majorId = parseInt(majorMinor.split(\"-\")[0]);\n let opName = opTuple[i][2];\n g.addNode(majorMinor, {\n label: opName + \" \" + majorMinor,\n fragment: majorId\n });\n }\n\n // Define edges by traversing graph from root node (Screen)\n //NOTE: The indentation value in opTuple which is opTuple[1] represents the relative level of each operator in tree w.r.t root operator\n var nodeStack = [opTuple[0]]; //Add Root\n for (var i = 1; i < opTuple.length; i++) {\n let top = nodeStack.pop();\n let currItem = opTuple[i];\n let stackTopIndent = top[1].length;\n let currItemIndent = currItem[1].length; //Since tokenizing gives indent size at index 1\n //Compare top-of-stack indent with current iterItem indent\n while (stackTopIndent >= currItemIndent) {\n top = nodeStack.pop();\n stackTopIndent = top[1].length;\n }\n\n //Found parent\n //Add edge if Implicit src exists\n //Refer: https://dagrejs.github.io/project/dagre-d3/latest/demo/style-attrs.html / https://github.com/d3/d3-shape#curves\n if (implicitSrcMap[currItem[0]] != null) {\n //Note: Order matters because it affects layout (currently: BT)\n //Ref: //https://github.com/dagrejs/dagre/issues/116\n g.addEdge(null, currItem[0], implicitSrcMap[currItem[0]], {\n style: \"fill:none; stroke:gray; stroke-width:3px; stroke-dasharray: 5,5;marker-end:none\"\n });\n \n }\n //Adding edge\n g.addEdge(null, currItem[0], top[0]);\n\n if (currItemIndent != stackTopIndent)\n nodeStack.push(top);\n if (currItemIndent >= stackTopIndent)\n nodeStack.push(currItem);\n }\n\n return g;\n }", "plan(x, d) { x = x * 12 / d - 6; return 1.4 * Math.exp(x) / (Math.exp(x) + 1) }", "function MigrationPlan(migrationTracker) {\n this._migrations = []\n this._tracker = migrationTracker\n}", "function ANT() { }", "function AttackPlan(sims) {\n this.sims = sims;\n }", "function goTravelPlans() {\n\t// load active travel plans\n\tvar activeTravelPlans = getActiveTravelPlans();\n\t$(\"#active-travel-plans-list\").empty();\n\tif (activeTravelPlans.length == 0) addNoDataCard(\"#active-travel-plans-list\");\n\tactiveTravelPlans.forEach((plan) => {\n\t\tloadTravelPlan(\"#active-travel-plans-list\", plan);\n\t});\n\t// load upcoming travel plans\n\tvar upcomingTravelPlans = getUpcomingTravelPlans();\n\t$(\"#upcoming-travel-plans-list\").empty();\n\tif (upcomingTravelPlans.length == 0)\n\t\taddNoDataCard(\"#upcoming-travel-plans-list\");\n\tupcomingTravelPlans.forEach((plan) => {\n\t\tloadTravelPlan(\"#upcoming-travel-plans-list\", plan);\n\t});\n\t// load past travel plans\n\tvar pastTravelPlans = getPastTravelPlans();\n\t$(\"#past-travel-plans-list\").empty();\n\tif (pastTravelPlans.length == 0) addNoDataCard(\"#past-travel-plans-list\");\n\tpastTravelPlans.forEach((plan) => {\n\t\tloadTravelPlan(\"#past-travel-plans-list\", plan);\n\t});\n\t// load the travel plan section\n\tloadPageSection(\"#travel-plans-page\");\n}", "start () {\n return testPF(this.m, this.p0, this.q, this.r)\n }", "function theEnd(err) {\n if (err) {\n closed = 1;\n return closed ? null : reply(boom.badRequest(err));\n }\n setTimeout(function() {\n queue(1)\n .defer(function(cb) {\n var query = 'ALTER TABLE temp_' + tableName + ' ADD COLUMN time INT DEFAULT 0;';\n client.query(query, cb);\n })\n .defer(function(cb) {\n var ramdom = (data.preserve === \"true\");\n var order = ' ORDER BY RANDOM();';\n if (ramdom) order = ';';\n var query = 'CREATE TABLE ' + tableName + ' as SELECT * FROM temp_' + tableName + order;\n client.query(query, cb);\n })\n .defer(function(cb) {\n var query = 'CREATE INDEX CONCURRENTLY ON ' + tableName + ' (time);';\n client.query(query, cb);\n })\n .defer(function(cb) {\n if (new_task) {\n var query = 'CREATE TABLE ' + table_stats + ' (time INT, attributes HSTORE);';\n client.query(query, cb);\n } else {\n cb();\n }\n })\n .defer(function(cb) {\n if (new_task) {\n var query = 'CREATE INDEX CONCURRENTLY ON ' + table_stats + ' (time);';\n client.query(query, cb);\n } else {\n cb();\n }\n }).defer(function(cb) {\n var query = queries.create_type();\n client.query(query, cb);\n }).defer(function(cb) {\n var query = queries.create_function(tableName, taskid);\n client.query(query, cb);\n })\n .defer(function(cb) {\n var query = 'DROP TABLE temp_' + tableName + ';';\n client.query(query, cb);\n })\n .defer(function(cb) { //Lets avoid create tables out off this file\n var query = queries.create_task_details();\n client.query(query, cb);\n })\n .defer(function(cb) {\n if (new_task) {\n var details = [];\n details.push(taskid);\n details.push(data.name);\n details.push(data.source);\n details.push(tableName);\n details.push(data.description);\n details.push(Math.round(+new Date() / 1000));\n details.push(false); //status =false, for a new task\n details.push(data.changeset_comment);\n var query = 'INSERT INTO task_details VALUES($1, $2, $3, $4, $5, $6, $7,$8);';\n client.query(query, details, cb);\n } else {\n var details = [];\n details.push(data.source);\n details.push(tableName);\n details.push(data.description);\n details.push(data.changeset_comment);\n details.push(false); //status =false, change to avalible task\n details.push(data.id); // modifed id task\n var query = 'UPDATE task_details SET source=$1, tasktable=$2, description=$3, changeset_comment=$4, status=$5 WHERE id=$6;';\n client.query(query, details, cb);\n }\n })\n .awaitAll(function(err, results) {\n if (err) return reply(boom.badRequest(err));\n callback({\n \"status\": true,\n taskid: taskid\n });\n });\n }, 500);\n }", "function main() {\n\n /*\n * Example template callback\n *\n * callback = function(message) {\n * if (message) console.log(message);\n * }\n *\n */\n\n /*\n * Example usage of connect and disconnect\n *\n * connect().then(callback, callback);\n * disconnect().then(callback, callback);\n */\n\n /*\n * Example usage of User routines\n *\n * addUser(\"user1\", \"token1\").then(callback, callback);\n * getUser(\"token1\").then(callback, callback);\n */\n\n /*\n * Example usage of TopTrack routines\n *\n * features = {[ACOUSTICNESS]: 0.3, [DANCEABILITY]: 0.5, \n * [ENERGY]: 0.8, [TEMPO]: 113.4, [VALENCE]: 0.8};\n * addTopTrack(\"user1\", \"uri1\", features).then(callback, callback);\n */\n\n /*\n * Example usage of Playlist routines\n *\n * addPlaylist(\"user1\", \"uri2\").then(disconnectCB, disconnectCB);\n * getPlaylistId(\"uri1\").then(disconnectCB, disconnectCB);\n * getUserPlaylists(\"user1\").then(disconnectCB, disconnectCB);\n * getPlaylistUri(\"15\").then(disconnectCB, disconnectCB);\n */\n\n}", "Program(p) {\n gen(p.statements)\n }", "prepare() {\n }", "function createCarePlanTasks(groups, cb) {\n attDS.automigrate('CarePlanTask', function(err) {\n if (err) return cb(err);\n let CarePlanTask = app.models.CarePlanTask;\n CarePlanTask.create([{\n sequence: 1.1,\n key: 101,\n description: 'Total assist with bathing',\n enabled: true,\n carePlanGroupId: groups[0].id\n }, {\n sequence: 1.2,\n key: 102,\n description: 'Assist with bathing',\n enabled: true,\n carePlanGroupId: groups[0].id\n }, {\n sequence: 1.3,\n key: 103,\n description: 'Partial assist with bathing',\n enabled: false,\n carePlanGroupId: groups[0].id\n }, {\n sequence: 1.4,\n key: 104,\n description: 'Standby assist with bathing',\n enabled: false,\n carePlanGroupId: groups[0].id\n }, {\n sequence: 1.5,\n key: 105,\n description: 'Independent with bathing',\n enabled: false,\n carePlanGroupId: groups[0].id\n }, {\n sequence: 2.1,\n key: 121,\n description: 'Total assist with upper dressing',\n enabled: true,\n carePlanGroupId: groups[1].id\n }, {\n sequence: 2.2,\n key: 122,\n description: 'Assist with upper dressing',\n enabled: true,\n carePlanGroupId: groups[1].id\n }, {\n sequence: 3.2,\n key: 132,\n description: 'Assist with lower dressing',\n enabled: true,\n carePlanGroupId: groups[2].id\n }, {\n sequence: 3.3,\n key: 133,\n description: 'Partial assist with lower dressing',\n enabled: true,\n carePlanGroupId: groups[2].id\n }, {\n sequence: 4.3,\n key: 143,\n description: 'Use wheelchair and help maneuver',\n enabled: true,\n carePlanGroupId: groups[3].id\n }, {\n sequence: 4.4,\n key: 144,\n description: 'Perform pressure release',\n enabled: true,\n carePlanGroupId: groups[3].id\n }, {\n sequence: 1.1,\n key: 101,\n description: 'Total assist with bathing',\n enabled: false,\n carePlanGroupId: groups[4].id\n }, {\n sequence: 1.2,\n key: 102,\n description: 'Assist with bathing',\n enabled: true,\n carePlanGroupId: groups[4].id\n }, {\n sequence: 1.3,\n key: 103,\n description: 'Partial assist with bathing',\n enabled: true,\n carePlanGroupId: groups[4].id\n }, {\n sequence: 2.1,\n key: 121,\n description: 'Total assist with upper dressing',\n enabled: true,\n carePlanGroupId: groups[1].id\n }, {\n sequence: 2.2,\n key: 122,\n description: 'Assist with upper dressing',\n enabled: true,\n carePlanGroupId: groups[5].id\n }, {\n sequence: 2.3,\n key: 123,\n description: 'Partial assist with upper dressing',\n enabled: true,\n carePlanGroupId: groups[5].id\n }, {\n sequence: 3.3,\n key: 133,\n description: 'Partial assist with lower dressing',\n enabled: true,\n carePlanGroupId: groups[6].id\n }, {\n sequence: 3.4,\n key: 134,\n description: 'Standby assist with lower dressing',\n enabled: true,\n carePlanGroupId: groups[6].id\n }, {\n sequence: 4.2,\n key: 142,\n description: 'Use wheelchair and independent',\n enabled: true,\n carePlanGroupId: groups[7].id\n }, {\n sequence: 4.3,\n key: 143,\n description: 'Use wheelchair and help maneuver',\n enabled: true,\n carePlanGroupId: groups[7].id\n }, {\n sequence: 1.1,\n key: 101,\n description: 'Total assist with bathing',\n enabled: false,\n carePlanGroupId: groups[8].id\n }, {\n sequence: 1.2,\n key: 102,\n description: 'Assist with bathing',\n enabled: false,\n carePlanGroupId: groups[8].id\n }, {\n sequence: 1.3,\n key: 103,\n description: 'Partial assist with bathing',\n enabled: false,\n carePlanGroupId: groups[8].id\n }, {\n sequence: 1.4,\n key: 104,\n description: 'Standby assist with bathing',\n enabled: true,\n carePlanGroupId: groups[8].id\n }, {\n sequence: 1.5,\n key: 105,\n description: 'Independent with bathing',\n enabled: true,\n carePlanGroupId: groups[8].id\n }, {\n sequence: 2.3,\n key: 123,\n description: 'Partial assist with upper dressing',\n enabled: true,\n carePlanGroupId: groups[9].id\n }, {\n sequence: 2.4,\n key: 124,\n description: 'Standby assist with upper dressing',\n enabled: true,\n carePlanGroupId: groups[9].id\n }, {\n sequence: 2.5,\n key: 125,\n description: 'Independent with upper dressing',\n enabled: true,\n carePlanGroupId: groups[9].id\n }, {\n sequence: 3.4,\n key: 134,\n description: 'Standby assist with lower dressing',\n enabled: true,\n carePlanGroupId: groups[10].id\n }, {\n sequence: 3.5,\n key: 135,\n description: 'Independent with lower dressing',\n enabled: true,\n carePlanGroupId: groups[10].id\n }, {\n sequence: 4.1,\n key: 141,\n description: 'Independent in walking',\n enabled: true,\n carePlanGroupId: groups[11].id\n }, {\n sequence: 4.4,\n key: 144,\n description: 'Perform pressure release',\n enabled: true,\n carePlanGroupId: groups[11].id\n }], cb);\n });\n }", "run () {\n }", "function PerformanceTestCase() {\n}", "function runArrange(token) {\n try {\n token.testObj.arrange.exec();\n token.result.arrange = token.testObj.arrange.runtime;\n\n runAct(token);\n }\n catch(ex) {\n handlerError(token, ex);\n }\n }", "function run() {}", "function main() {\n console.log(oPieces)\n //let sRandomPlan = fRandomPiece('plans');\n //let sResult = '';\n\n // if plan calls plan it should draw without replacement to prevent infinite loop\n //console.log(sRandomPlan)\n}", "swapPlans() {\n\t\tlog.debug('Swapping plans..');\n\t\tconst now = new Date();\n\t\tconst tomorrow = this.main.plans.tomorrow;\n\n\t\tthis.main.plans.today = null;\n\n\t\tif (tomorrow && now.getDay() === tomorrow.date.toDate().getDay()) {\n\t\t\tthis.main.plans.today = tomorrow;\n\t\t\tthis.backupPlan(this.main.plans.today.raw, 'today');\n\t\t\tthis.main.plans.tomorrow = null;\n\t\t}\n\t}", "function generateReport(options, successCallback) {\n Database.getFullPlan(options.plan, function success(plan) {\n // Initialise data objects\n var resultsMatrix = {};\n var calc = {total: 0, pass: 0, fail: 0, pending: 0};\n Database.getAllWhere(\"results\", \"plan\", options.plan, function(results) {\n // Organise results so they can be accessed by page and criterion ID\n results.forEach(function(result) {\n resultsMatrix[result.page] = resultsMatrix[result.page] || {};\n resultsMatrix[result.page][result.criterion] = result;\n });\n // Generate the report and pass it back as a string\n successCallback(\"<h1>Web Accessibility Report (\" + plan.details.name + \")</h1>\" +\n \"<h4>Generated: \" + Date() + \"</h4>\" +\n \"<hr>\" +\n // Go through each pages group\n plan.pages.map(function(pages_group) {\n return \"<h2>Web page group: \" + pages_group.name + \"</h2>\" +\n \"<ul>\" +\n (pages_group.items.length ?\n // List all pages in this group\n pages_group.items.map(function(page) {\n return \"<li>\" + page.title + \" (\" + page.url + \")</li>\";\n }).join(\"\") +\n \"</ul>\" +\n // Go through each criteria group\n plan.criteria.map(function(criteria_group) {\n return \"<h3>Criteria set: \" + criteria_group.name + \"</h3>\" +\n \"<ul>\" +\n (criteria_group.items.length ?\n // Go through each criterion in this group\n criteria_group.items.map(function(criterion) {\n return \"<li>\" +\n // Include criterion details (where they exist and are requested in the options)\n \"<h4>\" + criterion.name + \"</h4>\" +\n \"<p>\" + criterion.description.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\\n/g, \"<br>\") + \"</p>\" +\n (options.criteria_details ?\n \"<h5>Why is it important?</h5>\" +\n \"<p>\" + criterion.reasoning.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\\n/g, \"<br>\") + \"</p>\" +\n \"<h5>Guidance</h5>\" +\n \"<p>\" + criterion.guidance.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\\n/g, \"<br>\") + \"</p>\" +\n \"<h5>Documentation</h5>\" +\n \"<p>\" + criterion.links.map(function(link) { return \"<a href='\" + link + \"' target='_blank'>\" + link + \"</a>\"; }).join(\"<br>\") + \"</p>\"\n : \"\") +\n \"<h4>Results</h4>\" +\n // Work out result totals for all pages in this group\n pages_group.items.map(function(page, index) {\n if (index == 0) calc.total = calc.pass = calc.fail = calc.pending = 0;\n var result = (resultsMatrix[page.id] && resultsMatrix[page.id][criterion.id]) || {status: \"pending\"};\n if (options.statuses.indexOf(result.status) != -1) {\n calc.total++;\n calc[result.status]++;\n }\n return \"\";\n }).join(\"\") +\n // Calculate percentages from result totals (for status requested in the options)\n options.statuses.map(function(status) {\n return status.charAt(0).toUpperCase() + status.slice(1) + \": \" + calc[status] + \"/\" + calc.total + \" (\" + (calc.total > 0 ? (Math.round(calc[status] / calc.total * 100) + \"%\") : \"n/a\") + \")<br>\";\n }).join(\"\") +\n (options.level == \"individual\" ?\n // Include information about each individual test on each page (if requested in the options)\n \"<br><ul>\" +\n pages_group.items.map(function(page) {\n var result = (resultsMatrix[page.id] && resultsMatrix[page.id][criterion.id]) || {status: \"pending\"};\n // Only include this test result is it has one of the statuses requested\n return (options.statuses.indexOf(result.status) != -1) ?\n \"<li>\" +\n page.title + \" (\" + page.url + \") - \" + result.status +\n (options.results_annotations && result.annotation ?\n \"<p>\" + result.annotation.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\\n/g, \"<br>\") + \"</p>\"\n : \"\") +\n (options.results_images && result.image ?\n \"<p><img src='\" + result.image + \"'></p>\"\n : \"\") +\n \"</li>\"\n : \"\";\n }).join(\"\") +\n \"</ul>\"\n : \"\") +\n \"</li>\";\n }).join(\"\")\n : \"<li><em>No criteria</em></li>\") +\n \"</ul>\" +\n \"\";\n }).join(\"\") +\n (options.tables ?\n // Create a table overview of tests on all the pages in this group\n \"<table border='1' cellspacing='2' cellpadding='2'>\" +\n \"<tr>\" +\n \"<th></th>\" +\n // List all pages on the x-axis\n pages_group.items.map(function(page) {\n return \"<th>\" + page.title + \"</th>\";\n }).join(\"\") +\n \"</tr>\" +\n plan.criteria.map(function(criteria_group) {\n // Include criteria group names\n return \"<tr><td><strong>\" + criteria_group.name + \"</strong></td></tr>\" +\n (criteria_group.items.length ?\n // Go through each criterion in the group\n criteria_group.items.map(function(criterion) {\n return \"<tr>\" +\n \"<td>\" + criterion.name + \"</td>\" +\n pages_group.items.map(function(page) {\n var result = (resultsMatrix[page.id] && resultsMatrix[page.id][criterion.id]) || {status: \"pending\"};\n return \"<td>\" +\n (options.statuses.indexOf(result.status) != -1 ?\n // Include tick icon for passing results\n (result.status == \"pass\" ? \"<img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMZJREFUOE/FjjEKwkAQRWezdiFJZ29toWfwEoJ6Bw/hRYR4Jru0whYO2AU06B+Z1Y1F1gTEB0N2d/77hP5CwYWV0Ws/REw4KWV6l+ScW8OmJKa7DEr2uoqTcdaSMTfLdqPrbiCKfPiQ17omco2T0FivLczZWAgtGb/+lqumEnmHhcNM9flJVBZU9oFXyVeygIItlk0QdHib4RuXPRCWCNWBcA3O3bIHJQuEL4Ho5ZVG4iA8h3QaJHsgTSAfB8melNORHn8N0QMwhI66An4NAgAAAABJRU5ErkJggg=='> \" : \"\") +\n // Include cross icon for failing results\n (result.status == \"fail\" ? \"<img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAKpJREFUOE+lU0EKgCAQ3CD7pPSK+kDQrd7qJehgkO2sJFHqoR0YCHdmWlclIBwHubYdXNctm7WNLGaAGjTQwiMI3kcz0ckMzph1n+dPCNZQEw20CGEvzGMy30TINKUQfD/MNxEyErf0LkSyYev7BsyYI9lLVYExizBfkx/UWiyTtc8tCl5DKhPmzJAFckyllkGu1Y5ZF6DagmqI6mNUXyT1VVY/JuD/cya6APHAd2wGj7MPAAAAAElFTkSuQmCC'> \" : \"\") +\n result.status.charAt(0).toUpperCase() + result.status.slice(1)\n : \"\") +\n \"</td>\";\n }).join(\"\") +\n \"</tr>\";\n }).join(\"\")\n : \"<tr><td colspan='\" + (pages_group.items.length + 1) + \"'><em>No criteria</em></td></tr>\")\n }).join(\"\") +\n \"</table>\"\n : \"\")\n : \"<li><em>No pages</em></li></ul>\");\n }).join(\"\") +\n \"\" +\n \"\");\n });\n });\n}", "get plans() {\r\n return new Plans(this);\r\n }", "function calculatePlan() {\n // Check if user left the minutes blank\n if (minutes) {\n // Find fee value to origin from destiny\n const getFee = values.find(value => value.origem === origin && value.destino === destiny);\n\n if (getFee) {\n\n // Calculate value with and without plan\n let withoutPlan = minutes * getFee.valor;\n let withPlan = ((minutes - plan) * getFee.valor) * 1.10;\n\n // Conditional to not show negatives values \n if (withPlan < 0) {\n withPlan = 0;\n }\n\n // Save values with and without plan\n setWithPlan(withPlan.toFixed(2));\n setWithoutPlan(withoutPlan.toFixed(2));\n setCalculateState(true); // Show results\n } else {\n //Error\n setAlertError(true);\n setCalculateState(false);\n }\n } else {\n setMinutesBlank(true);\n }\n }", "runTournament() {\n\n }", "function clear(){\n vm.plan.clear();\n\n }", "function calculatePlan()\n\t{\n\t\t// set data to object\n\t\tvar data = {\n\t\t\torigin: $('#origin').val(),\n\t\t\tdestiny: $('#destiny').val(),\n\t\t\tminutes: $('#minutes').val(),\n\t\t\tplan: $('#plan').val()\n\t\t}\n\n\t\t// Valid data\n\t\tif (data.origin == \"\" || data.destiny == \"\" || data.minutes == \"\" || data.plan == \"\")\n\t\t\treturn;\n\n\t\t// Send Request \n\t\t$.ajax({\n\t\t url: \"api/plan/calculate\",\n\t\t type: \"POST\",\n\t\t data: data,\n\t\t}).done(function(response) {\n\t\t\t// Init variables\n\t\t\tvar with_plan = \"Chamada não inclusa no Plano\";\n\t\t\tvar without_plan = \"-\";\n\n\t\t\t// Valid response\n\t\t\tif (typeof response.price !== 'undefined') {\n\t\t\t\twithout_plan = \"R$ \" + response.price;\n\t\t\t} else {\n\t\t\t\twith_plan = \"R$ \" + response.with_plan;\n\t\t\t\twithout_plan = \"R$ \" + response.without_plan;\n\t\t\t}\n\n\t\t\t// Set data in view\n\t\t\t$('.plan-result').text(with_plan);\n\t\t\t$('.without-plan-result').text(without_plan);\n\t\t});\n\t}", "function planProc (plan) {\n console.log (plan)\n // const scrollFoot = document.body.clientHeight - window.pageYOffset\n // window.scrollBy(0, scrollFoot)\n document.body.scrollIntoView(false)\n let textInput = document.querySelector('#text-input')\n if (plan === 0) textInput.value = 'Hello, I want to join an one hour class'\n else if (plan === 1) textInput.value = 'Hello, I want to join your courses on the month base'\n else textInput.value = 'Hello, I want to join your courses on the year base'\n}", "function test_candu_graphs_datastore_vsphere6() {}", "execute_program(){\n\t// execution loop\n\twhile(!this.step()){}\n}", "async function setUp() {\n await showCatFilter();\n await showAreaFilter();\n show($home);\n // drawMealPlanTable();\n // generateMealPlanFormOptions();\n }", "function createPlan(planObject) {\r\n var $planBox = $('<div class = \"plan-box\"></div>');\r\n var $heading = $('<h2 class = \"plan-heading\"></h2>');\r\n var $pricing = $('<h1 class = \"pricing\"></h1>');\r\n var $storage = $('<p class = \"plan-info\"></p>');\r\n var $maximumUsers = $('<p class = \"plan-info\"></p>');\r\n var $transfer = $('<p class = \"plan-info\"></p>');\r\n var $learnButton = $('<button id = \"learn-button\"></button>');\r\n\r\n $planBox.appendTo('#plans');\r\n $heading\r\n .text(planObject.plan)\r\n .appendTo($planBox);\r\n $(\"#pricing-checkbox\").change(function() {\r\n if(this.checked){\r\n $pricing.text(planObject.annualPrice);\r\n } else{\r\n $pricing.text(planObject.monthlyPrice);\r\n }\r\n })\r\n $pricing\r\n .text(planObject.monthlyPrice)\r\n .appendTo($planBox);\r\n $storage\r\n .text(planObject.storage + ' Storage')\r\n .appendTo($planBox);\r\n $maximumUsers\r\n .text(planObject.users + ' Users Allowed')\r\n .appendTo($planBox);\r\n $transfer\r\n .text('Send up to ' + planObject.transferSpeed + ' GB')\r\n .appendTo($planBox);\r\n $learnButton\r\n .text('Learn More')\r\n .appendTo($planBox);\r\n }", "get plans() {\r\n return new Plans(this, \"planner/plans\");\r\n }", "function plant() {\n \n}", "static beforeTask(taskKey, anyScanner) {\n if (taskKey.indexOf('Animes_') == 0) {\n let mode = taskKey.substring('Animes_'.length);\n if (mode == 'New') {\n return Promise.all([\n anyScanner.provider.getApproxMaxAnimeId({}),\n anyScanner.redis.getAsync(\"mal.maxGrabbedAnimeId\")\n ]).then(([approxMaxAnimeId, maxGrabbedAnimeId]) => {\n maxGrabbedAnimeId = maxGrabbedAnimeId ? parseInt(maxGrabbedAnimeId) : 0;\n approxMaxAnimeId = Math.max(maxGrabbedAnimeId, approxMaxAnimeId);\n let totalIdsCnt = (approxMaxAnimeId - maxGrabbedAnimeId);\n /*let listOfIds = (Array.from({length: approxMaxAnimeId}, \n (v, k) => maxGrabbedAnimeId + 1 + k));*/\n return {\n maxGrabbedAnimeId,\n approxMaxAnimeId,\n totalIdsCnt,\n };\n });\n } else {\n let cond = '1=1';\n\n return Promise.all([\n //totalIdsCnt\n anyScanner.db.one(\"\\\n select count(*) as cnt \\\n from malrec_items \\\n where \" + cond + \"\\\n \").then((row) => row.cnt),\n //listOfIds\n anyScanner.db.manyOrNone(\"\\\n select id \\\n from malrec_items \\\n where \" + cond + \"\\\n order by id asc \\\n \", {\n }).then((rows) => {\n return !rows ? [] : (rows.map((row) => parseInt(row.id)));\n }),\n ]).then(([totalIdsCnt, listOfIds]) => {\n return {\n totalIdsCnt,\n listOfIds\n };\n });\n }\n } else if (taskKey.indexOf('AnimesUserrecs_') == 0) {\n let mode = taskKey.substring('AnimesUserrecs_'.length);\n let cond = '1=1';\n if (mode == 'New')\n cond = \"recs_check_ts is null\";\n\n return Promise.all([\n //totalIdsCnt\n anyScanner.db.one(\"\\\n select count(*) as cnt \\\n from malrec_items \\\n where \" + cond + \"\\\n \").then((row) => row.cnt),\n //listOfIds\n anyScanner.db.manyOrNone(\"\\\n select id \\\n from malrec_items \\\n where \" + cond + \"\\\n order by id asc \\\n \", {\n }).then((rows) => {\n return !rows ? [] : (rows.map((row) => parseInt(row.id)));\n }),\n ]).then(([totalIdsCnt, listOfIds]) => {\n return {\n totalIdsCnt,\n listOfIds\n };\n });\n } else if (taskKey.indexOf('UserLogins_') == 0) {\n let mode = taskKey.substring('UserLogins_'.length);\n return anyScanner.redis.getAsync(\"mal.maxGrabbedUserId\").then((maxGrabbedUserId) => {\n maxGrabbedUserId = parseInt(maxGrabbedUserId);\n let totalIdsCnt, approxMaxId;\n if (maxGrabbedUserId == 0) {\n //first grab\n approxMaxId = anyScanner.options.scanner.approxBiggestUserId;\n totalIdsCnt = (approxMaxId - maxGrabbedUserId);\n } else {\n //not first grab\n approxMaxId = maxGrabbedUserId;\n totalIdsCnt = 0; //unknown max\n }\n return {\n approxMaxId,\n maxGrabbedUserId,\n totalIdsCnt,\n };\n });\n } else if (taskKey.indexOf('SpUserLogins_') == 0) {\n let mode = taskKey.substring('SpUserLogins_'.length);\n if (mode == 'Lost') {\n //find \"holes\"-ids\n return Promise.all([\n anyScanner.redis.getAsync(\"mal.maxGrabbedUserId\"),\n anyScanner.db.manyOrNone(\"\\\n select id \\\n from malrec_users \\\n where 1=1 \\\n order by id asc \\\n \", {\n }).then((rows) => {\n return (!rows ? [] : rows);\n }),\n ]).then(([maxGrabbedUserId, alreadyRows]) => {\n maxGrabbedUserId = parseInt(maxGrabbedUserId);\n assert(maxGrabbedUserId > 0);\n let alreadyIds = {};\n for (let row of alreadyRows)\n alreadyIds[row.id] = 1;\n let listOfIds = [];\n for (let id = 1 ; id < maxGrabbedUserId ; id++) {\n if (!alreadyIds[id])\n listOfIds.push(id);\n }\n let totalIdsCnt = listOfIds.length;\n return {\n listOfIds,\n totalIdsCnt,\n };\n });\n } else if (mode == 'Re') {\n //find ids in \"mal.recheckUserIds\"\n return anyScanner.redis.smembersAsync(\"mal.recheckUserIds\").then((userIds) => {\n let listOfIds = !userIds ? [] : userIds.map(Number);\n let totalIdsCnt = listOfIds.length;\n return {\n listOfIds,\n totalIdsCnt,\n };\n });\n }\n } else if (taskKey == 'UserProfiles_Re') {\n //find logins in \"mal.recheckUserLogins\"\n return anyScanner.redis.smembersAsync(\"mal.recheckUserLogins\").then((userLogins) => {\n let listOfData = !userLogins ? [] : userLogins;\n let listOfIds = Array.from({length: listOfData.length}, (v, k) => 0 + k);\n let totalIdsCnt = listOfIds.length;\n return {\n listOfIds,\n totalIdsCnt,\n listOfData\n };\n });\n } else if (taskKey.indexOf('UserProfiles_') == 0) {\n let mode = taskKey.substring('UserProfiles_'.length);\n let cond = '1=1';\n if (mode == 'New')\n cond = \"reg_date is null\";\n\n return Promise.all([\n //totalIdsCnt\n anyScanner.db.one(\"\\\n select count(*) as cnt \\\n from malrec_users \\\n where \" + cond + \"\\\n \").then((row) => row.cnt),\n //listOfIds\n anyScanner.db.manyOrNone(\"\\\n select id \\\n from malrec_users \" + cond + \"\\\n where \" + cond + \"\\\n order by id asc \\\n \", {\n }).then((rows) => {\n return !rows ? [] : (rows.map((row) => row.id));\n }),\n ]).then(([totalIdsCnt, listOfIds]) => {\n return {\n totalIdsCnt,\n listOfIds\n };\n });\n } else if (taskKey.indexOf('UserListsUpdated_') == 0) {\n let mode = taskKey.substring('UserListsUpdated_'.length);\n let cond = \"1=1\";\n if (mode == 'WithList')\n cond = \"list_update_ts is not null\";\n else if (mode == 'WithoutList')\n cond = \"list_update_ts is null\";\n else if (mode == 'Active')\n cond = \"list_update_ts > ('now'::timestamp - '1 year'::interval)\";\n else if (mode == 'NonActive')\n cond = \"list_update_ts < ('now'::timestamp - '1 year'::interval)\";\n\n return Promise.all([\n //totalIdsCnt\n anyScanner.db.one(\"\\\n select count(*) as cnt \\\n from malrec_users \\\n where need_to_check_list = false \\\n and \"+ cond +\" \\\n \").then((row) => row.cnt),\n //listOfIds\n anyScanner.db.manyOrNone(\"\\\n select id \\\n from malrec_users \\\n where need_to_check_list = false and \"+ cond +\" \\\n order by id asc \\\n \", {\n }).then((rows) => {\n let ids = !rows ? [] : rows.map((row) => parseInt(row.id));\n return ids;\n }),\n ]).then(([totalIdsCnt, listOfIds]) => {\n return {\n totalIdsCnt,\n listOfIds\n };\n });\n } else if (taskKey.indexOf('UserLists_') == 0) {\n let mode = taskKey.substring('UserLists_'.length);\n let cond = '1=1';\n if (mode == 'New')\n cond = \"list_check_ts is null\";\n else if (mode == 'Updated')\n cond = \"need_to_check_list = true\";\n\n return Promise.all([\n //totalIdsCnt\n anyScanner.db.one(\"\\\n select count(*) as cnt \\\n from malrec_users \\\n where \"+ cond +\"\\\n \").then((row) => row.cnt),\n //listOfIds\n anyScanner.db.manyOrNone(\"\\\n select id \\\n from malrec_users \\\n where \"+ cond +\"\\\n order by id asc \\\n \", {\n }).then((rows) => {\n let ids = !rows ? [] : rows.map((row) => parseInt(row.id));\n return ids;\n }),\n ]).then(([totalIdsCnt, listOfIds]) => {\n return {\n totalIdsCnt,\n listOfIds\n };\n });\n } else if (taskKey == 'test1') {\n let totalIdsCnt = 15000;\n let listOfIds = Array.from({length: 15000}, (v, k) => 1 + k);\n return Promise.resolve({\n totalIdsCnt,\n listOfIds,\n });\n } else {\n return Promise.resolve();\n }\n }", "function performCommand() {\n var PlanningGenerator = require('../lib/PlanningGenerator');\n\n var generator = new PlanningGenerator();\n var json = utils.createJsonObject(program.json, program);\n\n var connectionProperties = { user: program.user, password: program.password, groupId: json.groupId };\n\n generator.generate(json, connectionProperties);\n}", "function test_utilization_utilization_graphs() {}", "constructor(plan){\n\t\tthis.width = plan[0].length;\n\t\tthis.height = plan.length;\n\t\tthis.grid = [];\n\t\tthis.actors = [];\n\t\tfor (var y = 0; y < this.height; y++) {\n\t\t\tvar line = plan[y], gridLine = [];\n\t\t\tfor (var x = 0; x < this.width; x++) {\n\t\t\t\tvar ch = line[x], fieldType = null;\n\t\t\t\tvar Actor = this.actorChars[ch];\n\t\t\t\tif (Actor)\n\t\t\t\t\tthis.actors.push(new Actor(new Vector(x, y), ch));\t//for moving objects\n\t\t\t\telse if (ch == \"#\")\t\t\t//static objects will push to array\n\t\t\t\t\tfieldType = \"wall\";\n\t\t\t\telse if (ch == \"!\")\n\t\t\t\t\tfieldType = \"lava\";\n\t\t\t\tgridLine.push(fieldType);\n\t\t\t}\n\t\t\tthis.grid.push(gridLine);\n\t\t}\n\t\tthis.player = this.actors.filter(function(actor) {return actor.type == \"player\";})[0]; //player pos \n\t\tthis.status = this.finishDelay = null;\n\t\tthis.maxStep = 0.05; \n\t}", "function goToPlan(plan) {\n window.location.href = `/viewPlan/${plan.planId}`;\n }", "function test_candu_graphs_vm_compare_host_vsphere65() {}", "approve(result) { }", "function run() {\n\n }", "function main(){\n def('A', new Point(-1, 1));\n def('B', reflection_point(get('A')); // b (1, -1)\n\n def('P', new Point());\n\n def('k_AP', get_slope_from_points(get('A'), get('P')));\n def('k_BP', get_slope_from_points(get('B'), get('P')));\n\n equal(multi(get('k_AP'), get('k_BP')), -1/3); // x_p^2 + 3 y_p^2 == 4\n\n purpose()\n\n get_curve_from_point(get('P'))\n\n solve();\n}", "function convertPlan(planStr) {\n return planStr.trim().replace(/\\+/g, \"!\").replace(/\\./g, \" \").split('\\n');\n }", "function handleSelectPlan(each) {\n setSelectedPlan({ activePlan: each.id, activePlanName: each.header });\n }", "static createInstance(owner, planNumber, issueDateTime, activeDateTime, expiryDateTime, subscriberCount, totalAwards, trainerSessions, numClasses, gymAccess, poolAccess) {\n return new GymPlan({owner, planNumber, issueDateTime, activeDateTime, expiryDateTime, subscriberCount, totalAwards, trainerSessions, numClasses, gymAccess, poolAccess });\n }", "function makerun(generator,mode, factor,repeat) {\n var tasks = [ {\n cmd : \"state\",\n data : {\n generator : generator, \n mode : mode,\n factor : factor\n }\n } ];\n angular.forEach($rootScope.results.data().queries,\n function(v, index) {\n for (var i = 0; i < repeat; i++) {\n tasks.push({\n cmd : \"run\",\n data : index\n });\n };\n });\n return tasks;\n }", "plan () {\n return CapacityPlans.findOne(this.planId)\n }", "async findAllTaskPlanner(parent, args, { db }) {\n try {\n if (db.payload.result.role === \"admin\") {\n return await db.task.findAll();\n } else if (db.payload.result.role === \"planner\") {\n let data = await db.task.findAll({\n include: [\n {\n model: db.project,\n where: { created_by: db.payload.result.id },\n },\n {\n model: db.note,\n },\n ],\n });\n return data;\n } else {\n throw new Error(\"you are not allowed\");\n }\n } catch (error) {\n throw new Error(error);\n }\n }", "getCurrentPlan(subPlans, masterPlan) {\n // if there are no subplans then we obvs need to create one and post it to the database\n if(subPlans.length === 0) {\n this.postNewPlan(masterPlan.id, masterPlan.algorithm, (subPlans.length+1), this.state.data);\n } else {\n let totalFinished = 0;\n subPlans.map(plan => {\n if(plan.completed === true) totalFinished++;\n });\n // if the number of completed SubPlans is equal to the total number of SubPlans, then a new plan needs to be posted\n // determined by checking if that index is in the subPlans array\n if(subPlans[totalFinished] === undefined) {\n this.postNewPlan(masterPlan.id, masterPlan.algorithm, (subPlans.length+1), this.state.data);\n } else {\n this.setState({\n currentPlan: subPlans[totalFinished]\n });\n }\n }\n }", "function test_countTransitiveClosurePossibilities2() {\n\tit('Test functions in CountTransitiveClosurePossibilities class', () => {\n\n\t\tallLegalLinePlacementsExpectedAnswer = [\n\t\t\t[2, 3, 4, 5],\n\t\t\t[4, 5],\n\t\t\t[1, 2, 3],\n\t\t\t[2, 3, 4],\n\t\t\t[0, 1, 2, 3],\n\t\t\t[0, 1]\n\t\t];\n\n\t\tlet graphClosure = new app._test.GraphClosure(6);\n\t\tlet transitiveClosureMatrix = graphClosure.transitiveClosure(mediumMatrix);\n\t\tlet countTransitiveClosurePossibilities = new app._test.CountTransitiveClosurePossibilities(transitiveClosureMatrix);\n\n\t\tlet allLegalLinePlacements = countTransitiveClosurePossibilities.legalLinePlacements;\n\t\tlet emptyArray = new Array(6);\n\t\tfor (let i = 0; i < emptyArray.length; i++) {\n\t\t\temptyArray[i] = -1;\n\t\t}\n\t\tlet expectedAnswer = [\n\t\t\t[5, 2, 0, 4, 3, 1],\n\t\t\t[4, 5, 0, 2, 3, 1],\n\t\t\t[5, 4, 0, 2, 3, 1],\n\t\t\t[5, 2, 4, 0, 3, 1],\n\t\t\t[4, 5, 2, 0, 3, 1],\n\t\t\t[5, 4, 2, 0, 3, 1],\n\t\t\t[5, 2, 3, 4, 0, 1],\n\t\t\t[5, 2, 4, 3, 0, 1],\n\t\t\t[4, 5, 2, 3, 0, 1],\n\t\t\t[5, 4, 2, 3, 0, 1],\n\t\t\t[4, 5, 3, 2, 0, 1],\n\t\t\t[5, 4, 3, 2, 0, 1],\n\t\t\t[5, 2, 3, 4, 1, 0],\n\t\t\t[5, 2, 4, 3, 1, 0],\n\t\t\t[4, 5, 2, 3, 1, 0],\n\t\t\t[5, 4, 2, 3, 1, 0],\n\t\t\t[4, 5, 3, 2, 1, 0],\n\t\t\t[5, 4, 3, 2, 1, 0]\n\t\t];\n\n\t\tassert.equal(allLegalLinePlacements.length, 6);\n\t\tassert.equal(allLegalLinePlacements.toString(), allLegalLinePlacementsExpectedAnswer.toString());\n\t\tassert.equal(expectedAnswer.toString(), countTransitiveClosurePossibilities.getAllAnswers().toString());\n\t});\n}", "function runTests(t, optimizely)\n{\n // prepare env\n optimizely.setOptimizely(optimizelyCode);\n\n // planning tests\n t.plan(7);\n\n // check that test line doesn't exists in teh original html\n t.equal(originalHtml.indexOf('Experiment: Text Change'), -1);\n\n // run the thing\n optimizely(req, originalHtml, function(err, html, extra)\n {\n t.equal(err, null);\n // check updated content\n t.inequal(html.indexOf('Experiment: Text Change'), -1);\n\n // check extras\n t.inequal(extra.images, null);\n t.equal(extra.images.length, 2);\n\n t.inequal(extra.cookies, null);\n t.inequal(extra.cookies.getCookieHeader().length, 0);\n });\n\n}", "function getGameweekPlan(teamMap, teamInfo){\n // console.log('teamMap: ', teamMap);\n // console.log('teamInfo: ', teamInfo);\n\n var plan = {};\n\n var players = Object.values(teamMap);\n players.sort((a,b) => {\n return b.next_gw_expected_points - a.next_gw_expected_points;\n });\n\n // console.log('players: ', players);\n\n plan.captian = players[0];\n plan.viceCaptian = players[1];\n\n if(teamInfo.chips.find((chip) => chip.name === '3xc' && chip.status_for_entry === 'available')){\n plan.activateTripleCaptian =\n plan.captian.next_gw_expected_points >= 12\n ? 'Play Triple Captian'\n : plan.captian.next_gw_expected_points >= 8\n ? 'Maybe Play'\n : 'Stay away this week';\n }\n plan.bench = getBench(players);\n\n // console.log('plan: ' , plan.bench);\n\n if(teamInfo.chips.find((chip) => chip.name === 'bboost' && chip.status_for_entry === 'available')){\n var benchPoints =\n plan.bench.goalkeeper.next_gw_expected_points +\n plan.bench.outfield[0].next_gw_expected_points +\n plan.bench.outfield[1].next_gw_expected_points +\n plan.bench.outfield[2].next_gw_expected_points;\n\n plan.activateBenchBoost =\n benchPoints >= 25\n ? 'Play Bench Boost'\n : plan.captian.next_gw_expected_points >= 25\n ? 'Maybe Play'\n : 'Stay away this week';\n }\n return plan;\n}", "async createTaskPlanningItem(data, user) {\r\n const dbUser = await UserService.getUser(user.id);\r\n await perform(validate.userExists(dbUser))\r\n const planningDate = new Date(data.date);\r\n const calls = data.flows.map((flow) => {\r\n return this.createFlowTasks(flow, planningDate, data.user.toString(), dbUser);\r\n });\r\n await Promise.all(calls);\r\n return taskDAL.createTaskPlanningItem(data, dbUser);\r\n }", "async store(plans) {\n var errors = {};\n\n if (plans.import != undefined) plans.import = true;\n else plans.import = false;\n\n var isValid = await this.validate(plans, errors);\n\n if (isValid)\n try {\n await this.Plan.create(plans);\n\n return true;\n } catch (err) {\n errors.system_msg = \"Não foi possivel salvar o plano!\";\n\n return errors;\n }\n else return errors;\n }", "function buildRateTable() {\n\n // catch plan info & controls\n var scope = pf.planScope(), // HSA > state-rates > rate-tier > ...\n plan1 = PFGetValue('GapPlan1'),\n plan2 = PFGetValue('GapPlan2'),\n plan3 = PFGetValue('GapPlan3'),\n\n plansSelected = pf.listPlansSelected(), // store plan id's here ('1', '2', '6', '14', ect)\n planNames = []; // store plan names\n\n \n var planOptions = { // (expression) ? true : false\n 'hsaList1' : (plan1 !== '') ? (\n planNames.push(PFGetValue('GapPlan1Name'))\n ) : false,\n 'hsaList2' : (plan2 !== '') ? (\n planNames.push(PFGetValue('GapPlan2Name'))\n ) : false,\n 'hsaList3' : (plan3 !== '') ? (\n planNames.push(PFGetValue('GapPlan3Name'))\n ) : false\n };\n\n // function to point to rates\n function rate(index){\n // scope > (look into the plansSelected array with the index passed from the loop)\n // retrieve the plan number\n // '16' > 'payrollFrequency' > 'monthly' > \n // defined in the loop = ( [0], [1], or [2] ) > ( [0], [1], [2], or [3] )\n return scope[plansSelected[index]]['payrollFrequency'][pf.payrollFrequency]; \n }\n\n // start xml build\n var premiumsXATStart = '<!--ATModel:PF_Area_Template_Box-->';\n premiumsXATStart += '<!--size:1905815,1095477-->';\n premiumsXATStart += '<?Pageflex pf_xat_ver=\"1\"?>';\n premiumsXATStart += '<PF_VBox_Base border_simple_thickness=\"0\" border_name=\"_none\" h_align_contents=\"center\" v_align_contents=\"center\" display_order=\"0\" height=\"shrinkwrap\" width=\"1905815\" y_position=\"0\" x_position=\"0\">';\n \n var premiumsXATBody = []; \n \n var premiumsXATEnd = '</PF_VBox_Base>';\n \n var i = 0,\n premiumPlanTable = '';\n\n if (pf.rateTier === '4T') { // build 4-tier table\n \n for (i; i < pf.plansSelected(); i++) {\n //vertical box start\n premiumPlanTable = '<PF_VBox_Base name=\"GapHSARates4Tier\" x_position=\"126338\" y_position=\"1472002\" width=\"shrinkwrap\" height=\"shrinkwrap\" display_order=\"11\" v_align_contents=\"top\" h_align_contents=\"left\" border_name=\"_none\" border_simple_thickness=\"0\" top_margin=\"31750\">';\n // table group header row\n premiumPlanTable += '<PF_HBox_Base x_position=\"126338\" y_position=\"2112110\" width=\"shrinkwrap\" height=\"shrinkwrap\" display_order=\"10\" v_align_contents=\"top\" h_align_contents=\"left\" border_name=\"_none\" border_simple_thickness=\"0\" min_height=\"25400\">'; \n premiumPlanTable += '<PF_TextFrame_Base bottom_margin=\"12700\" top_margin=\"12700\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"White\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"shrinkwrap\" width=\"444500\" display_order=\"10\" y_position=\"2112110\" x_position=\"126338\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"393700\" min_width=\"0\">';\n premiumPlanTable += '<table_cell_leftHeading>';\n premiumPlanTable += '<_char>' + planNames[i] + '</_char>';\n premiumPlanTable += '</table_cell_leftHeading>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base bottom_margin=\"12700\" top_margin=\"12700\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"White\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"shrinkwrap\" width=\"1461315\" display_order=\"11\" y_position=\"2112110\" x_position=\"570838\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"1410515\" min_width=\"0\">';\n premiumPlanTable += '<table_before_label>';\n premiumPlanTable += '<_char>Employee Premiums</_char>';\n premiumPlanTable += '</table_before_label>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '</PF_HBox_Base>';\n // table header row\n premiumPlanTable += '<PF_HBox_Base x_position=\"126338\" y_position=\"2172780\" width=\"shrinkwrap\" height=\"shrinkwrap\" display_order=\"6\" v_align_contents=\"center\" h_align_contents=\"center\" border_name=\"_none\" border_simple_thickness=\"0\">';\n premiumPlanTable += '<PF_TextFrame_Base bottom_margin=\"17780\" top_margin=\"17780\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"Kemper_Orange\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"maximize\" width=\"444500\" display_order=\"6\" y_position=\"2057517\" x_position=\"126338\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"393700\" min_width=\"0\">';\n premiumPlanTable += '<table_header>';\n premiumPlanTable += '<_char></_char>';\n premiumPlanTable += '</table_header>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base bottom_margin=\"17780\" top_margin=\"17780\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"Kemper_Orange\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"maximize\" width=\"282755\" display_order=\"7\" y_position=\"2057517\" x_position=\"570838\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"231955\" min_width=\"0\">';\n premiumPlanTable += '<table_header>';\n premiumPlanTable += '<_char>Employee</_char>';\n premiumPlanTable += '</table_header>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base x_position=\"853593\" y_position=\"2057517\" display_order=\"8\" width=\"386080\" height=\"maximize\" runaround=\"false\" fill_name=\"_solid_fill\" fill_color=\"Kemper_Orange\" left_margin=\"25400\" right_margin=\"25400\" top_margin=\"17780\" bottom_margin=\"17780\">';\n premiumPlanTable += '<_text_column min_width=\"0\" max_width=\"335280\" v_align_contents=\"center\" runaround=\"false\">';\n premiumPlanTable += '<table_header>';\n premiumPlanTable += '<_char>Employee + Spouse</_char>';\n premiumPlanTable += '</table_header>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base bottom_margin=\"17780\" top_margin=\"17780\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"Kemper_Orange\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"maximize\" width=\"396240\" display_order=\"9\" y_position=\"2057517\" x_position=\"1239673\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"345440\" min_width=\"0\">';\n premiumPlanTable += '<table_header>';\n premiumPlanTable += '<_char>Employee + Children</_char>';\n premiumPlanTable += '</table_header>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base bottom_margin=\"17780\" top_margin=\"17780\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"Kemper_Orange\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"maximize\" width=\"396240\" display_order=\"10\" y_position=\"2057517\" x_position=\"1635913\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"345440\" min_width=\"0\">';\n premiumPlanTable += '<table_header>';\n premiumPlanTable += '<_char>Employee + Family</_char>';\n premiumPlanTable += '</table_header>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '</PF_HBox_Base>';\n // age less than 40 \n premiumPlanTable += '<PF_HBox_Base x_position=\"126338\" y_position=\"2254060\" width=\"shrinkwrap\" height=\"shrinkwrap\" display_order=\"7\" v_align_contents=\"center\" h_align_contents=\"center\" border_name=\"_none\" border_simple_thickness=\"0\">';\n premiumPlanTable += '<PF_TextFrame_Base fill_tint=\"20.000000\" bottom_margin=\"17780\" top_margin=\"17780\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"Kemper_Orange\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"maximize\" width=\"444500\" display_order=\"6\" y_position=\"2057517\" x_position=\"126338\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"393700\" min_width=\"0\">';\n premiumPlanTable += '<table_cell_leftHeading>';\n premiumPlanTable += '<_char>Age less than 40</_char>';\n premiumPlanTable += '</table_cell_leftHeading>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base fill_tint=\"20.000000\" bottom_margin=\"17780\" top_margin=\"17780\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"Kemper_Orange\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"maximize\" width=\"282755\" display_order=\"7\" y_position=\"2057517\" x_position=\"570838\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"231955\" min_width=\"0\">';\n premiumPlanTable += '<table_cell>';\n premiumPlanTable += '<_char>$' + rate(i)[0][0] + ' </_char>'; // iterate on i+1 to get the corresponding plan selection (plan 1, plan 2 or plan 3)\n premiumPlanTable += '</table_cell>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base fill_tint=\"20.000000\" x_position=\"853593\" y_position=\"2057517\" display_order=\"8\" width=\"386080\" height=\"maximize\" runaround=\"false\" fill_name=\"_solid_fill\" fill_color=\"Kemper_Orange\" left_margin=\"25400\" right_margin=\"25400\" top_margin=\"17780\" bottom_margin=\"17780\">';\n premiumPlanTable += '<_text_column min_width=\"0\" max_width=\"335280\" v_align_contents=\"center\" runaround=\"false\">';\n premiumPlanTable += '<table_cell>';\n premiumPlanTable += '<_char>$' + rate(i)[0][1] + '</_char>';\n premiumPlanTable += '</table_cell>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base fill_tint=\"20.000000\" bottom_margin=\"17780\" top_margin=\"17780\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"Kemper_Orange\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"maximize\" width=\"396240\" display_order=\"9\" y_position=\"2057517\" x_position=\"1239673\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"345440\" min_width=\"0\">';\n premiumPlanTable += '<table_cell>';\n premiumPlanTable += '<_char>$' + rate(i)[0][2] + '</_char>';\n premiumPlanTable += '</table_cell>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base fill_tint=\"20.000000\" bottom_margin=\"17780\" top_margin=\"17780\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"Kemper_Orange\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"maximize\" width=\"396240\" display_order=\"10\" y_position=\"2057517\" x_position=\"1635913\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"345440\" min_width=\"0\">';\n premiumPlanTable += '<table_cell>';\n premiumPlanTable += '<_char>$' + rate(i)[0][3] + '</_char>';\n premiumPlanTable += '</table_cell>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '</PF_HBox_Base>';\n // age less than 40-49\n premiumPlanTable += '<PF_HBox_Base x_position=\"126338\" y_position=\"2335340\" width=\"shrinkwrap\" height=\"shrinkwrap\" display_order=\"8\" v_align_contents=\"center\" h_align_contents=\"center\" border_name=\"_none\" border_simple_thickness=\"0\">';\n premiumPlanTable += '<PF_TextFrame_Base fill_tint=\"100.000000\" bottom_margin=\"17780\" top_margin=\"17780\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"White\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"maximize\" width=\"444500\" display_order=\"6\" y_position=\"2057517\" x_position=\"126338\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"393700\" min_width=\"0\">';\n premiumPlanTable += '<table_cell_leftHeading>';\n premiumPlanTable += '<_char>Age 40-49</_char>';\n premiumPlanTable += '</table_cell_leftHeading>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base fill_tint=\"100.000000\" bottom_margin=\"17780\" top_margin=\"17780\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"White\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"maximize\" width=\"282755\" display_order=\"7\" y_position=\"2057517\" x_position=\"570838\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"231955\" min_width=\"0\">';\n premiumPlanTable += '<table_cell>';\n premiumPlanTable += '<_char>$' + rate(i)[1][0] + '</_char>';\n premiumPlanTable += '</table_cell>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base fill_tint=\"100.000000\" x_position=\"853593\" y_position=\"2057517\" display_order=\"8\" width=\"386080\" height=\"maximize\" runaround=\"false\" fill_name=\"_solid_fill\" fill_color=\"White\" left_margin=\"25400\" right_margin=\"25400\" top_margin=\"17780\" bottom_margin=\"17780\">';\n premiumPlanTable += '<_text_column min_width=\"0\" max_width=\"335280\" v_align_contents=\"center\" runaround=\"false\">';\n premiumPlanTable += '<table_cell>';\n premiumPlanTable += '<_char>$' + rate(i)[1][1] + '</_char>';\n premiumPlanTable += '</table_cell>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base fill_tint=\"100.000000\" bottom_margin=\"17780\" top_margin=\"17780\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"White\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"maximize\" width=\"396240\" display_order=\"9\" y_position=\"2057517\" x_position=\"1239673\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"345440\" min_width=\"0\">';\n premiumPlanTable += '<table_cell>';\n premiumPlanTable += '<_char>$' + rate(i)[1][2] + '</_char>';\n premiumPlanTable += '</table_cell>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base fill_tint=\"100.000000\" bottom_margin=\"17780\" top_margin=\"17780\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"White\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"maximize\" width=\"396240\" display_order=\"10\" y_position=\"2057517\" x_position=\"1635913\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"345440\" min_width=\"0\">';\n premiumPlanTable += '<table_cell>';\n premiumPlanTable += '<_char>$' + rate(i)[1][3] + '</_char>';\n premiumPlanTable += '</table_cell>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '</PF_HBox_Base>';\n // age less than 50+\n premiumPlanTable += '<PF_HBox_Base x_position=\"126338\" y_position=\"2416620\" width=\"shrinkwrap\" height=\"shrinkwrap\" display_order=\"9\" v_align_contents=\"center\" h_align_contents=\"center\" border_name=\"_none\" border_simple_thickness=\"0\">';\n premiumPlanTable += '<PF_TextFrame_Base fill_tint=\"20.000000\" bottom_margin=\"17780\" top_margin=\"17780\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"Kemper_Orange\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"maximize\" width=\"444500\" display_order=\"6\" y_position=\"2057517\" x_position=\"126338\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"393700\" min_width=\"0\">';\n premiumPlanTable += '<table_cell_leftHeading>';\n premiumPlanTable += '<_char>Age 50+</_char>';\n premiumPlanTable += '</table_cell_leftHeading>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base fill_tint=\"20.000000\" bottom_margin=\"17780\" top_margin=\"17780\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"Kemper_Orange\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"maximize\" width=\"282755\" display_order=\"7\" y_position=\"2057517\" x_position=\"570838\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"231955\" min_width=\"0\">';\n premiumPlanTable += '<table_cell>';\n premiumPlanTable += '<_char>$' + rate(i)[2][0] + '</_char>';\n premiumPlanTable += '</table_cell>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base fill_tint=\"20.000000\" x_position=\"853593\" y_position=\"2057517\" display_order=\"8\" width=\"386080\" height=\"maximize\" runaround=\"false\" fill_name=\"_solid_fill\" fill_color=\"Kemper_Orange\" left_margin=\"25400\" right_margin=\"25400\" top_margin=\"17780\" bottom_margin=\"17780\">';\n premiumPlanTable += '<_text_column min_width=\"0\" max_width=\"335280\" v_align_contents=\"center\" runaround=\"false\">';\n premiumPlanTable += '<table_cell>';\n premiumPlanTable += '<_char>$' + rate(i)[2][1] + '</_char>';\n premiumPlanTable += '</table_cell>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base fill_tint=\"20.000000\" bottom_margin=\"17780\" top_margin=\"17780\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"Kemper_Orange\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"maximize\" width=\"396240\" display_order=\"9\" y_position=\"2057517\" x_position=\"1239673\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"345440\" min_width=\"0\">';\n premiumPlanTable += '<table_cell>';\n premiumPlanTable += '<_char>$' + rate(i)[2][2] + '</_char>';\n premiumPlanTable += '</table_cell>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base fill_tint=\"20.000000\" bottom_margin=\"17780\" top_margin=\"17780\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"Kemper_Orange\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"maximize\" width=\"396240\" display_order=\"10\" y_position=\"2057517\" x_position=\"1635913\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"345440\" min_width=\"0\">';\n premiumPlanTable += '<table_cell>';\n premiumPlanTable += '<_char>$' + rate(i)[2][3] + '</_char>';\n premiumPlanTable += '</table_cell>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '</PF_HBox_Base>';\n // vertical box end\n premiumPlanTable += '</PF_VBox_Base>';\n\n // push xml to premiumsXATBody array \n premiumsXATBody.push(premiumPlanTable);\n }\n\n } else { // build 3-tier table\n\n for (i; i < pf.plansSelected(); i++) {\n // table group header row\n premiumPlanTable = '<PF_VBox_Base border_simple_thickness=\"0\" border_name=\"_none\" h_align_contents=\"left\" v_align_contents=\"top\" display_order=\"0\" height=\"shrinkwrap\" width=\"shrinkwrap\" y_position=\"0\" x_position=\"0\" name=\"GapHSARates3Tier\" top_margin=\"31750\">';\n premiumPlanTable += '<PF_HBox_Base min_height=\"25400\" border_simple_thickness=\"0\" border_name=\"_none\" h_align_contents=\"left\" v_align_contents=\"top\" display_order=\"10\" height=\"shrinkwrap\" width=\"shrinkwrap\" y_position=\"2112110\" x_position=\"126338\">';\n premiumPlanTable += '<PF_TextFrame_Base x_position=\"126338\" y_position=\"2112110\" display_order=\"10\" width=\"444500\" height=\"shrinkwrap\" runaround=\"false\" fill_name=\"_solid_fill\" fill_color=\"White\" left_margin=\"25400\" right_margin=\"25400\" top_margin=\"12700\" bottom_margin=\"12700\">';\n premiumPlanTable += '<_text_column min_width=\"0\" max_width=\"393700\" v_align_contents=\"center\" runaround=\"false\">';\n premiumPlanTable += '<table_cell_leftHeading>';\n premiumPlanTable += '<_char>' + planNames[i] + '</_char>';\n premiumPlanTable += '</table_cell_leftHeading>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base x_position=\"570838\" y_position=\"2112110\" display_order=\"11\" width=\"1461315\" height=\"shrinkwrap\" runaround=\"false\" fill_name=\"_solid_fill\" fill_color=\"White\" left_margin=\"25400\" right_margin=\"25400\" top_margin=\"12700\" bottom_margin=\"12700\">';\n premiumPlanTable += '<_text_column min_width=\"0\" max_width=\"1410515\" v_align_contents=\"center\" runaround=\"false\">';\n premiumPlanTable += '<table_before_label>';\n premiumPlanTable += '<_char>Employee Premiums</_char>';\n premiumPlanTable += '</table_before_label>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '</PF_HBox_Base>';\n // table header row\n premiumPlanTable += '<PF_HBox_Base border_simple_thickness=\"0\" border_name=\"_none\" h_align_contents=\"center\" v_align_contents=\"center\" display_order=\"6\" height=\"shrinkwrap\" width=\"shrinkwrap\" y_position=\"2172780\" x_position=\"126338\">';\n premiumPlanTable += '<PF_TextFrame_Base x_position=\"126338\" y_position=\"2057517\" display_order=\"6\" width=\"444500\" height=\"maximize\" runaround=\"false\" fill_name=\"_solid_fill\" fill_color=\"Kemper_Orange\" left_margin=\"25400\" right_margin=\"25400\" top_margin=\"17780\" bottom_margin=\"17780\">';\n premiumPlanTable += '<_text_column min_width=\"0\" max_width=\"393700\" v_align_contents=\"center\" runaround=\"false\">';\n premiumPlanTable += '<table_header>';\n premiumPlanTable += '<_char></_char>';\n premiumPlanTable += '</table_header>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base x_position=\"570838\" y_position=\"2057517\" display_order=\"7\" width=\"484124\" height=\"maximize\" runaround=\"false\" fill_name=\"_solid_fill\" fill_color=\"Kemper_Orange\" left_margin=\"25400\" right_margin=\"25400\" top_margin=\"17780\" bottom_margin=\"17780\">';\n premiumPlanTable += '<_text_column min_width=\"0\" max_width=\"433324\" v_align_contents=\"center\" runaround=\"false\">';\n premiumPlanTable += '<table_header>';\n premiumPlanTable += '<_char>Employee</_char>';\n premiumPlanTable += '</table_header>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base bottom_margin=\"17780\" top_margin=\"17780\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"Kemper_Orange\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"maximize\" width=\"484124\" display_order=\"8\" y_position=\"2057517\" x_position=\"853593\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"433324\" min_width=\"0\">';\n premiumPlanTable += '<table_header>';\n premiumPlanTable += '<_char>Employee +1</_char>';\n premiumPlanTable += '</table_header>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base x_position=\"1239673\" y_position=\"2057517\" display_order=\"9\" width=\"484124\" height=\"maximize\" runaround=\"false\" fill_name=\"_solid_fill\" fill_color=\"Kemper_Orange\" left_margin=\"25400\" right_margin=\"25400\" top_margin=\"17780\" bottom_margin=\"17780\">';\n premiumPlanTable += '<_text_column min_width=\"0\" max_width=\"433324\" v_align_contents=\"center\" runaround=\"false\">';\n premiumPlanTable += '<table_header>';\n premiumPlanTable += '<_char>Employee +2 +</_char>';\n premiumPlanTable += '</table_header>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '</PF_HBox_Base>';\n // age under 40\n premiumPlanTable += '<PF_HBox_Base border_simple_thickness=\"0\" border_name=\"_none\" h_align_contents=\"center\" v_align_contents=\"center\" display_order=\"7\" height=\"shrinkwrap\" width=\"shrinkwrap\" y_position=\"2254060\" x_position=\"126338\">';\n premiumPlanTable += '<PF_TextFrame_Base x_position=\"126338\" y_position=\"2057517\" display_order=\"6\" width=\"444500\" height=\"maximize\" runaround=\"false\" fill_name=\"_solid_fill\" fill_color=\"Kemper_Orange\" left_margin=\"25400\" right_margin=\"25400\" top_margin=\"17780\" bottom_margin=\"17780\" fill_tint=\"20.000000\">';\n premiumPlanTable += '<_text_column min_width=\"0\" max_width=\"393700\" v_align_contents=\"center\" runaround=\"false\">';\n premiumPlanTable += '<table_cell_leftHeading>';\n premiumPlanTable += '<_char>Age less than 40</_char>';\n premiumPlanTable += '</table_cell_leftHeading>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base x_position=\"570838\" y_position=\"2057517\" display_order=\"7\" width=\"484124\" height=\"maximize\" runaround=\"false\" fill_name=\"_solid_fill\" fill_color=\"Kemper_Orange\" left_margin=\"25400\" right_margin=\"25400\" top_margin=\"17780\" bottom_margin=\"17780\" fill_tint=\"20.000000\">';\n premiumPlanTable += '<_text_column min_width=\"0\" max_width=\"433324\" v_align_contents=\"center\" runaround=\"false\">';\n premiumPlanTable += '<table_cell>';\n premiumPlanTable += '<_char>$' + rate(i)[0][0] + '</_char>';\n premiumPlanTable += '</table_cell>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base bottom_margin=\"17780\" top_margin=\"17780\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"Kemper_Orange\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"maximize\" width=\"484124\" display_order=\"8\" y_position=\"2057517\" x_position=\"853593\" fill_tint=\"20.000000\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"433324\" min_width=\"0\">';\n premiumPlanTable += '<table_cell>';\n premiumPlanTable += '<_char>$' + rate(i)[0][1] + '</_char>';\n premiumPlanTable += '</table_cell>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base x_position=\"1239673\" y_position=\"2057517\" display_order=\"9\" width=\"484124\" height=\"maximize\" runaround=\"false\" fill_name=\"_solid_fill\" fill_color=\"Kemper_Orange\" left_margin=\"25400\" right_margin=\"25400\" top_margin=\"17780\" bottom_margin=\"17780\" fill_tint=\"20.000000\">';\n premiumPlanTable += '<_text_column min_width=\"0\" max_width=\"433324\" v_align_contents=\"center\" runaround=\"false\">';\n premiumPlanTable += '<table_cell>';\n premiumPlanTable += '<_char>$' + rate(i)[0][2] + '</_char>';\n premiumPlanTable += '</table_cell>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '</PF_HBox_Base>';\n // age 40-49\n premiumPlanTable += '<PF_HBox_Base border_simple_thickness=\"0\" border_name=\"_none\" h_align_contents=\"center\" v_align_contents=\"center\" display_order=\"8\" height=\"shrinkwrap\" width=\"shrinkwrap\" y_position=\"2335340\" x_position=\"126338\">';\n premiumPlanTable += '<PF_TextFrame_Base x_position=\"126338\" y_position=\"2057517\" display_order=\"6\" width=\"444500\" height=\"maximize\" runaround=\"false\" fill_name=\"_solid_fill\" fill_color=\"White\" left_margin=\"25400\" right_margin=\"25400\" top_margin=\"17780\" bottom_margin=\"17780\" fill_tint=\"100.000000\">';\n premiumPlanTable += '<_text_column min_width=\"0\" max_width=\"393700\" v_align_contents=\"center\" runaround=\"false\">';\n premiumPlanTable += '<table_cell_leftHeading>';\n premiumPlanTable += '<_char>Age 40-49</_char>';\n premiumPlanTable += '</table_cell_leftHeading>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base x_position=\"570838\" y_position=\"2057517\" display_order=\"7\" width=\"484124\" height=\"maximize\" runaround=\"false\" fill_name=\"_solid_fill\" fill_color=\"White\" left_margin=\"25400\" right_margin=\"25400\" top_margin=\"17780\" bottom_margin=\"17780\" fill_tint=\"100.000000\">';\n premiumPlanTable += '<_text_column min_width=\"0\" max_width=\"433324\" v_align_contents=\"center\" runaround=\"false\">';\n premiumPlanTable += '<table_cell>';\n premiumPlanTable += '<_char>$' + rate(i)[1][0] + '</_char>';\n premiumPlanTable += '</table_cell>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base bottom_margin=\"17780\" top_margin=\"17780\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"White\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"maximize\" width=\"484124\" display_order=\"8\" y_position=\"2057517\" x_position=\"853593\" fill_tint=\"100.000000\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"433324\" min_width=\"0\">';\n premiumPlanTable += '<table_cell>';\n premiumPlanTable += '<_char>$' + rate(i)[1][1] + '</_char>';\n premiumPlanTable += '</table_cell>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base x_position=\"1239673\" y_position=\"2057517\" display_order=\"9\" width=\"484124\" height=\"maximize\" runaround=\"false\" fill_name=\"_solid_fill\" fill_color=\"White\" left_margin=\"25400\" right_margin=\"25400\" top_margin=\"17780\" bottom_margin=\"17780\" fill_tint=\"100.000000\">';\n premiumPlanTable += '<_text_column min_width=\"0\" max_width=\"433324\" v_align_contents=\"center\" runaround=\"false\">';\n premiumPlanTable += '<table_cell>';\n premiumPlanTable += '<_char>$' + rate(i)[1][2] + '</_char>';\n premiumPlanTable += '</table_cell>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '</PF_HBox_Base>';\n // age 50+\n premiumPlanTable += '<PF_HBox_Base border_simple_thickness=\"0\" border_name=\"_none\" h_align_contents=\"center\" v_align_contents=\"center\" display_order=\"9\" height=\"shrinkwrap\" width=\"shrinkwrap\" y_position=\"2416620\" x_position=\"126338\">';\n premiumPlanTable += '<PF_TextFrame_Base x_position=\"126338\" y_position=\"2057517\" display_order=\"6\" width=\"444500\" height=\"maximize\" runaround=\"false\" fill_name=\"_solid_fill\" fill_color=\"Kemper_Orange\" left_margin=\"25400\" right_margin=\"25400\" top_margin=\"17780\" bottom_margin=\"17780\" fill_tint=\"20.000000\">';\n premiumPlanTable += '<_text_column min_width=\"0\" max_width=\"393700\" v_align_contents=\"center\" runaround=\"false\">';\n premiumPlanTable += '<table_cell_leftHeading>';\n premiumPlanTable += '<_char>Age 50+</_char>';\n premiumPlanTable += '</table_cell_leftHeading>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base x_position=\"570838\" y_position=\"2057517\" display_order=\"7\" width=\"484124\" height=\"maximize\" runaround=\"false\" fill_name=\"_solid_fill\" fill_color=\"Kemper_Orange\" left_margin=\"25400\" right_margin=\"25400\" top_margin=\"17780\" bottom_margin=\"17780\" fill_tint=\"20.000000\">';\n premiumPlanTable += '<_text_column min_width=\"0\" max_width=\"433324\" v_align_contents=\"center\" runaround=\"false\">';\n premiumPlanTable += '<table_cell>';\n premiumPlanTable += '<_char>$' + rate(i)[2][0] + '</_char>';\n premiumPlanTable += '</table_cell>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base bottom_margin=\"17780\" top_margin=\"17780\" right_margin=\"25400\" left_margin=\"25400\" fill_color=\"Kemper_Orange\" fill_name=\"_solid_fill\" runaround=\"false\" height=\"maximize\" width=\"484124\" display_order=\"8\" y_position=\"2057517\" x_position=\"853593\" fill_tint=\"20.000000\">';\n premiumPlanTable += '<_text_column runaround=\"false\" v_align_contents=\"center\" max_width=\"433324\" min_width=\"0\">';\n premiumPlanTable += '<table_cell>';\n premiumPlanTable += '<_char>$' + rate(i)[2][1] + '</_char>';\n premiumPlanTable += '</table_cell>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '<PF_TextFrame_Base x_position=\"1239673\" y_position=\"2057517\" display_order=\"9\" width=\"484124\" height=\"maximize\" runaround=\"false\" fill_name=\"_solid_fill\" fill_color=\"Kemper_Orange\" left_margin=\"25400\" right_margin=\"25400\" top_margin=\"17780\" bottom_margin=\"17780\" fill_tint=\"20.000000\">';\n premiumPlanTable += '<_text_column min_width=\"0\" max_width=\"433324\" v_align_contents=\"center\" runaround=\"false\">';\n premiumPlanTable += '<table_cell>';\n premiumPlanTable += '<_char>$' + rate(i)[2][2] + '</_char>';\n premiumPlanTable += '</table_cell>';\n premiumPlanTable += '</_text_column>';\n premiumPlanTable += '</PF_TextFrame_Base>';\n premiumPlanTable += '</PF_HBox_Base>';\n // vert box end\n premiumPlanTable += '</PF_VBox_Base>';\n\n // push xml to premiumsXATBody array \n premiumsXATBody.push(premiumPlanTable);\n }\n }\n\n return premiumsXATStart + premiumsXATBody.join('') + premiumsXATEnd;\n //return xat_array.join('');\n}", "function ts_psr_treatment()\n\n{\n\n//Opens INRstar\n open_application(\"INRstar\");\n\n//Test cases to be run within the Test Suite\n\n//parameters ()\n tc_add_historic\n \n//Closes INRstar\n close_application();\n\n}", "run_build_all(type, option1){\n message('Reconstruction de tout…', {keep:false})\n this.run_build_sequencier(true)\n .then(this.run_build_cover.bind(this, null, true))\n .then(this.run_build_quatrieme.bind(this, null, true))\n .then(this.run_build_statistiques.bind(this, null, true))\n .then(this.run_build_traitement.bind(this, null, true))\n .then(this.run_build_sequencier.bind(this, null, true))\n .then(this.run_build_synopsis.bind(this, null, true))\n .then(this.run_build_pfa.bind(this, true))\n .then(this.run_build_books.bind(this, type, option1, true))\n}", "function run() {\n\tvar shipping = new Shipping();\n\tvar credentials = {token: 'dijfowje'};\n\tvar adapter = new ShippingAdapter(credentials);\n\n\t//Old shipping object and interface\n\tvar cost = shipping.request('12345', '11373', '2 lbs');\n\n\t//New shipping object with adapated interface\n\tcost = adapter.request('12345', '11373', '2 lbs');\n}", "function planTrip(sLine, sStop, eLine, eStop){\r\n\r\n // Getting the selected start line\r\n var line = getLine(sLine);\r\n // Printing the output of the line and stops\r\n console.log(`You must travel through the following stops on the ${sLine} line: ${fromTo(line, sStop, communStop)}`)\r\n\r\n // Changing the line if it's not the same line for the whole trip\r\n if(sLine !== eLine)\r\n console.log(`Change at Union Square from the ${sLine} line to the ${eLine} line.`);\r\n\r\n // Getting the selected end line\r\n line = getLine(eLine);\r\n // Printing the output of the line and stops\r\n console.log(`Your journey continues through the following stops: ${fromTo(line, communStop, eStop)}`)\r\n\r\n // Printing the total number of stops\r\n console.log(`${stopCounter} stops in total.`)\r\n\r\n // Reseting stop counter\r\n stopCounter = 0;\r\n}", "function submitFormCaller() {\n plan.submitForm();\n}" ]
[ "0.6775683", "0.6596631", "0.6396235", "0.62408274", "0.5932487", "0.5850713", "0.5849055", "0.5830911", "0.57806814", "0.5780187", "0.5769255", "0.5763793", "0.57437354", "0.56904185", "0.56315607", "0.56311274", "0.561285", "0.55772996", "0.555105", "0.5523135", "0.5500208", "0.5470563", "0.5464147", "0.54588467", "0.545478", "0.53828037", "0.5324089", "0.53154397", "0.5296438", "0.5284546", "0.526762", "0.5254026", "0.5253562", "0.5231982", "0.5215927", "0.52132714", "0.52132714", "0.51924664", "0.5174906", "0.51643336", "0.5156573", "0.5153552", "0.5137887", "0.5130027", "0.51042175", "0.50910413", "0.5090151", "0.5058689", "0.5050417", "0.5042784", "0.5039154", "0.50359654", "0.5014302", "0.5003941", "0.49899346", "0.4978143", "0.49722278", "0.49622536", "0.49614862", "0.49613577", "0.49564633", "0.4954762", "0.49392942", "0.49369365", "0.492822", "0.4924341", "0.49221256", "0.49185863", "0.4914647", "0.49097323", "0.489862", "0.4874285", "0.48740005", "0.48708254", "0.4870253", "0.4868607", "0.48685285", "0.4858927", "0.4848882", "0.4848127", "0.48334444", "0.48270553", "0.48210424", "0.48192558", "0.4813425", "0.48103952", "0.48089388", "0.48033732", "0.47924036", "0.47919366", "0.4787255", "0.47768876", "0.47764257", "0.47736552", "0.4768672", "0.47649494", "0.47597355", "0.4750919", "0.4744476", "0.47391206", "0.47389325" ]
0.0
-1
Split into static segments separated by path parameter placeholders. The number of segments is always 1 more than the number of parameters.
function matchDetails(m, isSearch) { var id, regexp, segment, type, cfg, arrayMode; id = m[2] || m[3]; // IE[78] returns '' for unmatched groups instead of null cfg = config.params[id]; segment = pattern.substring(last, m.index); regexp = isSearch ? m[4] : m[4] || (m[1] == '*' ? '.*' : null); type = $$UMFP.type(regexp || "string") || inherit($$UMFP.type("string"), { pattern: new RegExp(regexp, config.caseInsensitive ? 'i' : undefined) }); return { id: id, regexp: regexp, segment: segment, type: type, cfg: cfg }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $$route$recognizer$$StaticSegment(string) { this.string = string; }", "function $$route$recognizer$$StaticSegment(string) { this.string = string; }", "function $$route$recognizer$$StaticSegment(string) { this.string = string; }", "function $$route$recognizer$$StaticSegment(string) { this.string = string; }", "generatePathsParams(paths, params = {}) {\n const newPaths = [];\n\n for (const paramName in params) {\n const paramValues = params[paramName];\n paths.forEach(pagePath => {\n const regexp = new RegExp(`/:${paramName}[?+*]?`);\n if (regexp.exec(pagePath)) {\n for (const value of paramValues) {\n const finalPath = pagePath.replace(regexp, `/${value}`);\n if (finalPath !== '') newPaths.push(finalPath);\n }\n } else {\n newPaths.push(pagePath);\n }\n });\n }\n\n return newPaths;\n }", "function prepareParameters(segs) {\n for (var i = 0; i < segs.length; i++)\n if (segs[i][0] === '_')\n segs[i] = ':' + segs[i].substring(1);\n return segs;\n}", "function tokensToParser(segments, extraOptions) {\r\n const options = vue_router_esm_bundler_assign({}, BASE_PATH_PARSER_OPTIONS, extraOptions);\r\n // the amount of scores is the same as the length of segments except for the root segment \"/\"\r\n const score = [];\r\n // the regexp as a string\r\n let pattern = options.start ? '^' : '';\r\n // extracted keys\r\n const keys = [];\r\n for (const segment of segments) {\r\n // the root segment needs special treatment\r\n const segmentScores = segment.length ? [] : [90 /* Root */];\r\n // allow trailing slash\r\n if (options.strict && !segment.length)\r\n pattern += '/';\r\n for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {\r\n const token = segment[tokenIndex];\r\n // resets the score if we are inside a sub segment /:a-other-:b\r\n let subSegmentScore = 40 /* Segment */ +\r\n (options.sensitive ? 0.25 /* BonusCaseSensitive */ : 0);\r\n if (token.type === 0 /* Static */) {\r\n // prepend the slash if we are starting a new segment\r\n if (!tokenIndex)\r\n pattern += '/';\r\n pattern += token.value.replace(REGEX_CHARS_RE, '\\\\$&');\r\n subSegmentScore += 40 /* Static */;\r\n }\r\n else if (token.type === 1 /* Param */) {\r\n const { value, repeatable, optional, regexp } = token;\r\n keys.push({\r\n name: value,\r\n repeatable,\r\n optional,\r\n });\r\n const re = regexp ? regexp : BASE_PARAM_PATTERN;\r\n // the user provided a custom regexp /:id(\\\\d+)\r\n if (re !== BASE_PARAM_PATTERN) {\r\n subSegmentScore += 10 /* BonusCustomRegExp */;\r\n // make sure the regexp is valid before using it\r\n try {\r\n new RegExp(`(${re})`);\r\n }\r\n catch (err) {\r\n throw new Error(`Invalid custom RegExp for param \"${value}\" (${re}): ` +\r\n err.message);\r\n }\r\n }\r\n // when we repeat we must take care of the repeating leading slash\r\n let subPattern = repeatable ? `((?:${re})(?:/(?:${re}))*)` : `(${re})`;\r\n // prepend the slash if we are starting a new segment\r\n if (!tokenIndex)\r\n subPattern =\r\n // avoid an optional / if there are more segments e.g. /:p?-static\r\n // or /:p?-:p2\r\n optional && segment.length < 2\r\n ? `(?:/${subPattern})`\r\n : '/' + subPattern;\r\n if (optional)\r\n subPattern += '?';\r\n pattern += subPattern;\r\n subSegmentScore += 20 /* Dynamic */;\r\n if (optional)\r\n subSegmentScore += -8 /* BonusOptional */;\r\n if (repeatable)\r\n subSegmentScore += -20 /* BonusRepeatable */;\r\n if (re === '.*')\r\n subSegmentScore += -50 /* BonusWildcard */;\r\n }\r\n segmentScores.push(subSegmentScore);\r\n }\r\n // an empty array like /home/ -> [[{home}], []]\r\n // if (!segment.length) pattern += '/'\r\n score.push(segmentScores);\r\n }\r\n // only apply the strict bonus to the last score\r\n if (options.strict && options.end) {\r\n const i = score.length - 1;\r\n score[i][score[i].length - 1] += 0.7000000000000001 /* BonusStrict */;\r\n }\r\n // TODO: dev only warn double trailing slash\r\n if (!options.strict)\r\n pattern += '/?';\r\n if (options.end)\r\n pattern += '$';\r\n // allow paths like /dynamic to only match dynamic or dynamic/... but not dynamic_something_else\r\n else if (options.strict)\r\n pattern += '(?:/|$)';\r\n const re = new RegExp(pattern, options.sensitive ? '' : 'i');\r\n function parse(path) {\r\n const match = path.match(re);\r\n const params = {};\r\n if (!match)\r\n return null;\r\n for (let i = 1; i < match.length; i++) {\r\n const value = match[i] || '';\r\n const key = keys[i - 1];\r\n params[key.name] = value && key.repeatable ? value.split('/') : value;\r\n }\r\n return params;\r\n }\r\n function stringify(params) {\r\n let path = '';\r\n // for optional parameters to allow to be empty\r\n let avoidDuplicatedSlash = false;\r\n for (const segment of segments) {\r\n if (!avoidDuplicatedSlash || !path.endsWith('/'))\r\n path += '/';\r\n avoidDuplicatedSlash = false;\r\n for (const token of segment) {\r\n if (token.type === 0 /* Static */) {\r\n path += token.value;\r\n }\r\n else if (token.type === 1 /* Param */) {\r\n const { value, repeatable, optional } = token;\r\n const param = value in params ? params[value] : '';\r\n if (Array.isArray(param) && !repeatable)\r\n throw new Error(`Provided param \"${value}\" is an array but it is not repeatable (* or + modifiers)`);\r\n const text = Array.isArray(param) ? param.join('/') : param;\r\n if (!text) {\r\n if (optional) {\r\n // if we have more than one optional param like /:a?-static we\r\n // don't need to care about the optional param\r\n if (segment.length < 2) {\r\n // remove the last slash as we could be at the end\r\n if (path.endsWith('/'))\r\n path = path.slice(0, -1);\r\n // do not append a slash on the next iteration\r\n else\r\n avoidDuplicatedSlash = true;\r\n }\r\n }\r\n else\r\n throw new Error(`Missing required param \"${value}\"`);\r\n }\r\n path += text;\r\n }\r\n }\r\n }\r\n return path;\r\n }\r\n return {\r\n re,\r\n score,\r\n keys,\r\n parse,\r\n stringify,\r\n };\r\n}", "function subs_filter_from_pathParts(subSet) {\n var captureNode = subSet.cap;\n if (captureNode.index > 1) {\n return captureNode.path.slice(2, -1).split('/');\n }\n return staticUnusedArray;\n }", "function StaticSegment(string) { this.string = normalizeSegment(string); }", "parseSegment() {\n const path = matchSegments(this.remaining);\n\n if (path === '' && this.peekStartsWith(';')) {\n throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);\n }\n\n this.capture(path);\n return new UrlSegment(decode(path), this.parseMatrixParams());\n }", "function getSegmentParams(controller, template, isSecure, isDefault, dependencies)\n {\n var params = {\n templateUrl: TEMPLATES_URL + template,\n default: isDefault,\n dependencies: dependencies\n };\n if (controller) {\n params.controller = controller;\n }\n if (isSecure) {\n params.resolve = {\n auth: ['Auth', function(Auth) {\n return Auth.check();\n }]\n };\n params.resolveFailed = getSegmentParams('Login', '/login.html');\n }\n return params;\n }", "function generatePathParameters(isInstance) {\n const parameters = [];\n\n // Parameters available for singular and plural routes\n parameters.push(getParamRef('select'), getParamRef('populate'));\n\n if (isInstance) {\n // Parameters available for singular routes\n addPathSingularParameters(parameters);\n } else {\n addPathCollectionParameters(parameters);\n }\n return parameters;\n}", "function URLSplit(){\n var array = [];\n if($scope.newPath.indexOf(\"\\\\\")>= 0) {\n array = $scope.newPath.split(\"\\\\\");\n }\n else {\n array = $scope.newPath.split(\"/\");\n }\n var path = \"\";\n for(var i=0; i<=array.length-1; i++){\n path = path + array[i] + \">\"\n }\n $scope.pathXml = path.replace(/\\>$/, '');\n }", "parseSegment() {\n const path = matchSegments(this.remaining);\n if (path === '' && this.peekStartsWith(';')) {\n throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);\n }\n this.capture(path);\n return new UrlSegment(decode(path), this.parseMatrixParams());\n }", "parseSegment() {\n const path = matchSegments(this.remaining);\n if (path === '' && this.peekStartsWith(';')) {\n throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);\n }\n this.capture(path);\n return new UrlSegment(decode(path), this.parseMatrixParams());\n }", "parseSegment() {\n const path = matchSegments(this.remaining);\n if (path === '' && this.peekStartsWith(';')) {\n throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);\n }\n this.capture(path);\n return new UrlSegment(decode(path), this.parseMatrixParams());\n }", "parseSegment() {\n const path = matchSegments(this.remaining);\n if (path === '' && this.peekStartsWith(';')) {\n throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);\n }\n this.capture(path);\n return new UrlSegment(decode(path), this.parseMatrixParams());\n }", "parseSegment() {\n const path = matchSegments(this.remaining);\n if (path === '' && this.peekStartsWith(';')) {\n throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);\n }\n this.capture(path);\n return new UrlSegment(decode(path), this.parseMatrixParams());\n }", "splitURL(url){\n let UrlParts = url.substring(1).split('/');\n return UrlParts;\n }", "function split(array, segments) {\n\t segments = segments || 2;\n\t var results = [];\n\t if (array == null) {\n\t return results;\n\t }\n\n\t var minLength = Math.floor(array.length / segments),\n\t remainder = array.length % segments,\n\t i = 0,\n\t len = array.length,\n\t segmentIndex = 0,\n\t segmentLength;\n\n\t while (i < len) {\n\t segmentLength = minLength;\n\t if (segmentIndex < remainder) {\n\t segmentLength++;\n\t }\n\n\t results.push(array.slice(i, i + segmentLength));\n\n\t segmentIndex++;\n\t i += segmentLength;\n\t }\n\n\t return results;\n\t }", "function StaticSegment(string) { this.string = string; }", "function splitPath(p) {\n return p ? p.split(path.delimiter) : [];\n}", "function splitPath(p) {\n return p ? p.split(path.delimiter) : [];\n}", "function splitPath(p) {\n return p ? p.split(path.delimiter) : [];\n}", "function tokenizePath(path) {\n if (!path)\n return [[]];\n if (path === '/')\n return [[ROOT_TOKEN]];\n if (!path.startsWith('/')) {\n throw new Error(( true)\n ? `Route paths should start with a \"/\": \"${path}\" should be \"/${path}\".`\n : 0);\n }\n // if (tokenCache.has(path)) return tokenCache.get(path)!\n function crash(message) {\n throw new Error(`ERR (${state})/\"${buffer}\": ${message}`);\n }\n let state = 0 /* Static */;\n let previousState = state;\n const tokens = [];\n // the segment will always be valid because we get into the initial state\n // with the leading /\n let segment;\n function finalizeSegment() {\n if (segment)\n tokens.push(segment);\n segment = [];\n }\n // index on the path\n let i = 0;\n // char at index\n let char;\n // buffer of the value read\n let buffer = '';\n // custom regexp for a param\n let customRe = '';\n function consumeBuffer() {\n if (!buffer)\n return;\n if (state === 0 /* Static */) {\n segment.push({\n type: 0 /* Static */,\n value: buffer,\n });\n }\n else if (state === 1 /* Param */ ||\n state === 2 /* ParamRegExp */ ||\n state === 3 /* ParamRegExpEnd */) {\n if (segment.length > 1 && (char === '*' || char === '+'))\n crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);\n segment.push({\n type: 1 /* Param */,\n value: buffer,\n regexp: customRe,\n repeatable: char === '*' || char === '+',\n optional: char === '*' || char === '?',\n });\n }\n else {\n crash('Invalid state to consume buffer');\n }\n buffer = '';\n }\n function addCharToBuffer() {\n buffer += char;\n }\n while (i < path.length) {\n char = path[i++];\n if (char === '\\\\' && state !== 2 /* ParamRegExp */) {\n previousState = state;\n state = 4 /* EscapeNext */;\n continue;\n }\n switch (state) {\n case 0 /* Static */:\n if (char === '/') {\n if (buffer) {\n consumeBuffer();\n }\n finalizeSegment();\n }\n else if (char === ':') {\n consumeBuffer();\n state = 1 /* Param */;\n }\n else {\n addCharToBuffer();\n }\n break;\n case 4 /* EscapeNext */:\n addCharToBuffer();\n state = previousState;\n break;\n case 1 /* Param */:\n if (char === '(') {\n state = 2 /* ParamRegExp */;\n }\n else if (VALID_PARAM_RE.test(char)) {\n addCharToBuffer();\n }\n else {\n consumeBuffer();\n state = 0 /* Static */;\n // go back one character if we were not modifying\n if (char !== '*' && char !== '?' && char !== '+')\n i--;\n }\n break;\n case 2 /* ParamRegExp */:\n // TODO: is it worth handling nested regexp? like :p(?:prefix_([^/]+)_suffix)\n // it already works by escaping the closing )\n // https://paths.esm.dev/?p=AAMeJbiAwQEcDKbAoAAkP60PG2R6QAvgNaA6AFACM2ABuQBB#\n // is this really something people need since you can also write\n // /prefix_:p()_suffix\n if (char === ')') {\n // handle the escaped )\n if (customRe[customRe.length - 1] == '\\\\')\n customRe = customRe.slice(0, -1) + char;\n else\n state = 3 /* ParamRegExpEnd */;\n }\n else {\n customRe += char;\n }\n break;\n case 3 /* ParamRegExpEnd */:\n // same as finalizing a param\n consumeBuffer();\n state = 0 /* Static */;\n // go back one character if we were not modifying\n if (char !== '*' && char !== '?' && char !== '+')\n i--;\n customRe = '';\n break;\n default:\n crash('Unknown state');\n break;\n }\n }\n if (state === 2 /* ParamRegExp */)\n crash(`Unfinished custom RegExp for param \"${buffer}\"`);\n consumeBuffer();\n finalizeSegment();\n // tokenCache.set(path, tokens)\n return tokens;\n}", "static splitPath(path) {\n\t\treturn path.slice(1).split('/')\n\t}", "function StaticSegment(string) {\n this.string = string;\n }", "function StaticSegment(string) {\n this.string = string;\n }", "function StaticSegment(string) {\n this.string = string;\n }", "function StaticSegment(string) {\n this.string = string;\n }", "function StaticSegment(string) {\n this.string = string;\n }", "function splitPathByIds(path, indexes) {\n var subPaths = [];\n utils.genericSort(indexes, true); // sort ascending\n if (indexes[0] > 0) {\n subPaths.push(path.slice(0, indexes[0]));\n }\n for (var i=0, n=indexes.length; i<n; i++) {\n if (i < n-1) {\n subPaths.push(path.slice(indexes[i], indexes[i+1]));\n } else {\n subPaths.push(path.slice(indexes[i]));\n }\n }\n // handle case where first subring is split across endpoint of @path\n if (subPaths.length > indexes.length) {\n utils.merge(subPaths[0], subPaths.pop());\n }\n return subPaths;\n }", "function tokenizePath(path) {\r\n if (!path)\r\n return [[]];\r\n if (path === '/')\r\n return [[ROOT_TOKEN]];\r\n if (!path.startsWith('/')) {\r\n throw new Error(( true)\r\n ? `Route paths should start with a \"/\": \"${path}\" should be \"/${path}\".`\r\n : undefined);\r\n }\r\n // if (tokenCache.has(path)) return tokenCache.get(path)!\r\n function crash(message) {\r\n throw new Error(`ERR (${state})/\"${buffer}\": ${message}`);\r\n }\r\n let state = 0 /* Static */;\r\n let previousState = state;\r\n const tokens = [];\r\n // the segment will always be valid because we get into the initial state\r\n // with the leading /\r\n let segment;\r\n function finalizeSegment() {\r\n if (segment)\r\n tokens.push(segment);\r\n segment = [];\r\n }\r\n // index on the path\r\n let i = 0;\r\n // char at index\r\n let char;\r\n // buffer of the value read\r\n let buffer = '';\r\n // custom regexp for a param\r\n let customRe = '';\r\n function consumeBuffer() {\r\n if (!buffer)\r\n return;\r\n if (state === 0 /* Static */) {\r\n segment.push({\r\n type: 0 /* Static */,\r\n value: buffer,\r\n });\r\n }\r\n else if (state === 1 /* Param */ ||\r\n state === 2 /* ParamRegExp */ ||\r\n state === 3 /* ParamRegExpEnd */) {\r\n if (segment.length > 1 && (char === '*' || char === '+'))\r\n crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);\r\n segment.push({\r\n type: 1 /* Param */,\r\n value: buffer,\r\n regexp: customRe,\r\n repeatable: char === '*' || char === '+',\r\n optional: char === '*' || char === '?',\r\n });\r\n }\r\n else {\r\n crash('Invalid state to consume buffer');\r\n }\r\n buffer = '';\r\n }\r\n function addCharToBuffer() {\r\n buffer += char;\r\n }\r\n while (i < path.length) {\r\n char = path[i++];\r\n if (char === '\\\\' && state !== 2 /* ParamRegExp */) {\r\n previousState = state;\r\n state = 4 /* EscapeNext */;\r\n continue;\r\n }\r\n switch (state) {\r\n case 0 /* Static */:\r\n if (char === '/') {\r\n if (buffer) {\r\n consumeBuffer();\r\n }\r\n finalizeSegment();\r\n }\r\n else if (char === ':') {\r\n consumeBuffer();\r\n state = 1 /* Param */;\r\n }\r\n else {\r\n addCharToBuffer();\r\n }\r\n break;\r\n case 4 /* EscapeNext */:\r\n addCharToBuffer();\r\n state = previousState;\r\n break;\r\n case 1 /* Param */:\r\n if (char === '(') {\r\n state = 2 /* ParamRegExp */;\r\n }\r\n else if (VALID_PARAM_RE.test(char)) {\r\n addCharToBuffer();\r\n }\r\n else {\r\n consumeBuffer();\r\n state = 0 /* Static */;\r\n // go back one character if we were not modifying\r\n if (char !== '*' && char !== '?' && char !== '+')\r\n i--;\r\n }\r\n break;\r\n case 2 /* ParamRegExp */:\r\n // TODO: is it worth handling nested regexp? like :p(?:prefix_([^/]+)_suffix)\r\n // it already works by escaping the closing )\r\n // https://paths.esm.dev/?p=AAMeJbiAwQEcDKbAoAAkP60PG2R6QAvgNaA6AFACM2ABuQBB#\r\n // is this really something people need since you can also write\r\n // /prefix_:p()_suffix\r\n if (char === ')') {\r\n // handle the escaped )\r\n if (customRe[customRe.length - 1] == '\\\\')\r\n customRe = customRe.slice(0, -1) + char;\r\n else\r\n state = 3 /* ParamRegExpEnd */;\r\n }\r\n else {\r\n customRe += char;\r\n }\r\n break;\r\n case 3 /* ParamRegExpEnd */:\r\n // same as finalizing a param\r\n consumeBuffer();\r\n state = 0 /* Static */;\r\n // go back one character if we were not modifying\r\n if (char !== '*' && char !== '?' && char !== '+')\r\n i--;\r\n customRe = '';\r\n break;\r\n default:\r\n crash('Unknown state');\r\n break;\r\n }\r\n }\r\n if (state === 2 /* ParamRegExp */)\r\n crash(`Unfinished custom RegExp for param \"${buffer}\"`);\r\n consumeBuffer();\r\n finalizeSegment();\r\n // tokenCache.set(path, tokens)\r\n return tokens;\r\n}", "function splitEvery(value, delimiter, numDelimiters) {\n // Fail if we don't have a clear number to split on.\n if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) {\n throw new Error(\"Invalid number of delimiters (\" + numDelimiters + \") for splitEvery.\");\n }\n var segments = value.split(delimiter);\n // Short circuit extra logic for the simple case.\n if (numDelimiters === 1) {\n return segments;\n }\n var compoundSegments = [];\n var currentSegment = \"\";\n for (var i = 0; i < segments.length; i++) {\n if (currentSegment === \"\") {\n // Start a new segment.\n currentSegment = segments[i];\n }\n else {\n // Compound the current segment with the delimiter.\n currentSegment += delimiter + segments[i];\n }\n if ((i + 1) % numDelimiters === 0) {\n // We encountered the right number of delimiters, so add the entry.\n compoundSegments.push(currentSegment);\n // And reset the current segment.\n currentSegment = \"\";\n }\n }\n // Handle any leftover segment portion.\n if (currentSegment !== \"\") {\n compoundSegments.push(currentSegment);\n }\n return compoundSegments;\n}", "function splitEvery(value, delimiter, numDelimiters) {\n // Fail if we don't have a clear number to split on.\n if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) {\n throw new Error(\"Invalid number of delimiters (\" + numDelimiters + \") for splitEvery.\");\n }\n var segments = value.split(delimiter);\n // Short circuit extra logic for the simple case.\n if (numDelimiters === 1) {\n return segments;\n }\n var compoundSegments = [];\n var currentSegment = \"\";\n for (var i = 0; i < segments.length; i++) {\n if (currentSegment === \"\") {\n // Start a new segment.\n currentSegment = segments[i];\n }\n else {\n // Compound the current segment with the delimiter.\n currentSegment += delimiter + segments[i];\n }\n if ((i + 1) % numDelimiters === 0) {\n // We encountered the right number of delimiters, so add the entry.\n compoundSegments.push(currentSegment);\n // And reset the current segment.\n currentSegment = \"\";\n }\n }\n // Handle any leftover segment portion.\n if (currentSegment !== \"\") {\n compoundSegments.push(currentSegment);\n }\n return compoundSegments;\n}", "function splitEvery(value, delimiter, numDelimiters) {\n // Fail if we don't have a clear number to split on.\n if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) {\n throw new Error(\"Invalid number of delimiters (\" + numDelimiters + \") for splitEvery.\");\n }\n var segments = value.split(delimiter);\n // Short circuit extra logic for the simple case.\n if (numDelimiters === 1) {\n return segments;\n }\n var compoundSegments = [];\n var currentSegment = \"\";\n for (var i = 0; i < segments.length; i++) {\n if (currentSegment === \"\") {\n // Start a new segment.\n currentSegment = segments[i];\n }\n else {\n // Compound the current segment with the delimiter.\n currentSegment += delimiter + segments[i];\n }\n if ((i + 1) % numDelimiters === 0) {\n // We encountered the right number of delimiters, so add the entry.\n compoundSegments.push(currentSegment);\n // And reset the current segment.\n currentSegment = \"\";\n }\n }\n // Handle any leftover segment portion.\n if (currentSegment !== \"\") {\n compoundSegments.push(currentSegment);\n }\n return compoundSegments;\n}", "parseParametedRoute(url) {\n var nBread = url.split('/');\n var matched = {};\n for (var i = 0; i < this.routes.length; i++) {\n var route = this.routes[i];\n var routePath = route.path;\n var rBread = routePath.split('/');\n if (rBread.length !== nBread.length)\n continue;\n var routeParams = {};\n matched[`${route.path}`] = true;\n for (var j = 0; j < rBread.length; j++) {\n var el = rBread[j];\n if (nBread[j] === '' && j !== 0) {\n matched[`${route.path}`] = false;\n continue;\n }\n if (el === nBread[j])\n continue;\n else {\n if (el[0] === ':') {\n routeParams[el.replace(':', '')] = nBread[j];\n continue;\n }\n else {\n matched[`${route.path}`] = false;\n }\n }\n }\n }\n let keys = Object.keys(matched).filter((key) => matched[key] === true);\n if (!keys.length)\n throw Error(\"Couldn't find matching path\");\n else {\n let idx = this.routes.findIndex((r) => r.path === keys[0]);\n this.currentRoute['params'] = routeParams;\n return idx;\n }\n }", "function StaticSegment(string) {\n\t this.string = string;\n\t}", "function StaticSegment(string) {\n\t this.string = string;\n\t}", "function getPathSegment(path, index) {\n\n return path.split(\"?\")[0].split(\"/\")[index];\n }", "function pathSplit(path) {\n return path.split(\"/\");\n}", "function splitPath(p) {\n for (i=1;i<2;i++) {}\n \n if (!p)\n return [];\n \n if (common.platform === 'win')\n return p.split(';');\n else\n return p.split(':');\n }", "function tokensToParser(segments, extraOptions) {\n const options = assign({}, BASE_PATH_PARSER_OPTIONS, extraOptions);\n // the amount of scores is the same as the length of segments except for the root segment \"/\"\n let score = [];\n // the regexp as a string\n let pattern = options.start ? '^' : '';\n // extracted keys\n const keys = [];\n for (const segment of segments) {\n // the root segment needs special treatment\n const segmentScores = segment.length ? [] : [90 /* Root */];\n // allow trailing slash\n if (options.strict && !segment.length)\n pattern += '/';\n for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {\n const token = segment[tokenIndex];\n // resets the score if we are inside a sub segment /:a-other-:b\n let subSegmentScore = 40 /* Segment */ +\n (options.sensitive ? 0.25 /* BonusCaseSensitive */ : 0);\n if (token.type === 0 /* Static */) {\n // prepend the slash if we are starting a new segment\n if (!tokenIndex)\n pattern += '/';\n pattern += token.value.replace(REGEX_CHARS_RE, '\\\\$&');\n subSegmentScore += 40 /* Static */;\n }\n else if (token.type === 1 /* Param */) {\n const { value, repeatable, optional, regexp } = token;\n keys.push({\n name: value,\n repeatable,\n optional,\n });\n const re = regexp ? regexp : BASE_PARAM_PATTERN;\n // the user provided a custom regexp /:id(\\\\d+)\n if (re !== BASE_PARAM_PATTERN) {\n subSegmentScore += 10 /* BonusCustomRegExp */;\n // make sure the regexp is valid before using it\n try {\n new RegExp(`(${re})`);\n }\n catch (err) {\n throw new Error(`Invalid custom RegExp for param \"${value}\" (${re}): ` +\n err.message);\n }\n }\n // when we repeat we must take care of the repeating leading slash\n let subPattern = repeatable ? `((?:${re})(?:/(?:${re}))*)` : `(${re})`;\n // prepend the slash if we are starting a new segment\n if (!tokenIndex)\n subPattern = optional ? `(?:/${subPattern})` : '/' + subPattern;\n if (optional)\n subPattern += '?';\n pattern += subPattern;\n subSegmentScore += 20 /* Dynamic */;\n if (optional)\n subSegmentScore += -8 /* BonusOptional */;\n if (repeatable)\n subSegmentScore += -20 /* BonusRepeatable */;\n if (re === '.*')\n subSegmentScore += -50 /* BonusWildcard */;\n }\n segmentScores.push(subSegmentScore);\n }\n // an empty array like /home/ -> [[{home}], []]\n // if (!segment.length) pattern += '/'\n score.push(segmentScores);\n }\n // only apply the strict bonus to the last score\n if (options.strict && options.end) {\n const i = score.length - 1;\n score[i][score[i].length - 1] += 0.7000000000000001 /* BonusStrict */;\n }\n // TODO: dev only warn double trailing slash\n if (!options.strict)\n pattern += '/?';\n if (options.end)\n pattern += '$';\n // allow paths like /dynamic to only match dynamic or dynamic/... but not dynamic_something_else\n else if (options.strict)\n pattern += '(?:/|$)';\n const re = new RegExp(pattern, options.sensitive ? '' : 'i');\n function parse(path) {\n const match = path.match(re);\n const params = {};\n if (!match)\n return null;\n for (let i = 1; i < match.length; i++) {\n const value = match[i] || '';\n const key = keys[i - 1];\n params[key.name] = value && key.repeatable ? value.split('/') : value;\n }\n return params;\n }\n function stringify(params) {\n let path = '';\n // for optional parameters to allow to be empty\n let avoidDuplicatedSlash = false;\n for (const segment of segments) {\n if (!avoidDuplicatedSlash || !path.endsWith('/'))\n path += '/';\n avoidDuplicatedSlash = false;\n for (const token of segment) {\n if (token.type === 0 /* Static */) {\n path += token.value;\n }\n else if (token.type === 1 /* Param */) {\n const { value, repeatable, optional } = token;\n const param = value in params ? params[value] : '';\n if (Array.isArray(param) && !repeatable)\n throw new Error(`Provided param \"${value}\" is an array but it is not repeatable (* or + modifiers)`);\n const text = Array.isArray(param) ? param.join('/') : param;\n if (!text) {\n if (optional) {\n // remove the last slash as we could be at the end\n if (path.endsWith('/'))\n path = path.slice(0, -1);\n // do not append a slash on the next iteration\n else\n avoidDuplicatedSlash = true;\n }\n else\n throw new Error(`Missing required param \"${value}\"`);\n }\n path += text;\n }\n }\n }\n return path;\n }\n return {\n re,\n score,\n keys,\n parse,\n stringify,\n };\n}", "function GetDelimitedArguments(ParamURL)\n {\n var Parts = [];\n var Parameters;\n\n // Process URL parameters\n //\n if (ParamURL.indexOf(\"?\") != -1)\n {\n Parts = ParamURL.split(\"?\");\n }\n else if (ParamURL.indexOf(\"#\") != -1)\n {\n Parts = ParamURL.split(\"#\");\n Parameters = Parts.slice(1).join(\"#\");\n Parts.length = 2;\n Parts[1] = Parameters;\n }\n\n return Parts;\n }", "function GetDelimitedArguments(ParamURL)\n {\n var Parts = [];\n var Parameters;\n\n // Process URL parameters\n //\n if (ParamURL.indexOf(\"?\") != -1)\n {\n Parts = ParamURL.split(\"?\");\n }\n else if (ParamURL.indexOf(\"#\") != -1)\n {\n Parts = ParamURL.split(\"#\");\n Parameters = Parts.slice(1).join(\"#\");\n Parts.length = 2;\n Parts[1] = Parameters;\n }\n\n return Parts;\n }", "function subs_filter_within_pathParts(subSet) {\n var\n subInst = subSet.inst,\n currentNode = subInst.nodes[subInst.tank.currentIndex]\n ;\n if (currentNode.parentIndex > 1) {\n return subInst.nodes[currentNode.parentIndex].path.slice(2, -1).split('/');\n }\n return staticUnusedArray;\n }", "function tokensToParser(segments, extraOptions) {\r\n const options = assign({}, BASE_PATH_PARSER_OPTIONS, extraOptions);\r\n // the amount of scores is the same as the length of segments except for the root segment \"/\"\r\n const score = [];\r\n // the regexp as a string\r\n let pattern = options.start ? '^' : '';\r\n // extracted keys\r\n const keys = [];\r\n for (const segment of segments) {\r\n // the root segment needs special treatment\r\n const segmentScores = segment.length ? [] : [90 /* Root */];\r\n // allow trailing slash\r\n if (options.strict && !segment.length)\r\n pattern += '/';\r\n for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {\r\n const token = segment[tokenIndex];\r\n // resets the score if we are inside a sub segment /:a-other-:b\r\n let subSegmentScore = 40 /* Segment */ +\r\n (options.sensitive ? 0.25 /* BonusCaseSensitive */ : 0);\r\n if (token.type === 0 /* Static */) {\r\n // prepend the slash if we are starting a new segment\r\n if (!tokenIndex)\r\n pattern += '/';\r\n pattern += token.value.replace(REGEX_CHARS_RE, '\\\\$&');\r\n subSegmentScore += 40 /* Static */;\r\n }\r\n else if (token.type === 1 /* Param */) {\r\n const { value, repeatable, optional, regexp } = token;\r\n keys.push({\r\n name: value,\r\n repeatable,\r\n optional,\r\n });\r\n const re = regexp ? regexp : BASE_PARAM_PATTERN;\r\n // the user provided a custom regexp /:id(\\\\d+)\r\n if (re !== BASE_PARAM_PATTERN) {\r\n subSegmentScore += 10 /* BonusCustomRegExp */;\r\n // make sure the regexp is valid before using it\r\n try {\r\n new RegExp(`(${re})`);\r\n }\r\n catch (err) {\r\n throw new Error(`Invalid custom RegExp for param \"${value}\" (${re}): ` +\r\n err.message);\r\n }\r\n }\r\n // when we repeat we must take care of the repeating leading slash\r\n let subPattern = repeatable ? `((?:${re})(?:/(?:${re}))*)` : `(${re})`;\r\n // prepend the slash if we are starting a new segment\r\n if (!tokenIndex)\r\n subPattern =\r\n // avoid an optional / if there are more segments e.g. /:p?-static\r\n // or /:p?-:p2\r\n optional && segment.length < 2\r\n ? `(?:/${subPattern})`\r\n : '/' + subPattern;\r\n if (optional)\r\n subPattern += '?';\r\n pattern += subPattern;\r\n subSegmentScore += 20 /* Dynamic */;\r\n if (optional)\r\n subSegmentScore += -8 /* BonusOptional */;\r\n if (repeatable)\r\n subSegmentScore += -20 /* BonusRepeatable */;\r\n if (re === '.*')\r\n subSegmentScore += -50 /* BonusWildcard */;\r\n }\r\n segmentScores.push(subSegmentScore);\r\n }\r\n // an empty array like /home/ -> [[{home}], []]\r\n // if (!segment.length) pattern += '/'\r\n score.push(segmentScores);\r\n }\r\n // only apply the strict bonus to the last score\r\n if (options.strict && options.end) {\r\n const i = score.length - 1;\r\n score[i][score[i].length - 1] += 0.7000000000000001 /* BonusStrict */;\r\n }\r\n // TODO: dev only warn double trailing slash\r\n if (!options.strict)\r\n pattern += '/?';\r\n if (options.end)\r\n pattern += '$';\r\n // allow paths like /dynamic to only match dynamic or dynamic/... but not dynamic_something_else\r\n else if (options.strict)\r\n pattern += '(?:/|$)';\r\n const re = new RegExp(pattern, options.sensitive ? '' : 'i');\r\n function parse(path) {\r\n const match = path.match(re);\r\n const params = {};\r\n if (!match)\r\n return null;\r\n for (let i = 1; i < match.length; i++) {\r\n const value = match[i] || '';\r\n const key = keys[i - 1];\r\n params[key.name] = value && key.repeatable ? value.split('/') : value;\r\n }\r\n return params;\r\n }\r\n function stringify(params) {\r\n let path = '';\r\n // for optional parameters to allow to be empty\r\n let avoidDuplicatedSlash = false;\r\n for (const segment of segments) {\r\n if (!avoidDuplicatedSlash || !path.endsWith('/'))\r\n path += '/';\r\n avoidDuplicatedSlash = false;\r\n for (const token of segment) {\r\n if (token.type === 0 /* Static */) {\r\n path += token.value;\r\n }\r\n else if (token.type === 1 /* Param */) {\r\n const { value, repeatable, optional } = token;\r\n const param = value in params ? params[value] : '';\r\n if (Array.isArray(param) && !repeatable)\r\n throw new Error(`Provided param \"${value}\" is an array but it is not repeatable (* or + modifiers)`);\r\n const text = Array.isArray(param) ? param.join('/') : param;\r\n if (!text) {\r\n if (optional) {\r\n // if we have more than one optional param like /:a?-static we\r\n // don't need to care about the optional param\r\n if (segment.length < 2) {\r\n // remove the last slash as we could be at the end\r\n if (path.endsWith('/'))\r\n path = path.slice(0, -1);\r\n // do not append a slash on the next iteration\r\n else\r\n avoidDuplicatedSlash = true;\r\n }\r\n }\r\n else\r\n throw new Error(`Missing required param \"${value}\"`);\r\n }\r\n path += text;\r\n }\r\n }\r\n }\r\n return path;\r\n }\r\n return {\r\n re,\r\n score,\r\n keys,\r\n parse,\r\n stringify,\r\n };\r\n}", "function split(array, segments) {\n segments = segments || 2;\n\n var output = [],\n segmentLength = Math.floor(array.length / segments),\n remainder = array.length % segments,\n start = 0,\n i = 0,\n n = array.length,\n len;\n\n while (start < n) {\n len = i++ < remainder ? segmentLength + 1 : segmentLength;\n output.push(array.slice(start, start + len));\n start += len;\n }\n\n return output;\n }", "parts(key) {\n var raw = this.param(key);\n var parts = raw.split('|');\n for (var i = 0; i < parts.length; ++i) {\n parts[i] = parts[i].trim();\n }\n return parts;\n }", "function segmentStringsByMatch(segments, match)\n\t{\n\t\tvar newValues = [];\n\n\t\tfor (var i = 0; i < segments.length; i++)\n\t\t{\n\t\t\tvar value = segments[i];\n\t\t\tvar pos = value.indexOf(match);\n\t\t\tvar len = match.length;\n\t\t\tvar beforeText = value.substr(0, pos);\n\t\t\tvar afterText = value.substr(pos + len);\n\n\t\t\tif (pos === -1)\n\t\t\t{\n\t\t\t\tnewValues.push(value);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (beforeText.length !== 0) newValues.push(beforeText);\n\n\t\t\tnewValues.push(match);\n\n\t\t\tif (afterText.length !== 0) newValues.push(afterText);\n\t\t}\n\n\t\treturn newValues;\n\t}", "function splitPath(p) {\n for (i=1;i<2;i++) {}\n\n if (!p)\n return [];\n\n if (common.platform === 'win')\n return p.split(';');\n else\n return p.split(':');\n}", "extractParameters(url, routePattern) {\n var result = {};\n let names = routePattern.trimAll(\"/\").split(\"/\");\n let values = url.trimAll(\"/\").split(\"/\");\n\n for (var i=0; i<names.length; i++) {\n var name = names[i];\n if ((new RegExp(\"<.+?>\")).test(name)) {\n var trimmedName = name.replaceAll(\"<\", \"\").replaceAll(\">\", \"\");\n result[trimmedName] = values[i];\n }\n }\n return result;\n }", "function StaticSegment(string) {\n\t this.string = string;\n\t }", "function StaticSegment(string) {\n\t this.string = string;\n\t }", "function StaticSegment(string) {\n\t this.string = string;\n\t }", "function StaticSegment(string) {\n\t this.string = string;\n\t }", "function stringSplitter(string, split) {\n //base case\n if (!string.includes(split)) {\n return [string] \n }\n const newIndex = [string.slice(0, string.indexOf(split))];\n return newIndex.concat(stringSplitter(string.slice(string.indexOf(split) + 1), split))\n //recursive case\n //if the string has a character save it and call stringSplitter w empty array\n //iterate until you find the slash, save the string before the slash, call stringSplitter with the\n //rest of the string\n //when we get to a slash, push string to array\n\n}", "function defaultUrlMatcher(segments, segmentGroup, route) {\n const parts = route.path.split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n const posParams = {};\n // Check each config part against the actual URL\n for (let index = 0; index < parts.length; index++) {\n const part = parts[index];\n const segment = segments[index];\n const isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n }\n else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n return { consumed: segments.slice(0, parts.length), posParams };\n}", "function defaultUrlMatcher(segments, segmentGroup, route) {\n const parts = route.path.split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n const posParams = {};\n // Check each config part against the actual URL\n for (let index = 0; index < parts.length; index++) {\n const part = parts[index];\n const segment = segments[index];\n const isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n }\n else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n return { consumed: segments.slice(0, parts.length), posParams };\n}", "function defaultUrlMatcher(segments, segmentGroup, route) {\n const parts = route.path.split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n const posParams = {};\n // Check each config part against the actual URL\n for (let index = 0; index < parts.length; index++) {\n const part = parts[index];\n const segment = segments[index];\n const isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n }\n else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n return { consumed: segments.slice(0, parts.length), posParams };\n}", "function defaultUrlMatcher(segments, segmentGroup, route) {\n const parts = route.path.split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n const posParams = {};\n // Check each config part against the actual URL\n for (let index = 0; index < parts.length; index++) {\n const part = parts[index];\n const segment = segments[index];\n const isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n }\n else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n return { consumed: segments.slice(0, parts.length), posParams };\n}", "function defaultUrlMatcher(segments, segmentGroup, route) {\n const parts = route.path.split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n const posParams = {};\n // Check each config part against the actual URL\n for (let index = 0; index < parts.length; index++) {\n const part = parts[index];\n const segment = segments[index];\n const isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n }\n else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n return { consumed: segments.slice(0, parts.length), posParams };\n}", "static split(path) {\n if (!path || typeof path !== \"string\") {\n throw new Error(\"Path.split() - Invalid path.\");\n }\n\n const result = path.split(\"/\").map((s, i, arr) => {\n return i < arr.length - 1 ? s + \"/\" : s;\n });\n\n return path.endsWith(\"/\") ? result.slice(0, -1) : result;\n }", "_loadInitialRoute(){\n\n /*con esta constante y el window.location.pathname.split() estamos \n separar en un arreglo de dos elementos la ruta por ejemplo quedaría \n [/,contacto ] entonces podriamos acceder a cualquiera de estos elementos\n */\n const pathNameSplit = window.location.pathname.split('/');\n /*en esta funcion lo que estamos haciendo es segmentar \n estamos usando el operador ternario diciendo que si el tamaño del arreglo dado es mayor a uno \n solo accedamos al indice 1 que sería del ejemplo anterior [/, contacto] sería el contacto si es que el elemento\n es solo uno por ejemplo [/] entonces al path segs se le da un string vació */\n const pathSegs = pathNameSplit.length > 1 ? pathNameSplit.slice(1) : '';\n\n /* con el ...pathsegs lo que estamos pasando es a todo un obejto iterable por parametro */\n this.loadRoute(...pathSegs)\n }", "function getNumberOfUrlSegments(url) {\n // split at '/' or at '\\/' to split regex urls correctly\n return url.split(/\\\\?\\//).filter(s => s.length > 0 && s !== ',').length;\n }", "function getUrlVars(hashdivider)\n\t\t\t{\n\t\t\t\tvar vars = [], hash;\n\t\t\t\tvar hashes = window.location.href.slice(window.location.href.indexOf(hashdivider) + 1).split('_');\n\t\t\t\tfor(var i = 0; i < hashes.length; i++)\n\t\t\t\t{\n\t\t\t\t\thashes[i] = hashes[i].replace('%3D',\"=\");\n\t\t\t\t\thash = hashes[i].split('=');\n\t\t\t\t\tvars.push(hash[0]);\n\t\t\t\t\tvars[hash[0]] = hash[1];\n\t\t\t\t}\n\t\t\t\treturn vars;\n\t\t\t}", "function getUrlVars(hashdivider)\n\t\t\t{\n\t\t\t\tvar vars = [], hash;\n\t\t\t\tvar hashes = window.location.href.slice(window.location.href.indexOf(hashdivider) + 1).split('_');\n\t\t\t\tfor(var i = 0; i < hashes.length; i++)\n\t\t\t\t{\n\t\t\t\t\thashes[i] = hashes[i].replace('%3D',\"=\");\n\t\t\t\t\thash = hashes[i].split('=');\n\t\t\t\t\tvars.push(hash[0]);\n\t\t\t\t\tvars[hash[0]] = hash[1];\n\t\t\t\t}\n\t\t\t\treturn vars;\n\t\t\t}", "function getUrlVars(hashdivider)\n\t\t\t{\n\t\t\t\tvar vars = [], hash;\n\t\t\t\tvar hashes = window.location.href.slice(window.location.href.indexOf(hashdivider) + 1).split('_');\n\t\t\t\tfor(var i = 0; i < hashes.length; i++)\n\t\t\t\t{\n\t\t\t\t\thashes[i] = hashes[i].replace('%3D',\"=\");\n\t\t\t\t\thash = hashes[i].split('=');\n\t\t\t\t\tvars.push(hash[0]);\n\t\t\t\t\tvars[hash[0]] = hash[1];\n\t\t\t\t}\n\t\t\t\treturn vars;\n\t\t\t}", "function getUrlVars(hashdivider)\n\t\t\t{\n\t\t\t\tvar vars = [], hash;\n\t\t\t\tvar hashes = window.location.href.slice(window.location.href.indexOf(hashdivider) + 1).split('_');\n\t\t\t\tfor(var i = 0; i < hashes.length; i++)\n\t\t\t\t{\n\t\t\t\t\thashes[i] = hashes[i].replace('%3D',\"=\");\n\t\t\t\t\thash = hashes[i].split('=');\n\t\t\t\t\tvars.push(hash[0]);\n\t\t\t\t\tvars[hash[0]] = hash[1];\n\t\t\t\t}\n\t\t\t\treturn vars;\n\t\t\t}", "function getUrlVars(hashdivider)\n {\n var vars = [], hash;\n var hashes = window.location.href.slice(window.location.href.indexOf(hashdivider) + 1).split('_');\n for (var i = 0; i < hashes.length; i++)\n {\n hashes[i] = hashes[i].replace('%3D', \"=\");\n hash = hashes[i].split('=');\n vars.push(hash[0]);\n vars[hash[0]] = hash[1];\n }\n return vars;\n }", "function getNumberOfUrlSegments(url) {\n // split at '/' or at '\\/' to split regex urls correctly\n return url.split(/\\\\?\\//).filter(s => s.length > 0 && s !== ',').length;\n}", "function getNumberOfUrlSegments(url) {\n\t // split at '/' or at '\\/' to split regex urls correctly\n\t return url.split(/\\\\?\\//).filter(s => s.length > 0 && s !== ',').length;\n\t}", "listSegments(marker, options = {}) {\n return tslib.__asyncGenerator(this, arguments, function* listSegments_1() {\n let listBlobsFlatSegmentResponse;\n if (!!marker || marker === undefined) {\n do {\n listBlobsFlatSegmentResponse = yield tslib.__await(this.listBlobFlatSegment(marker, options));\n marker = listBlobsFlatSegmentResponse.continuationToken;\n yield yield tslib.__await(yield tslib.__await(listBlobsFlatSegmentResponse));\n } while (marker);\n }\n });\n }", "listSegments(marker, options = {}) {\n return tslib.__asyncGenerator(this, arguments, function* listSegments_1() {\n let listBlobsFlatSegmentResponse;\n if (!!marker || marker === undefined) {\n do {\n listBlobsFlatSegmentResponse = yield tslib.__await(this.listBlobFlatSegment(marker, options));\n marker = listBlobsFlatSegmentResponse.continuationToken;\n yield yield tslib.__await(yield tslib.__await(listBlobsFlatSegmentResponse));\n } while (marker);\n }\n });\n }", "function _split(uri){return uri.match(_splitRe);}", "allocateStatic(allowDirty = true) {\n if (allowDirty && this.dirtyMemory.length > 0) {\n let addr = this.dirtyMemory.shift();\n return addr.split(\" \");\n }\n //Create placeholder address\n let addr = \"S\" + this.staticLength.toString().padStart(3, \"0\");\n this.staticLength++;\n addr = addr.substr(0, 2) + \" \" + addr.substr(2);\n this.staticTable[addr] = \"\";\n return addr.split(\" \");\n }", "_getParams(route) {\n var matches = route.match(/:\\w+/g)\n return (matches || []).map(match => {\n return match.substring(1, match.length)\n })\n }", "function _splitKeyPath(path) {\n return Array.isArray(path) ? path : path.split('.');\n}", "function tokenizePath(path) {\r\n if (!path)\r\n return [[]];\r\n if (path === '/')\r\n return [[ROOT_TOKEN]];\r\n if (!path.startsWith('/')) {\r\n throw new Error(( false)\r\n ? undefined\r\n : `Invalid path \"${path}\"`);\r\n }\r\n // if (tokenCache.has(path)) return tokenCache.get(path)!\r\n function crash(message) {\r\n throw new Error(`ERR (${state})/\"${buffer}\": ${message}`);\r\n }\r\n let state = 0 /* Static */;\r\n let previousState = state;\r\n const tokens = [];\r\n // the segment will always be valid because we get into the initial state\r\n // with the leading /\r\n let segment;\r\n function finalizeSegment() {\r\n if (segment)\r\n tokens.push(segment);\r\n segment = [];\r\n }\r\n // index on the path\r\n let i = 0;\r\n // char at index\r\n let char;\r\n // buffer of the value read\r\n let buffer = '';\r\n // custom regexp for a param\r\n let customRe = '';\r\n function consumeBuffer() {\r\n if (!buffer)\r\n return;\r\n if (state === 0 /* Static */) {\r\n segment.push({\r\n type: 0 /* Static */,\r\n value: buffer,\r\n });\r\n }\r\n else if (state === 1 /* Param */ ||\r\n state === 2 /* ParamRegExp */ ||\r\n state === 3 /* ParamRegExpEnd */) {\r\n if (segment.length > 1 && (char === '*' || char === '+'))\r\n crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);\r\n segment.push({\r\n type: 1 /* Param */,\r\n value: buffer,\r\n regexp: customRe,\r\n repeatable: char === '*' || char === '+',\r\n optional: char === '*' || char === '?',\r\n });\r\n }\r\n else {\r\n crash('Invalid state to consume buffer');\r\n }\r\n buffer = '';\r\n }\r\n function addCharToBuffer() {\r\n buffer += char;\r\n }\r\n while (i < path.length) {\r\n char = path[i++];\r\n if (char === '\\\\' && state !== 2 /* ParamRegExp */) {\r\n previousState = state;\r\n state = 4 /* EscapeNext */;\r\n continue;\r\n }\r\n switch (state) {\r\n case 0 /* Static */:\r\n if (char === '/') {\r\n if (buffer) {\r\n consumeBuffer();\r\n }\r\n finalizeSegment();\r\n }\r\n else if (char === ':') {\r\n consumeBuffer();\r\n state = 1 /* Param */;\r\n }\r\n else {\r\n addCharToBuffer();\r\n }\r\n break;\r\n case 4 /* EscapeNext */:\r\n addCharToBuffer();\r\n state = previousState;\r\n break;\r\n case 1 /* Param */:\r\n if (char === '(') {\r\n state = 2 /* ParamRegExp */;\r\n }\r\n else if (VALID_PARAM_RE.test(char)) {\r\n addCharToBuffer();\r\n }\r\n else {\r\n consumeBuffer();\r\n state = 0 /* Static */;\r\n // go back one character if we were not modifying\r\n if (char !== '*' && char !== '?' && char !== '+')\r\n i--;\r\n }\r\n break;\r\n case 2 /* ParamRegExp */:\r\n // TODO: is it worth handling nested regexp? like :p(?:prefix_([^/]+)_suffix)\r\n // it already works by escaping the closing )\r\n // https://paths.esm.dev/?p=AAMeJbiAwQEcDKbAoAAkP60PG2R6QAvgNaA6AFACM2ABuQBB#\r\n // is this really something people need since you can also write\r\n // /prefix_:p()_suffix\r\n if (char === ')') {\r\n // handle the escaped )\r\n if (customRe[customRe.length - 1] == '\\\\')\r\n customRe = customRe.slice(0, -1) + char;\r\n else\r\n state = 3 /* ParamRegExpEnd */;\r\n }\r\n else {\r\n customRe += char;\r\n }\r\n break;\r\n case 3 /* ParamRegExpEnd */:\r\n // same as finalizing a param\r\n consumeBuffer();\r\n state = 0 /* Static */;\r\n // go back one character if we were not modifying\r\n if (char !== '*' && char !== '?' && char !== '+')\r\n i--;\r\n customRe = '';\r\n break;\r\n default:\r\n crash('Unknown state');\r\n break;\r\n }\r\n }\r\n if (state === 2 /* ParamRegExp */)\r\n crash(`Unfinished custom RegExp for param \"${buffer}\"`);\r\n consumeBuffer();\r\n finalizeSegment();\r\n // tokenCache.set(path, tokens)\r\n return tokens;\r\n}", "function getNamedParams(pathName = '') {\n if (pathName.trim().length === 0) return []\n const namedUrlParams = getPathNames(pathName);\n return namedUrlParams.reduce((validParams, param) => {\n if (param[0] === ':') {\n validParams.push(param.slice(1));\n }\n\n return validParams\n }, [])\n }", "constructSwaggerPathParameters(parameters){\n if (!parameters) return ''\n let path = '';\n for (let parameter of parameters){\n if (parameter.in === 'query'){\n debug('Were not really doing anything here')\n }\n }\n return path;\n }", "function stringWithSplit(input) {\n return input.split('/')\n}", "function ___R$$priv$project$rome$$internal$path$match$parse_ts$normalizePatternSegments(\n\t\tparser,\n\t\tsegments,\n\t) {\n\t\tconst normalized = [];\n\n\t\t// Never normalize it if there's a single segment. This is to support writing a pattern that's just \"*\"\n\t\tif (segments.length === 1) {\n\t\t\treturn segments;\n\t\t}\n\n\t\tfor (const seg of segments) {\n\t\t\t// Remove all wildcard-only segments from 'beginning\n\t\t\tif (\n\t\t\t\tnormalized.length === 0 &&\n\t\t\t\t___R$$priv$project$rome$$internal$path$match$parse_ts$isWildcardOnlySegment(\n\t\t\t\t\tparser,\n\t\t\t\t\tseg,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Remove all empty segments\n\t\t\tif (seg.type === \"Segment\" && seg.parts.length === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnormalized.push(seg);\n\t\t}\n\n\t\t// TODO Remove duplicate wildcard segments\n\t\t// - Multiple WildcardSegment\n\t\t// - Wildcard next to a WildcardSegment\n\t\t// Remove all wildcard-only segments from end\n\t\twhile (\n\t\t\t___R$$priv$project$rome$$internal$path$match$parse_ts$isWildcardOnlySegment(\n\t\t\t\tparser,\n\t\t\t\tnormalized[normalized.length - 1],\n\t\t\t)\n\t\t) {\n\t\t\tnormalized.pop();\n\t\t}\n\n\t\treturn normalized;\n\t}", "function TemplateSegmentsGetter(config, isDynamic) {\n config = config || {};\n var timelineConverter = config.timelineConverter;\n var instance;\n\n function checkConfig() {\n if (!timelineConverter || !timelineConverter.hasOwnProperty('calcPeriodRelativeTimeFromMpdRelativeTime')) {\n throw new Error(_streaming_constants_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MISSING_CONFIG_ERROR);\n }\n }\n\n function getSegmentByIndex(representation, index) {\n checkConfig();\n\n if (!representation) {\n return null;\n }\n\n var template = representation.adaptation.period.mpd.manifest.Period_asArray[representation.adaptation.period.index].AdaptationSet_asArray[representation.adaptation.index].Representation_asArray[representation.index].SegmentTemplate;\n index = Math.max(index, 0);\n var seg = Object(_SegmentsUtils__WEBPACK_IMPORTED_MODULE_2__[\"getIndexBasedSegment\"])(timelineConverter, isDynamic, representation, index);\n\n if (seg) {\n seg.replacementTime = Math.round((index - 1) * representation.segmentDuration * representation.timescale, 10);\n var url = template.media;\n url = Object(_SegmentsUtils__WEBPACK_IMPORTED_MODULE_2__[\"replaceTokenForTemplate\"])(url, 'Number', seg.replacementNumber);\n url = Object(_SegmentsUtils__WEBPACK_IMPORTED_MODULE_2__[\"replaceTokenForTemplate\"])(url, 'Time', seg.replacementTime);\n seg.media = url;\n }\n\n var duration = representation.segmentDuration;\n\n if (isNaN(duration)) {\n representation.availableSegmentsNumber = 1;\n } else {\n representation.availableSegmentsNumber = Math.ceil(representation.adaptation.period.duration / duration);\n }\n\n return seg;\n }\n\n function getSegmentByTime(representation, requestedTime) {\n checkConfig();\n\n if (!representation) {\n return null;\n }\n\n var duration = representation.segmentDuration;\n\n if (isNaN(duration)) {\n return null;\n }\n\n var periodTime = timelineConverter.calcPeriodRelativeTimeFromMpdRelativeTime(representation, requestedTime);\n var index = Math.floor(periodTime / duration);\n return getSegmentByIndex(representation, index);\n }\n\n instance = {\n getSegmentByIndex: getSegmentByIndex,\n getSegmentByTime: getSegmentByTime\n };\n return instance;\n}", "function namedParamsWithIndex() {\n const namedUrlParams = getPathNames(namedUrl);\n\n return namedUrlParams.reduce((validParams, param, index) => {\n if (param[0] === ':') {\n validParams.push({ value: param.slice(1), index });\n }\n return validParams;\n }, []);\n }", "parseParams(location){\n let route = this; \n var keys=[],params={};\n var tokens = this.getMatch(location.pathname);\n if (tokens && tokens.keys.length!=0){\n var i = 1;\n var keys = tokens.keys;\n keys.forEach((e) => params[e.name] = tokens.token[i++] );\n }\n this.params = params;\n return params;\n }", "function splitAt_(insertPosition) {\n \n}", "function defaultUrlMatcher(segments, segmentGroup, route) {\n var parts = route.path.split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n var posParams = {};\n // Check each config part against the actual URL\n for (var index = 0; index < parts.length; index++) {\n var part = parts[index];\n var segment = segments[index];\n var isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n }\n else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n return { consumed: segments.slice(0, parts.length), posParams: posParams };\n}", "function defaultUrlMatcher(segments, segmentGroup, route) {\n var parts = route.path.split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n var posParams = {};\n // Check each config part against the actual URL\n for (var index = 0; index < parts.length; index++) {\n var part = parts[index];\n var segment = segments[index];\n var isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n }\n else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n return { consumed: segments.slice(0, parts.length), posParams: posParams };\n}", "function defaultUrlMatcher(segments, segmentGroup, route) {\n var parts = route.path.split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n var posParams = {};\n // Check each config part against the actual URL\n for (var index = 0; index < parts.length; index++) {\n var part = parts[index];\n var segment = segments[index];\n var isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n }\n else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n return { consumed: segments.slice(0, parts.length), posParams: posParams };\n}", "function defaultUrlMatcher(segments, segmentGroup, route) {\n var parts = route.path.split('/');\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n var posParams = {};\n // Check each config part against the actual URL\n for (var index = 0; index < parts.length; index++) {\n var part = parts[index];\n var segment = segments[index];\n var isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n }\n else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n return { consumed: segments.slice(0, parts.length), posParams: posParams };\n}", "function normalizePaths(path) {\n // @ts-ignore (not sure why this happens)\n return path.map(segment => typeof segment === 'string' ? segment.split('.') : segment);\n} // Supports passing either an id or a value (document/reference/object)", "function getDynamicStructure(staticPart){\n var params = staticPart.param;\n var dynamicStruct = {\n value: { attrs: ['z'] },\n };\n\n for (var i = params.length - 1; i >= 0; i--) {\n\n //Deal with element type params\n if(params[i].type == 'Element'){\n var elementName = params[i].name;\n dynamicStruct.value[elementName] = {};\n dynamicStruct.value[elementName].attrs = [];\n _.forEach(params[i].param, function(param){\n dynamicStruct.value[elementName].attrs.push(param.name);\n });\n continue;\n }\n\n dynamicStruct.value.attrs.push(params[i].name)\n };\n\n return dynamicStruct;\n }", "loadStaticRoutes () {\n LOG.debug(`location.RouteLoader.loadStaticRoutes [loading static routes]`)\n const ds = DSSelector.getDS()\n const numbersAPI = new NumbersAPI(ds)\n const domainsAPI = new DomainsAPI(ds)\n const gatewaysAPI = new GatewaysAPI(ds)\n const egressRoutes = this.getDomainEgressRoutes(\n domainsAPI,\n numbersAPI,\n gatewaysAPI\n )\n\n egressRoutes\n .keySet()\n .toArray()\n .forEach(key => {\n LOG.debug(`loading route for key => ${key}`)\n this.store.put(key, JSON.stringify(egressRoutes.get(key)))\n })\n }", "function segment(WrappedComponent, mapping) {\n // pathMatch;\n return class extends Component {\n constructor(props) {\n super(props);\n\n this.state = {};\n }\n\n render() {\n const {\n path,\n currentPath,\n isRelative = true,\n basePath,\n exact = false,\n ...rest\n } = this.props;\n\n // currentPath /bbb/aaa/123/ccc/ddd\n // currentPath /bbb/aaa/123/ccc\n\n // base /bbb\n // path /aaa/{id}/ccc\n // path aaa/{id}/ccc\n\n // to /bbb/aaa/{id}/ccc\n\n // last '/' to ''\n // console.log(currentPath, path, isRelative, basePath);\n if (isRelative) {\n const result = relativeMatch(currentPath, basePath, path, exact);\n if (result) {\n return (\n <WrappedComponent\n currentPath={currentPath}\n // basePath={xxx} // this is in result\n {...result}\n {...rest}\n />\n );\n }\n return null;\n }\n const result = pathMatch(currentPath, path);\n if (result) {\n return (\n <WrappedComponent\n currentPath={currentPath}\n basePath={basePath}\n {...result}\n {...rest}\n />\n );\n }\n return null;\n }\n };\n}", "function split(input, separator) {}", "function split(path) {\n if (!path) {\n return [];\n }\n return String(path).split(SEPARATOR_RE);\n}", "function extendingEndpoints() {\n var segments = Array.prototype.slice.call(arguments, 0);\n return function () {\n var path = '';\n segments.forEach(function (pathSegment) {\n path = path + pathSegment;\n createEndpointFromPath(path);\n console.log(' registered path %s', path);\n });\n }\n}", "function split(s, separators) {\n let before = null;\n let after = null;\n for (let i = 0; i < separators.length; ++i) {\n const sep = separators[i];\n const index = s.indexOf(sep);\n if (index >= 0 && (before === null || index < before.length)) {\n before = s.substring(0, index);\n after = s.substring(index + sep.length);\n }\n }\n return [before, after];\n}", "listHierarchySegments(delimiter, marker, options = {}) {\n return tslib.__asyncGenerator(this, arguments, function* listHierarchySegments_1() {\n let listBlobsHierarchySegmentResponse;\n if (!!marker || marker === undefined) {\n do {\n listBlobsHierarchySegmentResponse = yield tslib.__await(this.listBlobHierarchySegment(delimiter, marker, options));\n marker = listBlobsHierarchySegmentResponse.continuationToken;\n yield yield tslib.__await(yield tslib.__await(listBlobsHierarchySegmentResponse));\n } while (marker);\n }\n });\n }", "listHierarchySegments(delimiter, marker, options = {}) {\n return tslib.__asyncGenerator(this, arguments, function* listHierarchySegments_1() {\n let listBlobsHierarchySegmentResponse;\n if (!!marker || marker === undefined) {\n do {\n listBlobsHierarchySegmentResponse = yield tslib.__await(this.listBlobHierarchySegment(delimiter, marker, options));\n marker = listBlobsHierarchySegmentResponse.continuationToken;\n yield yield tslib.__await(yield tslib.__await(listBlobsHierarchySegmentResponse));\n } while (marker);\n }\n });\n }" ]
[ "0.555547", "0.555547", "0.555547", "0.555547", "0.54235095", "0.5254827", "0.52054834", "0.516155", "0.51597726", "0.5154381", "0.5143667", "0.51289546", "0.5120334", "0.5102536", "0.5102536", "0.5102536", "0.5102536", "0.5102536", "0.50962883", "0.5081762", "0.5077474", "0.5028615", "0.5028615", "0.5028615", "0.50257033", "0.5002912", "0.4994186", "0.4994186", "0.4994186", "0.4994186", "0.4994186", "0.49712962", "0.49609485", "0.49598435", "0.49598435", "0.49598435", "0.49575686", "0.49550247", "0.49550247", "0.49482724", "0.49362645", "0.49352342", "0.49306723", "0.4929375", "0.4929375", "0.49174652", "0.4913945", "0.4913157", "0.4912892", "0.49085566", "0.48915377", "0.4888478", "0.48425186", "0.48425186", "0.48425186", "0.48425186", "0.48338008", "0.4818081", "0.4818081", "0.4818081", "0.4818081", "0.4818081", "0.4776307", "0.47314084", "0.47189736", "0.47173676", "0.47173676", "0.47173676", "0.47173676", "0.4715135", "0.47085422", "0.47062182", "0.46958554", "0.46958554", "0.46884418", "0.4666852", "0.4663366", "0.46512195", "0.46449617", "0.46412587", "0.46391597", "0.46351558", "0.46213192", "0.45934895", "0.45910615", "0.4584363", "0.45459443", "0.4539815", "0.4539815", "0.4539815", "0.4539815", "0.45345524", "0.4523401", "0.45123848", "0.45061255", "0.4505979", "0.44995967", "0.44940835", "0.4492507", "0.447988", "0.447988" ]
0.0
-1
Wrap nonarray value as array
function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrayWrap(val) {\n return _.isArray(val) ? val : (isDefined(val) ? [val] : []);\n }", "function arrayWrap(val) {\n return isArray(val) ? val : (isDefined(val) ? [val] : []);\n }", "function arrayWrap(val) {\n\t return predicates_1.isArray(val) ? val : (predicates_1.isDefined(val) ? [val] : []);\n\t }", "function arrayWrap(val) {\n\t return predicates_1.isArray(val) ? val : (predicates_1.isDefined(val) ? [val] : []);\n\t }", "function arrayWrap(val) {\n return isArray(val) ? val : (isDefined(val) ? [val] : []);\n }", "function arrayWrap(val) {\n return isArray(val) ? val : (isDefined(val) ? [val] : []);\n }", "function arrayWrap(val) {\n return isArray(val) ? val : isDefined(val) ? [val] : [];\n }", "function arrayWrap(val) {\n return predicates_1.isArray(val) ? val : (predicates_1.isDefined(val) ? [val] : []);\n }", "function arrayWrap(val) {\n return predicates_1.isArray(val) ? val : (predicates_1.isDefined(val) ? [val] : []);\n }", "force_array(val) {\n return this.is_array(val) ? val : [val];\n }", "function arrayify(val) {\n return !Array.isArray(val) ? [val] : val;\n}", "_standardValueArray(value) {\n\n if (_.isFunction(value)) {\n value = this.map(value);\n } else if (!(value instanceof Array)) {\n value = Array(this.length).fill(value);\n }\n\n return Array.from(value);\n }", "if (value.constructor != Array){\n value = [value, value];\n }", "function arrayify(val) {\n return val ? Array.isArray(val) ? val : [val] : [];\n}", "function arrayify(val) {\n return val ? Array.isArray(val) ? val : [val] : [];\n}", "function arrayify(value) {\n if (value === undefined) return [];\n else if (_.isArray(value)) return value;\n else return [value];\n}", "function arrayify(val) {\n return val ? (Array.isArray(val) ? val : [val]) : [];\n}", "function arrayify$1(val) {\n return val ? (Array.isArray(val) ? val : [val]) : [];\n}", "function arrayWrap(obj) {\n var arr = [];\n arr.push(obj);\n return arr;\n }", "function mkArray(val) {\n return Array.isArray(val) ? val : [val];\n }", "function asArray(value) {\n if (lodash_default.a.isNil(value)) {\n return [];\n } else if (lodash_default.a.isArray(value)) {\n return value;\n } else {\n return [value];\n }\n}", "function asContentArray(value) {\r\n if (!value) {\r\n return [];\r\n }\r\n if (value instanceof Array) {\r\n return value;\r\n }\r\n return [value];\r\n }", "function handleArray (val) {\n\t\tvar self = this;\n\t\treturn val.map(function (m) {\n\t\t\treturn self.cast(m);\n\t\t});\n\t}", "function toArray(value) {\n if (Array.isArray(value)) {\n return value;\n }\n return value !== undefined ? [value] : [];\n}", "function wrap(x){\r\n return [x];\r\n}", "function justArray(array){\n\treturn array;\n}", "function arrayify(a) {\n return [].slice.call(a);\n }", "function normalizeToArray(value) {\n return [].concat(value);\n}", "function safeCastArray(value) {\n if (value) {\n return castArray(value);\n } else {\n return [];\n }\n}", "function arrayUnwrap(val) {\n\t switch(val.length) {\n\t case 0: return undefined;\n\t case 1: return mode === \"auto\" ? val[0] : val;\n\t default: return val;\n\t }\n\t }", "function arrayUnwrap(val) {\n\t switch(val.length) {\n\t case 0: return undefined;\n\t case 1: return mode === \"auto\" ? val[0] : val;\n\t default: return val;\n\t }\n\t }", "function arrayFrom(value) {\n return [].slice.call(value);\n }", "function Arr(){ return Literal.apply(this,arguments) }", "function toArray(val){\n\t var ret = [],\n\t kind = kindOf(val),\n\t n;\n\n\t if (val != null) {\n\t if ( val.length == null || kind === 'String' || kind === 'Function' || kind === 'RegExp' || val === GLOBAL ) {\n\t //string, regexp, function have .length but user probably just want\n\t //to wrap value into an array..\n\t ret[ret.length] = val;\n\t } else {\n\t //window returns true on isObject in IE7 and may have length\n\t //property. `typeof NodeList` returns `function` on Safari so\n\t //we can't use it (#58)\n\t n = val.length;\n\t while (n--) {\n\t ret[n] = val[n];\n\t }\n\t }\n\t }\n\t return ret;\n\t }", "function arrayUnwrap(val) {\n\t switch (val.length) {\n\t case 0: return undefined;\n\t case 1: return mode === \"auto\" ? val[0] : val;\n\t default: return val;\n\t }\n\t }", "function arrayUnwrap(val) {\n\t switch (val.length) {\n\t case 0: return undefined;\n\t case 1: return mode === \"auto\" ? val[0] : val;\n\t default: return val;\n\t }\n\t }", "function Array() {}", "function _setCoerce(obj) {\n return _array.call(this, Array.from(obj));\n}", "isArray() {\r\n\t\t\t\t\treturn this.bareLiteral(Arr);\r\n\t\t\t\t}", "function arrayUnwrap(val) {\n switch (val.length) {\n case 0:\n return undefined;\n case 1:\n return mode === \"auto\" ? val[0] : val;\n default:\n return val;\n }\n }", "function arrayUnwrap(val) {\n switch (val.length) {\n case 0:\n return undefined;\n case 1:\n return mode === \"auto\" ? val[0] : val;\n default:\n return val;\n }\n }", "function castAsArray(arg) {\n if (!Array.isArray(arg)) {\n arg = [arg];\n }\n\n return arg;\n}", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayFrom(value) {\n return [].slice.call(value);\n}", "function arrayFrom(value) {\n return [].slice.call(value);\n}", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function transformerList(val) {\n return util.arrayify(val);\n}", "function array$1(value) {\r\n return Array.isArray(value);\r\n }", "function arrayUnwrap(val) {\n switch (val.length) {\n case 0:\n return undefined;\n case 1:\n return mode === 'auto' ? val[0] : val;\n default:\n return val;\n }\n }", "function asArray(a) {\n return Array.isArray(a) ? a : [a];\n }", "function arrayUnwrap(val) {\n\t\t\t\tswitch(val.length) {\n\t\t\t\t\tcase 0: return undefined;\n\t\t\t\t\tcase 1: return mode === \"auto\" ? val[0] : val;\n\t\t\t\t\tdefault: return val;\n\t\t\t\t}\n\t\t\t}", "function arrayify(val, mapFn) {\n\t if (!val) return [];\n\t if (_lodashLangIsBoolean2[\"default\"](val)) return arrayify([val], mapFn);\n\t if (_lodashLangIsString2[\"default\"](val)) return arrayify(list(val), mapFn);\n\n\t if (Array.isArray(val)) {\n\t if (mapFn) val = val.map(mapFn);\n\t return val;\n\t }\n\n\t return [val];\n\t}", "function arrayify(val, mapFn) {\n\t if (!val) return [];\n\t if (_lodashLangIsBoolean2[\"default\"](val)) return arrayify([val], mapFn);\n\t if (_lodashLangIsString2[\"default\"](val)) return arrayify(list(val), mapFn);\n\n\t if (Array.isArray(val)) {\n\t if (mapFn) val = val.map(mapFn);\n\t return val;\n\t }\n\n\t return [val];\n\t}", "function arrayify(val, mapFn) {\n\t if (!val) return [];\n\t if (_lodashLangIsBoolean2[\"default\"](val)) return arrayify([val], mapFn);\n\t if (_lodashLangIsString2[\"default\"](val)) return arrayify(list(val), mapFn);\n\n\t if (Array.isArray(val)) {\n\t if (mapFn) val = val.map(mapFn);\n\t return val;\n\t }\n\n\t return [val];\n\t}", "function arrayify(val /*: any*/, mapFn /*:: ?: Function*/) /*: Array<any>*/ {\n\t if (!val) return [];\n\t if (_lodashLangIsBoolean2[\"default\"](val)) return arrayify([val], mapFn);\n\t if (_lodashLangIsString2[\"default\"](val)) return arrayify(list(val), mapFn);\n\n\t if (Array.isArray(val)) {\n\t if (mapFn) val = val.map(mapFn);\n\t return val;\n\t }\n\n\t return [val];\n\t}", "function arrayUnwrap(val) {\n switch (val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch (val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch (val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch (val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function transformerList(val) {\n\t return util.arrayify(val);\n\t}", "function transformerList(val) {\n\t return util.arrayify(val);\n\t}", "function toArray(data) {\n return data instanceof Array ? data : [data];\n}" ]
[ "0.77192384", "0.76270837", "0.75723267", "0.75723267", "0.7554663", "0.7554663", "0.75508195", "0.747994", "0.747994", "0.7457606", "0.71685237", "0.7148838", "0.7065602", "0.6958656", "0.6958656", "0.6869584", "0.68252397", "0.6766194", "0.67249966", "0.66873527", "0.6613203", "0.6569351", "0.65228343", "0.6518648", "0.64563274", "0.6452805", "0.64395124", "0.6433932", "0.63731194", "0.6366243", "0.6366243", "0.63542175", "0.63343346", "0.6334323", "0.6333769", "0.6333769", "0.63124585", "0.62867373", "0.62856865", "0.62832445", "0.62832445", "0.6278557", "0.62713224", "0.62608874", "0.62608874", "0.62529165", "0.62529165", "0.62529165", "0.62529165", "0.62529165", "0.62529165", "0.62529165", "0.62529165", "0.62529165", "0.62529165", "0.62529165", "0.62529165", "0.62529165", "0.62529165", "0.62529165", "0.62529165", "0.62529165", "0.62529165", "0.62505263", "0.62213105", "0.62152827", "0.6205454", "0.6187033", "0.6183268", "0.6183268", "0.6183268", "0.6170482", "0.61583745", "0.61583745", "0.61583745", "0.61583745", "0.6153343", "0.6153343", "0.61445683" ]
0.7781231
18
Unwrap array value for "auto" mode. Return undefined for empty array.
function arrayUnwrap(val) { switch(val.length) { case 0: return undefined; case 1: return mode === "auto" ? val[0] : val; default: return val; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n\t switch(val.length) {\n\t case 0: return undefined;\n\t case 1: return mode === \"auto\" ? val[0] : val;\n\t default: return val;\n\t }\n\t }", "function arrayUnwrap(val) {\n\t switch(val.length) {\n\t case 0: return undefined;\n\t case 1: return mode === \"auto\" ? val[0] : val;\n\t default: return val;\n\t }\n\t }", "function arrayUnwrap(val) {\n\t\t\t\tswitch(val.length) {\n\t\t\t\t\tcase 0: return undefined;\n\t\t\t\t\tcase 1: return mode === \"auto\" ? val[0] : val;\n\t\t\t\t\tdefault: return val;\n\t\t\t\t}\n\t\t\t}", "function arrayUnwrap(val) {\n switch (val.length) {\n case 0:\n return undefined;\n case 1:\n return mode === \"auto\" ? val[0] : val;\n default:\n return val;\n }\n }", "function arrayUnwrap(val) {\n switch (val.length) {\n case 0:\n return undefined;\n case 1:\n return mode === \"auto\" ? val[0] : val;\n default:\n return val;\n }\n }", "function arrayUnwrap(val) {\n switch (val.length) {\n case 0:\n return undefined;\n case 1:\n return mode === 'auto' ? val[0] : val;\n default:\n return val;\n }\n }", "function arrayUnwrap(val) {\n\t switch (val.length) {\n\t case 0: return undefined;\n\t case 1: return mode === \"auto\" ? val[0] : val;\n\t default: return val;\n\t }\n\t }", "function arrayUnwrap(val) {\n\t switch (val.length) {\n\t case 0: return undefined;\n\t case 1: return mode === \"auto\" ? val[0] : val;\n\t default: return val;\n\t }\n\t }", "function arrayUnwrap(val) {\n switch (val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch (val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch (val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "function arrayUnwrap(val) {\n switch (val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }", "force_array(val) {\n return this.is_array(val) ? val : [val];\n }", "function arrayify(value) {\n if (value === undefined) return [];\n else if (_.isArray(value)) return value;\n else return [value];\n}", "function justArray(array){\n\treturn array;\n}", "function arrayWrap(val) {\n return _.isArray(val) ? val : (isDefined(val) ? [val] : []);\n }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function array(arr){\n\n return arr.split(\",\").slice(1,-1).join(\" \") || null\n }", "function arrayWrap(val) {\n return isArray(val) ? val : isDefined(val) ? [val] : [];\n }", "function arrayify(val) {\n return !Array.isArray(val) ? [val] : val;\n}", "function arrayToNullable(a) {\n return a.length === 0 ? null : a[0];\n}", "function arrayToNullable(a) {\n return a.length === 0 ? null : a[0];\n}", "function arrayWrap(val) {\n return isArray(val) ? val : (isDefined(val) ? [val] : []);\n }", "function _ensureArray(option) {\n if (!(option instanceof Array))\n return [option];\n return option;\n}", "function arrayWrap(val) {\n return isArray(val) ? val : (isDefined(val) ? [val] : []);\n }", "function arrayWrap(val) {\n return isArray(val) ? val : (isDefined(val) ? [val] : []);\n }", "function arrayify$1(val) {\n return val ? (Array.isArray(val) ? val : [val]) : [];\n}", "function arrayify(a) {\n return [].slice.call(a);\n }", "function arrayify(val) {\n return val ? Array.isArray(val) ? val : [val] : [];\n}", "function arrayify(val) {\n return val ? Array.isArray(val) ? val : [val] : [];\n}", "function ensureArray(val) {\n if (typeof val === 'undefined')\n return [];\n if (!Array.isArray(val))\n return [val];\n return val;\n}", "function toArray(value) {\n if (Array.isArray(value)) {\n return value;\n }\n return value !== undefined ? [value] : [];\n}", "function uuclean(source) { // @param Array: source\r\n // @return Array: clean Array\r\n if (Array.isArray(source)) {\r\n var rv = [], i = 0, iz = source.length;\r\n\r\n for (; i < iz; ++i) {\r\n if (i in source) {\r\n if (source[i] != null) { // null and undefined\r\n rv.push(source[i]);\r\n }\r\n }\r\n }\r\n return rv;\r\n }\r\n return source;\r\n}", "function getFilledUpArray(array) {\n let lastDefinedElement;\n return array.map(element => {\n if (element === \"\") {\n element = lastDefinedElement;\n }\n lastDefinedElement = element;\n return element;\n });\n}", "function arrayify(val) {\n return val ? (Array.isArray(val) ? val : [val]) : [];\n}", "function normalizeToArray(value) {\n return [].concat(value);\n}", "function arrayWrap(val) {\n return predicates_1.isArray(val) ? val : (predicates_1.isDefined(val) ? [val] : []);\n }", "function arrayWrap(val) {\n return predicates_1.isArray(val) ? val : (predicates_1.isDefined(val) ? [val] : []);\n }", "function arrayWrap(val) {\n\t return predicates_1.isArray(val) ? val : (predicates_1.isDefined(val) ? [val] : []);\n\t }", "function arrayWrap(val) {\n\t return predicates_1.isArray(val) ? val : (predicates_1.isDefined(val) ? [val] : []);\n\t }", "function finalArray(array){\n let rep=null;\n if(Array.isArray(array)){\n rep=array[array.length-1];\n }\n return rep;\n}", "function arrayFrom(value) {\n return [].slice.call(value);\n }", "function fixArray(arr){\n let tmp = arr;\n while(tmp[0] == ''){\n tmp.shift();\n }\n while(tmp[tmp.length-1] == ''){\n tmp.pop();\n }\n return tmp;\n}", "function lastOrUndefined(array) {\n if (array.length === 0) {\n return undefined;\n }\n return array[array.length - 1];\n }", "function arrayFrom(value) {\n return [].slice.call(value);\n}", "function arrayFrom(value) {\n return [].slice.call(value);\n}", "function arrayDestructure() {\n for (var _len15 = arguments.length, rest = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) {\n rest[_key15] = arguments[_key15];\n }\n var _x = x;\n var _x2 = babelHelpers.slicedToArray(_x, 1);\n rest[0] = _x2[0];\n}", "_standardValueArray(value) {\n\n if (_.isFunction(value)) {\n value = this.map(value);\n } else if (!(value instanceof Array)) {\n value = Array(this.length).fill(value);\n }\n\n return Array.from(value);\n }", "_arrayToRoot() {\n if (Array.isArray(this._)) {\n if (this._.length > 1) {\n return console.error(\"Array can contain only one child element for now\");\n } else {\n return this._ = this._[0];\n }\n }\n }", "function asArray(value) {\n if (lodash_default.a.isNil(value)) {\n return [];\n } else if (lodash_default.a.isArray(value)) {\n return value;\n } else {\n return [value];\n }\n}", "function arrayify(maybeArray) {\n return Array.isArray(maybeArray) ? maybeArray : [maybeArray];\n }", "function arrayify(maybeArray) {\n\t return Array.isArray(maybeArray) ? maybeArray : [maybeArray];\n\t}", "function ensureArray(value) {\n var def = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n if (typeof value === 'undefined' || value === '') return ensureArray(def);\n if (!Array.isArray(value)) value = [value];\n return value;\n}", "function extractValue2(arr){\n return arr.map(arr => Object.values(arr)[1]);\n}", "function safeCastArray(value) {\n if (value) {\n return castArray(value);\n } else {\n return [];\n }\n}", "function arrayify(maybeArray) {\n return Array.isArray(maybeArray) ? maybeArray : [maybeArray];\n}", "function normalize$3(a) {\n\t if (!(a instanceof Array)) {\n\t a = [a, a];\n\t }\n\t\n\t return a;\n\t }", "function first(a) { return (a instanceof Array) ? a[0] : a; }", "function unwrapLContainer(value) {\n while (Array.isArray(value)) {\n // This check is same as `isLContainer()` but we don't call at as we don't want to call\n // `Array.isArray()` twice and give JITer more work for inlining.\n if (value[TYPE] === true) return value;\n value = value[HOST];\n }\n\n return null;\n }", "function unwrapLContainer(value) {\n while (Array.isArray(value)) {\n // This check is same as `isLContainer()` but we don't call at as we don't want to call\n // `Array.isArray()` twice and give JITer more work for inlining.\n if (value[TYPE] === true)\n return value;\n value = value[HOST];\n }\n return null;\n}", "function unwrapLContainer(value) {\n while (Array.isArray(value)) {\n // This check is same as `isLContainer()` but we don't call at as we don't want to call\n // `Array.isArray()` twice and give JITer more work for inlining.\n if (value[TYPE] === true)\n return value;\n value = value[HOST];\n }\n return null;\n}" ]
[ "0.87155336", "0.87155336", "0.87155336", "0.87155336", "0.87155336", "0.87155336", "0.87155336", "0.87155336", "0.87155336", "0.87155336", "0.87155336", "0.87155336", "0.87155336", "0.87155336", "0.87155336", "0.87155336", "0.87155336", "0.87155336", "0.8686914", "0.8686914", "0.8669917", "0.8606815", "0.8606815", "0.85972834", "0.8576106", "0.8576106", "0.8557544", "0.8557544", "0.8557544", "0.8557544", "0.6526821", "0.62516195", "0.60874707", "0.60501003", "0.6044517", "0.6044517", "0.6044517", "0.6044517", "0.6044517", "0.6044517", "0.6044517", "0.6044517", "0.6044517", "0.6044517", "0.6044517", "0.6044517", "0.6044517", "0.6044517", "0.6044517", "0.6044517", "0.6044517", "0.6044517", "0.6044517", "0.6044517", "0.6044517", "0.6044517", "0.5991754", "0.59601295", "0.5902778", "0.5894525", "0.5894525", "0.58854127", "0.58236855", "0.5820984", "0.5820984", "0.5742078", "0.5716053", "0.5706804", "0.5706804", "0.57027", "0.5690129", "0.56885004", "0.5685651", "0.56687605", "0.5637259", "0.56361115", "0.56361115", "0.56247604", "0.56247604", "0.56193316", "0.5617382", "0.56120205", "0.5577987", "0.5547714", "0.5547714", "0.5546045", "0.55371714", "0.55016947", "0.55007", "0.5492533", "0.54817456", "0.5449617", "0.54251236", "0.54185057", "0.5418109", "0.5416768", "0.5410877", "0.53791356", "0.5377747", "0.5377747" ]
0.87254673
0
Wraps type (.is/.encode/.decode) functions to operate on each value of an array
function arrayHandler(callback, allTruthyMode) { return function handleArray(val) { val = arrayWrap(val); var result = map(val, callback); if (allTruthyMode === true) return filter(result, falsey).length === 0; return arrayUnwrap(result); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleArray (val) {\n\t\tvar self = this;\n\t\treturn val.map(function (m) {\n\t\t\treturn self.cast(m);\n\t\t});\n\t}", "function forEachType(array, type, fn, thisArg) {\n array.forEach(function (value) {\n if (value instanceof type) {\n fn.call(thisArg, value);\n }\n });\n}", "function ArrayType(type, mode) {\n var _this = this;\n // Wrap non-array value as array\n function arrayWrap(val) {\n return predicates_1.isArray(val) ? val : (predicates_1.isDefined(val) ? [val] : []);\n }\n // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n function arrayUnwrap(val) {\n switch (val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }\n // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (predicates_1.isArray(val) && val.length === 0)\n return val;\n var arr = arrayWrap(val);\n var result = common_1.map(arr, callback);\n return (allTruthyMode === true) ? common_1.filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n };\n }\n // Wraps type (.equals) functions to operate on each value of an array\n function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length)\n return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i]))\n return false;\n }\n return true;\n };\n }\n ['encode', 'decode', 'equals', '$normalize'].forEach(function (name) {\n var paramTypeFn = type[name].bind(type);\n var wrapperFn = name === 'equals' ? arrayEqualsHandler : arrayHandler;\n _this[name] = wrapperFn(paramTypeFn);\n });\n common_1.extend(this, {\n dynamic: type.dynamic,\n name: type.name,\n pattern: type.pattern,\n inherit: type.inherit,\n is: arrayHandler(type.is.bind(type), true),\n $arrayMode: mode\n });\n}", "function ArrayType(type, mode) {\n var _this = this;\n // Wrap non-array value as array\n function arrayWrap(val) {\n return predicates_1.isArray(val) ? val : (predicates_1.isDefined(val) ? [val] : []);\n }\n // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n function arrayUnwrap(val) {\n switch (val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }\n // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (predicates_1.isArray(val) && val.length === 0)\n return val;\n var arr = arrayWrap(val);\n var result = common_1.map(arr, callback);\n return (allTruthyMode === true) ? common_1.filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n };\n }\n // Wraps type (.equals) functions to operate on each value of an array\n function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length)\n return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i]))\n return false;\n }\n return true;\n };\n }\n ['encode', 'decode', 'equals', '$normalize'].forEach(function (name) {\n var paramTypeFn = type[name].bind(type);\n var wrapperFn = name === 'equals' ? arrayEqualsHandler : arrayHandler;\n _this[name] = wrapperFn(paramTypeFn);\n });\n common_1.extend(this, {\n dynamic: type.dynamic,\n name: type.name,\n pattern: type.pattern,\n inherit: type.inherit,\n is: arrayHandler(type.is.bind(type), true),\n $arrayMode: mode\n });\n}", "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\t\tcase 0x1405: return setValueV1uiArray; // UINT\n\t\t\tcase 0x8dc6: return setValueV2uiArray; // _VEC2\n\t\t\tcase 0x8dc7: return setValueV3uiArray; // _VEC3\n\t\t\tcase 0x8dc8: return setValueV4uiArray; // _VEC4\n\n\t\t\tcase 0x8b5e: // SAMPLER_2D\n\t\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\t\treturn setValueT1Array;\n\n\t\t\tcase 0x8b5f: // SAMPLER_3D\n\t\t\tcase 0x8dcb: // INT_SAMPLER_3D\n\t\t\tcase 0x8dd3: // UNSIGNED_INT_SAMPLER_3D\n\t\t\t\treturn setValueT3DArray;\n\n\t\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\t\treturn setValueT6Array;\n\n\t\t\tcase 0x8dc1: // SAMPLER_2D_ARRAY\n\t\t\tcase 0x8dcf: // INT_SAMPLER_2D_ARRAY\n\t\t\tcase 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY\n\t\t\tcase 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW\n\t\t\t\treturn setValueT2DArrayArray;\n\n\t\t}\n\n\t}", "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\tcase 0x1405: return setValueV1uiArray; // UINT\n\t\tcase 0x8dc6: return setValueV2uiArray; // _VEC2\n\t\tcase 0x8dc7: return setValueV3uiArray; // _VEC3\n\t\tcase 0x8dc8: return setValueV4uiArray; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1Array;\n\n\t\tcase 0x8b5f: // SAMPLER_3D\n\t\tcase 0x8dcb: // INT_SAMPLER_3D\n\t\tcase 0x8dd3: // UNSIGNED_INT_SAMPLER_3D\n\t\t\treturn setValueT3DArray;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6Array;\n\n\t\tcase 0x8dc1: // SAMPLER_2D_ARRAY\n\t\tcase 0x8dcf: // INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW\n\t\t\treturn setValueT2DArrayArray;\n\n\t}\n\n}", "function ArrayType(type, mode) {\n var _this = this;\n // Wrap non-array value as array\n function arrayWrap(val) {\n return isArray(val) ? val : (isDefined(val) ? [val] : []);\n }\n // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n function arrayUnwrap(val) {\n switch (val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }\n // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0)\n return val;\n var arr = arrayWrap(val);\n var result = map(arr, callback);\n return (allTruthyMode === true) ? filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n };\n }\n // Wraps type (.equals) functions to operate on each value of an array\n function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length)\n return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i]))\n return false;\n }\n return true;\n };\n }\n ['encode', 'decode', 'equals', '$normalize'].forEach(function (name) {\n var paramTypeFn = type[name].bind(type);\n var wrapperFn = name === 'equals' ? arrayEqualsHandler : arrayHandler;\n _this[name] = wrapperFn(paramTypeFn);\n });\n extend(this, {\n dynamic: type.dynamic,\n name: type.name,\n pattern: type.pattern,\n inherit: type.inherit,\n is: arrayHandler(type.is.bind(type), true),\n $arrayMode: mode\n });\n}", "function ArrayType(type, mode) {\n var _this = this;\n // Wrap non-array value as array\n function arrayWrap(val) {\n return isArray(val) ? val : (isDefined(val) ? [val] : []);\n }\n // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n function arrayUnwrap(val) {\n switch (val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }\n // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0)\n return val;\n var arr = arrayWrap(val);\n var result = map(arr, callback);\n return (allTruthyMode === true) ? filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n };\n }\n // Wraps type (.equals) functions to operate on each value of an array\n function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length)\n return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i]))\n return false;\n }\n return true;\n };\n }\n ['encode', 'decode', 'equals', '$normalize'].forEach(function (name) {\n var paramTypeFn = type[name].bind(type);\n var wrapperFn = name === 'equals' ? arrayEqualsHandler : arrayHandler;\n _this[name] = wrapperFn(paramTypeFn);\n });\n extend(this, {\n dynamic: type.dynamic,\n name: type.name,\n pattern: type.pattern,\n inherit: type.inherit,\n is: arrayHandler(type.is.bind(type), true),\n $arrayMode: mode\n });\n}", "map(f) { // Maps a function over this type (just like arrays)\n return f(this._value);\n }", "function ArrayType(type, mode) {\n\t var _this = this;\n\t // Wrap non-array value as array\n\t function arrayWrap(val) {\n\t return predicates_1.isArray(val) ? val : (predicates_1.isDefined(val) ? [val] : []);\n\t }\n\t // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n\t function arrayUnwrap(val) {\n\t switch (val.length) {\n\t case 0: return undefined;\n\t case 1: return mode === \"auto\" ? val[0] : val;\n\t default: return val;\n\t }\n\t }\n\t // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n\t function arrayHandler(callback, allTruthyMode) {\n\t return function handleArray(val) {\n\t if (predicates_1.isArray(val) && val.length === 0)\n\t return val;\n\t var arr = arrayWrap(val);\n\t var result = common_1.map(arr, callback);\n\t return (allTruthyMode === true) ? common_1.filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n\t };\n\t }\n\t // Wraps type (.equals) functions to operate on each value of an array\n\t function arrayEqualsHandler(callback) {\n\t return function handleArray(val1, val2) {\n\t var left = arrayWrap(val1), right = arrayWrap(val2);\n\t if (left.length !== right.length)\n\t return false;\n\t for (var i = 0; i < left.length; i++) {\n\t if (!callback(left[i], right[i]))\n\t return false;\n\t }\n\t return true;\n\t };\n\t }\n\t ['encode', 'decode', 'equals', '$normalize'].forEach(function (name) {\n\t var paramTypeFn = type[name].bind(type);\n\t var wrapperFn = name === 'equals' ? arrayEqualsHandler : arrayHandler;\n\t _this[name] = wrapperFn(paramTypeFn);\n\t });\n\t common_1.extend(this, {\n\t dynamic: type.dynamic,\n\t name: type.name,\n\t pattern: type.pattern,\n\t is: arrayHandler(type.is.bind(type), true),\n\t $arrayMode: mode\n\t });\n\t}", "function ArrayType(type, mode) {\n\t var _this = this;\n\t // Wrap non-array value as array\n\t function arrayWrap(val) {\n\t return predicates_1.isArray(val) ? val : (predicates_1.isDefined(val) ? [val] : []);\n\t }\n\t // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n\t function arrayUnwrap(val) {\n\t switch (val.length) {\n\t case 0: return undefined;\n\t case 1: return mode === \"auto\" ? val[0] : val;\n\t default: return val;\n\t }\n\t }\n\t // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n\t function arrayHandler(callback, allTruthyMode) {\n\t return function handleArray(val) {\n\t if (predicates_1.isArray(val) && val.length === 0)\n\t return val;\n\t var arr = arrayWrap(val);\n\t var result = common_1.map(arr, callback);\n\t return (allTruthyMode === true) ? common_1.filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n\t };\n\t }\n\t // Wraps type (.equals) functions to operate on each value of an array\n\t function arrayEqualsHandler(callback) {\n\t return function handleArray(val1, val2) {\n\t var left = arrayWrap(val1), right = arrayWrap(val2);\n\t if (left.length !== right.length)\n\t return false;\n\t for (var i = 0; i < left.length; i++) {\n\t if (!callback(left[i], right[i]))\n\t return false;\n\t }\n\t return true;\n\t };\n\t }\n\t ['encode', 'decode', 'equals', '$normalize'].forEach(function (name) {\n\t var paramTypeFn = type[name].bind(type);\n\t var wrapperFn = name === 'equals' ? arrayEqualsHandler : arrayHandler;\n\t _this[name] = wrapperFn(paramTypeFn);\n\t });\n\t common_1.extend(this, {\n\t dynamic: type.dynamic,\n\t name: type.name,\n\t pattern: type.pattern,\n\t inherit: type.inherit,\n\t is: arrayHandler(type.is.bind(type), true),\n\t $arrayMode: mode\n\t });\n\t}", "function typed_to_plain(tarr) {\n var retval = new Array(tarr.length)\n for (var i = 0; i < tarr.length; i++) {\n retval[i] = tarr[i]\n }\n return retval\n }", "function Arr(){ return Literal.apply(this,arguments) }", "function ArrayType(type, mode) {\n var _this = this;\n // Wrap non-array value as array\n function arrayWrap(val) {\n return isArray(val) ? val : isDefined(val) ? [val] : [];\n }\n // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n function arrayUnwrap(val) {\n switch (val.length) {\n case 0:\n return undefined;\n case 1:\n return mode === 'auto' ? val[0] : val;\n default:\n return val;\n }\n }\n // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0)\n return val;\n var arr = arrayWrap(val);\n var result = map(arr, callback);\n return allTruthyMode === true ? filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n };\n }\n // Wraps type (.equals) functions to operate on each value of an array\n function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length)\n return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i]))\n return false;\n }\n return true;\n };\n }\n ['encode', 'decode', 'equals', '$normalize'].forEach(function (name) {\n var paramTypeFn = type[name].bind(type);\n var wrapperFn = name === 'equals' ? arrayEqualsHandler : arrayHandler;\n _this[name] = wrapperFn(paramTypeFn);\n });\n extend(this, {\n dynamic: type.dynamic,\n name: type.name,\n pattern: type.pattern,\n inherit: type.inherit,\n is: arrayHandler(type.is.bind(type), true),\n $arrayMode: mode,\n });\n }", "function typed_to_plain(tarr) {\n var retval = new Array(tarr.length);\n for (var i = 0; i < tarr.length; i++) {\n retval[i] = tarr[i];\n }\n return retval;\n }", "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\t\tcase 0x8b5e: // SAMPLER_2D\n\t\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\t\treturn setValueT1Array;\n\n\t\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\t\treturn setValueT6Array;\n\n\t\t}\n\n\t}", "function Array() {}", "function encode([types, values]) {\n let outputBuffer = [];\n _.times(_.size(types), i => {\n const type = types[i];\n const value = values[i];\n outputBuffer.push(mappings[type].pack(value));\n });\n return outputBuffer;\n}", "function visit(mapFun, resultFun, array) {\n if (Array.isArray(array))\n return resultFun(array.map(mapFun));\n else\n return resultFun(array);\n}", "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t}\n\n}", "function writeIterable({ type, buffer, value, length }) {\n buffer.addAll(flexInt.makeValueBuffer(length));\n for (const instance of value)\n type.writeValue(buffer, instance);\n}", "function getPureArraySetter( type ) {\n\n\t \tswitch ( type ) {\n\n\t \t\tcase 0x1406: return setValue1fv; // FLOAT\n\t \t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t \t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t \t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t \t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t \t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t \t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t \t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t \t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t \t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t \t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t \t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t \t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t \t}\n\n\t }", "function getPureArraySetter( type ) {\n\t\n\t\t\tswitch ( type ) {\n\t\n\t\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\t\n\t\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\t\n\t\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\t\n\t\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\t\n\t\t\t}\n\t\n\t\t}", "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}", "function getPureArraySetter(type) {\n\n\tswitch (type) {\n\n\t\tcase 0x1406:\n\t\t\treturn setValue1fv; // FLOAT\n\t\tcase 0x8b50:\n\t\t\treturn setValueV2a; // _VEC2\n\t\tcase 0x8b51:\n\t\t\treturn setValueV3a; // _VEC3\n\t\tcase 0x8b52:\n\t\t\treturn setValueV4a; // _VEC4\n\n\t\tcase 0x8b5a:\n\t\t\treturn setValueM2a; // _MAT2\n\t\tcase 0x8b5b:\n\t\t\treturn setValueM3a; // _MAT3\n\t\tcase 0x8b5c:\n\t\t\treturn setValueM4a; // _MAT4\n\n\t\tcase 0x8b5e:\n\t\t\treturn setValueT1a; // SAMPLER_2D\n\t\tcase 0x8b60:\n\t\t\treturn setValueT6a; // SAMPLER_CUBE\n\n\t\tcase 0x1404:case 0x8b56:\n\t\t\treturn setValue1iv; // INT, BOOL\n\t\tcase 0x8b53:case 0x8b57:\n\t\t\treturn setValue2iv; // _VEC2\n\t\tcase 0x8b54:case 0x8b58:\n\t\t\treturn setValue3iv; // _VEC3\n\t\tcase 0x8b55:case 0x8b59:\n\t\t\treturn setValue4iv; // _VEC4\n\n\t}\n}", "function renderArray(array ,func){\n array.forEach(element => {\n func(element);\n });\n}", "transform(value) {\n if (Array.isArray(value)) {\n return 'array';\n }\n return typeof value;\n }", "if (value.constructor != Array){\n value = [value, value];\n }", "function getPureArraySetter( type ) {\n\n\t\t\tswitch ( type ) {\n\n\t\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t\t}\n\n\t\t}", "function _array(obj) {\n var stringifiers = this;\n return ('[' +\n obj\n .map(function (item) {\n return stringifiers[typeGuess_1.guessType(item)](item);\n })\n .toString() +\n ']');\n}", "__get_t(arr_val) {\n if (this.__is_1D_array(arr_val)) {\n const dtypes = []\n let int_tracker = []\n let float_tracker = []\n let string_tracker = []\n let bool_tracker = []\n let lim;\n\n //remove NaNs from array\n let arr = []\n arr_val.map(val => {\n if (!(isNaN(val) && typeof val != \"string\")) {\n arr.push(val)\n }\n })\n\n if (arr.length < config.get_dtype_test_lim) {\n lim = arr.length - 1\n } else {\n lim = config.get_dtype_test_lim - 1\n }\n arr.forEach((ele, indx) => {\n let count = indx\n if (typeof ele == 'boolean') {\n float_tracker.push(false)\n int_tracker.push(false)\n string_tracker.push(false)\n bool_tracker.push(true)\n } else if (!isNaN(Number(ele))) {\n\n if (ele.toString().includes(\".\")) {\n float_tracker.push(true)\n int_tracker.push(false)\n string_tracker.push(false)\n bool_tracker.push(false)\n } else {\n float_tracker.push(false)\n int_tracker.push(true)\n string_tracker.push(false)\n bool_tracker.push(false)\n\n }\n } else {\n float_tracker.push(false)\n int_tracker.push(false)\n string_tracker.push(true)\n bool_tracker.push(false)\n }\n\n if (count == lim) {\n //if atleast one string appears return string dtype\n const even = (element) => element == true;\n if (string_tracker.some(even)) {\n dtypes.push(\"string\")\n } else if (float_tracker.some(even)) {\n dtypes.push(\"float32\")\n } else if (int_tracker.some(even)) {\n dtypes.push(\"int32\")\n } else if (bool_tracker.some(even)) {\n dtypes.push(\"boolean\")\n } else {\n dtypes.push(\"undefined\")\n }\n }\n })\n\n return dtypes\n\n } else {\n const dtypes = []\n let lim;\n if (arr_val[0].length < config.get_dtype_test_lim) {\n lim = arr_val[0].length - 1\n } else {\n lim = config.get_dtype_test_lim - 1\n }\n arr_val.forEach((ele) => {\n let int_tracker = []\n let float_tracker = []\n let string_tracker = []\n let bool_tracker = []\n\n //remove NaNs from array before checking dtype\n let arr = []\n ele.map(val => {\n if (!(isNaN(val) && typeof val != \"string\")) {\n arr.push(val)\n } else {\n arr.push(\"NaN\") //set NaN to string and return dtype \"\"string\". The caller should explicitly convert the dtype\n }\n })\n\n arr.forEach((ele, indx) => {\n let count = indx\n if (typeof ele == 'boolean') {\n float_tracker.push(false)\n int_tracker.push(false)\n string_tracker.push(false)\n bool_tracker.push(true)\n\n } else if (!isNaN(Number(ele))) {\n\n if (ele.toString().includes(\".\")) {\n float_tracker.push(true)\n int_tracker.push(false)\n string_tracker.push(false)\n bool_tracker.push(false)\n } else {\n float_tracker.push(false)\n int_tracker.push(true)\n string_tracker.push(false)\n bool_tracker.push(false)\n\n }\n } else {\n float_tracker.push(false)\n int_tracker.push(false)\n string_tracker.push(true)\n bool_tracker.push(false)\n }\n\n if (count == lim) {\n //if atleast one string appears return string dtype\n const even = (element) => element == true;\n if (string_tracker.some(even)) {\n dtypes.push(\"string\")\n } else if (float_tracker.some(even)) {\n dtypes.push(\"float32\")\n } else if (int_tracker.some(even)) {\n dtypes.push(\"int32\")\n } else if (bool_tracker.some(even)) {\n dtypes.push(\"boolean\")\n } else {\n dtypes.push(\"undefined\")\n }\n }\n })\n\n });\n\n return dtypes\n }\n }", "replace( t, old_type, new_type ) {\n if(t.type==old_type) t.type = new_type\n if( Array.isArray(t.value) ) {\n var a = t.value\n for(var i=0; i<a.length; i++) a[i] = this.replace(a[i], old_type, new_type)\n } \n return t\n }", "function arrayWrap(val) {\n\t return predicates_1.isArray(val) ? val : (predicates_1.isDefined(val) ? [val] : []);\n\t }", "function arrayWrap(val) {\n\t return predicates_1.isArray(val) ? val : (predicates_1.isDefined(val) ? [val] : []);\n\t }", "function map(array, f){\n //create var for transformed array\n var transformed = [];\n //loop through the element\n each(array, function(element, index){\n //push the value from the parameter function (f) to transformed array\n transformed.push(f(element));\n });\n //return transformed array\n return transformed;\n}", "function w$(e){return Array.isArray(e)}", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }", "function setDataOfArray(array, data_type, data) {\n\tfor (let i=0; i < array.length; i++) {\n\t\tarray[i][data_type] = data;\n\t}\n}", "function arrayify(val /*: any*/, mapFn /*:: ?: Function*/) /*: Array<any>*/ {\n\t if (!val) return [];\n\t if (_lodashLangIsBoolean2[\"default\"](val)) return arrayify([val], mapFn);\n\t if (_lodashLangIsString2[\"default\"](val)) return arrayify(list(val), mapFn);\n\n\t if (Array.isArray(val)) {\n\t if (mapFn) val = val.map(mapFn);\n\t return val;\n\t }\n\n\t return [val];\n\t}", "function test (input) {\n for (var i = 0; i < input.length; i++) {\n\n if (Array.isArray(input[i])) {\n\n stringifier (input[i]);\n\n }\n \n else {\n \n converter (input[i]);\n \n \n }\n\n }\n \n }", "static castToPrimitiveType(field, data) {\n if (data.hasOwnProperty(field)) {\n if (Array.isArray(data[field])) {\n data[field] = data[field].map(val => detectType(val));\n } else {\n data[field] = detectType(data[field]);\n }\n }\n }", "function transformerList(val) {\n\t return util.arrayify(val);\n\t}", "function transformerList(val) {\n\t return util.arrayify(val);\n\t}", "function transformerList(val) {\n return util.arrayify(val);\n}", "function forEachArrayMethod(fn) {\n function call(name, mustConvertThisToArray) {\n var desc = Object.getOwnPropertyDescriptor(Array.prototype, name);\n fn(name, desc, !! mustConvertThisToArray);\n }\n\n call(\"every\");\n call(\"filter\");\n call(\"find\");\n call(\"findIndex\");\n call(\"forEach\");\n call(\"includes\");\n call(\"indexOf\");\n call(\"join\");\n call(\"lastIndexOf\");\n call(\"map\");\n call(\"reduce\");\n call(\"reduceRight\");\n call(\"slice\");\n call(\"some\");\n call(\"toLocaleString\");\n call(\"toString\");\n\n // The `reverse` and `sort` methods are usually destructive, but for\n // `tuple` objects they return a new `tuple` object that has been\n // appropriately reversed/sorted.\n call(\"reverse\", true);\n call(\"sort\", true);\n\n // Make `[...someTuple]` work.\n call(useSymbol && Symbol.iterator || \"@@iterator\");\n}", "function convertToArrs(elem) {\n return function(el) {\n return el.qs.map(convertTo(elem));\n };\n }", "function map(value, func) {\n if (isArray(value)) {\n var result = clone(value);\n\n for (var i = 0; i < result.length; ++i) {\n result[i] = func(result[i], i, result);\n }\n\n return result;\n }\n\n return func(value);\n} //", "function arrayify(val, mapFn) {\n\t if (!val) return [];\n\t if (_lodashLangIsBoolean2[\"default\"](val)) return arrayify([val], mapFn);\n\t if (_lodashLangIsString2[\"default\"](val)) return arrayify(list(val), mapFn);\n\n\t if (Array.isArray(val)) {\n\t if (mapFn) val = val.map(mapFn);\n\t return val;\n\t }\n\n\t return [val];\n\t}", "function arrayify(val, mapFn) {\n\t if (!val) return [];\n\t if (_lodashLangIsBoolean2[\"default\"](val)) return arrayify([val], mapFn);\n\t if (_lodashLangIsString2[\"default\"](val)) return arrayify(list(val), mapFn);\n\n\t if (Array.isArray(val)) {\n\t if (mapFn) val = val.map(mapFn);\n\t return val;\n\t }\n\n\t return [val];\n\t}", "function arrayify(val, mapFn) {\n\t if (!val) return [];\n\t if (_lodashLangIsBoolean2[\"default\"](val)) return arrayify([val], mapFn);\n\t if (_lodashLangIsString2[\"default\"](val)) return arrayify(list(val), mapFn);\n\n\t if (Array.isArray(val)) {\n\t if (mapFn) val = val.map(mapFn);\n\t return val;\n\t }\n\n\t return [val];\n\t}", "function encodeSingle (type, arg) {\n\t var size, num, ret, i\n\t\n\t if (type === 'address') {\n\t return encodeSingle('uint160', parseNumber(arg))\n\t } else if (type === 'bool') {\n\t return encodeSingle('uint8', arg ? 1 : 0)\n\t } else if (type === 'string') {\n\t return encodeSingle('bytes', new Buffer(arg, 'utf8'))\n\t } else if (isArray(type)) {\n\t // this part handles fixed-length ([2]) and variable length ([]) arrays\n\t // NOTE: we catch here all calls to arrays, that simplifies the rest\n\t if (typeof arg.length === 'undefined') {\n\t throw new Error('Not an array?')\n\t }\n\t size = parseTypeArray(type)\n\t if (size !== 'dynamic' && size !== 0 && arg.length > size) {\n\t throw new Error('Elements exceed array size: ' + size)\n\t }\n\t ret = []\n\t type = type.slice(0, type.lastIndexOf('['))\n\t if (typeof arg === 'string') {\n\t arg = JSON.parse(arg)\n\t }\n\t for (i in arg) {\n\t ret.push(encodeSingle(type, arg[i]))\n\t }\n\t if (size === 'dynamic') {\n\t var length = encodeSingle('uint256', arg.length)\n\t ret.unshift(length)\n\t }\n\t return Buffer.concat(ret)\n\t } else if (type === 'bytes') {\n\t arg = new Buffer(arg)\n\t\n\t ret = Buffer.concat([ encodeSingle('uint256', arg.length), arg ])\n\t\n\t if ((arg.length % 32) !== 0) {\n\t ret = Buffer.concat([ ret, utils.zeros(32 - (arg.length % 32)) ])\n\t }\n\t\n\t return ret\n\t } else if (type.startsWith('bytes')) {\n\t size = parseTypeN(type)\n\t if (size < 1 || size > 32) {\n\t throw new Error('Invalid bytes<N> width: ' + size)\n\t }\n\t\n\t return utils.setLengthRight(arg, 32)\n\t } else if (type.startsWith('uint')) {\n\t size = parseTypeN(type)\n\t if ((size % 8) || (size < 8) || (size > 256)) {\n\t throw new Error('Invalid uint<N> width: ' + size)\n\t }\n\t\n\t num = parseNumber(arg)\n\t if (num.bitLength() > size) {\n\t throw new Error('Supplied uint exceeds width: ' + size + ' vs ' + num.bitLength())\n\t }\n\t\n\t if (num < 0) {\n\t throw new Error('Supplied uint is negative')\n\t }\n\t\n\t return num.toArrayLike(Buffer, 'be', 32)\n\t } else if (type.startsWith('int')) {\n\t size = parseTypeN(type)\n\t if ((size % 8) || (size < 8) || (size > 256)) {\n\t throw new Error('Invalid int<N> width: ' + size)\n\t }\n\t\n\t num = parseNumber(arg)\n\t if (num.bitLength() > size) {\n\t throw new Error('Supplied int exceeds width: ' + size + ' vs ' + num.bitLength())\n\t }\n\t\n\t return num.toTwos(256).toArrayLike(Buffer, 'be', 32)\n\t } else if (type.startsWith('ufixed')) {\n\t size = parseTypeNxM(type)\n\t\n\t num = parseNumber(arg)\n\t\n\t if (num < 0) {\n\t throw new Error('Supplied ufixed is negative')\n\t }\n\t\n\t return encodeSingle('uint256', num.mul(new BN(2).pow(new BN(size[1]))))\n\t } else if (type.startsWith('fixed')) {\n\t size = parseTypeNxM(type)\n\t\n\t return encodeSingle('int256', parseNumber(arg).mul(new BN(2).pow(new BN(size[1]))))\n\t }\n\t\n\t throw new Error('Unsupported or invalid type: ' + type)\n\t}", "function pipe(arrOfFuncs, value) {\n\n}", "function ctResolveArray(str, values)\n{\n\tvar ret = '';\n\tvar type = ctParseType(str);\n\n\twhile (type['len'] !== undefined) {\n\t\tif (isNaN(parseInt(type['len'], 10))) {\n\t\t\tif (typeof (values[type['len']]) != 'number')\n\t\t\t\tthrow (new Error('cannot sawp in non-number ' +\n\t\t\t\t 'for array value'));\n\t\t\tret = '[' + values[type['len']] + ']' + ret;\n\t\t} else {\n\t\t\tret = '[' + type['len'] + ']' + ret;\n\t\t}\n\t\ttype = ctParseType(type['type']);\n\t}\n\n\tret = type['type'] + ret;\n\n\treturn (ret);\n}", "function decode([types, values]) {\n let outputBuffer = [];\n _.times(_.size(types), i => {\n const type = types[i];\n const value = values[i];\n outputBuffer.push(mappings[type].unpack(value));\n });\n return outputBuffer;\n}", "function s(e,t){this.fun=e,this.array=t}", "function encodeSingle (type, arg) {\n var size, num, ret, i\n\n if (type === 'address') {\n return encodeSingle('uint160', parseNumber(arg))\n } else if (type === 'bool') {\n return encodeSingle('uint8', arg ? 1 : 0)\n } else if (type === 'string') {\n return encodeSingle('bytes', Buffer.from(arg, 'utf8'))\n } else if (isArray(type)) {\n // this part handles fixed-length ([2]) and variable length ([]) arrays\n // NOTE: we catch here all calls to arrays, that simplifies the rest\n if (typeof arg.length === 'undefined') {\n throw new Error('Not an array?')\n }\n size = parseTypeArray(type)\n if (size !== 'dynamic' && size !== 0 && arg.length > size) {\n throw new Error('Elements exceed array size: ' + size)\n }\n ret = []\n type = type.slice(0, type.lastIndexOf('['))\n if (typeof arg === 'string') {\n arg = JSON.parse(arg)\n }\n for (i in arg) {\n ret.push(encodeSingle(type, arg[i]))\n }\n if (size === 'dynamic') {\n var length = encodeSingle('uint256', arg.length)\n ret.unshift(length)\n }\n return Buffer.concat(ret)\n } else if (type === 'bytes') {\n arg = Buffer.from(arg)\n\n ret = Buffer.concat([ encodeSingle('uint256', arg.length), arg ])\n\n if ((arg.length % 32) !== 0) {\n ret = Buffer.concat([ ret, utils.zeros(32 - (arg.length % 32)) ])\n }\n\n return ret\n } else if (type.startsWith('bytes')) {\n size = parseTypeN(type)\n if (size < 1 || size > 32) {\n throw new Error('Invalid bytes<N> width: ' + size)\n }\n\n return utils.setLengthRight(arg, 32)\n } else if (type.startsWith('uint')) {\n size = parseTypeN(type)\n if ((size % 8) || (size < 8) || (size > 256)) {\n throw new Error('Invalid uint<N> width: ' + size)\n }\n\n num = parseNumber(arg)\n if (num.bitLength() > size) {\n throw new Error('Supplied uint exceeds width: ' + size + ' vs ' + num.bitLength())\n }\n\n if (num < 0) {\n throw new Error('Supplied uint is negative')\n }\n\n return num.toArrayLike(Buffer, 'be', 32)\n } else if (type.startsWith('int')) {\n size = parseTypeN(type)\n if ((size % 8) || (size < 8) || (size > 256)) {\n throw new Error('Invalid int<N> width: ' + size)\n }\n\n num = parseNumber(arg)\n if (num.bitLength() > size) {\n throw new Error('Supplied int exceeds width: ' + size + ' vs ' + num.bitLength())\n }\n\n return num.toTwos(256).toArrayLike(Buffer, 'be', 32)\n } else if (type.startsWith('ufixed')) {\n size = parseTypeNxM(type)\n\n num = parseNumber(arg)\n\n if (num < 0) {\n throw new Error('Supplied ufixed is negative')\n }\n\n return encodeSingle('uint256', num.mul(new BN(2).pow(new BN(size[1]))))\n } else if (type.startsWith('fixed')) {\n size = parseTypeNxM(type)\n\n return encodeSingle('int256', parseNumber(arg).mul(new BN(2).pow(new BN(size[1]))))\n }\n\n throw new Error('Unsupported or invalid type: ' + type)\n}", "function encodeSingle (type, arg) {\n var size, num, ret, i\n\n if (type === 'address') {\n return encodeSingle('uint160', parseNumber(arg))\n } else if (type === 'bool') {\n return encodeSingle('uint8', arg ? 1 : 0)\n } else if (type === 'string') {\n return encodeSingle('bytes', Buffer.from(arg, 'utf8'))\n } else if (isArray(type)) {\n // this part handles fixed-length ([2]) and variable length ([]) arrays\n // NOTE: we catch here all calls to arrays, that simplifies the rest\n if (typeof arg.length === 'undefined') {\n throw new Error('Not an array?')\n }\n size = parseTypeArray(type)\n if (size !== 'dynamic' && size !== 0 && arg.length > size) {\n throw new Error('Elements exceed array size: ' + size)\n }\n ret = []\n type = type.slice(0, type.lastIndexOf('['))\n if (typeof arg === 'string') {\n arg = JSON.parse(arg)\n }\n for (i in arg) {\n ret.push(encodeSingle(type, arg[i]))\n }\n if (size === 'dynamic') {\n var length = encodeSingle('uint256', arg.length)\n ret.unshift(length)\n }\n return Buffer.concat(ret)\n } else if (type === 'bytes') {\n arg = Buffer.from(arg)\n\n ret = Buffer.concat([ encodeSingle('uint256', arg.length), arg ])\n\n if ((arg.length % 32) !== 0) {\n ret = Buffer.concat([ ret, utils.zeros(32 - (arg.length % 32)) ])\n }\n\n return ret\n } else if (type.startsWith('bytes')) {\n size = parseTypeN(type)\n if (size < 1 || size > 32) {\n throw new Error('Invalid bytes<N> width: ' + size)\n }\n\n return utils.setLengthRight(arg, 32)\n } else if (type.startsWith('uint')) {\n size = parseTypeN(type)\n if ((size % 8) || (size < 8) || (size > 256)) {\n throw new Error('Invalid uint<N> width: ' + size)\n }\n\n num = parseNumber(arg)\n if (num.bitLength() > size) {\n throw new Error('Supplied uint exceeds width: ' + size + ' vs ' + num.bitLength())\n }\n\n if (num < 0) {\n throw new Error('Supplied uint is negative')\n }\n\n return num.toArrayLike(Buffer, 'be', 32)\n } else if (type.startsWith('int')) {\n size = parseTypeN(type)\n if ((size % 8) || (size < 8) || (size > 256)) {\n throw new Error('Invalid int<N> width: ' + size)\n }\n\n num = parseNumber(arg)\n if (num.bitLength() > size) {\n throw new Error('Supplied int exceeds width: ' + size + ' vs ' + num.bitLength())\n }\n\n return num.toTwos(256).toArrayLike(Buffer, 'be', 32)\n } else if (type.startsWith('ufixed')) {\n size = parseTypeNxM(type)\n\n num = parseNumber(arg)\n\n if (num < 0) {\n throw new Error('Supplied ufixed is negative')\n }\n\n return encodeSingle('uint256', num.mul(new BN(2).pow(new BN(size[1]))))\n } else if (type.startsWith('fixed')) {\n size = parseTypeNxM(type)\n\n return encodeSingle('int256', parseNumber(arg).mul(new BN(2).pow(new BN(size[1]))))\n }\n\n throw new Error('Unsupported or invalid type: ' + type)\n}", "function createArrayMethod(type){\r\n var isMap = type == 1\r\n , isFilter = type == 2\r\n , isSome = type == 3\r\n , isEvery = type == 4\r\n , isFindIndex = type == 6\r\n , noholes = type == 5 || isFindIndex;\r\n return function(callbackfn/*, that = undefined */){\r\n var O = Object(assertDefined(this))\r\n , that = arguments[1]\r\n , self = ES5Object(O)\r\n , f = ctx(callbackfn, that, 3)\r\n , length = toLength(self.length)\r\n , index = 0\r\n , result = isMap ? Array(length) : isFilter ? [] : undefined\r\n , val, res;\r\n for(;length > index; index++)if(noholes || index in self){\r\n val = self[index];\r\n res = f(val, index, O);\r\n if(type){\r\n if(isMap)result[index] = res; // map\r\n else if(res)switch(type){\r\n case 3: return true; // some\r\n case 5: return val; // find\r\n case 6: return index; // findIndex\r\n case 2: result.push(val); // filter\r\n } else if(isEvery)return false; // every\r\n }\r\n }\r\n return isFindIndex ? -1 : isSome || isEvery ? isEvery : result;\r\n }\r\n}", "function map(value, func) {\n if (isArray(value)) {\n var result = clone(value);\n for (var i = 0; i < result.length; ++i) {\n result[i] = func(result[i], i, result);\n }\n return result;\n }\n return func(value);\n}" ]
[ "0.6362277", "0.61982536", "0.5944448", "0.5944448", "0.5895186", "0.58848447", "0.58508056", "0.58508056", "0.5708453", "0.5635075", "0.56344354", "0.5589951", "0.5579362", "0.55663633", "0.55500406", "0.55388385", "0.5481845", "0.54738003", "0.54528856", "0.5444366", "0.5444366", "0.5444366", "0.5444366", "0.5444366", "0.5444366", "0.5444366", "0.5444366", "0.5444366", "0.5444366", "0.5444366", "0.5444366", "0.5444366", "0.5444366", "0.5444366", "0.5432251", "0.5405713", "0.53857577", "0.5366691", "0.5366691", "0.5366691", "0.5366691", "0.5366691", "0.5366691", "0.5366691", "0.5366691", "0.53521705", "0.5349594", "0.5341228", "0.5330723", "0.5329807", "0.5282574", "0.5256354", "0.5248466", "0.5239503", "0.5239503", "0.5228422", "0.52119964", "0.5209942", "0.5209942", "0.5209942", "0.5209942", "0.5209942", "0.5209942", "0.5209942", "0.5209942", "0.5209942", "0.5209942", "0.5209942", "0.5209942", "0.5209942", "0.5209942", "0.5209942", "0.5209942", "0.5209942", "0.5209942", "0.5209942", "0.5209942", "0.5209942", "0.5209942", "0.5205347", "0.5189614", "0.5178786", "0.51723343", "0.51660484", "0.51660484", "0.5161652", "0.5157842", "0.5154065", "0.5147737", "0.51387215", "0.51387215", "0.51387215", "0.51380295", "0.51350766", "0.5124932", "0.5123354", "0.51182675", "0.5116734", "0.5116734", "0.51133126", "0.51114196" ]
0.0
-1
Wraps type (.equals) functions to operate on each value of an array
function arrayEqualsHandler(callback) { return function handleArray(val1, val2) { var left = arrayWrap(val1), right = arrayWrap(val2); if (left.length !== right.length) return false; for (var i = 0; i < left.length; i++) { if (!callback(left[i], right[i])) return false; } return true; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrayEqualsHandler(callback) {\n\t return function handleArray(val1, val2) {\n\t var left = arrayWrap(val1), right = arrayWrap(val2);\n\t if (left.length !== right.length) return false;\n\t for (var i = 0; i < left.length; i++) {\n\t if (!callback(left[i], right[i])) return false;\n\t }\n\t return true;\n\t };\n\t }", "function arrayEqualsHandler(callback) {\n\t return function handleArray(val1, val2) {\n\t var left = arrayWrap(val1), right = arrayWrap(val2);\n\t if (left.length !== right.length) return false;\n\t for (var i = 0; i < left.length; i++) {\n\t if (!callback(left[i], right[i])) return false;\n\t }\n\t return true;\n\t };\n\t }", "function arrayEqualsHandler(callback) {\n\t\t\t\treturn function handleArray(val1, val2) {\n\t\t\t\t\tvar left = arrayWrap(val1), right = arrayWrap(val2);\n\t\t\t\t\tif (left.length !== right.length) return false;\n\t\t\t\t\tfor (var i = 0; i < left.length; i++) {\n\t\t\t\t\t\tif (!callback(left[i], right[i])) return false;\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t};\n\t\t\t}", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1),\n right = arrayWrap(val2),\n i = 0;\n\n if (left.length !== right.length) { return false; }\n\n for (i = 0; i < left.length; i += 1) {\n if (!callback(left[i], right[i])) { return false; }\n }\n\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length)\n return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i]))\n return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length)\n return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i]))\n return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length)\n return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i]))\n return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length)\n return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i]))\n return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length)\n return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i]))\n return false;\n }\n return true;\n };\n }", "function arrayEqualsHandler(callback) {\n\t return function handleArray(val1, val2) {\n\t var left = arrayWrap(val1), right = arrayWrap(val2);\n\t if (left.length !== right.length)\n\t return false;\n\t for (var i = 0; i < left.length; i++) {\n\t if (!callback(left[i], right[i]))\n\t return false;\n\t }\n\t return true;\n\t };\n\t }", "function arrayEqualsHandler(callback) {\n\t return function handleArray(val1, val2) {\n\t var left = arrayWrap(val1), right = arrayWrap(val2);\n\t if (left.length !== right.length)\n\t return false;\n\t for (var i = 0; i < left.length; i++) {\n\t if (!callback(left[i], right[i]))\n\t return false;\n\t }\n\t return true;\n\t };\n\t }", "function ArrayType(type, mode) {\n var _this = this;\n // Wrap non-array value as array\n function arrayWrap(val) {\n return predicates_1.isArray(val) ? val : (predicates_1.isDefined(val) ? [val] : []);\n }\n // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n function arrayUnwrap(val) {\n switch (val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }\n // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (predicates_1.isArray(val) && val.length === 0)\n return val;\n var arr = arrayWrap(val);\n var result = common_1.map(arr, callback);\n return (allTruthyMode === true) ? common_1.filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n };\n }\n // Wraps type (.equals) functions to operate on each value of an array\n function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length)\n return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i]))\n return false;\n }\n return true;\n };\n }\n ['encode', 'decode', 'equals', '$normalize'].forEach(function (name) {\n var paramTypeFn = type[name].bind(type);\n var wrapperFn = name === 'equals' ? arrayEqualsHandler : arrayHandler;\n _this[name] = wrapperFn(paramTypeFn);\n });\n common_1.extend(this, {\n dynamic: type.dynamic,\n name: type.name,\n pattern: type.pattern,\n inherit: type.inherit,\n is: arrayHandler(type.is.bind(type), true),\n $arrayMode: mode\n });\n}", "function ArrayType(type, mode) {\n var _this = this;\n // Wrap non-array value as array\n function arrayWrap(val) {\n return predicates_1.isArray(val) ? val : (predicates_1.isDefined(val) ? [val] : []);\n }\n // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n function arrayUnwrap(val) {\n switch (val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }\n // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (predicates_1.isArray(val) && val.length === 0)\n return val;\n var arr = arrayWrap(val);\n var result = common_1.map(arr, callback);\n return (allTruthyMode === true) ? common_1.filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n };\n }\n // Wraps type (.equals) functions to operate on each value of an array\n function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length)\n return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i]))\n return false;\n }\n return true;\n };\n }\n ['encode', 'decode', 'equals', '$normalize'].forEach(function (name) {\n var paramTypeFn = type[name].bind(type);\n var wrapperFn = name === 'equals' ? arrayEqualsHandler : arrayHandler;\n _this[name] = wrapperFn(paramTypeFn);\n });\n common_1.extend(this, {\n dynamic: type.dynamic,\n name: type.name,\n pattern: type.pattern,\n inherit: type.inherit,\n is: arrayHandler(type.is.bind(type), true),\n $arrayMode: mode\n });\n}", "function equals(a, b) {\n\tconsole.log(a.constructor);\n\tif (a.constructor === Array && b.constructor === Array) {\n\t\treturn a.every(a => {\n\t\t\tconsole.log({ a });\n\t\t\treturn b.every(b => {\n\t\t\t\tconsole.log({ b });\n\t\t\t\treturn a === b;\n\t\t\t});\n\t\t});\n\t} else {\n\t\treturn [a].every(a => {\n\t\t\tconsole.log({ a });\n\t\t\treturn [b].every(b => {\n\t\t\t\tconsole.log({ b });\n\t\t\t\treturn a === b;\n\t\t\t});\n\t\t});\n\t}\n}", "function ArrayType(type, mode) {\n var _this = this;\n // Wrap non-array value as array\n function arrayWrap(val) {\n return isArray(val) ? val : (isDefined(val) ? [val] : []);\n }\n // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n function arrayUnwrap(val) {\n switch (val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }\n // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0)\n return val;\n var arr = arrayWrap(val);\n var result = map(arr, callback);\n return (allTruthyMode === true) ? filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n };\n }\n // Wraps type (.equals) functions to operate on each value of an array\n function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length)\n return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i]))\n return false;\n }\n return true;\n };\n }\n ['encode', 'decode', 'equals', '$normalize'].forEach(function (name) {\n var paramTypeFn = type[name].bind(type);\n var wrapperFn = name === 'equals' ? arrayEqualsHandler : arrayHandler;\n _this[name] = wrapperFn(paramTypeFn);\n });\n extend(this, {\n dynamic: type.dynamic,\n name: type.name,\n pattern: type.pattern,\n inherit: type.inherit,\n is: arrayHandler(type.is.bind(type), true),\n $arrayMode: mode\n });\n}", "function ArrayType(type, mode) {\n var _this = this;\n // Wrap non-array value as array\n function arrayWrap(val) {\n return isArray(val) ? val : (isDefined(val) ? [val] : []);\n }\n // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n function arrayUnwrap(val) {\n switch (val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }\n // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0)\n return val;\n var arr = arrayWrap(val);\n var result = map(arr, callback);\n return (allTruthyMode === true) ? filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n };\n }\n // Wraps type (.equals) functions to operate on each value of an array\n function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length)\n return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i]))\n return false;\n }\n return true;\n };\n }\n ['encode', 'decode', 'equals', '$normalize'].forEach(function (name) {\n var paramTypeFn = type[name].bind(type);\n var wrapperFn = name === 'equals' ? arrayEqualsHandler : arrayHandler;\n _this[name] = wrapperFn(paramTypeFn);\n });\n extend(this, {\n dynamic: type.dynamic,\n name: type.name,\n pattern: type.pattern,\n inherit: type.inherit,\n is: arrayHandler(type.is.bind(type), true),\n $arrayMode: mode\n });\n}", "static allEqualElements(array) {\n let arrayBase = array[0]\n for (let i = 0; i < array.length; i++) {\n if (array[i] !== arrayBase) {\n return false\n }\n }\n return true;\n }", "function ArrayType(type, mode) {\n\t var _this = this;\n\t // Wrap non-array value as array\n\t function arrayWrap(val) {\n\t return predicates_1.isArray(val) ? val : (predicates_1.isDefined(val) ? [val] : []);\n\t }\n\t // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n\t function arrayUnwrap(val) {\n\t switch (val.length) {\n\t case 0: return undefined;\n\t case 1: return mode === \"auto\" ? val[0] : val;\n\t default: return val;\n\t }\n\t }\n\t // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n\t function arrayHandler(callback, allTruthyMode) {\n\t return function handleArray(val) {\n\t if (predicates_1.isArray(val) && val.length === 0)\n\t return val;\n\t var arr = arrayWrap(val);\n\t var result = common_1.map(arr, callback);\n\t return (allTruthyMode === true) ? common_1.filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n\t };\n\t }\n\t // Wraps type (.equals) functions to operate on each value of an array\n\t function arrayEqualsHandler(callback) {\n\t return function handleArray(val1, val2) {\n\t var left = arrayWrap(val1), right = arrayWrap(val2);\n\t if (left.length !== right.length)\n\t return false;\n\t for (var i = 0; i < left.length; i++) {\n\t if (!callback(left[i], right[i]))\n\t return false;\n\t }\n\t return true;\n\t };\n\t }\n\t ['encode', 'decode', 'equals', '$normalize'].forEach(function (name) {\n\t var paramTypeFn = type[name].bind(type);\n\t var wrapperFn = name === 'equals' ? arrayEqualsHandler : arrayHandler;\n\t _this[name] = wrapperFn(paramTypeFn);\n\t });\n\t common_1.extend(this, {\n\t dynamic: type.dynamic,\n\t name: type.name,\n\t pattern: type.pattern,\n\t inherit: type.inherit,\n\t is: arrayHandler(type.is.bind(type), true),\n\t $arrayMode: mode\n\t });\n\t}", "function ArrayType(type, mode) {\n\t var _this = this;\n\t // Wrap non-array value as array\n\t function arrayWrap(val) {\n\t return predicates_1.isArray(val) ? val : (predicates_1.isDefined(val) ? [val] : []);\n\t }\n\t // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n\t function arrayUnwrap(val) {\n\t switch (val.length) {\n\t case 0: return undefined;\n\t case 1: return mode === \"auto\" ? val[0] : val;\n\t default: return val;\n\t }\n\t }\n\t // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n\t function arrayHandler(callback, allTruthyMode) {\n\t return function handleArray(val) {\n\t if (predicates_1.isArray(val) && val.length === 0)\n\t return val;\n\t var arr = arrayWrap(val);\n\t var result = common_1.map(arr, callback);\n\t return (allTruthyMode === true) ? common_1.filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n\t };\n\t }\n\t // Wraps type (.equals) functions to operate on each value of an array\n\t function arrayEqualsHandler(callback) {\n\t return function handleArray(val1, val2) {\n\t var left = arrayWrap(val1), right = arrayWrap(val2);\n\t if (left.length !== right.length)\n\t return false;\n\t for (var i = 0; i < left.length; i++) {\n\t if (!callback(left[i], right[i]))\n\t return false;\n\t }\n\t return true;\n\t };\n\t }\n\t ['encode', 'decode', 'equals', '$normalize'].forEach(function (name) {\n\t var paramTypeFn = type[name].bind(type);\n\t var wrapperFn = name === 'equals' ? arrayEqualsHandler : arrayHandler;\n\t _this[name] = wrapperFn(paramTypeFn);\n\t });\n\t common_1.extend(this, {\n\t dynamic: type.dynamic,\n\t name: type.name,\n\t pattern: type.pattern,\n\t is: arrayHandler(type.is.bind(type), true),\n\t $arrayMode: mode\n\t });\n\t}", "function check_array(arr, value, law)\r\n{\r\n var op = law;\r\n for (key_temp in arr)\r\n {\r\n if (op)\r\n {\r\n if (operators[op](arr[key_temp], value))\r\n {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n}", "function check_array(arr, value, law)\n{\n var op = law;\n\n for (key_temp in arr)\n {\n if (op)\n {\n if (operators[op](arr[key_temp], value))\n {\n return true;\n }\n }\n }\n return false;\n}", "function arrayEquals(array) {\n // if the other array is a falsy value, return\n if (!array)\n return false;\n\n // compare lengths - can save a lot of time\n if (this.length != array.length)\n return false;\n\n for (var i = 0, l=this.length; i < l; i++) {\n // Check if we have nested arrays\n if (this[i] instanceof Array && array[i] instanceof Array) {\n // recurse into the nested arrays\n if (!this[i].equals(array[i]))\n return false;\n }\n else if (this[i] != array[i]) {\n // Warning - two different object instances will never be equal: {x:20} != {x:20}\n return false;\n }\n }\n return true;\n }", "function arrayEquals(array) {\n // if the other array is a falsy value, return\n if (!array)\n return false;\n\n // compare lengths - can save a lot of time\n if (this.length != array.length)\n return false;\n\n for (var i = 0, l=this.length; i < l; i++) {\n // Check if we have nested arrays\n if (this[i] instanceof Array && array[i] instanceof Array) {\n // recurse into the nested arrays\n if (!this[i].equals(array[i]))\n return false;\n }\n else if (this[i] != array[i]) {\n // Warning - two different object instances will never be equal: {x:20} != {x:20}\n return false;\n }\n }\n return true;\n }", "function every(array, test) {\n // Your code here.\n }", "function forEachType(array, type, fn, thisArg) {\n array.forEach(function (value) {\n if (value instanceof type) {\n fn.call(thisArg, value);\n }\n });\n}", "function jt(t){return\"[object Array]\"===Rt.call(t)}", "function any(func, array){\n for (var i=0; i<array.length; i++){\n\t if (func(array[i])) return true;\n }\n return false;\n }", "function all(func, array){\n for (var i=0; i<array.length; i++){\n\t if (!func(array[i])) return false;\n }\n return true;\n }", "function ArrayType(type, mode) {\n var _this = this;\n // Wrap non-array value as array\n function arrayWrap(val) {\n return isArray(val) ? val : isDefined(val) ? [val] : [];\n }\n // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n function arrayUnwrap(val) {\n switch (val.length) {\n case 0:\n return undefined;\n case 1:\n return mode === 'auto' ? val[0] : val;\n default:\n return val;\n }\n }\n // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0)\n return val;\n var arr = arrayWrap(val);\n var result = map(arr, callback);\n return allTruthyMode === true ? filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n };\n }\n // Wraps type (.equals) functions to operate on each value of an array\n function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length)\n return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i]))\n return false;\n }\n return true;\n };\n }\n ['encode', 'decode', 'equals', '$normalize'].forEach(function (name) {\n var paramTypeFn = type[name].bind(type);\n var wrapperFn = name === 'equals' ? arrayEqualsHandler : arrayHandler;\n _this[name] = wrapperFn(paramTypeFn);\n });\n extend(this, {\n dynamic: type.dynamic,\n name: type.name,\n pattern: type.pattern,\n inherit: type.inherit,\n is: arrayHandler(type.is.bind(type), true),\n $arrayMode: mode,\n });\n }", "function eqArrays(array1, array2) {\n let isSame = (array1.length === array2.length) && array1.every(function(element, index) {\n return element === array2[index];\n });\n return isSame;\n //console.log(isSame);\n}", "function createArrayMethod(type){\r\n var isMap = type == 1\r\n , isFilter = type == 2\r\n , isSome = type == 3\r\n , isEvery = type == 4\r\n , isFindIndex = type == 6\r\n , noholes = type == 5 || isFindIndex;\r\n return function(callbackfn/*, that = undefined */){\r\n var O = Object(assertDefined(this))\r\n , that = arguments[1]\r\n , self = ES5Object(O)\r\n , f = ctx(callbackfn, that, 3)\r\n , length = toLength(self.length)\r\n , index = 0\r\n , result = isMap ? Array(length) : isFilter ? [] : undefined\r\n , val, res;\r\n for(;length > index; index++)if(noholes || index in self){\r\n val = self[index];\r\n res = f(val, index, O);\r\n if(type){\r\n if(isMap)result[index] = res; // map\r\n else if(res)switch(type){\r\n case 3: return true; // some\r\n case 5: return val; // find\r\n case 6: return index; // findIndex\r\n case 2: result.push(val); // filter\r\n } else if(isEvery)return false; // every\r\n }\r\n }\r\n return isFindIndex ? -1 : isSome || isEvery ? isEvery : result;\r\n }\r\n}", "function same(arr){\n\nlet result = arr.every((elem)=>{\n return elem === arr[0];\n })\nreturn result\n}", "function every (array, f){\n for (var i =0; i<array.length; i++){ \n if (!f(array[i]))\n return false;\n }\n return true;\n}", "function arrayEquals(a, b, identityAccessor) {\n if (a.length !== b.length) return false;\n\n for (var i = 0; i < a.length; i++) {\n var valueA = a[i];\n var valueB = b[i];\n\n if (identityAccessor) {\n valueA = identityAccessor(valueA);\n valueB = identityAccessor(valueB);\n }\n\n if (valueB !== valueA) {\n return false;\n }\n }\n\n return true;\n }", "function arrayEquals(a, b, identityAccessor) {\n if (a.length !== b.length)\n return false;\n for (let i = 0; i < a.length; i++) {\n let valueA = a[i];\n let valueB = b[i];\n if (identityAccessor) {\n valueA = identityAccessor(valueA);\n valueB = identityAccessor(valueB);\n }\n if (valueB !== valueA) {\n return false;\n }\n }\n return true;\n}", "function arrayEquals(a, b, identityAccessor) {\n if (a.length !== b.length)\n return false;\n for (let i = 0; i < a.length; i++) {\n let valueA = a[i];\n let valueB = b[i];\n if (identityAccessor) {\n valueA = identityAccessor(valueA);\n valueB = identityAccessor(valueB);\n }\n if (valueB !== valueA) {\n return false;\n }\n }\n return true;\n}", "function arrayEquals(a, b, identityAccessor) {\n if (a.length !== b.length)\n return false;\n for (let i = 0; i < a.length; i++) {\n let valueA = a[i];\n let valueB = b[i];\n if (identityAccessor) {\n valueA = identityAccessor(valueA);\n valueB = identityAccessor(valueB);\n }\n if (valueB !== valueA) {\n return false;\n }\n }\n return true;\n}", "function arrayEquals(a, b, identityAccessor) {\n if (a.length !== b.length)\n return false;\n for (let i = 0; i < a.length; i++) {\n let valueA = a[i];\n let valueB = b[i];\n if (identityAccessor) {\n valueA = identityAccessor(valueA);\n valueB = identityAccessor(valueB);\n }\n if (valueB !== valueA) {\n return false;\n }\n }\n return true;\n}", "function arrayEquals(a, b, identityAccessor) {\n if (a.length !== b.length)\n return false;\n for (let i = 0; i < a.length; i++) {\n let valueA = a[i];\n let valueB = b[i];\n if (identityAccessor) {\n valueA = identityAccessor(valueA);\n valueB = identityAccessor(valueB);\n }\n if (valueB !== valueA) {\n return false;\n }\n }\n return true;\n}", "function j(n){return\"[object Array]\"===x.call(n)}", "function SquareArrayVals(arr){\n}", "function arrayEquals(array1, array2) {\n // if the other array is a falsy value, return\n if (!array2) {\n return false;\n } // compare lengths - can save a lot of time\n\n\n if (array1.length !== array2.length) {\n return false;\n }\n\n for (let i = 0, l = array1.length; i < l; i++) {\n // Check if we have nested arrays\n if (array1[i] instanceof Array && array2[i] instanceof Array) {\n // recurse into the nested arrays\n if (!array1[i].equals(array2[i])) {\n return false;\n }\n } else if (array1[i] !== array2[i]) {\n // Warning - two different object instances will never be\n // equal: {x:20} != {x:20}\n return false;\n }\n }\n\n return true;\n}", "function arrayOf (rule, a) {\n\t return low.isArray(a) && a.every(rule)\n\t}", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n\t return function handleArray(val) {\n\t val = arrayWrap(val);\n\t var result = map(val, callback);\n\t if (allTruthyMode === true)\n\t return filter(result, falsey).length === 0;\n\t return arrayUnwrap(result);\n\t };\n\t }", "function checkValuesArray(values)\n\t\t{\n\t\t\treturn values.every(function(value)\t\t//loop until true\n\t\t\t{\n\t\t\t\tvar type = EZ.is(value, RegExp) ? 'regex' : typeof(value);\n\t\t\t\tswitch(typeof type)\n\t\t\t\t{\n\t\t\t\t\tcase 'regex': \treturn value.test(arg.valueOf());\n\n\t\t\t\t\tcase 'boolean':\n\t\t\t\t\tcase 'number':\treturn arg.valueOf() == value;\t//allow js coercion\n\n\t\t\t\t\tcase 'string':\treturn arg.toString() === value;\n\t\t\t\t\tcase 'function':return EZ.is(arg,value)\n\t\t\t\t\tcase 'object': \treturn arg === value;\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function checkValuesArray(values)\n\t\t{\n\t\t\treturn values.every(function(value)\t\t//loop until true\n\t\t\t{\n\t\t\t\tvar type = EZ.is(value, RegExp) ? 'regex' : typeof(value);\n\t\t\t\tswitch(typeof type)\n\t\t\t\t{\n\t\t\t\t\tcase 'regex': \treturn value.test(arg.valueOf());\n\n\t\t\t\t\tcase 'boolean':\n\t\t\t\t\tcase 'number':\treturn arg.valueOf() == value;\t//allow js coercion\n\n\t\t\t\t\tcase 'string':\treturn arg.toString() === value;\n\t\t\t\t\tcase 'function':return EZ.is(arg,value)\n\t\t\t\t\tcase 'object': \treturn arg === value;\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function create_array_equal(){\n //enter your code here\n var g = 0;\n return function equals(a,b){g++; console.log(g);\n \treturn array_equal(a,b)}\n}", "function testAny(arr, fn) {\n for(var i=0;i<arr.length;i++) {\n if(fn(arr[i])) {\n return true;\n }\n }\n return false;\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function ve(t, e) {\n for (var n = Ie(e), r = function(t) {\n n.some((function(e) {\n return ct(e, t);\n })) || n.push(t);\n }, i = 0, o = t.elements; i < o.length; i++) {\n r(o[i]);\n }\n return {\n arrayValue: {\n values: n\n }\n };\n}", "function some(array, f){\n\t// var status = false;\n\tfor (var i = 0; i < array.length; i++){\n\t\tif (f(array[i])) return true;\n\t}\n\treturn false;\n}", "static allEqualElements(array) {\n let firstElement = array[0]\n for (let i = 1; i < array.length; i++) {\n if (array[i] !== firstElement) {\n return false;\n }\n }\n return true;\n }", "function $forall(o, cb) {\n\t\tif (o instanceof Uint8Array) {\n\t\t\tfor (var i = 0, l = o.length; i < l; i++) {\n\t\t\t\t$k[$j++] = o[i];\n\t\t\t\tif (cb && cb() == $b) break;\n\t\t\t}\n\t\t} else if (o instanceof Array) {\n\t\t\t// The array may be a view.\n\t\t\tfor (var a = o.b, i = o.o, l = o.o + o.length; i < l; i++) {\n\t\t\t\t$k[$j++] = a[i];\n\t\t\t\tif (cb && cb() == $b) break;\n\t\t\t}\n\t\t} else if (typeof o === 'string') {\n\t\t\tfor (var i = 0, l = o.length; i < l; i++) {\n\t\t\t\t$k[$j++] = o.charCodeAt(i);\n\t\t\t\tif (cb && cb() == $b) break;\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var id in o) {\n\t\t\t\t$k[$j++] = id;\n\t\t\t\t$k[$j++] = o[id];\n\t\t\t\tif (cb && cb() == $b) break;\n\t\t\t}\n\t\t}\n\t}", "function Arguments$prototype$equals(other) {\n return Array$prototype$equals.call (this, other);\n }", "function checkType(houseArr, nDataType)\n {\n console.log(\"in the method checkType\");\n return houseArr.every(function(item){\n console.log(typeof(item));\n return typeof(item) === nDataType;\n }, nDataType);\n }", "function arrayEqualTo(arr, target) {\n return arr.filter(function(val) {\n if(val != target) {\n return true;\n }\n }).map(function(val) {\n return val**2;\n })\n}", "function vt(t) {\n return !!t && \"arrayValue\" in t;\n}", "function function1(array1){\n return array1.ownerName == \"Luke\";\n }", "function arrayHandler(callback, allTruthyMode) {\n\t return function handleArray(val) {\n\t if (isArray(val) && val.length === 0) return val;\n\t val = arrayWrap(val);\n\t var result = map(val, callback);\n\t if (allTruthyMode === true)\n\t return filter(result, falsey).length === 0;\n\t return arrayUnwrap(result);\n\t };\n\t }", "function Arguments$prototype$equals(other) {\n return Array$prototype$equals.call(this, other);\n }", "function isArray(val){return(val instanceof Array);}", "function arrayHandler(callback, allTruthyMode) {\n\t\t\t\treturn function handleArray(val) {\n\t\t\t\t\tif (isArray(val) && val.length === 0) return val;\n\t\t\t\t\tval = arrayWrap(val);\n\t\t\t\t\tvar result = map(val, callback);\n\t\t\t\t\tif (allTruthyMode === true)\n\t\t\t\t\t\treturn filter(result, falsey).length === 0;\n\t\t\t\t\treturn arrayUnwrap(result);\n\t\t\t\t};\n\t\t\t}", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n var result;\n\n if (_.isArray(val) && val.length === 0) { return val; }\n\n val = arrayWrap(val);\n result = _.map(val, callback);\n\n if (allTruthyMode === true) {\n return _.filter(result, falsey).length === 0;\n }\n\n return arrayUnwrap(result);\n };\n }", "function equals(a, b, callback){\n\t callback = callback || is;\n\n\t if (!isArray(a) || !isArray(b)) {\n\t return callback(a, b);\n\t }\n\n\t if (a.length !== b.length) {\n\t return false;\n\t }\n\n\t return every(a, makeCompare(callback), b);\n\t }", "function allSameType (input) {\n var type = typeof input[0];\n return input.every(function(val){\n return typeof val === type;\n })\n}", "function forEachArrayMethod(fn) {\n function call(name, mustConvertThisToArray) {\n var desc = Object.getOwnPropertyDescriptor(Array.prototype, name);\n fn(name, desc, !! mustConvertThisToArray);\n }\n\n call(\"every\");\n call(\"filter\");\n call(\"find\");\n call(\"findIndex\");\n call(\"forEach\");\n call(\"includes\");\n call(\"indexOf\");\n call(\"join\");\n call(\"lastIndexOf\");\n call(\"map\");\n call(\"reduce\");\n call(\"reduceRight\");\n call(\"slice\");\n call(\"some\");\n call(\"toLocaleString\");\n call(\"toString\");\n\n // The `reverse` and `sort` methods are usually destructive, but for\n // `tuple` objects they return a new `tuple` object that has been\n // appropriately reversed/sorted.\n call(\"reverse\", true);\n call(\"sort\", true);\n\n // Make `[...someTuple]` work.\n call(useSymbol && Symbol.iterator || \"@@iterator\");\n}", "function dataTypeChecker(arr) {\n let dataType = typeof arr[0];\n let same = true;\n for (let i = 0; i < arr.length; i++) {\n if (dataType !== typeof arr[i]) {\n return (same = false);\n }\n }\n return same;\n}", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }", "function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }" ]
[ "0.65492845", "0.65492845", "0.6536716", "0.65311587", "0.65311587", "0.65311587", "0.65311587", "0.65311587", "0.65311587", "0.65311587", "0.65311587", "0.65311587", "0.65311587", "0.65311587", "0.65311587", "0.65311587", "0.65311587", "0.65311587", "0.65311587", "0.65311587", "0.65311587", "0.6528816", "0.6515534", "0.64770573", "0.64770573", "0.64770573", "0.64770573", "0.6471201", "0.6464031", "0.6464031", "0.6167096", "0.6167096", "0.60850775", "0.59581053", "0.59581053", "0.58388084", "0.58056176", "0.5797576", "0.5758041", "0.5728858", "0.5652129", "0.5652129", "0.564169", "0.5619477", "0.5616454", "0.5592325", "0.5549025", "0.55489814", "0.55194247", "0.5499893", "0.5495365", "0.5462736", "0.5455024", "0.5454349", "0.5454349", "0.5454349", "0.5454349", "0.5454349", "0.5434223", "0.5408571", "0.5392411", "0.5376923", "0.5342107", "0.53315663", "0.533135", "0.5317445", "0.5317445", "0.5310758", "0.5308974", "0.52948594", "0.52948594", "0.52948594", "0.52948594", "0.52948594", "0.5294304", "0.5287463", "0.52772975", "0.5262152", "0.5234615", "0.5219813", "0.5218018", "0.521654", "0.5215334", "0.5212231", "0.52061945", "0.5203206", "0.5202058", "0.5200987", "0.51924694", "0.51805073", "0.5179534", "0.517858", "0.5176569", "0.5176569", "0.5176569", "0.5176569", "0.5176569", "0.5176569", "0.5176569", "0.5176569" ]
0.6572565
0
`flushTypeQueue()` waits until `$urlMatcherFactory` is injected before invoking the queued `definitionFn`s
function flushTypeQueue() { while(typeQueue.length) { var type = typeQueue.shift(); if (type.pattern) throw new Error("You cannot override a type's .pattern at runtime."); angular.extend($types[type.name], injector.invoke(type.def)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function flushTypeQueue() {\n\t while(typeQueue.length) {\n\t var type = typeQueue.shift();\n\t if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n\t angular.extend($types[type.name], injector.invoke(type.def));\n\t }\n\t }", "function flushTypeQueue() {\n\t while(typeQueue.length) {\n\t var type = typeQueue.shift();\n\t if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n\t angular.extend($types[type.name], injector.invoke(type.def));\n\t }\n\t }", "function flushTypeQueue() {\n while(typeQueue.length) {\n var type = typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }", "function flushTypeQueue() {\n while(typeQueue.length) {\n var type = typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }", "function flushTypeQueue() {\n while(typeQueue.length) {\n var type = typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }", "function flushTypeQueue() {\n while(typeQueue.length) {\n var type = typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }", "function flushTypeQueue() {\n while(typeQueue.length) {\n var type = typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }", "function flushTypeQueue() {\n while(typeQueue.length) {\n var type = typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }", "function flushTypeQueue() {\n while(typeQueue.length) {\n var type = typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }", "function flushTypeQueue() {\n while(typeQueue.length) {\n var type = typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }", "function flushTypeQueue() {\n while(typeQueue.length) {\n var type = typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }", "function flushTypeQueue() {\n while(typeQueue.length) {\n var type = typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }", "function flushTypeQueue() {\n while(typeQueue.length) {\n var type = typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }", "function flushTypeQueue() {\n while(typeQueue.length) {\n var type = typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }", "function flushTypeQueue() {\n while(typeQueue.length) {\n var type = typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }", "function flushTypeQueue() {\n while(typeQueue.length) {\n var type = typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }", "function flushTypeQueue() {\n while(typeQueue.length) {\n var type = typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }", "function flushTypeQueue() {\n while(typeQueue.length) {\n var type = typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }", "function flushTypeQueue() {\n while(typeQueue.length) {\n var type = typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }", "function flushTypeQueue() {\n while(typeQueue.length) {\n var type = typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }", "function flushTypeQueue() {\n while (typeQueue.length) {\n var type = typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }", "function flushTypeQueue() {\n\t\t\twhile(typeQueue.length) {\n\t\t\t\tvar type = typeQueue.shift();\n\t\t\t\tif (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n\t\t\t\tangular.extend($types[type.name], injector.invoke(type.def));\n\t\t\t}\n\t\t}", "function flushTypeQueue() {\n var type;\n\n while (typeQueue.length) {\n type = typeQueue.shift();\n if (type.pattern) {\n throw new Error(\"You cannot override a type's .pattern at runtime.\");\n }\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }", "function flush_queue() {\n $.each(action_queue, function () {\n // $ is a special case that means onload\n if (this.method === '$') {\n this.params.apply(this.node, []);\n }\n // otherwise call method on the jquery object with given params.\n else {\n if (!isTypeOf(this.params, 'Array')) {\n this.params = [this.params];\n }\n this.node[this.method].apply(this.node, this.params);\n }\n });\n action_queue = [];\n }", "function queue_deferred(provider, deferred) {\n let deflist = deferred_defs.get(provider);\n if (!_.isEmpty(deflist)) {\n deflist.push(deferred);\n } else {\n deferred_defs.set(provider, [deferred]);\n }\n }", "function takeinDefQueue() {\n if (languageQueue) {\n for (var i = 0; i < languageQueue.length; ++i) {\n manager.register(languageQueue[i]);\n }\n // For multiple require contexts to work.\n //sap.viz.extapi.manifest._queue.language.registerList = [];\n }\n }", "function setupQueueFunctionQueued() {\n // Generate all currently queued functions.\n generateAvailableQueued();\n }", "function flushModuleScopingQueueAsMuchAsPossible() {\n if (!flushingModuleQueue) {\n flushingModuleQueue = true;\n\n try {\n for (var i = moduleQueue.length - 1; i >= 0; i--) {\n var _moduleQueue$i = moduleQueue[i],\n moduleType = _moduleQueue$i.moduleType,\n ngModule = _moduleQueue$i.ngModule;\n\n if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) {\n // dequeue\n moduleQueue.splice(i, 1);\n setScopeOnDeclaredComponents(moduleType, ngModule);\n }\n }\n } finally {\n flushingModuleQueue = false;\n }\n }\n }", "function callQueue(qType, codeModule, FireTiming, DisplayErrors, codeID) {\n qType.push([codeModule, FireTiming, DisplayErrors, codeID]);\n }", "function flushModuleScopingQueueAsMuchAsPossible() {\n if (!flushingModuleQueue) {\n flushingModuleQueue = true;\n try {\n for (var i = moduleQueue.length - 1; i >= 0; i--) {\n var _a = moduleQueue[i], moduleType = _a.moduleType, ngModule = _a.ngModule;\n if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) {\n // dequeue\n moduleQueue.splice(i, 1);\n setScopeOnDeclaredComponents(moduleType, ngModule);\n }\n }\n }\n finally {\n flushingModuleQueue = false;\n }\n }\n}", "function flushModuleScopingQueueAsMuchAsPossible() {\n if (!flushingModuleQueue) {\n flushingModuleQueue = true;\n try {\n for (var i = moduleQueue.length - 1; i >= 0; i--) {\n var _a = moduleQueue[i], moduleType = _a.moduleType, ngModule = _a.ngModule;\n if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) {\n // dequeue\n moduleQueue.splice(i, 1);\n setScopeOnDeclaredComponents(moduleType, ngModule);\n }\n }\n }\n finally {\n flushingModuleQueue = false;\n }\n }\n}", "function flushModuleScopingQueueAsMuchAsPossible() {\n if (!flushingModuleQueue) {\n flushingModuleQueue = true;\n try {\n for (var i = moduleQueue.length - 1; i >= 0; i--) {\n var _a = moduleQueue[i], moduleType = _a.moduleType, ngModule = _a.ngModule;\n if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) {\n // dequeue\n moduleQueue.splice(i, 1);\n setScopeOnDeclaredComponents(moduleType, ngModule);\n }\n }\n }\n finally {\n flushingModuleQueue = false;\n }\n }\n}", "function flushModuleScopingQueueAsMuchAsPossible() {\n if (!flushingModuleQueue) {\n flushingModuleQueue = true;\n\n try {\n for (var i = moduleQueue.length - 1; i >= 0; i--) {\n var _moduleQueue$i = moduleQueue[i],\n moduleType = _moduleQueue$i.moduleType,\n ngModule = _moduleQueue$i.ngModule;\n\n if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) {\n // dequeue\n moduleQueue.splice(i, 1);\n setScopeOnDeclaredComponents(moduleType, ngModule);\n }\n }\n } finally {\n flushingModuleQueue = false;\n }\n }\n}", "function takeinDefQueue(){\r\n var langs = window.sap && sap.viz && sap.viz.extapi && sap.viz.extapi.manifest &&\r\n sap.viz.extapi.manifest._queue && sap.viz.extapi.manifest._queue.language &&\r\n sap.viz.extapi.manifest._queue.language.registerList;\r\n\r\n if(langs){\r\n for(var i = 0; i < langs.length; ++i){\r\n manager.register(langs[i]);\r\n }\r\n // For multiple require contexts to work.\r\n //sap.viz.extapi.manifest._queue.language.registerList = [];\r\n }\r\n }", "function flushModuleScopingQueueAsMuchAsPossible() {\n if (!flushingModuleQueue) {\n flushingModuleQueue = true;\n try {\n for (let i = moduleQueue.length - 1; i >= 0; i--) {\n const { moduleType, ngModule } = moduleQueue[i];\n if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) {\n // dequeue\n moduleQueue.splice(i, 1);\n setScopeOnDeclaredComponents(moduleType, ngModule);\n }\n }\n }\n finally {\n flushingModuleQueue = false;\n }\n }\n}", "function flushModuleScopingQueueAsMuchAsPossible() {\n if (!flushingModuleQueue) {\n flushingModuleQueue = true;\n try {\n for (let i = moduleQueue.length - 1; i >= 0; i--) {\n const { moduleType, ngModule } = moduleQueue[i];\n if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) {\n // dequeue\n moduleQueue.splice(i, 1);\n setScopeOnDeclaredComponents(moduleType, ngModule);\n }\n }\n }\n finally {\n flushingModuleQueue = false;\n }\n }\n}", "function flushModuleScopingQueueAsMuchAsPossible() {\n if (!flushingModuleQueue) {\n flushingModuleQueue = true;\n try {\n for (let i = moduleQueue.length - 1; i >= 0; i--) {\n const { moduleType, ngModule } = moduleQueue[i];\n if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) {\n // dequeue\n moduleQueue.splice(i, 1);\n setScopeOnDeclaredComponents(moduleType, ngModule);\n }\n }\n }\n finally {\n flushingModuleQueue = false;\n }\n }\n}", "function flushModuleScopingQueueAsMuchAsPossible() {\n if (!flushingModuleQueue) {\n flushingModuleQueue = true;\n try {\n for (let i = moduleQueue.length - 1; i >= 0; i--) {\n const { moduleType, ngModule } = moduleQueue[i];\n if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) {\n // dequeue\n moduleQueue.splice(i, 1);\n setScopeOnDeclaredComponents(moduleType, ngModule);\n }\n }\n }\n finally {\n flushingModuleQueue = false;\n }\n }\n}", "function flushModuleScopingQueueAsMuchAsPossible() {\n if (!flushingModuleQueue) {\n flushingModuleQueue = true;\n try {\n for (let i = moduleQueue.length - 1; i >= 0; i--) {\n const { moduleType, ngModule } = moduleQueue[i];\n if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) {\n // dequeue\n moduleQueue.splice(i, 1);\n setScopeOnDeclaredComponents(moduleType, ngModule);\n }\n }\n }\n finally {\n flushingModuleQueue = false;\n }\n }\n}", "function flushModuleScopingQueueAsMuchAsPossible() {\n if (!flushingModuleQueue) {\n flushingModuleQueue = true;\n try {\n for (let i = moduleQueue.length - 1; i >= 0; i--) {\n const { moduleType, ngModule } = moduleQueue[i];\n if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) {\n // dequeue\n moduleQueue.splice(i, 1);\n setScopeOnDeclaredComponents(moduleType, ngModule);\n }\n }\n }\n finally {\n flushingModuleQueue = false;\n }\n }\n}", "function _queuePattern() {\n // queue a default pattern\n this.queued_patterns.push(0);\n console.log(\"Queued Patterns: \", this.queued_patterns);\n}", "function flush() {\n\t\t\t\t\tvar i = 0;\n\t\t\t\t\twhile (i < fnQueueLen) {\n\t\t\t\t\t\tfn(fnQueue[i], fnQueue[i + 1]);\n\t\t\t\t\t\tfnQueue[i++] = $undefined;\n\t\t\t\t\t\tfnQueue[i++] = $undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\tfnQueueLen = 0;\n\t\t\t\t\tif (fnQueue.length > initQueueSize) fnQueue.length = initQueueSize;\n\t\t\t\t}", "function flushModuleScopingQueueAsMuchAsPossible(){if(!flushingModuleQueue){flushingModuleQueue=true;try{for(var i=moduleQueue.length-1;i>=0;i--){var _a=moduleQueue[i],moduleType=_a.moduleType,ngModule=_a.ngModule;if(ngModule.declarations&&ngModule.declarations.every(isResolvedDeclaration)){// dequeue\nmoduleQueue.splice(i,1);setScopeOnDeclaredComponents(moduleType,ngModule);}}}finally{flushingModuleQueue=false;}}}", "function processQueue() {\n var queue = nextTick.queue;\n var digest = nextTick.digest;\n\n nextTick.queue = [];\n nextTick.timeout = null;\n nextTick.digest = false;\n\n queue.forEach(function(queueItem) {\n var skip = queueItem.scope && queueItem.scope.$$destroyed;\n if (!skip) {\n queueItem.callback();\n }\n });\n\n if (digest) $rootScope.$digest();\n }", "function processQueue() {\n var queue = nextTick.queue;\n var digest = nextTick.digest;\n\n nextTick.queue = [];\n nextTick.timeout = null;\n nextTick.digest = false;\n\n queue.forEach(function(queueItem) {\n var skip = queueItem.scope && queueItem.scope.$$destroyed;\n if (!skip) {\n queueItem.callback();\n }\n });\n\n if (digest) $rootScope.$digest();\n }", "function processQueue() {\n var skip = scope && scope.$$destroyed;\n var queue = !skip ? nextTick.queue : [];\n var digest = !skip ? nextTick.digest : null;\n\n nextTick.queue = [];\n nextTick.timeout = null;\n nextTick.digest = false;\n\n queue.forEach(function(callback) {\n callback();\n });\n\n if (digest) $rootScope.$digest();\n }", "function processQueue() {\n var skip = scope && scope.$$destroyed;\n var queue = !skip ? nextTick.queue : [];\n var digest = !skip ? nextTick.digest : null;\n\n nextTick.queue = [];\n nextTick.timeout = null;\n nextTick.digest = false;\n\n queue.forEach(function(callback) {\n callback();\n });\n\n if (digest) $rootScope.$digest();\n }", "function processQueue() {\n var queue = nextTick.queue;\n var digest = nextTick.digest;\n\n nextTick.queue = [];\n nextTick.timeout = null;\n nextTick.digest = false;\n\n queue.forEach(function(queueItem) {\n var skip = queueItem.scope && queueItem.scope.$$destroyed;\n if (!skip) {\n queueItem.callback();\n }\n });\n\n if (digest) $rootScope.$digest();\n }", "function queueContentHooks(def, tView, i) {\n if (def.afterContentInit) {\n (tView.contentHooks || (tView.contentHooks = [])).push(i, def.afterContentInit);\n }\n if (def.afterContentChecked) {\n (tView.contentHooks || (tView.contentHooks = [])).push(i, def.afterContentChecked);\n (tView.contentCheckHooks || (tView.contentCheckHooks = [])).push(i, def.afterContentChecked);\n }\n}", "function queueContentHooks(def, tView, i) {\n if (def.afterContentInit) {\n (tView.contentHooks || (tView.contentHooks = [])).push(i, def.afterContentInit);\n }\n if (def.afterContentChecked) {\n (tView.contentHooks || (tView.contentHooks = [])).push(i, def.afterContentChecked);\n (tView.contentCheckHooks || (tView.contentCheckHooks = [])).push(i, def.afterContentChecked);\n }\n}", "function queueContentHooks(def, tView, i) {\n if (def.afterContentInit) {\n (tView.contentHooks || (tView.contentHooks = [])).push(i, def.afterContentInit);\n }\n if (def.afterContentChecked) {\n (tView.contentHooks || (tView.contentHooks = [])).push(i, def.afterContentChecked);\n (tView.contentCheckHooks || (tView.contentCheckHooks = [])).push(i, def.afterContentChecked);\n }\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function flushSchedulerQueue() {\n\t\t runSchedulerQueue(queue.sort(queueSorter));\n\t\t runSchedulerQueue(userQueue);\n\t\t // user watchers triggered more watchers,\n\t\t // keep flushing until it depletes\n\t\t if (queue.length) {\n\t\t return flushSchedulerQueue();\n\t\t }\n\t\t // devtool hook\n\t\t /* istanbul ignore if */\n\t\t if (devtools && config.devtools) {\n\t\t devtools.emit('flush');\n\t\t }\n\t\t resetSchedulerState();\n\t\t}", "function flushDeferredBindings() {\n var i = 0;\n while (i < deferredBindingQueue.length) {\n var context = deferredBindingQueue[i++];\n var count = deferredBindingQueue[i++];\n var prop = deferredBindingQueue[i++];\n var bindingIndex = deferredBindingQueue[i++];\n var sanitizationRequired = deferredBindingQueue[i++];\n registerBinding(context, count, prop, bindingIndex, sanitizationRequired);\n }\n deferredBindingQueue.length = 0;\n}", "function initAllQueue() {\n queue.clickTargetBlank.dequeue();\n queue.validClick.dequeue();\n}", "function queueSetup() {\n console.log(\"q setup done\");\n}", "function flushMountQueue () {\n\t while (mountQueue.length > 0) {\n\t var entityId = mountQueue.shift()\n\t var entity = entities[entityId]\n\t trigger('afterRender', entity, [entity.context, entity.nativeElement])\n\t trigger('afterMount', entity, [entity.context, entity.nativeElement, setState(entity)])\n\t }\n\t }", "function runQueue() {\n if(queue.length) {\n const f = queue.shift();\n window.setTimeout(() => {\n f();\n runQueue();\n }, 50);\n }\n }", "function clearQueue(){updateQueue.length=0;markupQueue.length=0;}", "function flush () {\n /* jshint unused: false */\n var f = document.documentElement.offsetHeight\n queue.forEach(run)\n queue = []\n queued = false\n}", "function flush () {\n /* jshint unused: false */\n var f = document.documentElement.offsetHeight\n queue.forEach(run)\n queue = []\n queued = false\n}" ]
[ "0.680272", "0.680272", "0.6773441", "0.6773441", "0.6773441", "0.6773441", "0.6773441", "0.6773441", "0.6773441", "0.6773441", "0.6773441", "0.6773441", "0.6773441", "0.6773441", "0.6773441", "0.6773441", "0.6773441", "0.6773441", "0.6773441", "0.6773441", "0.67564297", "0.67227554", "0.67199516", "0.5629819", "0.5521481", "0.5293386", "0.51508886", "0.5109559", "0.5103493", "0.5053747", "0.5053747", "0.5053747", "0.50366414", "0.5015684", "0.5010766", "0.5010766", "0.5010766", "0.5010766", "0.5010766", "0.5010766", "0.50041497", "0.49347645", "0.49151373", "0.48415667", "0.48415667", "0.4816336", "0.4816336", "0.48117828", "0.47940758", "0.47940758", "0.47940758", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.4720676", "0.47067493", "0.46949965", "0.46916652", "0.4685136", "0.46783683", "0.4658816", "0.4634166", "0.4630984", "0.4630984" ]
0.67488533
21
array config: param name (param[]) overrides default settings. explicit config overrides param name.
function getArrayMode() { var arrayDefaults = { array: (location === "search" ? "auto" : false) }; var arrayParamNomenclature = id.match(/\[\]$/) ? { array: true } : {}; return extend(arrayDefaults, arrayParamNomenclature, config).array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getArrayMode() {\n\t var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n\t var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n\t return extend(arrayDefaults, arrayParamNomenclature, config).array;\n\t }", "function getArrayMode() {\n\t var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n\t var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n\t return extend(arrayDefaults, arrayParamNomenclature, config).array;\n\t }", "function getArrayMode() {\n\t\t\t\tvar arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n\t\t\t\tvar arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n\t\t\t\treturn extend(arrayDefaults, arrayParamNomenclature, config).array;\n\t\t\t}", "function getArrayMode() {\n var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = {array: (location === \"search\" ? \"auto\" : false)};\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? {array: true} : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = {\n array: (location === \"search\" ? \"auto\" : false)\n },\n arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n\t var arrayDefaults = { array: (location === DefType.SEARCH ? \"auto\" : false) };\n\t var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n\t return common_1.extend(arrayDefaults, arrayParamNomenclature, config).array;\n\t }", "function getArrayMode() {\n\t var arrayDefaults = { array: (location === DefType.SEARCH ? \"auto\" : false) };\n\t var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n\t return common_1.extend(arrayDefaults, arrayParamNomenclature, config).array;\n\t }", "function getArrayMode() {\n var arrayDefaults = { array: location === exports.DefType.SEARCH ? 'auto' : false };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = { array: (location === exports.DefType.SEARCH ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = { array: (location === exports.DefType.SEARCH ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "stateParametersToArray() {\n const { parameters } = this.state;\n return Object.keys(parameters).map(key => {\n const item = parameters[key];\n return { name: item.name, value: item.defaultParameterValue.value };\n });\n }", "function use_config() {\n var n = arguments.length;\n var name = make_name(arguments, n - 1);\n all_configs[name] = arguments[n - 1];\n if (audio_graph) {\n audio_graph.config(name.split('.'), all_configs[name]);\n }\n if (audio_ui) {\n audio_ui.config(name.split('.'), all_configs[name]);\n }\n}", "function getArrayMode() {\n var arrayDefaults = { array: (location === DefType.SEARCH ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return common_1.extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "function getArrayMode() {\n var arrayDefaults = { array: (location === DefType.SEARCH ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return common_1.extend(arrayDefaults, arrayParamNomenclature, config).array;\n }", "param(){\n var param = this.config.param;\n param.forEach(function(p) {\n this.addData(p.name, p.value);\n }, this);\n }", "static array(...params) {\r\n return new ContractParam(ContractParamType.Array, params);\r\n }", "static manyFromConfig(config) {\n let result = [];\n let connections = config.getSection(\"connections\");\n if (connections.length() > 0) {\n let connectionSections = connections.getSectionNames();\n for (let index = 0; index < connectionSections.length; index++) {\n let connection = connections.getSection(connectionSections[index]);\n result.push(new ConnectionParams(connection));\n }\n }\n else {\n let connection = config.getSection(\"connection\");\n if (connection.length() > 0)\n result.push(new ConnectionParams(connection));\n }\n return result;\n }", "function config(k, v, _argc) {\n if ( (_argc = arguments.length) == 1 ) {\n \tif(isObject(k)){\n \t\t_configs = extend(TRUE, _configs,k)\n \t} else {\n var r = _configs;\n split(k, function(_, it){\n r = r && r[it];\n }, '.')\n return r;\n }\n } else if (_argc == 0){\n \treturn _configs\n } else if (isObject(v)) {\n _configs[k] = extend(TRUE, _configs[k] || {}, v)\n } else {\n _configs[k] = v\n }\n}", "function createParamsObject(arrayName, params) {\n\n\tvar result = {};\n\tfor (var p in params) {\n\t\tif( params.hasOwnProperty(p) && p != \"apikey\") {\n\t\t result[arrayName + \".\" + p] = params[p];\n\t\t} \n\t}\n //console.log(\"******************************\");\n //console.log(params);\n //console.log(result);\n //console.log(\"******************************\");\n\treturn result;\n}", "function createParamsObject(arrayName, params) {\n\n\tvar result = {};\n\tfor (var p in params) {\n\t\tif( params.hasOwnProperty(p) && p != \"apikey\") {\n\t\t result[arrayName + \".$.\" + p] = params[p];\n\t\t} \n\t}\n //console.log(\"******************************\");\n //console.log(params);\n console.log(result);\n //console.log(\"******************************\");\n\treturn result;\n}", "_defaultParams(name, params) {\n const handlers = this.recognizer.handlersFor(name);\n let paramNames = [];\n for (let i = 0, len = handlers.length; i < len; i++) {\n paramNames = paramNames.concat(handlers[i].names);\n }\n params = Object.assign(pick(this.store.state.params, paramNames), params);\n this._cleanParams(params);\n return params;\n }", "constructor(configs) {\n const defaults = {\n name: 'default'\n }\n this.configs = Object.assign({}, defaults, configs)\n }", "function computeConfiguration(params, _token, _next) {\n if (!params.items) {\n return null;\n }\n let result = [];\n for (let item of params.items) {\n // The server asks the client for configuration settings without a section\n // If a section is present we return null to indicate that the configuration\n // is not supported.\n if (item.section) {\n result.push(null);\n continue;\n }\n let config;\n if (item.scopeUri) {\n config = vscode_1.workspace.getConfiguration('lspMultiRootSample', client.protocol2CodeConverter.asUri(item.scopeUri));\n }\n else {\n config = vscode_1.workspace.getConfiguration('lspMultiRootSample');\n }\n result.push({\n maxNumberOfProblems: config.get('maxNumberOfProblems')\n });\n }\n return result;\n }", "static get pluginConfig() {\n return [];\n }", "static get pluginConfig() {\n return [];\n }", "function initConfig(config) {\n config = config || {};\n\n // Do NOT use configMerge() for the data object because this method merges arrays\n // and so would change references to labels and datasets, preventing data updates.\n var data = config.data = config.data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n\n config.options = helpers.configMerge(\n defaults.global,\n defaults[config.type],\n config.options || {});\n\n return config;\n }", "function initConfig(config) {\n config = config || {};\n\n // Do NOT use configMerge() for the data object because this method merges arrays\n // and so would change references to labels and datasets, preventing data updates.\n var data = config.data = config.data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n\n config.options = helpers.configMerge(\n defaults.global,\n defaults[config.type],\n config.options || {});\n\n return config;\n }", "mergeDefaultConfigs() {\n\t\tthis.controlOptions = deepmerge( config.defaults, this.controlOptions, {\n\t\t\tarrayMerge: ( destination, source ) => source\n\t\t} );\n\n\t\tthis.baseConfig = $.extend( true, {}, this.controlOptions );\n\n\t\tthis.options.target = null;\n\t\tthis.controlOptions = deepmerge( this.controlOptions, this.options, {\n\t\t\tarrayMerge: ( destination, source ) => source\n\t\t} );\n\t}", "function readListParam( name, params ) {\n let array = [];\n\n const INDEXED_PARAM_REGEX = new RegExp( '^' + name + '\\\\[([0-9]+)\\\\]$' );\n for( let property of Object.keys(params) ) {\n let matches = INDEXED_PARAM_REGEX.exec( property );\n if( matches !== null ) {\n let index = matches[1];\n array[ index ] = params[ property ];\n }\n }\n\n if ( params.hasOwnProperty( name ) ) {\n let value = params[ name ];\n if ( typeof value === \"string\" ) {\n array.push( value );\n } else if ( Array.isArray( value ) ) {\n array = array.concat( value );\n }\n }\n\n return array;\n}", "function update_params () {\n\t\tvar config = Jupyter.notebook.config;\n\t\tfor (var key in params) {\n\t\t\tif (config.data.hasOwnProperty(key)) {\n\t\t\t\tparams[key] = config.data[key];\n\t\t\t}\n\t\t}\n\t}", "function configFromArray(config) {\n var input = [];\n var i;\n var date;\n var currentDate;\n var expectedWeekday;\n var yearToUse;\n if (config._d) {\n return config;\n }\n currentDate = currentDateArray(config);\n // compute day of the year from weeks and weekdays\n if (config._w && config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"c\" /* DATE */]] == null && config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"b\" /* MONTH */]] == null) {\n dayOfYearFromWeekInfo(config);\n }\n // if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__utils_defaults__[\"a\" /* defaults */])(config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"a\" /* YEAR */]], currentDate[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"a\" /* YEAR */]]);\n if (config._dayOfYear > __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__units_year__[\"b\" /* daysInYear */])(yearToUse) || config._dayOfYear === 0) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__parsing_flags__[\"a\" /* getParsingFlags */])(config)._overflowDayOfYear = true;\n }\n date = new Date(Date.UTC(yearToUse, 0, config._dayOfYear));\n config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"b\" /* MONTH */]] = date.getUTCMonth();\n config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"c\" /* DATE */]] = date.getUTCDate();\n }\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n // Check for 24:00:00.000\n if (config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"d\" /* HOUR */]] === 24 &&\n config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"e\" /* MINUTE */]] === 0 &&\n config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"f\" /* SECOND */]] === 0 &&\n config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"g\" /* MILLISECOND */]] === 0) {\n config._nextDay = true;\n config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"d\" /* HOUR */]] = 0;\n }\n config._d = (config._useUTC ? __WEBPACK_IMPORTED_MODULE_3__date_from_array__[\"b\" /* createUTCDate */] : __WEBPACK_IMPORTED_MODULE_3__date_from_array__[\"a\" /* createDate */]).apply(null, input);\n expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n if (config._nextDay) {\n config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"d\" /* HOUR */]] = 24;\n }\n // check for mismatching day of week\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__parsing_flags__[\"a\" /* getParsingFlags */])(config).weekdayMismatch = true;\n }\n return config;\n}", "function setComponentsConfig(config) {\n\t defaultConfig.components = Object.assign(config);\n\t}", "function configFromArray (config) {\n\t var i, date, input = [], currentDate, yearToUse;\n\t\n\t if (config._d) {\n\t return;\n\t }\n\t\n\t currentDate = currentDateArray(config);\n\t\n\t //compute day of the year from weeks and weekdays\n\t if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n\t dayOfYearFromWeekInfo(config);\n\t }\n\t\n\t //if the day of the year is set, figure out what it is\n\t if (config._dayOfYear) {\n\t yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\t\n\t if (config._dayOfYear > daysInYear(yearToUse)) {\n\t getParsingFlags(config)._overflowDayOfYear = true;\n\t }\n\t\n\t date = createUTCDate(yearToUse, 0, config._dayOfYear);\n\t config._a[MONTH] = date.getUTCMonth();\n\t config._a[DATE] = date.getUTCDate();\n\t }\n\t\n\t // Default to current date.\n\t // * if no year, month, day of month are given, default to today\n\t // * if day of month is given, default month and year\n\t // * if month is given, default only year\n\t // * if year is given, don't default anything\n\t for (i = 0; i < 3 && config._a[i] == null; ++i) {\n\t config._a[i] = input[i] = currentDate[i];\n\t }\n\t\n\t // Zero out whatever was not defaulted, including time\n\t for (; i < 7; i++) {\n\t config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n\t }\n\t\n\t // Check for 24:00:00.000\n\t if (config._a[HOUR] === 24 &&\n\t config._a[MINUTE] === 0 &&\n\t config._a[SECOND] === 0 &&\n\t config._a[MILLISECOND] === 0) {\n\t config._nextDay = true;\n\t config._a[HOUR] = 0;\n\t }\n\t\n\t config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n\t // Apply timezone offset from input. The actual utcOffset can be changed\n\t // with parseZone.\n\t if (config._tzm != null) {\n\t config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\t }\n\t\n\t if (config._nextDay) {\n\t config._a[HOUR] = 24;\n\t }\n\t }", "function configFromArray (config) {\n\t var i, date, input = [], currentDate, yearToUse;\n\t\n\t if (config._d) {\n\t return;\n\t }\n\t\n\t currentDate = currentDateArray(config);\n\t\n\t //compute day of the year from weeks and weekdays\n\t if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n\t dayOfYearFromWeekInfo(config);\n\t }\n\t\n\t //if the day of the year is set, figure out what it is\n\t if (config._dayOfYear) {\n\t yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\t\n\t if (config._dayOfYear > daysInYear(yearToUse)) {\n\t getParsingFlags(config)._overflowDayOfYear = true;\n\t }\n\t\n\t date = createUTCDate(yearToUse, 0, config._dayOfYear);\n\t config._a[MONTH] = date.getUTCMonth();\n\t config._a[DATE] = date.getUTCDate();\n\t }\n\t\n\t // Default to current date.\n\t // * if no year, month, day of month are given, default to today\n\t // * if day of month is given, default month and year\n\t // * if month is given, default only year\n\t // * if year is given, don't default anything\n\t for (i = 0; i < 3 && config._a[i] == null; ++i) {\n\t config._a[i] = input[i] = currentDate[i];\n\t }\n\t\n\t // Zero out whatever was not defaulted, including time\n\t for (; i < 7; i++) {\n\t config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n\t }\n\t\n\t // Check for 24:00:00.000\n\t if (config._a[HOUR] === 24 &&\n\t config._a[MINUTE] === 0 &&\n\t config._a[SECOND] === 0 &&\n\t config._a[MILLISECOND] === 0) {\n\t config._nextDay = true;\n\t config._a[HOUR] = 0;\n\t }\n\t\n\t config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n\t // Apply timezone offset from input. The actual utcOffset can be changed\n\t // with parseZone.\n\t if (config._tzm != null) {\n\t config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\t }\n\t\n\t if (config._nextDay) {\n\t config._a[HOUR] = 24;\n\t }\n\t }", "function configFromArray (config) {\n\t var i, date, input = [], currentDate, yearToUse;\n\t\n\t if (config._d) {\n\t return;\n\t }\n\t\n\t currentDate = currentDateArray(config);\n\t\n\t //compute day of the year from weeks and weekdays\n\t if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n\t dayOfYearFromWeekInfo(config);\n\t }\n\t\n\t //if the day of the year is set, figure out what it is\n\t if (config._dayOfYear) {\n\t yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\t\n\t if (config._dayOfYear > daysInYear(yearToUse)) {\n\t getParsingFlags(config)._overflowDayOfYear = true;\n\t }\n\t\n\t date = createUTCDate(yearToUse, 0, config._dayOfYear);\n\t config._a[MONTH] = date.getUTCMonth();\n\t config._a[DATE] = date.getUTCDate();\n\t }\n\t\n\t // Default to current date.\n\t // * if no year, month, day of month are given, default to today\n\t // * if day of month is given, default month and year\n\t // * if month is given, default only year\n\t // * if year is given, don't default anything\n\t for (i = 0; i < 3 && config._a[i] == null; ++i) {\n\t config._a[i] = input[i] = currentDate[i];\n\t }\n\t\n\t // Zero out whatever was not defaulted, including time\n\t for (; i < 7; i++) {\n\t config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n\t }\n\t\n\t // Check for 24:00:00.000\n\t if (config._a[HOUR] === 24 &&\n\t config._a[MINUTE] === 0 &&\n\t config._a[SECOND] === 0 &&\n\t config._a[MILLISECOND] === 0) {\n\t config._nextDay = true;\n\t config._a[HOUR] = 0;\n\t }\n\t\n\t config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n\t // Apply timezone offset from input. The actual utcOffset can be changed\n\t // with parseZone.\n\t if (config._tzm != null) {\n\t config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\t }\n\t\n\t if (config._nextDay) {\n\t config._a[HOUR] = 24;\n\t }\n\t }", "function configFromArray (config) {\n\t var i, date, input = [], currentDate, yearToUse;\n\t\n\t if (config._d) {\n\t return;\n\t }\n\t\n\t currentDate = currentDateArray(config);\n\t\n\t //compute day of the year from weeks and weekdays\n\t if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n\t dayOfYearFromWeekInfo(config);\n\t }\n\t\n\t //if the day of the year is set, figure out what it is\n\t if (config._dayOfYear) {\n\t yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\t\n\t if (config._dayOfYear > daysInYear(yearToUse)) {\n\t getParsingFlags(config)._overflowDayOfYear = true;\n\t }\n\t\n\t date = createUTCDate(yearToUse, 0, config._dayOfYear);\n\t config._a[MONTH] = date.getUTCMonth();\n\t config._a[DATE] = date.getUTCDate();\n\t }\n\t\n\t // Default to current date.\n\t // * if no year, month, day of month are given, default to today\n\t // * if day of month is given, default month and year\n\t // * if month is given, default only year\n\t // * if year is given, don't default anything\n\t for (i = 0; i < 3 && config._a[i] == null; ++i) {\n\t config._a[i] = input[i] = currentDate[i];\n\t }\n\t\n\t // Zero out whatever was not defaulted, including time\n\t for (; i < 7; i++) {\n\t config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n\t }\n\t\n\t // Check for 24:00:00.000\n\t if (config._a[HOUR] === 24 &&\n\t config._a[MINUTE] === 0 &&\n\t config._a[SECOND] === 0 &&\n\t config._a[MILLISECOND] === 0) {\n\t config._nextDay = true;\n\t config._a[HOUR] = 0;\n\t }\n\t\n\t config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n\t // Apply timezone offset from input. The actual utcOffset can be changed\n\t // with parseZone.\n\t if (config._tzm != null) {\n\t config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\t }\n\t\n\t if (config._nextDay) {\n\t config._a[HOUR] = 24;\n\t }\n\t }", "function configFromArray (config) {\n\t var i, date, input = [], currentDate, yearToUse;\n\t\n\t if (config._d) {\n\t return;\n\t }\n\t\n\t currentDate = currentDateArray(config);\n\t\n\t //compute day of the year from weeks and weekdays\n\t if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n\t dayOfYearFromWeekInfo(config);\n\t }\n\t\n\t //if the day of the year is set, figure out what it is\n\t if (config._dayOfYear) {\n\t yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\t\n\t if (config._dayOfYear > daysInYear(yearToUse)) {\n\t getParsingFlags(config)._overflowDayOfYear = true;\n\t }\n\t\n\t date = createUTCDate(yearToUse, 0, config._dayOfYear);\n\t config._a[MONTH] = date.getUTCMonth();\n\t config._a[DATE] = date.getUTCDate();\n\t }\n\t\n\t // Default to current date.\n\t // * if no year, month, day of month are given, default to today\n\t // * if day of month is given, default month and year\n\t // * if month is given, default only year\n\t // * if year is given, don't default anything\n\t for (i = 0; i < 3 && config._a[i] == null; ++i) {\n\t config._a[i] = input[i] = currentDate[i];\n\t }\n\t\n\t // Zero out whatever was not defaulted, including time\n\t for (; i < 7; i++) {\n\t config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n\t }\n\t\n\t // Check for 24:00:00.000\n\t if (config._a[HOUR] === 24 &&\n\t config._a[MINUTE] === 0 &&\n\t config._a[SECOND] === 0 &&\n\t config._a[MILLISECOND] === 0) {\n\t config._nextDay = true;\n\t config._a[HOUR] = 0;\n\t }\n\t\n\t config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n\t // Apply timezone offset from input. The actual utcOffset can be changed\n\t // with parseZone.\n\t if (config._tzm != null) {\n\t config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\t }\n\t\n\t if (config._nextDay) {\n\t config._a[HOUR] = 24;\n\t }\n\t }", "function configFromArray(config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "getPreparedCallsConfig() {\n if (!this._preparedCallsConfig) {\n let callsConfig = JSON.parse(JSON.stringify(this._callsConfig)); // clone\n\n this._preparedCallsConfig = callsConfig.map(item => {\n if (!item.vendor) {\n item.vendor = item.title;\n }\n\n if (!(item.listen instanceof Array)) {\n item.listen = [item.listen];\n }\n\n if (!item.match) {\n item.match = item.listen;\n }\n\n if (!(item.match instanceof Array)) {\n item.match = [item.match];\n }\n\n if (!item.not_match) {\n item.not_match = [];\n }\n if (!(item.not_match instanceof Array)) {\n item.not_match = [item.not_match];\n }\n\n // Convert `listen` property\n item.listen = this._expandListenConfig(item.listen);\n\n // Convert masks to real regexps\n item.match = this._convertMasksToRegexps(item.match);\n item.not_match = this._convertMasksToRegexps(item.not_match);\n\n // Result\n return item;\n });\n }\n\n return this._preparedCallsConfig;\n }", "function configFromArray (config) {\n\t var i, date, input = [], currentDate, yearToUse;\n\t\n\t if (config._d) {\n\t return;\n\t }\n\t\n\t currentDate = currentDateArray(config);\n\t\n\t //compute day of the year from weeks and weekdays\n\t if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n\t dayOfYearFromWeekInfo(config);\n\t }\n\t\n\t //if the day of the year is set, figure out what it is\n\t if (config._dayOfYear != null) {\n\t yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\t\n\t if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n\t getParsingFlags(config)._overflowDayOfYear = true;\n\t }\n\t\n\t date = createUTCDate(yearToUse, 0, config._dayOfYear);\n\t config._a[MONTH] = date.getUTCMonth();\n\t config._a[DATE] = date.getUTCDate();\n\t }\n\t\n\t // Default to current date.\n\t // * if no year, month, day of month are given, default to today\n\t // * if day of month is given, default month and year\n\t // * if month is given, default only year\n\t // * if year is given, don't default anything\n\t for (i = 0; i < 3 && config._a[i] == null; ++i) {\n\t config._a[i] = input[i] = currentDate[i];\n\t }\n\t\n\t // Zero out whatever was not defaulted, including time\n\t for (; i < 7; i++) {\n\t config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n\t }\n\t\n\t // Check for 24:00:00.000\n\t if (config._a[HOUR] === 24 &&\n\t config._a[MINUTE] === 0 &&\n\t config._a[SECOND] === 0 &&\n\t config._a[MILLISECOND] === 0) {\n\t config._nextDay = true;\n\t config._a[HOUR] = 0;\n\t }\n\t\n\t config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n\t // Apply timezone offset from input. The actual utcOffset can be changed\n\t // with parseZone.\n\t if (config._tzm != null) {\n\t config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\t }\n\t\n\t if (config._nextDay) {\n\t config._a[HOUR] = 24;\n\t }\n\t}", "function configFromArray (config) {\n\t var i, date, input = [], currentDate, yearToUse;\n\t\n\t if (config._d) {\n\t return;\n\t }\n\t\n\t currentDate = currentDateArray(config);\n\t\n\t //compute day of the year from weeks and weekdays\n\t if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n\t dayOfYearFromWeekInfo(config);\n\t }\n\t\n\t //if the day of the year is set, figure out what it is\n\t if (config._dayOfYear != null) {\n\t yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\t\n\t if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n\t getParsingFlags(config)._overflowDayOfYear = true;\n\t }\n\t\n\t date = createUTCDate(yearToUse, 0, config._dayOfYear);\n\t config._a[MONTH] = date.getUTCMonth();\n\t config._a[DATE] = date.getUTCDate();\n\t }\n\t\n\t // Default to current date.\n\t // * if no year, month, day of month are given, default to today\n\t // * if day of month is given, default month and year\n\t // * if month is given, default only year\n\t // * if year is given, don't default anything\n\t for (i = 0; i < 3 && config._a[i] == null; ++i) {\n\t config._a[i] = input[i] = currentDate[i];\n\t }\n\t\n\t // Zero out whatever was not defaulted, including time\n\t for (; i < 7; i++) {\n\t config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n\t }\n\t\n\t // Check for 24:00:00.000\n\t if (config._a[HOUR] === 24 &&\n\t config._a[MINUTE] === 0 &&\n\t config._a[SECOND] === 0 &&\n\t config._a[MILLISECOND] === 0) {\n\t config._nextDay = true;\n\t config._a[HOUR] = 0;\n\t }\n\t\n\t config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n\t // Apply timezone offset from input. The actual utcOffset can be changed\n\t // with parseZone.\n\t if (config._tzm != null) {\n\t config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\t }\n\t\n\t if (config._nextDay) {\n\t config._a[HOUR] = 24;\n\t }\n\t}", "function configFromArray(config) {\n\t var i,\n\t date,\n\t input = [],\n\t currentDate,\n\t yearToUse;\n\n\t if (config._d) {\n\t return;\n\t }\n\n\t currentDate = currentDateArray(config);\n\n\t //compute day of the year from weeks and weekdays\n\t if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n\t dayOfYearFromWeekInfo(config);\n\t }\n\n\t //if the day of the year is set, figure out what it is\n\t if (config._dayOfYear) {\n\t yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n\t if (config._dayOfYear > daysInYear(yearToUse)) {\n\t getParsingFlags(config)._overflowDayOfYear = true;\n\t }\n\n\t date = createUTCDate(yearToUse, 0, config._dayOfYear);\n\t config._a[MONTH] = date.getUTCMonth();\n\t config._a[DATE] = date.getUTCDate();\n\t }\n\n\t // Default to current date.\n\t // * if no year, month, day of month are given, default to today\n\t // * if day of month is given, default month and year\n\t // * if month is given, default only year\n\t // * if year is given, don't default anything\n\t for (i = 0; i < 3 && config._a[i] == null; ++i) {\n\t config._a[i] = input[i] = currentDate[i];\n\t }\n\n\t // Zero out whatever was not defaulted, including time\n\t for (; i < 7; i++) {\n\t config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n\t }\n\n\t // Check for 24:00:00.000\n\t if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n\t config._nextDay = true;\n\t config._a[HOUR] = 0;\n\t }\n\n\t config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n\t // Apply timezone offset from input. The actual utcOffset can be changed\n\t // with parseZone.\n\t if (config._tzm != null) {\n\t config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\t }\n\n\t if (config._nextDay) {\n\t config._a[HOUR] = 24;\n\t }\n\t }", "function configFromArray(config) {\n var input = [];\n var i;\n var date;\n var currentDate;\n var expectedWeekday;\n var yearToUse;\n if (config._d) {\n return config;\n }\n currentDate = currentDateArray(config);\n // compute day of the year from weeks and weekdays\n if (config._w && config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"a\" /* DATE */]] == null && config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"e\" /* MONTH */]] == null) {\n dayOfYearFromWeekInfo(config);\n }\n // if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = Object(__WEBPACK_IMPORTED_MODULE_5__utils_defaults__[\"a\" /* defaults */])(config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"i\" /* YEAR */]], currentDate[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"i\" /* YEAR */]]);\n if (config._dayOfYear > Object(__WEBPACK_IMPORTED_MODULE_1__units_year__[\"a\" /* daysInYear */])(yearToUse) || config._dayOfYear === 0) {\n Object(__WEBPACK_IMPORTED_MODULE_2__parsing_flags__[\"a\" /* getParsingFlags */])(config)._overflowDayOfYear = true;\n }\n date = new Date(Date.UTC(yearToUse, 0, config._dayOfYear));\n config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"e\" /* MONTH */]] = date.getUTCMonth();\n config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"a\" /* DATE */]] = date.getUTCDate();\n }\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n // Check for 24:00:00.000\n if (config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"b\" /* HOUR */]] === 24 &&\n config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"d\" /* MINUTE */]] === 0 &&\n config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"f\" /* SECOND */]] === 0 &&\n config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"c\" /* MILLISECOND */]] === 0) {\n config._nextDay = true;\n config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"b\" /* HOUR */]] = 0;\n }\n config._d = (config._useUTC ? __WEBPACK_IMPORTED_MODULE_3__date_from_array__[\"b\" /* createUTCDate */] : __WEBPACK_IMPORTED_MODULE_3__date_from_array__[\"a\" /* createDate */]).apply(null, input);\n expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n if (config._nextDay) {\n config._a[__WEBPACK_IMPORTED_MODULE_0__units_constants__[\"b\" /* HOUR */]] = 24;\n }\n // check for mismatching day of week\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {\n Object(__WEBPACK_IMPORTED_MODULE_2__parsing_flags__[\"a\" /* getParsingFlags */])(config).weekdayMismatch = true;\n }\n return config;\n}", "setConfigControl(state$$1, args) {\n\t const config = state$$1.recordConfig;\n\t config[args.name] = args.value;\n\t }", "function configFromArray (config) {\n\t var i, date, input = [], currentDate, yearToUse;\n\n\t if (config._d) {\n\t return;\n\t }\n\n\t currentDate = currentDateArray(config);\n\n\t //compute day of the year from weeks and weekdays\n\t if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n\t dayOfYearFromWeekInfo(config);\n\t }\n\n\t //if the day of the year is set, figure out what it is\n\t if (config._dayOfYear) {\n\t yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n\t if (config._dayOfYear > daysInYear(yearToUse)) {\n\t getParsingFlags(config)._overflowDayOfYear = true;\n\t }\n\n\t date = createUTCDate(yearToUse, 0, config._dayOfYear);\n\t config._a[MONTH] = date.getUTCMonth();\n\t config._a[DATE] = date.getUTCDate();\n\t }\n\n\t // Default to current date.\n\t // * if no year, month, day of month are given, default to today\n\t // * if day of month is given, default month and year\n\t // * if month is given, default only year\n\t // * if year is given, don't default anything\n\t for (i = 0; i < 3 && config._a[i] == null; ++i) {\n\t config._a[i] = input[i] = currentDate[i];\n\t }\n\n\t // Zero out whatever was not defaulted, including time\n\t for (; i < 7; i++) {\n\t config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n\t }\n\n\t // Check for 24:00:00.000\n\t if (config._a[HOUR] === 24 &&\n\t config._a[MINUTE] === 0 &&\n\t config._a[SECOND] === 0 &&\n\t config._a[MILLISECOND] === 0) {\n\t config._nextDay = true;\n\t config._a[HOUR] = 0;\n\t }\n\n\t config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n\t // Apply timezone offset from input. The actual utcOffset can be changed\n\t // with parseZone.\n\t if (config._tzm != null) {\n\t config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\t }\n\n\t if (config._nextDay) {\n\t config._a[HOUR] = 24;\n\t }\n\t }", "function configFromArray (config) {\n\t var i, date, input = [], currentDate, yearToUse;\n\n\t if (config._d) {\n\t return;\n\t }\n\n\t currentDate = currentDateArray(config);\n\n\t //compute day of the year from weeks and weekdays\n\t if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n\t dayOfYearFromWeekInfo(config);\n\t }\n\n\t //if the day of the year is set, figure out what it is\n\t if (config._dayOfYear) {\n\t yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n\t if (config._dayOfYear > daysInYear(yearToUse)) {\n\t getParsingFlags(config)._overflowDayOfYear = true;\n\t }\n\n\t date = createUTCDate(yearToUse, 0, config._dayOfYear);\n\t config._a[MONTH] = date.getUTCMonth();\n\t config._a[DATE] = date.getUTCDate();\n\t }\n\n\t // Default to current date.\n\t // * if no year, month, day of month are given, default to today\n\t // * if day of month is given, default month and year\n\t // * if month is given, default only year\n\t // * if year is given, don't default anything\n\t for (i = 0; i < 3 && config._a[i] == null; ++i) {\n\t config._a[i] = input[i] = currentDate[i];\n\t }\n\n\t // Zero out whatever was not defaulted, including time\n\t for (; i < 7; i++) {\n\t config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n\t }\n\n\t // Check for 24:00:00.000\n\t if (config._a[HOUR] === 24 &&\n\t config._a[MINUTE] === 0 &&\n\t config._a[SECOND] === 0 &&\n\t config._a[MILLISECOND] === 0) {\n\t config._nextDay = true;\n\t config._a[HOUR] = 0;\n\t }\n\n\t config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n\t // Apply timezone offset from input. The actual utcOffset can be changed\n\t // with parseZone.\n\t if (config._tzm != null) {\n\t config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\t }\n\n\t if (config._nextDay) {\n\t config._a[HOUR] = 24;\n\t }\n\t }", "function configFromArray (config) {\n\t var i, date, input = [], currentDate, yearToUse;\n\n\t if (config._d) {\n\t return;\n\t }\n\n\t currentDate = currentDateArray(config);\n\n\t //compute day of the year from weeks and weekdays\n\t if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n\t dayOfYearFromWeekInfo(config);\n\t }\n\n\t //if the day of the year is set, figure out what it is\n\t if (config._dayOfYear) {\n\t yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n\t if (config._dayOfYear > daysInYear(yearToUse)) {\n\t getParsingFlags(config)._overflowDayOfYear = true;\n\t }\n\n\t date = createUTCDate(yearToUse, 0, config._dayOfYear);\n\t config._a[MONTH] = date.getUTCMonth();\n\t config._a[DATE] = date.getUTCDate();\n\t }\n\n\t // Default to current date.\n\t // * if no year, month, day of month are given, default to today\n\t // * if day of month is given, default month and year\n\t // * if month is given, default only year\n\t // * if year is given, don't default anything\n\t for (i = 0; i < 3 && config._a[i] == null; ++i) {\n\t config._a[i] = input[i] = currentDate[i];\n\t }\n\n\t // Zero out whatever was not defaulted, including time\n\t for (; i < 7; i++) {\n\t config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n\t }\n\n\t // Check for 24:00:00.000\n\t if (config._a[HOUR] === 24 &&\n\t config._a[MINUTE] === 0 &&\n\t config._a[SECOND] === 0 &&\n\t config._a[MILLISECOND] === 0) {\n\t config._nextDay = true;\n\t config._a[HOUR] = 0;\n\t }\n\n\t config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n\t // Apply timezone offset from input. The actual utcOffset can be changed\n\t // with parseZone.\n\t if (config._tzm != null) {\n\t config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\t }\n\n\t if (config._nextDay) {\n\t config._a[HOUR] = 24;\n\t }\n\t }", "function configFromArray (config) {\n\t var i, date, input = [], currentDate, yearToUse;\n\n\t if (config._d) {\n\t return;\n\t }\n\n\t currentDate = currentDateArray(config);\n\n\t //compute day of the year from weeks and weekdays\n\t if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n\t dayOfYearFromWeekInfo(config);\n\t }\n\n\t //if the day of the year is set, figure out what it is\n\t if (config._dayOfYear) {\n\t yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n\t if (config._dayOfYear > daysInYear(yearToUse)) {\n\t getParsingFlags(config)._overflowDayOfYear = true;\n\t }\n\n\t date = createUTCDate(yearToUse, 0, config._dayOfYear);\n\t config._a[MONTH] = date.getUTCMonth();\n\t config._a[DATE] = date.getUTCDate();\n\t }\n\n\t // Default to current date.\n\t // * if no year, month, day of month are given, default to today\n\t // * if day of month is given, default month and year\n\t // * if month is given, default only year\n\t // * if year is given, don't default anything\n\t for (i = 0; i < 3 && config._a[i] == null; ++i) {\n\t config._a[i] = input[i] = currentDate[i];\n\t }\n\n\t // Zero out whatever was not defaulted, including time\n\t for (; i < 7; i++) {\n\t config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n\t }\n\n\t // Check for 24:00:00.000\n\t if (config._a[HOUR] === 24 &&\n\t config._a[MINUTE] === 0 &&\n\t config._a[SECOND] === 0 &&\n\t config._a[MILLISECOND] === 0) {\n\t config._nextDay = true;\n\t config._a[HOUR] = 0;\n\t }\n\n\t config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n\t // Apply timezone offset from input. The actual utcOffset can be changed\n\t // with parseZone.\n\t if (config._tzm != null) {\n\t config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\t }\n\n\t if (config._nextDay) {\n\t config._a[HOUR] = 24;\n\t }\n\t }", "function configFromArray (config) {\n\t var i, date, input = [], currentDate, yearToUse;\n\n\t if (config._d) {\n\t return;\n\t }\n\n\t currentDate = currentDateArray(config);\n\n\t //compute day of the year from weeks and weekdays\n\t if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n\t dayOfYearFromWeekInfo(config);\n\t }\n\n\t //if the day of the year is set, figure out what it is\n\t if (config._dayOfYear) {\n\t yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n\t if (config._dayOfYear > daysInYear(yearToUse)) {\n\t getParsingFlags(config)._overflowDayOfYear = true;\n\t }\n\n\t date = createUTCDate(yearToUse, 0, config._dayOfYear);\n\t config._a[MONTH] = date.getUTCMonth();\n\t config._a[DATE] = date.getUTCDate();\n\t }\n\n\t // Default to current date.\n\t // * if no year, month, day of month are given, default to today\n\t // * if day of month is given, default month and year\n\t // * if month is given, default only year\n\t // * if year is given, don't default anything\n\t for (i = 0; i < 3 && config._a[i] == null; ++i) {\n\t config._a[i] = input[i] = currentDate[i];\n\t }\n\n\t // Zero out whatever was not defaulted, including time\n\t for (; i < 7; i++) {\n\t config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n\t }\n\n\t // Check for 24:00:00.000\n\t if (config._a[HOUR] === 24 &&\n\t config._a[MINUTE] === 0 &&\n\t config._a[SECOND] === 0 &&\n\t config._a[MILLISECOND] === 0) {\n\t config._nextDay = true;\n\t config._a[HOUR] = 0;\n\t }\n\n\t config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n\t // Apply timezone offset from input. The actual utcOffset can be changed\n\t // with parseZone.\n\t if (config._tzm != null) {\n\t config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\t }\n\n\t if (config._nextDay) {\n\t config._a[HOUR] = 24;\n\t }\n\t }", "function configFromArray (config) {\n\t var i, date, input = [], currentDate, yearToUse;\n\n\t if (config._d) {\n\t return;\n\t }\n\n\t currentDate = currentDateArray(config);\n\n\t //compute day of the year from weeks and weekdays\n\t if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n\t dayOfYearFromWeekInfo(config);\n\t }\n\n\t //if the day of the year is set, figure out what it is\n\t if (config._dayOfYear) {\n\t yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n\t if (config._dayOfYear > daysInYear(yearToUse)) {\n\t getParsingFlags(config)._overflowDayOfYear = true;\n\t }\n\n\t date = createUTCDate(yearToUse, 0, config._dayOfYear);\n\t config._a[MONTH] = date.getUTCMonth();\n\t config._a[DATE] = date.getUTCDate();\n\t }\n\n\t // Default to current date.\n\t // * if no year, month, day of month are given, default to today\n\t // * if day of month is given, default month and year\n\t // * if month is given, default only year\n\t // * if year is given, don't default anything\n\t for (i = 0; i < 3 && config._a[i] == null; ++i) {\n\t config._a[i] = input[i] = currentDate[i];\n\t }\n\n\t // Zero out whatever was not defaulted, including time\n\t for (; i < 7; i++) {\n\t config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n\t }\n\n\t // Check for 24:00:00.000\n\t if (config._a[HOUR] === 24 &&\n\t config._a[MINUTE] === 0 &&\n\t config._a[SECOND] === 0 &&\n\t config._a[MILLISECOND] === 0) {\n\t config._nextDay = true;\n\t config._a[HOUR] = 0;\n\t }\n\n\t config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n\t // Apply timezone offset from input. The actual utcOffset can be changed\n\t // with parseZone.\n\t if (config._tzm != null) {\n\t config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\t }\n\n\t if (config._nextDay) {\n\t config._a[HOUR] = 24;\n\t }\n\t }", "function configFromArray (config) {\n\t var i, date, input = [], currentDate, yearToUse;\n\n\t if (config._d) {\n\t return;\n\t }\n\n\t currentDate = currentDateArray(config);\n\n\t //compute day of the year from weeks and weekdays\n\t if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n\t dayOfYearFromWeekInfo(config);\n\t }\n\n\t //if the day of the year is set, figure out what it is\n\t if (config._dayOfYear) {\n\t yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n\t if (config._dayOfYear > daysInYear(yearToUse)) {\n\t getParsingFlags(config)._overflowDayOfYear = true;\n\t }\n\n\t date = createUTCDate(yearToUse, 0, config._dayOfYear);\n\t config._a[MONTH] = date.getUTCMonth();\n\t config._a[DATE] = date.getUTCDate();\n\t }\n\n\t // Default to current date.\n\t // * if no year, month, day of month are given, default to today\n\t // * if day of month is given, default month and year\n\t // * if month is given, default only year\n\t // * if year is given, don't default anything\n\t for (i = 0; i < 3 && config._a[i] == null; ++i) {\n\t config._a[i] = input[i] = currentDate[i];\n\t }\n\n\t // Zero out whatever was not defaulted, including time\n\t for (; i < 7; i++) {\n\t config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n\t }\n\n\t // Check for 24:00:00.000\n\t if (config._a[HOUR] === 24 &&\n\t config._a[MINUTE] === 0 &&\n\t config._a[SECOND] === 0 &&\n\t config._a[MILLISECOND] === 0) {\n\t config._nextDay = true;\n\t config._a[HOUR] = 0;\n\t }\n\n\t config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n\t // Apply timezone offset from input. The actual utcOffset can be changed\n\t // with parseZone.\n\t if (config._tzm != null) {\n\t config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\t }\n\n\t if (config._nextDay) {\n\t config._a[HOUR] = 24;\n\t }\n\t }", "function configFromArray(config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n config._pf._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n\t var i, date, input = [], currentDate, yearToUse;\n\t\n\t if (config._d) {\n\t return;\n\t }\n\t\n\t currentDate = currentDateArray(config);\n\t\n\t //compute day of the year from weeks and weekdays\n\t if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n\t dayOfYearFromWeekInfo(config);\n\t }\n\t\n\t //if the day of the year is set, figure out what it is\n\t if (config._dayOfYear) {\n\t yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\t\n\t if (config._dayOfYear > daysInYear(yearToUse)) {\n\t getParsingFlags(config)._overflowDayOfYear = true;\n\t }\n\t\n\t date = createUTCDate(yearToUse, 0, config._dayOfYear);\n\t config._a[MONTH] = date.getUTCMonth();\n\t config._a[DATE] = date.getUTCDate();\n\t }\n\t\n\t // Default to current date.\n\t // * if no year, month, day of month are given, default to today\n\t // * if day of month is given, default month and year\n\t // * if month is given, default only year\n\t // * if year is given, don't default anything\n\t for (i = 0; i < 3 && config._a[i] == null; ++i) {\n\t config._a[i] = input[i] = currentDate[i];\n\t }\n\t\n\t // Zero out whatever was not defaulted, including time\n\t for (; i < 7; i++) {\n\t config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n\t }\n\t\n\t // Check for 24:00:00.000\n\t if (config._a[HOUR] === 24 &&\n\t config._a[MINUTE] === 0 &&\n\t config._a[SECOND] === 0 &&\n\t config._a[MILLISECOND] === 0) {\n\t config._nextDay = true;\n\t config._a[HOUR] = 0;\n\t }\n\t\n\t config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n\t // Apply timezone offset from input. The actual utcOffset can be changed\n\t // with parseZone.\n\t if (config._tzm != null) {\n\t config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\t }\n\t\n\t if (config._nextDay) {\n\t config._a[HOUR] = 24;\n\t }\n\t}", "function configFromArray (config) {\n\t var i, date, input = [], currentDate, yearToUse;\n\t\n\t if (config._d) {\n\t return;\n\t }\n\t\n\t currentDate = currentDateArray(config);\n\t\n\t //compute day of the year from weeks and weekdays\n\t if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n\t dayOfYearFromWeekInfo(config);\n\t }\n\t\n\t //if the day of the year is set, figure out what it is\n\t if (config._dayOfYear) {\n\t yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\t\n\t if (config._dayOfYear > daysInYear(yearToUse)) {\n\t getParsingFlags(config)._overflowDayOfYear = true;\n\t }\n\t\n\t date = createUTCDate(yearToUse, 0, config._dayOfYear);\n\t config._a[MONTH] = date.getUTCMonth();\n\t config._a[DATE] = date.getUTCDate();\n\t }\n\t\n\t // Default to current date.\n\t // * if no year, month, day of month are given, default to today\n\t // * if day of month is given, default month and year\n\t // * if month is given, default only year\n\t // * if year is given, don't default anything\n\t for (i = 0; i < 3 && config._a[i] == null; ++i) {\n\t config._a[i] = input[i] = currentDate[i];\n\t }\n\t\n\t // Zero out whatever was not defaulted, including time\n\t for (; i < 7; i++) {\n\t config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n\t }\n\t\n\t // Check for 24:00:00.000\n\t if (config._a[HOUR] === 24 &&\n\t config._a[MINUTE] === 0 &&\n\t config._a[SECOND] === 0 &&\n\t config._a[MILLISECOND] === 0) {\n\t config._nextDay = true;\n\t config._a[HOUR] = 0;\n\t }\n\t\n\t config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n\t // Apply timezone offset from input. The actual utcOffset can be changed\n\t // with parseZone.\n\t if (config._tzm != null) {\n\t config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\t }\n\t\n\t if (config._nextDay) {\n\t config._a[HOUR] = 24;\n\t }\n\t}", "function configFromArray (config) {\n\t var i, date, input = [], currentDate, yearToUse;\n\t\n\t if (config._d) {\n\t return;\n\t }\n\t\n\t currentDate = currentDateArray(config);\n\t\n\t //compute day of the year from weeks and weekdays\n\t if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n\t dayOfYearFromWeekInfo(config);\n\t }\n\t\n\t //if the day of the year is set, figure out what it is\n\t if (config._dayOfYear) {\n\t yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\t\n\t if (config._dayOfYear > daysInYear(yearToUse)) {\n\t getParsingFlags(config)._overflowDayOfYear = true;\n\t }\n\t\n\t date = createUTCDate(yearToUse, 0, config._dayOfYear);\n\t config._a[MONTH] = date.getUTCMonth();\n\t config._a[DATE] = date.getUTCDate();\n\t }\n\t\n\t // Default to current date.\n\t // * if no year, month, day of month are given, default to today\n\t // * if day of month is given, default month and year\n\t // * if month is given, default only year\n\t // * if year is given, don't default anything\n\t for (i = 0; i < 3 && config._a[i] == null; ++i) {\n\t config._a[i] = input[i] = currentDate[i];\n\t }\n\t\n\t // Zero out whatever was not defaulted, including time\n\t for (; i < 7; i++) {\n\t config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n\t }\n\t\n\t // Check for 24:00:00.000\n\t if (config._a[HOUR] === 24 &&\n\t config._a[MINUTE] === 0 &&\n\t config._a[SECOND] === 0 &&\n\t config._a[MILLISECOND] === 0) {\n\t config._nextDay = true;\n\t config._a[HOUR] = 0;\n\t }\n\t\n\t config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n\t // Apply timezone offset from input. The actual utcOffset can be changed\n\t // with parseZone.\n\t if (config._tzm != null) {\n\t config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\t }\n\t\n\t if (config._nextDay) {\n\t config._a[HOUR] = 24;\n\t }\n\t}", "function initConfig(config) {\n\t\t\tconfig = config || {};\n\n\t\t\t// Do NOT use configMerge() for the data object because this method merges arrays\n\t\t\t// and so would change references to labels and datasets, preventing data updates.\n\t\t\tvar data = config.data = config.data || {};\n\t\t\tdata.datasets = data.datasets || [];\n\t\t\tdata.labels = data.labels || [];\n\n\t\t\tconfig.options = helpers.configMerge(\n\t\t\t\tdefaults.global,\n\t\t\t\tdefaults[config.type],\n\t\t\t\tconfig.options || {});\n\n\t\t\treturn config;\n\t\t}", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function initConfig(config) {\n\t\t\tconfig = config || {};\n\t\n\t\t\t// Do NOT use configMerge() for the data object because this method merges arrays\n\t\t\t// and so would change references to labels and datasets, preventing data updates.\n\t\t\tvar data = config.data = config.data || {};\n\t\t\tdata.datasets = data.datasets || [];\n\t\t\tdata.labels = data.labels || [];\n\t\n\t\t\tconfig.options = helpers.configMerge(\n\t\t\t\tChart.defaults.global,\n\t\t\t\tChart.defaults[config.type],\n\t\t\t\tconfig.options || {});\n\t\n\t\t\treturn config;\n\t\t}", "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== config._d.getDay()) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }", "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== config._d.getDay()) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }", "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== config._d.getDay()) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }", "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "processConfig(config) {\n if (typeof config === 'string' || Array.isArray(config)) {\n return {\n field: config,\n ascending: null\n };\n }\n\n return config;\n }", "processConfig(config) {\n if (typeof config === 'string' || Array.isArray(config)) {\n return {\n field: config,\n ascending: null\n };\n }\n\n return config;\n }", "function configFromArray (config) {\n\t var i, date, input = [], currentDate, yearToUse;\n\n\t if (config._d) {\n\t return;\n\t }\n\n\t currentDate = currentDateArray(config);\n\n\t //compute day of the year from weeks and weekdays\n\t if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n\t dayOfYearFromWeekInfo(config);\n\t }\n\n\t //if the day of the year is set, figure out what it is\n\t if (config._dayOfYear != null) {\n\t yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n\t if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n\t getParsingFlags(config)._overflowDayOfYear = true;\n\t }\n\n\t date = createUTCDate(yearToUse, 0, config._dayOfYear);\n\t config._a[MONTH] = date.getUTCMonth();\n\t config._a[DATE] = date.getUTCDate();\n\t }\n\n\t // Default to current date.\n\t // * if no year, month, day of month are given, default to today\n\t // * if day of month is given, default month and year\n\t // * if month is given, default only year\n\t // * if year is given, don't default anything\n\t for (i = 0; i < 3 && config._a[i] == null; ++i) {\n\t config._a[i] = input[i] = currentDate[i];\n\t }\n\n\t // Zero out whatever was not defaulted, including time\n\t for (; i < 7; i++) {\n\t config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n\t }\n\n\t // Check for 24:00:00.000\n\t if (config._a[HOUR] === 24 &&\n\t config._a[MINUTE] === 0 &&\n\t config._a[SECOND] === 0 &&\n\t config._a[MILLISECOND] === 0) {\n\t config._nextDay = true;\n\t config._a[HOUR] = 0;\n\t }\n\n\t config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n\t // Apply timezone offset from input. The actual utcOffset can be changed\n\t // with parseZone.\n\t if (config._tzm != null) {\n\t config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\t }\n\n\t if (config._nextDay) {\n\t config._a[HOUR] = 24;\n\t }\n\t}", "function configFromArray (config) {\n\t var i, date, input = [], currentDate, yearToUse;\n\n\t if (config._d) {\n\t return;\n\t }\n\n\t currentDate = currentDateArray(config);\n\n\t //compute day of the year from weeks and weekdays\n\t if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n\t dayOfYearFromWeekInfo(config);\n\t }\n\n\t //if the day of the year is set, figure out what it is\n\t if (config._dayOfYear != null) {\n\t yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n\t if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n\t getParsingFlags(config)._overflowDayOfYear = true;\n\t }\n\n\t date = createUTCDate(yearToUse, 0, config._dayOfYear);\n\t config._a[MONTH] = date.getUTCMonth();\n\t config._a[DATE] = date.getUTCDate();\n\t }\n\n\t // Default to current date.\n\t // * if no year, month, day of month are given, default to today\n\t // * if day of month is given, default month and year\n\t // * if month is given, default only year\n\t // * if year is given, don't default anything\n\t for (i = 0; i < 3 && config._a[i] == null; ++i) {\n\t config._a[i] = input[i] = currentDate[i];\n\t }\n\n\t // Zero out whatever was not defaulted, including time\n\t for (; i < 7; i++) {\n\t config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n\t }\n\n\t // Check for 24:00:00.000\n\t if (config._a[HOUR] === 24 &&\n\t config._a[MINUTE] === 0 &&\n\t config._a[SECOND] === 0 &&\n\t config._a[MILLISECOND] === 0) {\n\t config._nextDay = true;\n\t config._a[HOUR] = 0;\n\t }\n\n\t config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n\t // Apply timezone offset from input. The actual utcOffset can be changed\n\t // with parseZone.\n\t if (config._tzm != null) {\n\t config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\t }\n\n\t if (config._nextDay) {\n\t config._a[HOUR] = 24;\n\t }\n\t}", "function EMCallConfigs() {\r\n if (arguments.length == 0) {\r\n this._callConfigs = new easemobNode.EMCallConfigs();\r\n } else {\r\n this._callConfigs = arguments[0];\r\n }\r\n}", "function configFromArray(config) {\r\n var i, date, input = [], currentDate, yearToUse;\r\n\r\n if (config._d) {\r\n return;\r\n }\r\n\r\n currentDate = currentDateArray(config);\r\n\r\n //compute day of the year from weeks and weekdays\r\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\r\n dayOfYearFromWeekInfo(config);\r\n }\r\n\r\n //if the day of the year is set, figure out what it is\r\n if (config._dayOfYear) {\r\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\r\n\r\n if (config._dayOfYear > daysInYear(yearToUse)) {\r\n getParsingFlags(config)._overflowDayOfYear = true;\r\n }\r\n\r\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\r\n config._a[MONTH] = date.getUTCMonth();\r\n config._a[DATE] = date.getUTCDate();\r\n }\r\n\r\n // Default to current date.\r\n // * if no year, month, day of month are given, default to today\r\n // * if day of month is given, default month and year\r\n // * if month is given, default only year\r\n // * if year is given, don't default anything\r\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\r\n config._a[i] = input[i] = currentDate[i];\r\n }\r\n\r\n // Zero out whatever was not defaulted, including time\r\n for (; i < 7; i++) {\r\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\r\n }\r\n\r\n // Check for 24:00:00.000\r\n if (config._a[HOUR] === 24 &&\r\n config._a[MINUTE] === 0 &&\r\n config._a[SECOND] === 0 &&\r\n config._a[MILLISECOND] === 0) {\r\n config._nextDay = true;\r\n config._a[HOUR] = 0;\r\n }\r\n\r\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\r\n // Apply timezone offset from input. The actual utcOffset can be changed\r\n // with parseZone.\r\n if (config._tzm != null) {\r\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\r\n }\r\n\r\n if (config._nextDay) {\r\n config._a[HOUR] = 24;\r\n }\r\n }", "function setConfigObject (config, prev) {\n Object.keys(config).forEach(function (key) {\n var value = config[key]\n var fullKey = prev ? prev + '.' + key : key\n\n // if the value is an inner object and we have dot-notation\n // enabled, treat inner objects in config the same as\n // heavily nested dot notations (foo.bar.apple).\n if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) {\n // if the value is an object but not an array, check nested object\n setConfigObject(value, fullKey)\n } else {\n // setting arguments via CLI takes precedence over\n // values within the config file.\n if (!hasKey(argv, fullKey.split('.')) || (flags.defaulted[fullKey]) || (flags.arrays[fullKey] && configuration['combine-arrays'])) {\n setArg(fullKey, value)\n }\n }\n })\n }", "function setConfigObject (config, prev) {\n Object.keys(config).forEach(function (key) {\n var value = config[key]\n var fullKey = prev ? prev + '.' + key : key\n\n // if the value is an inner object and we have dot-notation\n // enabled, treat inner objects in config the same as\n // heavily nested dot notations (foo.bar.apple).\n if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) {\n // if the value is an object but not an array, check nested object\n setConfigObject(value, fullKey)\n } else {\n // setting arguments via CLI takes precedence over\n // values within the config file.\n if (!hasKey(argv, fullKey.split('.')) || (flags.defaulted[fullKey]) || (flags.arrays[fullKey] && configuration['combine-arrays'])) {\n setArg(fullKey, value)\n }\n }\n })\n }", "function setConfigObject (config, prev) {\n Object.keys(config).forEach(function (key) {\n var value = config[key]\n var fullKey = prev ? prev + '.' + key : key\n\n // if the value is an inner object and we have dot-notation\n // enabled, treat inner objects in config the same as\n // heavily nested dot notations (foo.bar.apple).\n if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) {\n // if the value is an object but not an array, check nested object\n setConfigObject(value, fullKey)\n } else {\n // setting arguments via CLI takes precedence over\n // values within the config file.\n if (!hasKey(argv, fullKey.split('.')) || (flags.defaulted[fullKey]) || (flags.arrays[fullKey] && configuration['combine-arrays'])) {\n setArg(fullKey, value)\n }\n }\n })\n }", "function setConfigObject (config, prev) {\n Object.keys(config).forEach(function (key) {\n var value = config[key]\n var fullKey = prev ? prev + '.' + key : key\n\n // if the value is an inner object and we have dot-notation\n // enabled, treat inner objects in config the same as\n // heavily nested dot notations (foo.bar.apple).\n if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) {\n // if the value is an object but not an array, check nested object\n setConfigObject(value, fullKey)\n } else {\n // setting arguments via CLI takes precedence over\n // values within the config file.\n if (!hasKey(argv, fullKey.split('.')) || (flags.defaulted[fullKey]) || (flags.arrays[fullKey] && configuration['combine-arrays'])) {\n setArg(fullKey, value)\n }\n }\n })\n }", "function configFromArray (config) {\r\n var i, date, input = [], currentDate, yearToUse;\r\n\r\n if (config._d) {\r\n return;\r\n }\r\n\r\n currentDate = currentDateArray(config);\r\n\r\n //compute day of the year from weeks and weekdays\r\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\r\n dayOfYearFromWeekInfo(config);\r\n }\r\n\r\n //if the day of the year is set, figure out what it is\r\n if (config._dayOfYear) {\r\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\r\n\r\n if (config._dayOfYear > daysInYear(yearToUse)) {\r\n getParsingFlags(config)._overflowDayOfYear = true;\r\n }\r\n\r\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\r\n config._a[MONTH] = date.getUTCMonth();\r\n config._a[DATE] = date.getUTCDate();\r\n }\r\n\r\n // Default to current date.\r\n // * if no year, month, day of month are given, default to today\r\n // * if day of month is given, default month and year\r\n // * if month is given, default only year\r\n // * if year is given, don't default anything\r\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\r\n config._a[i] = input[i] = currentDate[i];\r\n }\r\n\r\n // Zero out whatever was not defaulted, including time\r\n for (; i < 7; i++) {\r\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\r\n }\r\n\r\n // Check for 24:00:00.000\r\n if (config._a[HOUR] === 24 &&\r\n config._a[MINUTE] === 0 &&\r\n config._a[SECOND] === 0 &&\r\n config._a[MILLISECOND] === 0) {\r\n config._nextDay = true;\r\n config._a[HOUR] = 0;\r\n }\r\n\r\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\r\n // Apply timezone offset from input. The actual utcOffset can be changed\r\n // with parseZone.\r\n if (config._tzm != null) {\r\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\r\n }\r\n\r\n if (config._nextDay) {\r\n config._a[HOUR] = 24;\r\n }\r\n }", "function configFromArray (config) {\r\n var i, date, input = [], currentDate, yearToUse;\r\n\r\n if (config._d) {\r\n return;\r\n }\r\n\r\n currentDate = currentDateArray(config);\r\n\r\n //compute day of the year from weeks and weekdays\r\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\r\n dayOfYearFromWeekInfo(config);\r\n }\r\n\r\n //if the day of the year is set, figure out what it is\r\n if (config._dayOfYear) {\r\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\r\n\r\n if (config._dayOfYear > daysInYear(yearToUse)) {\r\n getParsingFlags(config)._overflowDayOfYear = true;\r\n }\r\n\r\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\r\n config._a[MONTH] = date.getUTCMonth();\r\n config._a[DATE] = date.getUTCDate();\r\n }\r\n\r\n // Default to current date.\r\n // * if no year, month, day of month are given, default to today\r\n // * if day of month is given, default month and year\r\n // * if month is given, default only year\r\n // * if year is given, don't default anything\r\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\r\n config._a[i] = input[i] = currentDate[i];\r\n }\r\n\r\n // Zero out whatever was not defaulted, including time\r\n for (; i < 7; i++) {\r\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\r\n }\r\n\r\n // Check for 24:00:00.000\r\n if (config._a[HOUR] === 24 &&\r\n config._a[MINUTE] === 0 &&\r\n config._a[SECOND] === 0 &&\r\n config._a[MILLISECOND] === 0) {\r\n config._nextDay = true;\r\n config._a[HOUR] = 0;\r\n }\r\n\r\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\r\n // Apply timezone offset from input. The actual utcOffset can be changed\r\n // with parseZone.\r\n if (config._tzm != null) {\r\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\r\n }\r\n\r\n if (config._nextDay) {\r\n config._a[HOUR] = 24;\r\n }\r\n }", "get defaultConfig() {\n return [\n this.historyButtonGroup,\n this.basicInlineButtonGroup,\n this.linkButtonGroup,\n this.clipboardButtonGroup,\n this.scriptButtonGroup,\n this.insertButtonGroup,\n this.listIndentButtonGroup,\n ];\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n config._pf._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n config._pf._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n config._pf._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n config._pf._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "function setConfigObject(config, prev) {\n Object.keys(config).forEach(function (key) {\n var value = config[key];\n var fullKey = prev ? prev + '.' + key : key; // if the value is an inner object and we have dot-notation\n // enabled, treat inner objects in config the same as\n // heavily nested dot notations (foo.bar.apple).\n\n if (_typeof(value) === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) {\n // if the value is an object but not an array, check nested object\n setConfigObject(value, fullKey);\n } else {\n // setting arguments via CLI takes precedence over\n // values within the config file.\n if (!hasKey(argv, fullKey.split('.')) || flags.defaulted[fullKey] || flags.arrays[fullKey] && configuration['combine-arrays']) {\n setArg(fullKey, value);\n }\n }\n });\n } // set all config objects passed in opts", "function configFromArray(config) {\n var i, date, input = [],\n currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }" ]
[ "0.63017124", "0.63017124", "0.62138784", "0.61632574", "0.61632574", "0.61632574", "0.61632574", "0.61632574", "0.61632574", "0.61632574", "0.61632574", "0.61632574", "0.61632574", "0.61632574", "0.61632574", "0.61632574", "0.61632574", "0.61632574", "0.61632574", "0.61632574", "0.61632574", "0.6130163", "0.61219233", "0.5933105", "0.5933105", "0.5931728", "0.5920308", "0.5920308", "0.5835706", "0.5822038", "0.57782507", "0.57782507", "0.5678349", "0.56758684", "0.554876", "0.5529348", "0.5400261", "0.53823155", "0.5343241", "0.5337568", "0.5306472", "0.5293858", "0.5293858", "0.52870125", "0.52870125", "0.5286495", "0.52782357", "0.52649236", "0.52637106", "0.52566665", "0.5254804", "0.5254804", "0.5254804", "0.5254804", "0.5254804", "0.52508795", "0.5234239", "0.52330214", "0.52330214", "0.5214914", "0.5202555", "0.5199889", "0.5185924", "0.5185924", "0.5185924", "0.5185924", "0.5185924", "0.5185924", "0.5185924", "0.5180686", "0.5170024", "0.516918", "0.516918", "0.516918", "0.5153065", "0.51417387", "0.51366127", "0.51248896", "0.51248896", "0.51248896", "0.51248896", "0.5116433", "0.5116433", "0.5114378", "0.5114378", "0.5114138", "0.5112682", "0.51119137", "0.51119137", "0.51119137", "0.51119137", "0.5102765", "0.5102765", "0.5097061", "0.5094769", "0.5094769", "0.5094769", "0.5094769", "0.50897896", "0.50894463" ]
0.6189371
3
returns false, true, or the squash value to indicate the "default parameter url squash policy".
function getSquashPolicy(config, isOptional) { var squash = config.squash; if (!isOptional || squash === false) return false; if (!isDefined(squash) || squash == null) return defaultSquashPolicy; if (squash === true || isString(squash)) return squash; throw new Error("Invalid squash policy: '" + squash + "'. Valid policies: false, true, or arbitrary string"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSquashPolicy(config, isOptional) {\n\t var squash = config.squash;\n\t if (!isOptional || squash === false)\n\t return false;\n\t if (!predicates_1.isDefined(squash) || squash == null)\n\t return urlMatcherConfig_1.matcherConfig.defaultSquashPolicy();\n\t if (squash === true || predicates_1.isString(squash))\n\t return squash;\n\t throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n\t}", "function getSquashPolicy(config, isOptional) {\n\t var squash = config.squash;\n\t if (!isOptional || squash === false) return false;\n\t if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n\t if (squash === true || isString(squash)) return squash;\n\t throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n\t }", "function getSquashPolicy(config, isOptional) {\n\t var squash = config.squash;\n\t if (!isOptional || squash === false) return false;\n\t if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n\t if (squash === true || isString(squash)) return squash;\n\t throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n\t }", "function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n\n if (!isOptional || squash === false) { return false; }\n if (squash === undefined || squash === null) { return defaultSquashPolicy; }\n if (squash === true || _.isString(squash)) { return squash; }\n\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }", "function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }", "function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }", "function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }", "function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }", "function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }", "function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }", "function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }", "function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }", "function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }", "function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }", "function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }", "function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }", "function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }", "function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }", "function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }", "function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }", "function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }", "function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }", "function getSquashPolicy(config, isOptional) {\n\t\t\t\tvar squash = config.squash;\n\t\t\t\tif (!isOptional || squash === false) return false;\n\t\t\t\tif (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n\t\t\t\tif (squash === true || isString(squash)) return squash;\n\t\t\t\tthrow new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n\t\t\t}", "function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }", "_getDefaultAccessPolicy() {\n let p = this.access.defaultAccessPolicy;\n switch (p) {\n case 'deny': return false;\n case 'allow': return true;\n case true: return true;\n case false: return false;\n }\n return false;\n }", "function defaultTrue( value ) { return optionalDefault( value, true ); }", "function defaultConditional() {\n return true;\n}", "function validatePut() {\n return true\n}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function defaultFalse( value ) { return optionalDefault( value, false ); }", "isSharing() {\n return this.data()[\"sharing\"]\n }", "getPostSubmitRedirect() {\n if (typeof this.payload.redirect === \"string\") {\n return this.payload.redirect;\n }\n\n return false;\n }", "function defaultFilter(proxyReqOptBuilder, userReq) { // eslint-disable-line\n return true;\n}", "isDeployed() {\n return !!this.url\n }", "function hasConfig(sKey) {\n\t\t\t\treturn document.location.search.indexOf(\"sap-ui-\"+sKey) > -1 || // URL \n\t\t\t\t\t!!oCfgData[sKey.toLowerCase()]; // currently, properties of oCfgData are converted to lower case (DOM attributes)\n\t\t\t}", "async function shouldSquashPredicate() {\n let matcher = await getMatcher();\n return (pinnedTab, newTab) => {\n if (!isEligibleForSquash(pinnedTab, newTab))\n return false;\n return matcher.match(pinnedTab, newTab);\n };\n}", "static boolean(value) {\r\n return new ContractParam(ContractParamType.Boolean, !!value);\r\n }", "function getShareOption(num) {\n\tswitch (num) {\n\t\tcase '0':\n\t\t\treturn 'private';\n\t\t\tbreak;\n\t\tcase '1':\n\t\t\treturn 'public';\n\t\t\tbreak;\n\t\tcase '2':\n\t\t\treturn 'individual';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn num;\n\t}\n}", "function isDefaultSetting(handler, property) {\n return handler[property] === $.mockjaxSettings[property];\n }", "function isDefaultSetting(handler, property) {\n return handler[property] === $.mockjaxSettings[property];\n }", "function isDefaultSetting(handler, property) {\n return handler[property] === $.mockjaxSettings[property];\n }", "function defaultSlugify(value, type) {\n var maxLength = type.options && type.options.maxLength || 200;\n var slugifyOpts = {\n truncate: maxLength,\n symbols: true\n };\n return value ? (0, _speakingurl.default)(value, slugifyOpts) : '';\n}", "get isSecure()\n\t{\n\t\t//exchWebService.commonAbFunctions.logInfo(\"exchangeAbFolderDirectory: isSecure\\n\");\n\t\treturn true;\n\t}", "function always () { return true }", "function validateDefault(params/*, markup*/) {\n return params.trim().split(' ', 2)[0] === name;\n }", "function bool(name: string, defaultVal: boolean): boolean {\n return process.env[name] ? process.env[name] === 'true' || process.env[name] === '1' : defaultVal;\n}", "function isManuallyGraded(grade_opt)\n{\n return (grade_opt.split(\"|\")[0]).indexOf(GRADING_OPT_MANUAL) != -1;\n}", "evaluateEnabled(enabled) {\n // const enabled = this.serverless.service.custom.customDomain.enabled;\n if (enabled === undefined) {\n return true;\n }\n if (typeof enabled === \"boolean\") {\n return enabled;\n }\n else if (typeof enabled === \"string\" && enabled === \"true\") {\n return true;\n }\n else if (typeof enabled === \"string\" && enabled === \"false\") {\n return false;\n }\n throw new Error(`${Globals_1.default.pluginName}: Ambiguous enablement boolean: \"${enabled}\"`);\n }", "get allowsPosting()\n\t{\n\t\treturn true;\n\t}", "function GetBoolSetting(key) {\n if (GetSetting(key) == \"true\")\n return true;\n else if (GetSetting(key) == \"false\")\n return false;\n else\n return false;\n}", "function defaultBooleanValue(v) { }", "function currentValue() {\n var answer = $location.search()[paramName] || defaultValue;\n return answer === \"false\" ? false : answer;\n }", "static isShowingFavouritesOnly(){\n let settings = JSON.parse(localStorage.getItem('userPreferences'));\n if (settings === null || settings === undefined) {\n return false;\n }\n\n if(settings.showFavouritesOnly === null || \n settings.showFavouritesOnly === undefined ){\n return false;\n }\n return settings.showFavouritesOnly;\n}", "function getStatusURL(type, value) {\n\tvar goal_image;\n\tif (type == \"binary\") {\n\t\tif (value)\n\t\t\tgoal_image = img_on;\n\t\telse\n\t\t\tgoal_image = img_off;\n\t}\n\telse if (type == \"lock\") {\n\t\tif (value)\n\t\t\tgoal_image = img_unlock;\n\t\telse\n\t\t\tgoal_image = img_lock;\n\t}\n\treturn goal_image;\n}", "function fnValidateConfigSharesQuota(share, sharedb){\n try {\n // \"soft-quota\" is optional\n if (fnHas(share, \"soft-quota\") !== true){\n return true;\n }\n \n const quota = share[\"soft-quota\"];\n\n // must have \"limit\" and \"whitelist\" properties\n assert( fnHas(quota, [\"limit\", \"whitelist\"]) );\n \n // check \"limit\" property\n assert( fnIsString(quota[\"limit\"]) && quota[\"limit\"].length > 2 && quota[\"limit\"].length < 12 );\n const unit = quota[\"limit\"].slice(quota[\"limit\"].length - 2, quota[\"limit\"].length);\n assert( [\"kB\", \"MB\", \"GB\"].includes(unit) );\n let limitRaw = quota[\"limit\"].slice(0, quota[\"limit\"].length - 2);\n assert( fnValidateString(limitRaw, [\"09\"]) );\n limitRaw = parseInt(limitRaw, 10);\n let limitBytes = 0;\n limitBytes = (unit === \"kB\") ? (limitRaw * 1024) : limitBytes;\n limitBytes = (unit === \"MB\") ? (limitRaw * 1024 * 1024) : limitBytes;\n limitBytes = (unit === \"GB\") ? (limitRaw * 1024 * 1024 * 1024) : limitBytes;\n \n // check \"whitelist\" property\n assert( fnIsArray(quota[\"whitelist\"]) );\n let whitelist = [];\n assert(quota[\"whitelist\"].every((e) => {\n if (fnIsString(e) !== true){\n return false;\n }\n \n if (e === \"nobody\"){\n whitelist.push(\"nobody\");\n return true;\n }\n else if (sharedb.users.includes(e)){\n whitelist.push(e);\n return true;\n }\n else if (fnHas(sharedb.groups, e)){\n whitelist = whitelist.concat(sharedb.groups[e]);\n return true;\n }\n else {\n return false;\n }\n }));\n \n // remove duplicates from \"whitelist\"\n whitelist = fnRemoveDuplicates(whitelist);\n \n // add \"$soft-quota\" to \"share\"\n share[\"$soft-quota\"] = { \"limit\": limitBytes, \"whitelist\": whitelist };\n \n return true;\n }\n catch (error){\n return `SHARE '${share[\"path\"]}' HAS AN INVALID SOFT-QUOTA`;\n }\n}", "function defaultTrue(v) {\n return v === false ? false : true;\n }", "function defaultTrue(v) {\n return v === false ? false : true;\n }", "function defaultTrue(v) {\n return v === false ? false : true;\n }", "function defaultTrue(v) {\n return v === false ? false : true;\n }", "function boolean(value) {\n if (value == \"\") {\n return \"\";\n } else {\n return value;\n }\n}", "function trustNone(){return false;}", "function useGatewayAuthentication (req) {\n // can be set on request if via application supplied callback\n if (req.useGateway === true) { return true }\n\n // otherwise via query parameter\n var origUrl = req.originalUrl\n var useGateway = false\n var idx = origUrl.indexOf(gatewayParameter)\n if (idx >= 0) {\n useGateway = true\n }\n\n return useGateway\n}", "function hideOptionDefaultValue(localStorage) {\n var value = localStorage[\"camelHideOptionDefaultValue\"];\n return Core.parseBooleanValue(value, Camel.defaultHideOptionDefaultValue);\n }", "isValid() {\n if (\n this.state.isDanger ||\n this.state.apiValue === '' ||\n this.state.apiValue === undefined\n )\n return false;\n\n return true;\n }", "function CheckMode(the_url_nomode, the_mode)\n{\n\tvar cgi_args_delim = \"?\";\n\tvar cgi_args_str_split = the_url_nomode.split('?');\n\tvar new_cgi_args = cgi_args_str_split[0];\n\tif( cgi_args_str_split.length == 2 )\n\t{\n\t\tvar cgi_args_split = cgi_args_str_split[1].split('&');\n\t\tfor( var i = 0 ; i < cgi_args_split.length; ++ i )\n\t\t{\n\t\t\tvar keyval = cgi_args_split[i];\n\t\t\tif ( keyval.substring(0,5) != 'mode=' )\n\t\t\t{\n\t\t\t\tnew_cgi_args += cgi_args_delim + keyval;\n\t\t\t\tcgi_args_delim = \"&\";\n\t\t\t}\n\t\t}\n\t}\n\treturn new_cgi_args + cgi_args_delim + \"mode=\" + the_mode;\n}", "get isFallback() {}", "function argumentOrDefault(key){var args=customizations; return args[key]===undefined ? _defaultParams2.default[key] : args[key];}", "isSecure() {\n return this.https ? true : false;\n }", "function trustNone () {\n return false\n}", "function trustNone () {\n return false\n}", "function trustNone () {\n return false\n}", "function trustNone () {\n return false\n}", "function trustNone () {\n return false\n}", "function trustNone () {\n return false\n}", "function trustNone () {\n return false\n}", "function trustNone () {\n return false\n}", "function trustNone () {\n return false\n}", "function trustNone () {\n return false\n}", "function _cleanBooleanParam(_paramValue) {\n switch (_paramValue.toString().toLowerCase()) {\n case 'true':\n case 'on':\n case 'yes':\n case '1':\n return 'true';\n case 'false':\n case 'off':\n case 'no':\n case '0':\n return 'false';\n default:\n return _paramValue;\n }\n}", "set isFallback(value) {}", "function foo(param = 'no') {\n return 'yes';\n}", "needsReview() {\n return this.isLoggedIn() && this.user.settings.needsReview\n }", "needsReview() {\n return this.isLoggedIn() && this.user.settings.needsReview\n }", "function TrySwitchProcessingMode(Purl) {\r\n if ($(\"#processModeSwitch a\").length == 0) {\r\n return JSON.stringify({ API: \"TrySwitchProcessingMode\", Purl: Purl, Result: false, Message: \"Unable to switch modes.\" });\r\n }\r\n else {\r\n $(\"#processModeSwitch a\").click();\r\n return JSON.stringify({ API: \"TrySwitchProcessingMode\", Purl: Purl, Result: true, Message: \"Processing mode switched.\" });\r\n }\r\n}", "isSimple() {\n return false;\n }", "function insertDefaultJenkinsUrl(){\n\n if(settings.defaultDataImported == false) {\n\n insertNewJenkins(\"UBPorts\", \"https://ci.ubports.com\");\n insertNewJenkins(\"Ubuntu\", \"https://core-apps-jenkins.ubuntu.com/\");\n\n return true;\n }else\n return false;\n }", "ssEnabled () {\n // this._ssEnabled = false\n if (this._ssEnabled) {\n return this._ssEnabled\n }\n try {\n window.sessionStorage.setItem('_t', 1)\n window.sessionStorage.removeItem('_t')\n this._ssEnabled = true\n } catch (e) {}\n\n return this._ssEnabled\n }", "getPartition() {\n return super.getAsNullableString(\"partition\") || \"aws\";\n }" ]
[ "0.7491433", "0.7254034", "0.7254034", "0.7237181", "0.72049975", "0.72049975", "0.72049975", "0.72049975", "0.72049975", "0.72049975", "0.72049975", "0.72049975", "0.72049975", "0.72049975", "0.72049975", "0.72049975", "0.72049975", "0.72049975", "0.72049975", "0.72049975", "0.72049975", "0.72049975", "0.71835285", "0.71674037", "0.54453814", "0.52808416", "0.51416045", "0.50309134", "0.4917879", "0.4917879", "0.4917879", "0.4917879", "0.4917879", "0.4917879", "0.4917879", "0.4917879", "0.4917879", "0.4917879", "0.4917879", "0.4917879", "0.4917879", "0.49090758", "0.48645163", "0.48145604", "0.47915065", "0.47442693", "0.47376093", "0.4729029", "0.4719671", "0.47184706", "0.47079188", "0.47079188", "0.47079188", "0.4684418", "0.46717036", "0.46382213", "0.4625223", "0.46208212", "0.46166295", "0.46150208", "0.46081752", "0.46004242", "0.45929506", "0.45875716", "0.45759526", "0.45477712", "0.45320243", "0.45281664", "0.45281664", "0.45281664", "0.45281664", "0.4521844", "0.45087317", "0.45034167", "0.4503411", "0.45029014", "0.44991347", "0.44956404", "0.44672042", "0.44647712", "0.44583672", "0.44583672", "0.44583672", "0.44583672", "0.44583672", "0.44583672", "0.44583672", "0.44583672", "0.44583672", "0.44583672", "0.44525692", "0.44462556", "0.4442942", "0.44376823", "0.44376823", "0.44376293", "0.4428892", "0.44255662", "0.4420498", "0.4420229" ]
0.71952134
22
[Internal] Get the default value of a parameter, which may be an injectable function.
function $$getDefaultValue() { if (!injector) throw new Error("Injectable functions cannot be called at configuration time"); var defaultValue = injector.invoke(config.$$fn); if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue)) throw new Error("Default value (" + defaultValue + ") for parameter '" + self.id + "' is not an instance of Type (" + self.type.name + ")"); return defaultValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n\t if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n\t var defaultValue = injector.invoke(config.$$fn);\n\t if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n\t throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n\t return defaultValue;\n\t }", "function $$getDefaultValue() {\n if (!injector) {\n throw new Error(\"Injectable functions cannot be called at configuration time\");\n }\n\n var defaultValue = injector.invoke(config.$$fn);\n\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue)) {\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n }\n\n return defaultValue;\n }", "function $$getDefaultValue() {\n\t\t\t\tif (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n\t\t\t\tvar defaultValue = injector.invoke(config.$$fn);\n\t\t\t\tif (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n\t\t\t\t\tthrow new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n\t\t\t\treturn defaultValue;\n\t\t\t}", "function $$getDefaultValue() {\n\t if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n\t return injector.invoke(config.$$fn);\n\t }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n return injector.invoke(config.$$fn);\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n return injector.invoke(config.$$fn);\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n return injector.invoke(config.$$fn);\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n return injector.invoke(config.$$fn);\n }", "function getDefaultVal(defaultVal, data) {\n\treturn $isFunction(defaultVal)\n\t\t? defaultVal.call(data)\n\t\t: defaultVal;\n}", "function argumentOrDefault(key) {\n\t var args = customizations;\n\t return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n\t }", "function argumentOrDefault(key){var args=customizations; return args[key]===undefined ? _defaultParams2.default[key] : args[key];}", "function default_val(arg, val) {\n\treturn typeof arg === \"undefined\" ? val : arg;\n} // default_val()", "function argumentOrDefault(key) {\r\n var args = customizations;\r\n return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\r\n }", "function argumentOrDefault(key) {\n var args = customizations;\n return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n }", "function argumentOrDefault(key) {\n var args = customizations;\n return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n }", "function argumentOrDefault(key) {\n var args = customizations;\n return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n }", "function argumentOrDefault(key) {\n var args = customizations;\n return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n }", "function defaulted(value,defaultValue){return value!==undefined?value:defaultValue;}", "function _defaultArg(name, _default) {\n return isUndefined(name) ? _default : name;\n}", "function assignParameterValue(argument, defaultValue){\n\t\t\treturn typeof argument !== 'undefined' ? argument : defaultValue;\n\t\t}", "function assignParameterValue(argument, defaultValue){\n\t\t\treturn typeof argument !== 'undefined' ? argument : defaultValue;\n\t\t}", "function getDefault(value, optional) {\n return value || optional;\n}", "function defaulted(value, defaultValue) {\n return value !== undefined ? value : defaultValue;\n }", "function defaulted(value, defaultValue) {\n return value !== undefined ? value : defaultValue;\n}", "function defaulted(value, defaultValue) {\n return value !== undefined ? value : defaultValue;\n}", "function defaulted(value, defaultValue) {\n return value !== undefined ? value : defaultValue;\n}", "function defaulted(value, defaultValue) {\n return value !== undefined ? value : defaultValue;\n}", "function defaulted(value, defaultValue) {\n return value !== undefined ? value : defaultValue;\n}", "function defaulted(value, defaultValue) {\n return value !== undefined ? value : defaultValue;\n}", "function defaultValue(value, theDefault)\n {\n return (value !== undefined) ? value : theDefault;\n }", "function defaulted(value, defaultValue) {\n return value !== undefined ? value : defaultValue;\n}", "function defaulted(value, defaultValue) {\r\n return value !== undefined ? value : defaultValue;\r\n}", "function defaulted(value, defaultValue) {\r\n return value !== undefined ? value : defaultValue;\r\n}", "function defaulted(value, defaultValue) {\r\n return value !== undefined ? value : defaultValue;\r\n}", "function argumentOrDefault(key) {\n var args = customizations;\n\n if (typeof args[key] !== 'undefined') {\n return args[key];\n } else {\n return defaultParams[key];\n }\n }", "function optionalParameter( value, defaultValue ) {\n\n\t\treturn value !== undefined ? value : defaultValue;\n\n\t}", "function useParameter(parameterKey, defaultValue) {\n var _useStoryContext = useStoryContext(),\n parameters = _useStoryContext.parameters;\n\n if (parameterKey) {\n return parameters[parameterKey] || defaultValue;\n }\n\n return undefined;\n}", "function useParameter(parameterKey, defaultValue) {\n var _useStoryContext = useStoryContext(),\n parameters = _useStoryContext.parameters;\n\n if (parameterKey) {\n return parameters[parameterKey] || defaultValue;\n }\n\n return undefined;\n}", "function getParamValWithDefault(context, propMetrics, useSeriesExtremes, mappingParamOptions, fallback, defaults, contextValueProp) {\n return pick(getMappingParameterValue(context, propMetrics, useSeriesExtremes, extend({\n min: 0, max: 1, mapTo: 'y', mapFunction: 'linear', within: 'chart'\n }, (defaults || {})), mappingParamOptions, contextValueProp), fallback);\n }", "function assignDefaultValue(value, defaultValue) {\n if (checkForParameter(value)) return value;\n return defaultValue;\n }", "function defaultValue(defaultVal, data) {\n if (data === undefined) {\n return defaultVal;\n } else {\n return data;\n }\n}", "function defaultValue(v) { }", "function defaultVal(actual, defaultValue) {\n\t return actual == null ? defaultValue : actual;\n\t}", "function checkForParameter(parameter, defaultparameter) {\r\n try {\r\n if (parameter !== null && parameter !== undefined\r\n && parameter !== \"null\" && parameter !== \"NaN\"\r\n && parameter !== \"undefined\"\r\n && parameter != \"\"\r\n && parameter != \" \") {\r\n return parameter;\r\n } else {\r\n\r\n return defaultparameter;\r\n }\r\n } catch (e) {\r\n log.error(\"Err@ FN checkForParameter\", e);\r\n }\r\n }", "function getValueDefault(a, defaultValue) {\n if (hasValue(a)) {\n return a;\n }\n else {\n return defaultValue;\n }\n}", "get(defaultVal) {\n return this.getClass().fromNullable(super.get(defaultVal).value);\n }", "function defaultValue(test,defaultValue) {\r\n\treturn (typeof test !== 'undefined' ? test : defaultValue);\r\n}", "function getUrlParam(parameter, defaultvalue){\n var urlparameter = defaultvalue;\n if(window.location.href.indexOf(parameter) > -1){\n urlparameter = getUrlVars()[parameter];\n }\n return urlparameter;\n }", "_getDefaultValue() {\n const that = this;\n\n return that._cloneValue(that._defaultValue);\n }", "function undefinedDefault(value, defaultValue) {\n return (value !== undefined) ? value : defaultValue;\n}", "function get(option, defaultValue) {\n return option === undefined ? defaultValue : option;\n}", "function get(option, defaultValue) {\n return option === undefined ? defaultValue : option;\n}", "cfgValue(variable, defaultVal) {\n let val = defaultVal ? this.cfg.get(variable) : this.cfg.require(variable);\n if (typeof val === 'string') {\n let v = val.toLowerCase();\n if (v === 'no' || v === 'false' || v === 'none') {\n val = undefined;\n }\n }\n return val || defaultVal;\n }", "function defaultValue(x, y = 12) {\n // y is 12 if not passed (or passed as undefined)\n return x + y;\n}", "function optionalDefault( value, defaultValue ) {\n \tif ( value === undefined ) return defaultValue;\n \telse if ( value == null ) return defaultValue;\n \telse return value;\n }", "function valueOrDefault(value, defaultValue) {\n\t\treturn typeof value === 'undefined' ? defaultValue : value;\n\t}", "function toDefault(val, def) {\n if (is_1.isValue(val) && !(is_1.isEmpty(val) && !is_1.isEmpty(def)))\n return val;\n return is_1.isValue(def) ? def : null;\n}", "function defaultValue (key) {\n if (!checkAllAliases(key, flags.bools) &&\n !checkAllAliases(key, flags.counts) &&\n `${key}` in defaults) {\n return defaults[key]\n } else {\n return defaultForType(guessType(key))\n }\n }", "function defaultValue (key) {\n if (!checkAllAliases(key, flags.bools) &&\n !checkAllAliases(key, flags.counts) &&\n `${key}` in defaults) {\n return defaults[key]\n } else {\n return defaultForType(guessType(key))\n }\n }", "function def(arg, val) { return (typeof arg !== 'undefined') ? arg : val; }", "function getDefault(filter) {\n\tvar returnVal = \"\";\n\tvar key = filter.dataset.key;\n\tvar defaultValue = filter.dataset.defaultValue;\n\n\tif (defaultValue) {\n\t\t// If defaultValue is set\n\t\treturnVal = defaultValue;\n\t}\n\n\treturn returnVal;\n}", "function getDefaultValue(path) {\n var node = path.node;\n var defaultValue;\n if (types.Literal.check(node)) {\n defaultValue = node.raw;\n } else {\n if (types.AssignmentPattern.check(path.node)) {\n path = (0, _resolveToValue2.default)(path.get('right'));\n } else {\n path = (0, _resolveToValue2.default)(path);\n }\n if (types.ImportDeclaration.check(path.node)) {\n defaultValue = node.name;\n } else {\n node = path.node;\n defaultValue = (0, _printValue2.default)(path);\n }\n }\n if (typeof defaultValue !== 'undefined') {\n return {\n value: defaultValue,\n computed: types.CallExpression.check(node) || types.MemberExpression.check(node) || types.Identifier.check(node)\n };\n }\n}", "function get_default(obj, prop, def) {\n return prop in obj ? obj[prop] : def;\n }", "function a(param=0) {\n return param;\n}", "function defaultValue(a,b,c=10)\n{\n console.log(a+\" \"+b+\" \"+c);\n}", "function default_missing_values(default_val)\n{\n\treturn default_val;\n}", "function assignParameter(assertValue, defaultValue) {\n if (assertValue == undefined) \n return defaultValue;\n return assertValue;\n }", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t }", "function getPropDefaultValue(vm, prop, name) {\n\t\t // no default, return undefined\n\t\t if (!hasOwn(prop, 'default')) {\n\t\t return undefined;\n\t\t }\n\t\t var def = prop.default;\n\t\t // warn against non-factory defaults for Object & Array\n\t\t if (isObject(def)) {\n\t\t (\"production\") !== 'production' && warn('Invalid default value for prop \"' + name + '\": ' + 'Props with type Object/Array must use a factory function ' + 'to return the default value.', vm);\n\t\t }\n\t\t // call factory function for non-Function types\n\t\t return typeof def === 'function' && prop.type !== Function ? def.call(vm) : def;\n\t\t}", "function defaultToZero(arg) {\n return arg === undefined ? 0 : arg;\n }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "get defaultValue() {\n return this.getStringAttribute('default_value');\n }", "function getArg(aArgs, aName, aDefaultValue) {\n\t\t if (aName in aArgs) {\n\t\t return aArgs[aName];\n\t\t } else if (arguments.length === 3) {\n\t\t return aDefaultValue;\n\t\t } else {\n\t\t throw new Error('\"' + aName + '\" is a required argument.');\n\t\t }\n\t\t}", "function getPropDefaultValue (vm, prop, name) {\n\t // no default, return undefined\n\t if (!hasOwn(prop, 'default')) {\n\t return undefined\n\t }\n\t var def = prop.default;\n\t // warn against non-factory defaults for Object & Array\n\t if (isObject(def)) {\n\t \"development\" !== 'production' && warn(\n\t 'Invalid default value for prop \"' + name + '\": ' +\n\t 'Props with type Object/Array must use a factory function ' +\n\t 'to return the default value.',\n\t vm\n\t );\n\t }\n\t // call factory function for non-Function types\n\t return typeof def === 'function' && prop.type !== Function\n\t ? def.call(vm)\n\t : def\n\t}", "function defaultIntegerValue(v) { }", "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "function dArgVal(argToCheck, defVal)\r\n{\r\n\tif (argToCheck == undefined) \r\n\t{\r\n\t\treturn defVal;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn argToCheck;\r\n\t}\r\n}", "function getPropDefaultValue (vm, prop, name) {\n\t // no default, return undefined\n\t if (!hasOwn(prop, 'default')) {\n\t return undefined\n\t }\n\t var def = prop.default\n\t // warn against non-factory defaults for Object & Array\n\t if (isObject(def)) {\n\t process.env.NODE_ENV !== 'production' && warn(\n\t 'Invalid default value for prop \"' + name + '\": ' +\n\t 'Props with type Object/Array must use a factory function ' +\n\t 'to return the default value.',\n\t vm\n\t )\n\t }\n\t // call factory function for non-Function types\n\t return typeof def === 'function' && prop.type !== Function\n\t ? def.call(vm)\n\t : def\n\t}", "function getPropDefaultValue (vm, prop, name) {\n // no default, return undefined\n if (!hasOwn(prop, 'default')) {\n return undefined\n }\n var def = prop.default;\n // warn against non-factory defaults for Object & Array\n if (isObject(def)) {\n \"development\" !== 'production' && warn(\n 'Invalid default value for prop \"' + name + '\": ' +\n 'Props with type Object/Array must use a factory function ' +\n 'to return the default value.',\n vm\n );\n }\n // call factory function for non-Function types\n return typeof def === 'function' && prop.type !== Function\n ? def.call(vm)\n : def\n}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}", "function getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}" ]
[ "0.7800003", "0.7800003", "0.7800003", "0.7800003", "0.7800003", "0.7800003", "0.7800003", "0.7800003", "0.7800003", "0.7800003", "0.7800003", "0.7800003", "0.7800003", "0.7800003", "0.7800003", "0.77837276", "0.7736508", "0.77205086", "0.75418746", "0.7512533", "0.7512533", "0.7512533", "0.7422268", "0.71551055", "0.7143046", "0.71377283", "0.711584", "0.70687616", "0.70670766", "0.70670766", "0.70670766", "0.70670766", "0.69170576", "0.69034696", "0.68944794", "0.68944794", "0.68459666", "0.6821748", "0.6815909", "0.6815909", "0.6815909", "0.6815909", "0.6815909", "0.6815909", "0.6809613", "0.6788205", "0.6768633", "0.6768633", "0.6768633", "0.6712625", "0.6708541", "0.66949904", "0.66949904", "0.6675239", "0.66300726", "0.66161317", "0.66133875", "0.66059536", "0.6579886", "0.6569878", "0.6523215", "0.6346945", "0.6324282", "0.6304586", "0.6287635", "0.6258598", "0.6258598", "0.623296", "0.6224818", "0.61995155", "0.6195023", "0.60974646", "0.60781235", "0.60781235", "0.606875", "0.60551417", "0.60086304", "0.59998065", "0.5997843", "0.5953498", "0.5949842", "0.5948523", "0.5927163", "0.5927163", "0.5927163", "0.5927163", "0.592573", "0.5921966", "0.59177774", "0.5914342", "0.59045917", "0.5899569", "0.5892774", "0.588592", "0.5877393", "0.5876412", "0.5868821", "0.5865619", "0.5865619", "0.5865619" ]
0.77487004
16
[Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the default value, which may be the result of an injectable function.
function $value(value) { function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; } function $replace(value) { var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; }); return replacement.length ? replacement[0] : value; } value = $replace(value); return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get(key, default_value) {\n // get sets the default value if key is not found\n const val = this._get(key);\n if (val === undefined) {\n this.set(key, default_value);\n return default_value;\n } else {\n return this.decode(val);\n }\n }", "function decodeValue(value) {\n if (value == null) {\n return null;\n }\n return value.replace(decodeLookupRegex, (m) => decodeMap[m] || \"\");\n}", "function deserializeValue(value) {\n try {\n return value\n ? value == 'true' ||\n (value == 'false'\n ? false\n : value == 'null'\n ? null\n : +value + '' == value\n ? +value\n : /^[\\[\\{]/.test(value)\n ? h.parseJSON(value)\n : value)\n : value;\n } catch (e) {\n return value;\n }\n }", "function deserializeValue( value ) {\n try {\n return value ? value == \"true\" || (value == \"false\" ? false : value == \"null\" ? null : +value + \"\" == value ? +value : /^[\\[\\{]/.test( value ) ? $.parseJSON( value ) : value) : value\n } catch ( e ) {\n return value\n }\n }", "function decodeValue (value, options) {\n return getValueEncoder(options).decode(value)\n}", "function decodeValue (value, options) {\n return getValueEncoder(options).decode(value)\n}", "function $value(value) {\n\t function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n\t function $replace(value) {\n\t var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n\t return replacement.length ? replacement[0] : value;\n\t }\n\t value = $replace(value);\n\t return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n\t }", "get(defaultVal) {\n return this.getClass().fromNullable(super.get(defaultVal).value);\n }", "function deserializeValue(value) {\n\t try {\n\t return value ? value == \"true\" || (value == \"false\" ? false : value == \"null\" ? null : +value + \"\" == value ? +value : /^[\\[\\{]/.test(value) ? $.parseJSON(value) : value) : value;\n\t } catch (e) {\n\t return value;\n\t }\n\t }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n (value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value) : value\n } catch (e) {\n return value\n }\n }", "function deserializeValue(value) {\r\n try {\r\n return value ?\r\n value == \"true\" ||\r\n ( value == \"false\" ? false :\r\n value == \"null\" ? null :\r\n +value + \"\" == value ? +value :\r\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\r\n value )\r\n : value\r\n } catch(e) {\r\n return value\r\n }\r\n }", "function deserializeValue(value) {\r\n try {\r\n return value ?\r\n value == \"true\" ||\r\n ( value == \"false\" ? false :\r\n value == \"null\" ? null :\r\n +value + \"\" == value ? +value :\r\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\r\n value )\r\n : value\r\n } catch(e) {\r\n return value\r\n }\r\n }", "value(vDefault) {\n\t\tif (this.value_ === undefined) {\n\t\t\treturn vDefault;\n\t\t} else {\n\t\t\treturn this.value_;\n\t\t}\n\t}", "function deserializeValue(value) {\r\n try {\r\n return value ?\r\n value == \"true\" ||\r\n ( value == \"false\" ? false :\r\n value == \"null\" ? null :\r\n +value + \"\" == value ? +value :\r\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\r\n value )\r\n : value\r\n } catch(e) {\r\n return value\r\n }\r\n }", "_get_value() {\n return this._has_value() ? this._value : undefined;\n }", "function getFinalValue(value, defaultValue) {\n return value === undefined || value === null ? defaultValue : value;\n}", "function GetValue(value, defvalue) { return value || parseInt(value) == 0 ? value : defvalue; }", "function deserializeValue(value) {\n var num;\n try {\n return value ? value == \"true\" || (value == \"false\" ? false : value == \"null\" ? null : !/^0/.test(value) && !isNaN(num = Number(value)) ? num : /^[\\[\\{]/.test(value) ? $.parseJSON(value) : value) : value;\n } catch (e) {\n return value;\n }\n }", "function $$getDefaultValue() {\n\t\t\t\tif (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n\t\t\t\tvar defaultValue = injector.invoke(config.$$fn);\n\t\t\t\tif (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n\t\t\t\t\tthrow new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n\t\t\t\treturn defaultValue;\n\t\t\t}", "function deserializeValue(value){try{return value?value==\"true\"||(value==\"false\"?false:value==\"null\"?null:+value+\"\"==value?+value:/^[\\[\\{]/.test(value)?$.parseJSON(value):value):value;}catch(e){return value;}}", "function toDefault(val, def) {\n if (is_1.isValue(val) && !(is_1.isEmpty(val) && !is_1.isEmpty(def)))\n return val;\n return is_1.isValue(def) ? def : null;\n}", "function deserializeValue(value) {\n var num\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n !/^0/.test(value) && !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n var num\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n !/^0/.test(value) && !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n var num\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n !/^0/.test(value) && !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n var num\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n !/^0/.test(value) && !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n var num\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n !/^0/.test(value) && !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "getDefaultValue(type) {\n switch (type) {\n case \"string\":\n return \"New Value\";\n case \"array\":\n return [];\n case \"boolean\":\n return false;\n case \"null\":\n return null;\n case \"number\":\n return 0;\n case \"object\":\n return {};\n default:\n // We don't have a datatype for some reason (perhaps additionalProperties was true)\n return \"New Value\";\n }\n }", "getValue() {\n return this.defined ? this.value : \"None\";\n }", "function $$getDefaultValue() {\n\t if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n\t var defaultValue = injector.invoke(config.$$fn);\n\t if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n\t throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n\t return defaultValue;\n\t }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }", "function valueOrDefault(value, defaultValue) {\n\t\treturn typeof value === 'undefined' ? defaultValue : value;\n\t}", "function $value(value) {\n function hasReplaceVal(val) {\n return function (obj) {\n return obj.from === val;\n };\n }\n\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function (obj) {\n return obj.to;\n });\n return replacement.length ? replacement[0] : value;\n }\n\n value = $replace(value);\n return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "function getDefault(value, optional) {\n return value || optional;\n}", "function $$getDefaultValue() {\n if (!injector) {\n throw new Error(\"Injectable functions cannot be called at configuration time\");\n }\n\n var defaultValue = injector.invoke(config.$$fn);\n\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue)) {\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n }\n\n return defaultValue;\n }", "cfgValue(variable, defaultVal) {\n let val = defaultVal ? this.cfg.get(variable) : this.cfg.require(variable);\n if (typeof val === 'string') {\n let v = val.toLowerCase();\n if (v === 'no' || v === 'false' || v === 'none') {\n val = undefined;\n }\n }\n return val || defaultVal;\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n return injector.invoke(config.$$fn);\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n return injector.invoke(config.$$fn);\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n return injector.invoke(config.$$fn);\n }", "function $$getDefaultValue() {\n\t if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n\t return injector.invoke(config.$$fn);\n\t }", "function defaulted(value,defaultValue){return value!==undefined?value:defaultValue;}", "getDefault() {\n return JSON.parse(JSON.stringify(this.default))\n }", "function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n return injector.invoke(config.$$fn);\n }", "get(key, default_value, type_value = \"var\", type_template = \"\")\n\t{\n\t\tkey = this.toString(key);\n\t\tvar val = super.get(key);\n\t\tif (val == undefined) return default_value;\n\t\t/*if (isBrowser()) return Runtime.rtl.convert(val, type_value, default_value, type_template);*/\n\t\treturn use(\"Runtime.rtl\").convert(val, type_value, default_value, type_template);\n\t}", "function defaultString(value){\n\tif (!(value) || value == \"undefined\") {\n\t\treturn \"\";\n\t} \n\treturn value;\t\n}", "function getDefaultVal(defaultVal, data) {\n\treturn $isFunction(defaultVal)\n\t\t? defaultVal.call(data)\n\t\t: defaultVal;\n}", "get defaultValueCoding() {\n\t\treturn this.__defaultValueCoding;\n\t}", "function getValue(value) {\n var data = value,\n result = value;\n\n if (typeof data === 'string') {\n try {\n if (!data || data === 'true') {\n result = true;\n } else if (data === 'false') {\n result = false;\n } else if (data === 'null') {\n result = null;\n } else if (+data + '' === data) {\n result = +data;\n } else {\n result = rbrace.test(data) ? JSON.parse(data) : data;\n }\n } catch (error) {\n }\n }\n return result;\n}", "function get(context, key) {\n var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n var userDefaults = getUserDefaults(context);\n var storedValue = userDefaults.stringForKey_(key);\n if (!storedValue) {\n return defaultValue;\n }\n try {\n return JSON.parse(storedValue);\n } catch (e) {\n return defaultValue;\n }\n}", "function decodeUrlValue(value) {\n try {\n return JSON.parse(value);\n } catch (e) {\n return value;\n }\n}", "value() { return undefined; }", "function get(obj, key, defaultVal){\n var result = obj[key];\n return (typeof result!==\"undefined\")? result : defaultVal;\n}", "function getValue(val) {\n if (typeOf(val) === 'string') {\n var propVal = get(this, val);\n\n return 'undefined' === typeof propVal ? val : propVal;\n } else if ((0, _emberMomentUtilsIsDescriptor['default'])(val)) {\n var funcName = val.func ? 'func' : // Ember < 1.11\n '_getter'; // Ember >= 1.11\n return val.altKey ? get(this, val.altKey) : val[funcName].apply(this);\n } else {\n return val;\n }\n }", "function Get_String(variable, defaultValue)\n{\n\t//return the variable or its default value\n\treturn variable && variable != \"null\" && variable != \"undefined\" ? variable : defaultValue;\n}", "function checkUndefined(value) {\n if (JSON.stringify(value) === undefined) {\n return \"\";\n } else {\n return value;\n }\n }", "function defaulted(value, defaultValue) {\n return value !== undefined ? value : defaultValue;\n}", "function defaulted(value, defaultValue) {\n return value !== undefined ? value : defaultValue;\n}", "function defaulted(value, defaultValue) {\n return value !== undefined ? value : defaultValue;\n}", "function defaulted(value, defaultValue) {\n return value !== undefined ? value : defaultValue;\n}", "function defaulted(value, defaultValue) {\n return value !== undefined ? value : defaultValue;\n}", "function defaulted(value, defaultValue) {\n return value !== undefined ? value : defaultValue;\n}", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }" ]
[ "0.6742883", "0.6609838", "0.61787677", "0.6120768", "0.6120049", "0.6120049", "0.6114009", "0.6112803", "0.6110313", "0.6100529", "0.6100529", "0.6100529", "0.6053176", "0.6053176", "0.6053176", "0.6053176", "0.6053176", "0.6053176", "0.6053176", "0.6053176", "0.6053176", "0.6053176", "0.6053176", "0.6053176", "0.6053176", "0.6049803", "0.6024342", "0.6024342", "0.60174894", "0.6010095", "0.5940726", "0.5936007", "0.59118515", "0.59102345", "0.58699894", "0.58207154", "0.5820361", "0.5817894", "0.5817894", "0.5817894", "0.5817894", "0.5817894", "0.58173597", "0.5808761", "0.58086824", "0.5798105", "0.57976747", "0.57976747", "0.57976747", "0.57976747", "0.57976747", "0.57976747", "0.57976747", "0.57976747", "0.57976747", "0.57976747", "0.57976747", "0.57976747", "0.57976747", "0.57976747", "0.57976747", "0.57951796", "0.5783514", "0.578134", "0.5742698", "0.5742698", "0.5742698", "0.5742698", "0.5742698", "0.5718374", "0.5690953", "0.56826067", "0.5652821", "0.5652821", "0.5652821", "0.56498915", "0.5628735", "0.5624166", "0.5616649", "0.56045204", "0.55722725", "0.5540731", "0.55365825", "0.55057853", "0.54982334", "0.54956704", "0.5467101", "0.5455719", "0.543897", "0.543266", "0.5381379", "0.53765553", "0.53765553", "0.53765553", "0.53765553", "0.53765553", "0.53765553", "0.53712726", "0.53712726", "0.53712726" ]
0.53717333
97
Returns a string that is a prefix of all strings matching the RegExp
function regExpPrefix(re) { var prefix = /^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(re.source); return (prefix != null) ? prefix[1].replace(/\\(.)/g, "$1") : ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n\t var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n\t return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n\t }", "function regExpPrefix(re) {\n\t var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n\t return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n\t }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n\t\t\tvar prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n\t\t\treturn (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n\t\t}", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n\n return (prefix !== null && prefix !== undefined) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function prefix(s) {\r\n return gm_prefix+s;\r\n }", "function startsWith(input){\n\t\treturn new RegExp('^' + input, 'g');\n\t}", "function makePrefixRe(str) {\n if (typeof str !== 'string') {\n throw new RangeError('invalid template');\n }\n let template = str.replace(\n /-|\\||\\{|\\}|\\(|\\)|\\\\|\\?|\\./g,\n match => {\n return `\\\\${match}`;\n }\n );\n return new RegExp(`^${template}(.*)$`);\n }", "function pattern_prefix(schema, identifier) {\n if ( schema ) {\n // to match a table name including schema prefix\n // name should not be part of another name, so we require\n // to start a at a word boundary\n if ( identifier[0] !== '\"' ) {\n return '\\\\b';\n } else {\n return '';\n }\n } else {\n // to match a table name without schema\n // name should not begin right after a dot (i.e. have a explicit schema)\n // nor be part of another name\n // since the pattern matches the first character of the table\n // it must be put back in the replacement text\n replacement = '$01'+replacement;\n return '([^\\.a-z0-9_]|^)';\n }\n }", "function prefix(a, b) {\n let i;\n for (i = 0; a[i] === b[i] && i < a.length; i++);\n return a.substr(0, i);\n}", "function startAfterRegExpPrefix(value, prefix) {\n var match = prefix.exec(value);\n if (!match) {\n return;\n }\n if (match.index !== 0) {\n return;\n }\n return match[0].length;\n}", "function start(source) {\n return new RegExp('^' + source)\n}", "function buildWildcardClass(prefix) {\n return function (index, css) {\n return (css.match (new RegExp(\"(^|\\\\s)\" + prefix + \"-\\\\S+\", \"g\") ) || []).join(' ');\n }\n}", "_startWith (string, prefix) {\n if (typeof string != 'string') {\n return false;\n\n } else {\n for (var i = 0, length = prefix.length; i < length; i += 1) {\n var p = prefix[i];\n var s = string[i];\n if (p !== s) {\n return false;\n }\n }\n }\n return true;\n }", "function prefixMatch(p) {\n var i = -1,\n n = p.length,\n s = document.body.style;\n while (++i < n)\n if (p[i] + 'Transform' in s) return '-' + p[i].toLowerCase() + '-';\n return '';\n}", "function fixStart(word) {\n var firstLetter = word.charAt(0);\n console.log(firstLetter + word.slice(1).replace(new RegExp(firstLetter, 'g'), '*'));\n return fixStart;\n}", "function patternPrefix (schema, identifier) {\n if (schema) {\n // to match a table name including schema prefix\n // name should not be part of another name, so we require\n // to start a at a word boundary\n if (identifier[0] !== '\"') {\n return '\\\\b';\n } else {\n return '';\n }\n } else {\n // to match a table name without schema\n // name should not begin right after a dot (i.e. have a explicit schema)\n // nor be part of another name\n // since the pattern matches the first character of the table\n // it must be put back in the replacement text\n replacement = '$01' + replacement;\n return '([^\\.a-z0-9_]|^)'; // eslint-disable-line no-useless-escape\n }\n }", "startWith(prefix) {\n this.addBefore(`^${Rule(prefix).source}`);\n return this;\n }", "function fixStart(str)\n{\n //var firstChar = str.slice(0,1);\n var str1 = str.split(\"\");\n // var re = new RegExp(/(?!^)${firstChar}/,\"g\");\n // var str1 = str.replace(re,'*');\n for (var i = 1; i < str.length; i+=1)\n {\n if (str[i] === str[0])\n {\n str1[i] = '*';\n }\n }\n str1 = str1.join(\"\");\n console.log(str,\" is replaced : \",str1);\n return str1;\n}", "function prefix() {\n var prefix = '<span class=\"prior-prompt\">Sensory_5@Coding-Challenge: ~ $ </span>' + input();\n return prefix;\n}", "function prefixNames(prefix) {\n var classNames = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n classNames[_i - 1] = arguments[_i];\n }\n\n return classNames.map(function (className) {\n return className.split(\" \").map(function (name) {\n return name ? \"\" + prefix + name : \"\";\n }).join(\" \");\n }).join(\" \");\n }", "function strBeginsWith(str, prefix) {\n return str.indexOf(prefix) === 0;\n}", "function sc_prefix(s) {\n var i = s.lastIndexOf(\".\");\n return i ? s.substring(0, i) : s;\n}", "function startswith (string, prefix)\n{\n\treturn string.indexOf(prefix) == 0;\n}", "function commonPrefix(array) {\n let firstString = array.sort((a, b) => a.length - b.length)[0];\n let result = \"\";\n\n for (let idx = 1; idx <= firstString.length; idx += 1) {\n let prefix = firstString.slice(0, idx);\n for (let string of array) {\n if (string.startsWith(prefix)) {\n continue;\n } else {\n return result;\n }\n }\n result = prefix;\n }\n return result;\n}", "function startsWith(str, start) {\n var tr = str;\n\n if (tr.toLowerCase().startsWith(start)) {\n tr = str + 'pe';\n }\n\n return tr;\n}", "function findPrefix(inSrc, element, listCounters) {\n var prefix = \"\";\n if (!inSrc) {\n if (element.getType()===DocumentApp.ElementType.PARAGRAPH) {\n var paragraphObj = element;\n switch (paragraphObj.getHeading()) {\n // Add a # for each heading level. No break, so we accumulate the right number.\n case DocumentApp.ParagraphHeading.HEADING6: prefix+=\"#\";\n case DocumentApp.ParagraphHeading.HEADING5: prefix+=\"#\";\n case DocumentApp.ParagraphHeading.HEADING4: prefix+=\"#\";\n case DocumentApp.ParagraphHeading.HEADING3: prefix+=\"#\";\n case DocumentApp.ParagraphHeading.HEADING2: prefix+=\"#\";\n case DocumentApp.ParagraphHeading.HEADING1: prefix+=\"# \";\n default:\n }\n } else if (element.getType()===DocumentApp.ElementType.LIST_ITEM) {\n var listItem = element;\n var nesting = listItem.getNestingLevel()\n for (var i=0; i<nesting; i++) {\n prefix += \" \";\n }\n var gt = listItem.getGlyphType();\n // Bullet list (<ul>):\n if (gt === DocumentApp.GlyphType.BULLET\n || gt === DocumentApp.GlyphType.HOLLOW_BULLET\n || gt === DocumentApp.GlyphType.SQUARE_BULLET) {\n prefix += \"* \";\n } else {\n // Ordered list (<ol>):\n var key = listItem.getListId() + '.' + listItem.getNestingLevel();\n var counter = listCounters[key] || 0;\n counter++;\n listCounters[key] = counter;\n prefix += counter+\". \";\n }\n }\n }\n return prefix;\n}", "startsWith(t){}", "function fixStart (str) {\n\tvar firstLetter = str.charAt(0);\n\tvar remainder = str.slice(1, str.length);\n\tvar replaced = remainder.replace(RegExp(firstLetter, 'g'), '*');\n\tvar result = firstLetter.concat(replaced);\n\tdocument.write(result + '<br>');\n}", "function GetControlNamePrefix(inputName)\n{\n var arrParts = inputName.split('$');\n var prefix = \"\";\n var i;\n \n for(i=0;i<arrParts.length - 1;i++)\n prefix += arrParts[i] + \"$\";\n \n return prefix;\n}", "function strStartsWith(input, match) {\n return input.substring(0, match.length) === match;\n }", "function boldPrefix(word, prefix) {\r\n return word.replace(new RegExp('^(' + prefix + ')(.*)','ig'), '<b>$1</b>$2');\r\n}", "function prefixer(match, p1, offset, string) {\n return ('00000000000000000000' + match).substr(-20);\n }", "startsWith(c){ return false }", "startsWith(c){ return false }", "function fixStart(s) {\n var c = s.charAt(0);\n return c + s.slice(1).replace(new RegExp(c, 'g'), '*');\n }", "function starts_with(str, prefix) {\n\t\treturn str.lastIndexOf(prefix, 0) === 0;\n\t}", "function strStartsWith(input, match) {\n return input.substring(0, match.length) === match;\n }", "getPrefix () {\n return ''\n }", "function prefix(prefix, fn){\n\treturn function(input){\n\t\tfn( (prefix||'') + input )\n\t\treturn input\n\t}\n}", "function _all_string_prefixes() {\n return [\n '', 'FR', 'RF', 'Br', 'BR', 'Fr', 'r', 'B', 'R', 'b', 'bR',\n 'f', 'rb', 'rB', 'F', 'Rf', 'U', 'rF', 'u', 'RB', 'br', 'fR',\n 'fr', 'rf', 'Rb'];\n}", "function prefixer(match, p1, offset, string) {\n\t\t\t\t\treturn ('00000000000000000000'+match).substr(-20);\n\t\t\t\t}", "static removePrefix(value) {\n if (value.includes(InitialPrefix) && value.includes(EndPrefix)) {\n return value\n .toString()\n .replace(InitialPrefix, \"\")\n .replace(EndPrefix, \"\");\n }\n return value;\n }", "_buildRawMatcher(originalMatcher) {\n const prefix = originalMatcher.substring(0, 4);\n\n // Positive or negative lookbehind.\n if (prefix === '(?<=' || prefix === '(?<!') {\n return `${prefix}^${originalMatcher.slice(4)}`;\n }\n\n // Simple ^.\n return `^${originalMatcher}`;\n }", "function strStartsWith ( input, match ) {\r\n\t\treturn input.substring(0, match.length) === match;\r\n\t}", "function strStartsWith ( input, match ) {\r\n\t\treturn input.substring(0, match.length) === match;\r\n\t}", "function startsWith(str, prefix)\n{\n return (str.substr(0, prefix.length) == prefix);\n}", "function prefixer(prefix){\n\tthis.prefix=prefix;\n}", "function prefix(iri, factory) {\n return prefixes({\n '': iri.value || iri\n }, factory)('');\n}", "function strStartsWith ( input, match ) {\n\t\treturn input.substring(0, match.length) === match;\n\t}", "function strStartsWith ( input, match ) {\n\t\treturn input.substring(0, match.length) === match;\n\t}", "function strStartsWith(str, prefix)\n{\n if(typeof str != \"string\")\n {\n return false;\n }\n return str.indexOf(prefix) === 0;\n}", "function strStartsWith(input, match) {\n return input.substring(0, match.length) === match;\n }", "getPrefix() {\n return(this.prefix);\n }", "function commentReplace(match, singlePrefix) {\n return singlePrefix || '';\n }", "function commentReplace(match, singlePrefix) {\n return singlePrefix || '';\n }", "function commentReplace(match, singlePrefix) {\n return singlePrefix || '';\n }", "function commentReplace(match, singlePrefix) {\n return singlePrefix || '';\n }", "function commentReplace(match, singlePrefix) {\n return singlePrefix || '';\n }", "function preProcess(s) {\n var n = s.length;\n if (n === 0) {\n return \"^$\";\n }\n var ret = \"^\";\n for (var i = 0; i < n; i++)\n ret += \"#\" + s.substr(i, 1);\n\n ret += \"#$\";\n return ret;\n }", "startsWith(t) { return true }", "function doesStringStartWith(s, prefix) {\r\n return s.substr(0, prefix.length) === prefix;\r\n}", "function doesStringStartWith(s, prefix) {\r\n return s.substr(0, prefix.length) === prefix;\r\n}", "getPrefix(message) {\n if (typeof (this.Prefix) === \"function\") {\n return this.Prefix(this, message);\n }\n return this.Prefix;\n }", "function ifPrefix(s, array) {\n var newarray = [];\n for (var i = 0; i < array.length; i++) {\n if(!array[i].startsWith(s)){\n newarray.push(array[i]);\n }\n }\n return newarray;\n}", "function formal_prefix_replace_maybe(str, old_prefix, new_prefix) {\n var oldlen = old_prefix.length;\n\n if (str.length < oldlen) {\n return str;\n }\n\n if (str.substring(0, oldlen) == old_prefix) {\n return new_prefix + str.substring(oldlen);\n }\n\n return str;\n}", "function stringStartsWith(string, prefix) {\n return string.slice(0, prefix.length) == prefix;\n }", "function randomPrefix(){\n var prefix = choose(choose(selected).prefixes);\n // Add a space if the prefix doesn't end with the special | character\n if (prefix[prefix.length-1] == '|')\n return prefix.slice(0, prefix.length-1);\n return prefix + ' ';\n}", "function substringsAtStart(string) {\n return string.split('').map(function (char, i) {\n return string.slice(0, i + 1)\n });\n}", "startsWith(t){ return false }", "function stringStartsWith(str, prefix) {\r\n // returns false for empty strings too\r\n if ((!str) || !prefix) return false;\r\n return str.indexOf(prefix, 0) === 0;\r\n }", "function startsWith(input) {\n\tif(input==='a' || input==='A') {\n\t\treturn (\"starts with A\");\n\t}\n\telse if(input==='b' || input==='B') {\n\t\treturn (\"starts with B\");\n\t}\n\telse if(input==='c' || input==='C') {\n\t\treturn (\"starts with C\");\n\t}\n\telse if(input==='d' || input==='D') {\n\t\treturn (\"starts with D\");\n\t}\n\telse if(input==='e' || input==='E') {\n\t\treturn (\"starts with E\");\n\t}\n\telse {\n\t\treturn (\"starts with something else\");\n\t}\n}", "getPrefix(word) {\n validate(word);\n const retValue = getLastLetterNode(this.head, word);\n return !!retValue.value && retValue.word;\n }", "function startsWith(str, prefix) {\n\t str = toString(str);\n\t prefix = toString(prefix);\n\n\t return str.indexOf(prefix) === 0;\n\t }", "function doesStringStartWith(s, prefix) {\n return s.substr(0, prefix.length) === prefix;\n}", "function wordPattern(word) {\n let arr = word.toLowerCase().split(''), letters = [...new Set(arr)], res = '';\n for (let key of arr)\n res += `.${letters.indexOf(key)}`;\n return res.substr(1);\n}", "function highlightNamesThatStartWithP() {\n\n}", "function prefix() {\n return 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \\n' +\n 'PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> ' +\n 'PREFIX skos: <http://www.w3.org/2004/02/skos/core#> ' +\n 'PREFIX qb: <http://purl.org/linked-data/cube#> ' +\n 'PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> ' +\n 'PREFIX owl: <http://www.w3.org/2002/07/owl#> ';\n}", "function findCommonPrefix(str) {\n lastChar = commonPrefix.length - 1;\n commonPrefix = commonPrefix.substring(0, lastChar);\n }", "function getCampaignPrefix() {\n var prefix;\n var $elem = $('#main .breadcrumb .mm-name span, #main .mm-campaign-name span.overflow-tooltip');\n if (!$elem.length) { return ''; }\n prefix = $elem.eq(0).text().match(/(M?T|CID|PC|VCB)\\d*/, '')[0];\n return prefix || '';\n }", "function createStartsWithFilter(startsWith) {\n // YOUR CODE BELOW HERE //\n return Starting => Starting.charAt(0).toLowerCase() === startsWith.toLowerCase();\n}" ]
[ "0.7314573", "0.7314573", "0.7314573", "0.7314573", "0.7314573", "0.7314573", "0.7314573", "0.7314573", "0.7314573", "0.7314573", "0.7314573", "0.7314573", "0.7314573", "0.7314573", "0.7314573", "0.7314573", "0.7314573", "0.7314573", "0.7314573", "0.72977245", "0.72977245", "0.72324187", "0.7221942", "0.7218268", "0.67550796", "0.6520663", "0.624156", "0.6124378", "0.60515004", "0.6021968", "0.59867", "0.59794194", "0.5964266", "0.5895967", "0.58837384", "0.58768064", "0.587237", "0.5867455", "0.5800769", "0.5799387", "0.5781266", "0.5767325", "0.5748584", "0.57448316", "0.57354265", "0.5724166", "0.5711541", "0.56880194", "0.5682727", "0.56641424", "0.5654644", "0.5647894", "0.5630315", "0.5630315", "0.5630127", "0.562604", "0.5613801", "0.5612588", "0.5601436", "0.5592301", "0.55874133", "0.55688804", "0.5554252", "0.55469745", "0.55469745", "0.554306", "0.5532821", "0.5530112", "0.5523229", "0.5523229", "0.5505976", "0.55023986", "0.5493492", "0.5479314", "0.5479314", "0.5479314", "0.5479314", "0.5479314", "0.54554135", "0.54473513", "0.54394054", "0.54394054", "0.54374677", "0.54364413", "0.5433972", "0.54295117", "0.54239106", "0.54231495", "0.5408468", "0.54018754", "0.54001683", "0.5399347", "0.5393991", "0.5386896", "0.5385999", "0.53795505", "0.5375135", "0.5349376", "0.5335655", "0.5330956" ]
0.7280135
21
Interpolates matched values into a String.replace()style pattern
function interpolate(pattern, match) { return pattern.replace(/\$(\$|\d{1,2})/, function (m, what) { return match[what === '$' ? 0 : Number(what)]; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function replacer(match, p1, p2, p3, offset, string){\n // p1 is nondigits, p2 digits, and p3 non-alphanumerics\n return [p1, p2, p3].join(' - ');\n}", "function replacer(match, p1, p2, p3, offset, string) {\n // p1 is nondigits, p2 digits, and p3 non-alphanumerics\n return [p1, p2, p3].join(' - ');\n}", "function replacer(match, p1, p2, p3, offset, string) {\n // p1 is nondigits, p2 digits, and p3 non-alphanumerics\n return [p1, p2, p3].join(' - ');\n }", "function interpolate(phrase, options) {\n for (var arg in options) {\n if (arg !== '_' && options.hasOwnProperty(arg)) {\n // We create a new `RegExp` each time instead of using a more-efficient\n // string replace so that the same argument can be replaced multiple times\n // in the same phrase.\n phrase = phrase.replace(new RegExp('%\\\\{'+arg+'\\\\}', 'g'), options[arg]);\n }\n }\n return phrase;\n }", "function interpolate(phrase, options) {\n for (var arg in options) {\n if (arg !== '_' && options.hasOwnProperty(arg)) {\n // We create a new `RegExp` each time instead of using a more-efficient\n // string replace so that the same argument can be replaced multiple times\n // in the same phrase.\n phrase = phrase.replace(new RegExp('%\\\\{'+arg+'\\\\}', 'g'), options[arg]);\n }\n }\n return phrase;\n }", "function replaceAll(x, y, z){\n return x.toString().replace(new RegExp(y, \"g\"), z);\n }", "function substitute(val) {\n if (typeof val == 'string') {\n val = val.replace(/\\$\\{(.*?)\\}/g, (match, name) => {\n const rep = replacement(name);\n // If there's no replacement available, keep the placeholder.\n return (rep === null) ? match : rep;\n });\n }\n else if (Array.isArray(val))\n val = val.map((x) => substitute(x));\n else if (typeof val == 'object') {\n // Substitute values but not keys, so we don't deal with collisions.\n const result = {};\n for (let [k, v] of Object.entries(val))\n result[k] = substitute(v);\n val = result;\n }\n return val;\n}", "function interpolate(string, values) {\n if (!values) {\n values = {};\n }\n\n return (string || '').replace(/({{.*?}})/g, function (all, match) {\n var key = match.slice(2, -2); // ditch the wrappers\n var parts = key.split('|').map(trim);\n // exit function with interpolate string through functions\n return parts.reduce(function (prev, curr) {\n var value = pluck(curr, values);\n if (value) {\n prev = value;\n } else if (typeof interpolate[curr] === 'function') {\n prev = interpolate[curr](prev);\n }\n return prev;\n }, '');\n });\n}", "function $replace(str, format, re, replacement){ return str.replace($parse(str, getParsePosition(format, re)), replacement); }", "function interpolate(template, values) {\n return template.replace(/{([^}]+)}/g, function (_, p) {\n return p in values ? values[p] : \"{\" + p + \"}\";\n });\n}", "function interpolate(template, values) {\n return template.replace(/{([^}]+)}/g, function (_, p) {\n return p in values ? values[p] : \"{\" + p + \"}\";\n });\n}", "function replaceBulk(args) {\n\t\tvar solution = args.string;\n\t\tvar replaceArray = args.replacements;\n\t\tvar findArray = Object.keys(replaceArray);\n\t\t\n\t\tvar regex = [], map = {}; \n\t\tfor(var i = 0; i < findArray.length; i++) {\n\t\t\tvar orig = findArray[i];\n\t\t\tregex.push( findArray[i].replace(/([-[\\]{}()*+?.\\\\^$|#,])/g,'\\\\$1') );\n\t\t\tmap[orig] = replaceArray[orig]; \n\t\t}\n\t\tregex = regex.join('|');\n\t\tsolution = solution.replace( new RegExp( regex, 'g' ), function(matched){\n\t\t\tif(map[matched]) {\n\t\t\t\treturn map[matched];\n\t\t\t}\n\t\t\t\n\t\t\treturn matched;\n\t\t});\n\t\treturn solution;\n\t}", "function interpolate(strings, values) {\n\treturn strings.reduce(function (result, current_str, idx) {\n\t\treturn result + current_str + (idx < values.length ? values[idx] : '');\n\t}, '');\n}", "function interpolate(pattern, match) {\n\t return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n\t return match[what === '$' ? 0 : Number(what)];\n\t });\n\t }", "function interpolate(pattern, match) {\n\t return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n\t return match[what === '$' ? 0 : Number(what)];\n\t });\n\t }", "function interpolate(template, values) {\n return template.replace(/{([^}]+)}/g, function (_, p) {\n return p in values ? values[p] : \"{\" + p + \"}\";\n });\n }", "function replace(input, searchValue, replaceValue) {}", "function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }", "function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }", "function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }", "function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }", "function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }", "function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }", "function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }", "function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }", "function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }", "function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }", "function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }", "function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }", "function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }", "function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }", "function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }", "function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }", "function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }", "function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }", "function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }", "function replaceFunc(f) {\n return (...args) => { // args are [match, group1, group2, ..., offset, whole string, (some browsers:) named groups obj]\n const info = { // replace function will be called with this object\n match: args[0], // full matching string\n groups: [args[0]], // matched groups per index and, if available, by name\n offset: -1, // offset of match in all\n all: '', // full text in which match was found\n };\n let i=1;\n while(i<args.length && 'number' !== typeof args[i]) info.groups.push(args[i++]);\n info.offset = args[i];\n info.all = args[i+1];\n Object.entries(args[i+2] || {}).forEach(([k,v]) => info.groups[k] = v);\n return f.call(null, info);\n };\n}", "function t(e){return e.replace(v,i)}", "function replace(input, re, value) {\n if (re instanceof RegExp)\n { return input.replace(re, value); }\n return re.reduce(function (input, re) { return input.replace(re, value); }, input);\n }", "function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }", "function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }", "function solve() {\n String.format = function() {\n var result = arguments[0];\n\n for (var i = 0; i < arguments.length - 1; i++) {\n var matchExpression = new RegExp('\\\\{' + i + '\\\\}', 'gm');\n result = result.replace(matchExpression, arguments[i + 1]);\n }\n\n return result;\n };\n\n var frmt = '{0}, {1}, {0} text {2}';\n var text = String.format(frmt, 1, 'Pesho', 'Gosho');\n\n console.log(text);\n}", "function replaceValue(strings, key, replacement) {\n var regexp = new RegExp('(\"' + key + '\\\\s*\"\\\\s*:\\\\s*)\".*\"', \"g\");\n // $1 consists of \"key: \", see the regexp abobe\n replacement = \"$1\" + replacement;\n strings = strings.replace(regexp, replacement);\n return strings;\n }", "function interpolate(pattern, match) {\n\t\t\treturn pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n\t\t\t\treturn match[what === '$' ? 0 : Number(what)];\n\t\t\t});\n\t\t}", "function normalize(value, patterns) {\n var index = -1\n\n while (++index < patterns.length) {\n value = value.replace(patterns[index][0], patterns[index][1])\n }\n\n return value\n}", "function applyConsolePattern(template, regExpObj, fieldToReplace, tableToReplace, field, table){\n var fldRegExpObj = new RegExp(fieldToReplace, 'g');\n var tblRegExpObj = new RegExp(tableToReplace, 'g');\n \n // apply pattern\n var newContents = String(template.replace(regExpObj, '$2'));\n\n // replace field name\n newContents = newContents.replace(fldRegExpObj, field);\n \n // replace table name\n newContents = newContents.replace(tblRegExpObj, table);\n \n return newContents;\n}", "function doReplace(target, arr) {\n var pattern;\n var index = 0;\n\n do {\n\n var arg = arr.shift();\n\n if (typeof arg === 'object') {\n for (var key in arg) {\n pattern = new RegExp('#\\\\{' + key + '\\\\}', 'g');\n target = target.replace(pattern, arg[key]);\n }\n\n } else {\n pattern = new RegExp('#\\\\{' + index + '\\\\}', 'g');\n target = target.replace(pattern, arg.toString());\n index++;\n }\n\n } while (arr.length);\n\n return target;\n }", "function $$replace(str, parsePosition, replacement){ return str.replace($parse(str, parsePosition), replacement); }", "function f(e){return e.join(o).replace(y,x).replace(m,w)}", "function f(e){return e.join(o).replace(y,x).replace(m,w)}", "function replace_values(match, offset, s){\n var idx = parseInt(match.slice(2, -2), 10) - 1;\n if (match[0] === '{'){\n return expressionValues[idx] || 'null';\n }else{\n return childValues[idx] || '/* do nothing */';\n }\n }", "function replace_values(match, offset, s){\n var idx = parseInt(match.slice(2, -2), 10) - 1;\n if (match[0] === '{'){\n return expressionValues[idx] || 'null';\n }else{\n return childValues || '/* do nothing */';\n }\n }", "function applyCombinaison(pattern) {\n return T.reduce((str, c) => str.replace('X', c), pattern);\n}", "function replace(input, re, value) {\n if (re instanceof RegExp)\n return input.replace(re, value);\n return re.reduce(function (input, re) { return input.replace(re, value); }, input);\n}", "function replace(input, re, value) {\n if (re instanceof RegExp)\n return input.replace(re, value);\n return re.reduce(function (input, re) { return input.replace(re, value); }, input);\n}", "function i18nInterpolationV(instructions, values) {\n var viewData = _getViewData();\n var different = false;\n for (var i = 0; i < values.length; i++) {\n // Check if bindings have changed\n bindingUpdated(viewData[BINDING_INDEX]++, values[i]) && (different = true);\n }\n if (!different) {\n return NO_CHANGE;\n }\n var res = '';\n for (var i = 0; i < instructions.length; i++) {\n // Odd indexes are placeholders\n if (i & 1) {\n res += stringify$1(values[instructions[i]]);\n }\n else {\n res += instructions[i];\n }\n }\n return res;\n}", "function _substitute(str, map) {\n for (var name in map) {\n if (map.hasOwnProperty(name)) {\n str = str.replace(new RegExp('@' + name, 'gi'), map[name]);\n }\n }\n return str;\n}", "function regularReplace(dict, txt){\n for (i in dict){\n var match = new RegExp(escapeRegExp(dict[i].m), \"ig\");\n txt = txt.replace(match, c(flip(copyCase), dict[i].r));\n }\n return txt;\n}", "function replace_all(phrase, replaced, newstr) {\n var temp = new RegExp(replaced, \"g\");\n return phrase.replace(temp, newstr);\n}", "function doFormatting(format, replacements) {\n\treturn format.replace(\"$1\", replacements.one).replace(\"$2\", replacements.two).replace(\"$3\", replacements.three);\n}", "static replaceMany(str, subs) {\n let final = str;\n let sub = nanoid();\n let pairs = {};\n for (const [key, val] of Object.entries(subs)) {\n let sub = nanoid();\n final = final.replace(key, sub);\n pairs[sub] = val;\n }\n for (const [key, val] of Object.entries(pairs)) {\n final = final.replace(key, val);\n }\n return final;\n }", "function replacer(match) {\n if (match === from) {\n return to;\n } else {\n return match;\n }\n }", "function renderTemplate(values, content) {\n\n for (var key in values) {\n var regExp = new RegExp(\"\\\\{{2}\\\\s*\" + key + \"\\\\s*\\\\}{2}\", \"i\");\n content = content.replace(regExp, values[key]);\n }\n\n return content;\n\n}", "function _interpolate() {\n var fn = _.spread(util.format);\n\n var result = fn(_.slice(arguments));\n return result;\n }", "function replacer(currentFields, scope, dictionary, s, field) {\n\tlet parts = field.split('.'),\n\t\tv = currentFields;\n\tfor (let i=0; i<parts.length; i++) {\n\t\tv = v[parts[i]];\n\t\tif (v == null) return ''; // eslint-disable-line eqeqeq\n\n\t\t//allow field values to be <Text /> nodes\n\t\tif (v && v.nodeName === Text) {\n\t\t\treturn translate(v.attributes.id, scope, dictionary, v.attributes.fields, v.attributes.plural, v.attributes.fallback);\n\t\t}\n\t}\n\t// allow for recursive {{config.xx}} references:\n\tif (typeof v==='string' && v.match(/\\{\\{/)) {\n\t\tv = template(v, currentFields);\n\t}\n\treturn v;\n}", "function replacev2() {\r\n var arr1 = ['OR', 'AND', '\\'Assigned Group\\''] //wrong values\r\n var arr2 = ['or', 'and', 'assigned.group'] //right values\r\n //example string\r\n var str = \"'Reported Source' = \\\"Web\\\" OR 'Reported Source' = \\\"Email\\\" AND 'Assigned Group' = \\\"1-Call Center SD\\\"\"; //string for check\r\n\r\n for (var i = 0; i < arr1.length; i++) {\r\n str = str.replace(new RegExp(\" \" + arr1[i] + \" \", 'g'), ' ' + arr2[i] + ' ')\r\n str = str.replace(new RegExp(' = ', 'g'), ' == ')\r\n }\r\n //c(str)\r\n}", "function replace_groups(input, replacer) {\n var i, out = '', cnt = 0;\n for (i = 0; i < input.length; i += 1) {\n if (input[i] === '\\\\') {\n if (cnt === 0) {\n out += input[i] + input[i + 1];\n }\n i += 1; \n continue;\n }\n if (cnt === 0 && input[i] !== '(') {\n out += input[i];\n continue;\n }\n if (input[i] === '(') {\n cnt += 1;\n } else if (input[i] === ')') {\n cnt -= 1;\n if (cnt === 0) {\n out += replacer;\n }\n }\n }\n return out;\n}", "function formatString(text)\r\n{\r\n\tvar result = text;\r\n\tfor (var i = 1; i < arguments.length; i++)\r\n\t{\r\n\t\tvar pattern = \"{\" + (i - 1) + \"}\";\r\n\t\twhile (result.indexOf(pattern) >= 0)\r\n\t\t{\r\n\t\t\tresult = result.replace(pattern, arguments[i]);\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}", "function ReplaceMacros(str, arrMacro)\r\n{\r\n for (var i = 0; i < arrMacro.length; ++i)\r\n {\r\n var macro = arrMacro[i];\r\n str = str.replace(new RegExp(\"(\" + macro.name + \")\", \"g\"), macro.value)\r\n }\r\n \r\n return str;\r\n}", "function descifrar(string,object){\nfor (let i in object){\n string= string.replaceAll(i,object[i])\n}\nreturn string\n}", "function stringFormat(str, args) {\n var content = str;\n for (var i=0; i < args.length; i++) {\n var replacement = '{' + i + '}';\n content = content.replace(replacement, args[i]);\n }\n return content;\n }", "function replaceTemplate(template = '', map = {}) {\n const reg = Object.keys(map)\n .map(key => key.replace(/([.*+?^=!:${}()|[\\]/\\\\])/g, '\\\\$1'))\n .join('|');\n return template.replace(\n new RegExp(reg, 'gm'),\n placeholer => map[placeholer] || '',\n );\n}", "function updateValues(arr, regex, replace) {\n if ( ! regex || regex.length < 1 || ! isRegexValid(regex) ) {\n error(\"Invalid regex: \" + regex);\n return undefined;\n } else if (! replace ) {\n error(\"Undefined replace string\");\n return undefined;\n }\n else {\n var re = new RegExp(regex);\n var newArr = [];\n for (var i in arr) {\n var matches = arr[i].match(regex);\n if ( matches ) {\n newArr[i] = replace; // Iterate, replacing $1, $2, placeholders\n for (var j=1; j<matches.length; j++) {\n newArr[i] = newArr[i].replace(\"$\"+j, matches[j], \"gi\");\n }\n// Logger.log(newArr[i]);\n } else newArr[i] = undefined;\n }\n return newArr;\n }\n}", "function replaceAll(strText, mixFinder, strReplacer)\n{\n if (isArray(mixFinder)) {\n for (var intCount = 0; intCount < mixFinder.length; ++intCount)\n strText = replaceRegex(strText, mixFinder[intCount], strReplacer);\n } else\n strText = replaceRegex(strText, mixFinder, strReplacer);\n return strText;\n}", "replaceWith({entry, oldValue, newValue}) {\n\t\tconst regexOldValue = new RegExp(oldValue, 'gm');\n\n\t\tconst match = entry.match(this.standardRegex());\n\t\tif (match) {\n\t\t\tfor (const item of match) {\n\t\t\t\tlet newItem = '';\n\t\t\t\t// Only replace the first element of a dict\n\t\t\t\tif (item.includes('.')) {\n\t\t\t\t\tconst parts = item.split('.');\n\t\t\t\t\tparts[0] = parts[0].replace(regexOldValue, newValue);\n\t\t\t\t\tnewItem = parts.join('.');\n\t\t\t\t} else {\n\t\t\t\t\tnewItem = item.replace(regexOldValue, newValue);\n\t\t\t\t}\n\t\t\t\tentry = entry.replace(item, newItem);\n\t\t\t}\n\t\t}\n\t\tentry = this.replaceIdsAndRemoveInterpolationSymbol({\n\t\t\tentry: entry,\n\t\t\tregexOldValue: regexOldValue,\n\t\t\tnewValue: newValue\n\t\t});\n\t\treturn entry;\n\t}", "function replaceAllFactory(match, replaceWithText) {\n const r = RegExp(regexQuote(match), 'g');\n return (text) => text.replace(r, replaceWithText);\n}", "function snippet_substitute(template,t,x) {\n if (typeof(template) != 'string') {\n var i;\n for (i=template.length-1; i > 0; --i) {\n var r = new RegExp(template[i].r);\n if (r.test(x)) {\n template = template[i].t;\n break;\n }\n }\n if (i == 0) {\n template = template[0];\n }\n }\n var res = template.replace(\"[[T]]\",'[['+t+']]').replace(\"[[X]]\",'[['+x+']]');\n if (!res.match(/[\\.\\?!]$/)) { res += '.'; }\n return res;\n}", "function interpolate ( template, obj ) {\n return template.replace(/{([^{}]*)}/g,\n function (match, key) {\n var value = obj[key];\n if ( typeof value === 'string' || typeof r === 'number' ) {\n return value;\n }\n else {\n return \"\";\n }\n }\n );\n }", "interpolate(str = '', data = {}, globals = {}) {\n // Merge global values into the data object, prefixing each key with 'global.'\n Object.entries(globals).forEach(\n ([key, value]) => {\n data[`global.${key}`] = value;\n }\n );\n\n // Interpolate the values into the string provided by their keys\n Object.entries(data).forEach(\n ([key, value]) => {\n (typeof value === 'string')\n &&\n (str = str.replace(`{${key}}`, value));\n }\n );\n\n return str;\n }", "function __replace($str, $m) {\r\n return $str.replace(/\\$([^\\$]*)\\$/g, function(){return $m[arguments[1]];});\r\n}", "function replaceFirst(x, y, z){\n return x.toString().replace(y, z);\n }", "function replaceVariables( value ) {\n\n return value.replace( options.variableRegex, function( match, key ) {\n\n if ( options.variables[ key ] === undefined ) {\n grunt.log.warn( \"No variable definition found for: \" + key );\n return \"\";\n }\n\n return options.variables[ key ];\n } );\n\n }", "function adorn(str, regex, f) {\r\n\r\n\r\n return str.replace(regex, function repl(match) {\r\n var fr = f(match);\r\n return fr.before + match + fr.after;\r\n });\r\n\r\n\r\n\r\n}", "function format() {\n // The string containing the format items (e.g. \"{0}\")\n // will and always has to be the first argument.\n var string = arguments[0];\n // Start with the second argument (i = 1)\n for (var i = 1; i < arguments.length; i++) {\n // \"gm\" = RegEx options for Global search (more than one instance)\n // and for Multiline search.\n var regEx = new RegExp(\"\\\\{\" + (i - 1) + \"\\\\}\", \"gm\");\n string = string.replace(regEx, arguments[i]);\n }\n\n return string;\n }", "function jstrprintf() {\r\n\t\t//get length of arguments in function\r\n\t\tlen = arguments.length;\r\n\t\tif (len == 0) { return; } //return if len of arguments == zero\r\n\t\tif (len == 1) { return arguments[0]; } //return a zero dimension array if argumrnts are equal to one\r\n\t\t\r\n\t\t//declare some variables\r\n\t\tvar result;\r\n\t\tvar regexstr;\r\n\t\tvar replstr;\r\n\t\tvar formatstr;\r\n\t\tvar re;\r\n\t\t\r\n\t\t//Declare variables\r\n\t\tresult = \"\";\r\n\t\tregexstr = \"\";\r\n\t\treplstr = \"\";\r\n\t\tformatstr = arguments[0];\r\n\t\t\r\n\t\tfor (var i=1; i<arguments.length; i++) {\r\n\t\t\treplstr += String(i+100) + arguments[i] + String(i + 100);\r\n\t\t\tregexstr += String(i+100) + \"(.*)\" + String(i+100);\r\n\t\t}\r\n\t\tre = new RegExp(regexstr);\r\n\t\tvar result;\r\n\t\tresult = replstr.replace(re, formatstr);\r\n\t\t//console.log(result);\r\n\t\treturn result;\r\n\t}", "function i18nInterpolation4(instructions, v0, v1, v2, v3) {\n var viewData = _getViewData();\n var different = bindingUpdated4(viewData[BINDING_INDEX], v0, v1, v2, v3);\n viewData[BINDING_INDEX] += 4;\n if (!different) {\n return NO_CHANGE;\n }\n var res = '';\n for (var i = 0; i < instructions.length; i++) {\n // Odd indexes are bindings\n if (i & 1) {\n // Extract bits\n var idx = instructions[i];\n var b2 = idx & 2;\n var b1 = idx & 1;\n // Get the value from the argument vx where x = idx\n var value = b2 ? (b1 ? v3 : v2) : (b1 ? v1 : v0);\n res += stringify$1(value);\n }\n else {\n res += instructions[i];\n }\n }\n return res;\n}", "function replaceAll(value, searchValue, replaceValue) {\n return !value || !searchValue ? value : value.split(searchValue).join(replaceValue || \"\");\n}", "function replaceAll(value, searchValue, replaceValue) {\n return !value || !searchValue ? value : value.split(searchValue).join(replaceValue || \"\");\n}", "function interpolate(str, data) {\n\treturn str.replace(/\\$<([^>]+)>/gm, (s, key) => data[key])\n}", "function StringFormat()\r\n {\r\n var args = Array.prototype.slice.call(arguments, 0),\r\n string = args.shift();\r\n\r\n for(var i=0; i<args.length; i++)\r\n {\r\n string = string.replace( new RegExp('\\\\{'+i+'\\\\}','g'), args[i]);\r\n }\r\n\r\n return string;\r\n }", "function _interpolate(exp){ return ('{0} {1} {2}').sprintf($interpolate.startSymbol(), exp, $interpolate.endSymbol()); }", "replace(text, replacement) {\n const m = this.matches(text);\n\n // if no matches, then nothing to replace\n if (m.length == 0)\n return text;\n\n const subs = [];\n let lastEnd = 0;\n\n for (let i = 0; i < m.length; i++) {\n // get substring from last match's ending up to this match's start\n subs.push(text.substring(lastEnd, m[i].begin));\n\n lastEnd = m[i].end;\n\n if (i == m.length - 1) {\n // handle last substring\n subs.push(text.substring(m[i].end));\n }\n }\n\n return subs.join(replacement);\n }", "function format(subject) {\n 'use strict';\n\n var replaces = Array.prototype.slice.apply(arguments, [1, arguments.length]),\n parts = null,\n output,\n i;\n\n if (subject.match(/%s/g) === null && replaces.length > 0 || replaces.length !== subject.match(/%s/g).length) {\n throw 'Format error: The string count to replace do not matches the argument count. Subject: ' + subject + '. Replaces: ' + replaces;\n }\n\n output = subject;\n for (i = 1; i < arguments.length; i += 1) {\n parts = output.split('%s');\n output = parts[0] + arguments[i] + parts.slice(1, parts.length).join('%s');\n }\n\n return output;\n}", "function replace4(haystack, needle, replacement){\n const exp = new RegExp(`\\\\b${ needle }\\\\b`, 'g');\n\n return haystack.replace(exp, replacement);\n}", "replaceAll( _val, _newVal){\r\n \r\n this.HTMLElement.value = this.HTMLElement.value.split(_val).join(_newVal);\r\n\r\n}", "function value(strings, ...placeholders) {\n\treturn values =>\n\t\tplaceholders.length\n\t\t\t? interpolate(\n\t\t\t\t\tstrings,\n\t\t\t\t\tplaceholders.map(i => values[i])\n\t\t\t )\n\t\t\t: strings.join('');\n}", "formatString(string, replacements) {\n return string.replace(/:(\\w+)/g, (match, word) => {\n if (this[word]) {\n return '<span class=\"f-string-em\">' + this[word] + '</span>'\n } else if (replacements && replacements[word]) {\n return replacements[word]\n }\n \n return match\n })\n }", "function strictReplace(str, pairs) {\n var index, fromIndex = 0;\n\n pairs.some(function (pair) {\n var toReplace = pair[0], replaceWith = pair[1];\n\n index = str.indexOf(toReplace, fromIndex);\n if (index === -1) {\n return true;\n }\n\n str = str.substr(0, index) + replaceWith +\n str.substr(index + toReplace.length);\n\n fromIndex = index + replaceWith.length;\n });\n\n return str;\n}", "function replacer(match) {\n let len = match.length;\n\n // This is completely arbitrary but just demonstrating\n // you can make up your own logic\n if (len == 3) {\n // Make the word upper case\n return match.toUpperCase();\n } else if (len == 4) {\n // Pick a random word from the array\n let index = floor(random(0, four.length));\n return four[index];\n } else if (len == 5) {\n // Pick a random word from the array\n let index = floor(random(0, five.length));\n return five[index];\n }\n\n }", "function buildHTML(template /* Optional parameters to replace */) {\n\t\t// First argument is template string and next are replace values\n\t\tvar howManyToReplace = arguments.length - 1;\n\t\tvar str = template;\n\t\tfor (var i = 1; i <= howManyToReplace; i++) {\n\t\t\tstr = str.replace(\"{!\" + i + \"}\", arguments[i]);\n\t\t}\n\t\treturn str;\n\t}" ]
[ "0.6653262", "0.66018146", "0.6524723", "0.6517827", "0.6517827", "0.65100974", "0.64718235", "0.64557344", "0.6391604", "0.63568276", "0.63568276", "0.63335526", "0.6329891", "0.63048214", "0.63048214", "0.6227043", "0.62213075", "0.6167596", "0.6167596", "0.6167596", "0.6167596", "0.6167596", "0.6167596", "0.6167596", "0.6167596", "0.6167596", "0.6167596", "0.6167596", "0.6167596", "0.6167596", "0.6167596", "0.6167596", "0.6167596", "0.6167596", "0.6167596", "0.6167596", "0.6166007", "0.6149977", "0.6138499", "0.6133076", "0.6133076", "0.6092957", "0.60824615", "0.60729104", "0.6040941", "0.603607", "0.59945345", "0.59913665", "0.59836656", "0.59836656", "0.59733474", "0.5935308", "0.5934493", "0.5895786", "0.5895786", "0.58863705", "0.5878778", "0.5855299", "0.5832285", "0.58178306", "0.57989985", "0.5778978", "0.5770874", "0.5755604", "0.57261145", "0.5713335", "0.56885934", "0.56776595", "0.5667726", "0.5663269", "0.5651133", "0.5640155", "0.5634333", "0.5620291", "0.56074923", "0.5607185", "0.5587416", "0.55839735", "0.55808014", "0.55700076", "0.55422175", "0.5539913", "0.55370677", "0.55361336", "0.5531741", "0.55053747", "0.55031514", "0.55031514", "0.5482669", "0.5474151", "0.546822", "0.54657817", "0.54627126", "0.5458813", "0.54574883", "0.544591", "0.5442123", "0.5438143", "0.5436638", "0.54310304" ]
0.6159512
37
TODO: Optimize groups of rules with nonempty prefix into some sort of decision tree
function update(evt) { if (evt && evt.defaultPrevented) return; var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl; lastPushedUrl = undefined; // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573 //if (ignoreUpdate) return true; function check(rule) { var handled = rule($injector, $location); if (!handled) return false; if (isString(handled)) $location.replace().url(handled); return true; } var n = rules.length, i; for (i = 0; i < n; i++) { if (check(rules[i])) return; } // always check otherwise last to allow dynamic updates to the set of rules if (otherwise) check(otherwise); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processRule ( rule , returnObj ) {\n // some additional properties\n //var selector_arr = rule.selector.split( \" \" );\n rule.name = getSelectorName( rule.selector );//selector_arr.pop();\n // give a shorter unique id to it\n //var cssString = ruleToCSSString( rule );\n // \"-\" causes Router to get confused\n // only want something unique, so replacing with an \"n\"\n rule.uuid = getRuleUUID( rule );\n rule.children = [];\n rule.total_child_rules = 0;// just simple rules, not everything\n rule.total_child_comps = 0;\n rule.is_duplicate = false;\n\n // find depth\n rule.depth = Math.min( 6 , rule.selector.split(\" \").length-1 );\n if ( !returnObj.totals.depths[ rule.depth ] )\n returnObj.totals.depths[ rule.depth ] = 0;\n returnObj.totals.depths[ rule.depth ]++;\n if ( !returnObj.depths_all[ rule.depth ] )\n returnObj.depths_all[ rule.depth ] = [];\n returnObj.depths_all[ rule.depth ].push( rule.uuid );\n\n rule.metadata = {};\n rule.states = [];\n rule.pseudos = [];\n\n if ( rule.type == \"rule\" ) {\n returnObj.totals.rules++;\n returnObj.rules.push( rule );\n if ( !returnObj.totals.depths_rules[ rule.depth ] )\n returnObj.totals.depths_rules[ rule.depth ] = 0;\n returnObj.totals.depths_rules[ rule.depth ]++;\n }else if ( rule.type == \"tagged_rule\" ){\n processComponent( rule , returnObj );\n }\n\n returnObj.totals.overall++;\n\n // selector hash\n if ( !returnObj.selector_hash[rule.selector] ) {\n returnObj.selector_hash[rule.selector] = rule;\n }else{\n console.log(\"ERROR, selector not unique!\" , rule.selector );\n }\n\n returnObj.uuid_hash[ rule.uuid ] = rule;\n\n //finish up...\n returnObj.selector_hash[rule.name] = rule;\n returnObj.selectors.push( rule );\n}", "function splitRules()\n{\n\twhile(1)\n\t{\n\t\ttemprules=[];\n\t\tfor(var i=0;i<rules.length;i++)\n\t\t{\n\t\t\tvar cond; var effs; var elseEffs;var ruletosplit;\n\t\t\tif(\"effects\" in rules[i]==false){continue;}\n\t\t\tfor(var j=0;j<rules[i].effects.length;j++)\n\t\t\t{\n\t\t\t\tif(\"condition\" in rules[i].effects[j])\n\t\t\t\t{\n\t\t\t\t\tcond=rules[i].effects[j].condition;effs=rules[i].effects[j].effects;elseEffs=rules[i].effects[j].elseEffects;\n\t\t\t\t\tvar temp=rules[i].effects.splice(j+1);rules[i].effects.pop();\n\t\t\t\t\trules[i].effects=rules[i].effects.concat(temp);//take out this effect object\n\t\t\t\t\truletosplit=rules[i];//remember the rule\n\t\t\t\t\trules[i]=null;//remove the rule for this iteration\n\t\t\t\t\tvar splitted=splitARule(ruletosplit,cond,effs,elseEffs);\n\t\t\t\t\t//must alter all leads to arrays containing this rule so it doesn't break\n\t\t\t\t\tfor(var k in rules)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(rules[k])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(\"leadsTo\" in rules[k])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar tempindex=rules[k].leadsTo.indexOf(ruletosplit.name);\n\t\t\t\t\t\t\t\tif(tempindex>=0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar templeadsto=rules[k].leadsTo.splice(tempindex+1);rules[k].leadsTo.pop();\n\t\t\t\t\t\t\t\t\trules[k].leadsTo=rules[k].leadsTo.concat(templeadsto);\n\t\t\t\t\t\t\t\t\tfor(var l=0;l<splitted.length;l++)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\trules[k].leadsTo.push(splitted[l].name);\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\tfor(var k in temprules)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(temprules[k])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(\"leadsTo\" in temprules[k])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar tempindex=temprules[k].leadsTo.indexOf(ruletosplit.name);\n\t\t\t\t\t\t\t\tif(tempindex>=0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar templeadsto=temprules[k].leadsTo.splice(tempindex+1);temprules[k].leadsTo.pop();\n\t\t\t\t\t\t\t\t\ttemprules[k].leadsTo=temprules[k].leadsTo.concat(templeadsto);\n\t\t\t\t\t\t\t\t\tfor(var l=0;l<splitted.length;l++)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttemprules[k].leadsTo.push(splitted[l].name);\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}//no rule leads to itself so updating other rules should be fine\n\t\t\t\t\ttemprules=temprules.concat(splitted);//save split rules for next iteration\n\t\t\t\t\tbreak;//only split for one conditional per iteration\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tvar oldrules=rules.filter(function(a){if(a==null)return false;return true;});\n\t\trules=oldrules.concat(temprules);\n\t\tif(temprules.length==0){break;}//finally done\n\t}\n}", "static packMatchRules(prefix, model, match) {\n const rulesList = [];\n let rulesCounter = 0;\n for (const expression of match instanceof Array ? match : [match]) {\n const operationsList = [];\n let operationsCounter = 0;\n for (const path in expression) {\n const columns = Mapping.Helper.tryPathColumns(model, path);\n if (!columns) {\n throw new Error(`Invalid matching path '${path}' for the given model.`);\n }\n else {\n operationsCounter++;\n const operation = expression[path];\n const schema = columns[columns.length - 1];\n if (Mapping.Filters.Helper.isOperation(operation)) {\n this.packOperation(operationsList, schema, path, operation.operator, operation.value);\n }\n else {\n const entry = Object.entries(operation)[0];\n this.packOperation(operationsList, schema, path, entry[0], entry[1]);\n }\n }\n }\n if (operationsCounter > 0) {\n rulesList.push(operationsCounter, ...operationsList);\n rulesCounter++;\n }\n }\n return [prefix, rulesCounter, ...rulesList];\n }", "function prepareRules(rules, macros, actions, tokens, startConditions, caseless, caseHelper) {\n var m, i, k, action, conditions,\n active_conditions,\n newRules = [];\n\n if (macros) {\n macros = prepareMacros(macros);\n }\n\n function tokenNumberReplacement (str, token) {\n return 'return ' + (tokens[token] || \"'\" + token + \"'\");\n }\n\n actions.push('switch($avoiding_name_collisions) {');\n\n for (i = 0; i < rules.length; i++) {\n active_conditions = [];\n if (Object.prototype.toString.apply(rules[i][0]) !== '[object Array]') {\n // implicit add to all inclusive start conditions\n for (k in startConditions) {\n if (startConditions[k].inclusive) {\n active_conditions.push(k);\n startConditions[k].rules.push(i);\n }\n }\n } else if (rules[i][0][0] === '*') {\n // Add to ALL start conditions\n active_conditions.push('*');\n for (k in startConditions) {\n startConditions[k].rules.push(i);\n }\n rules[i].shift();\n } else {\n // Add to explicit start conditions\n conditions = rules[i].shift();\n for (k = 0; k < conditions.length; k++) {\n if (!startConditions.hasOwnProperty(conditions[k])) {\n startConditions[conditions[k]] = {\n rules: [], inclusive: false\n };\n console.warn('Lexer Warning : \"' + conditions[k] + '\" start condition should be defined as %s or %x; assuming %x now.');\n }\n active_conditions.push(conditions[k]);\n startConditions[conditions[k]].rules.push(i);\n }\n }\n\n m = rules[i][0];\n if (typeof m === 'string') {\n for (k in macros) {\n if (macros.hasOwnProperty(k)) {\n m = m.split('{' + k + '}').join('(' + macros[k] + ')');\n }\n }\n m = new RegExp('^(?:' + m + ')', caseless ? 'i' : '');\n }\n newRules.push(m);\n if (typeof rules[i][1] === 'function') {\n rules[i][1] = String(rules[i][1]).replace(/^\\s*function \\(\\)\\s?\\{/, '').replace(/\\}\\s*$/, '');\n }\n action = rules[i][1];\n if (tokens && action.match(/return '[^']+'/)) {\n action = action.replace(/return '([^']+)'/g, tokenNumberReplacement);\n }\n \n var code = ['\\n/*! Conditions::'];\n code = code.concat(active_conditions);\n code = code.concat('*/', '\\n/*! Rule:: ');\n code = code.concat(rules[i][0]);\n code = code.concat('*/', '\\n');\n \n var match_nr = /^return\\s+('[^\\']+'|\\d+)\\s*;?$/.exec(action.trim());\n if (match_nr) {\n caseHelper.push([].concat(code, i, ':', match_nr[1]).join(' ').replace(/[\\n]/g, '\\n '));\n } else {\n actions.push([].concat('case', i, ':', code, action, '\\nbreak;').join(' '));\n }\n }\n actions.push('default:');\n actions.push(' return this.simpleCaseActionClusters[$avoiding_name_collisions];');\n actions.push('}');\n\n return newRules;\n}", "function prepareRules(rules, macros, actions, tokens, startConditions, caseless, caseHelper) {\n var m, i, k, action, conditions,\n active_conditions,\n newRules = [];\n\n if (macros) {\n macros = prepareMacros(macros);\n }\n\n function tokenNumberReplacement (str, token) {\n return 'return ' + (tokens[token] || \"'\" + token + \"'\");\n }\n\n actions.push('switch($avoiding_name_collisions) {');\n\n for (i = 0; i < rules.length; i++) {\n active_conditions = [];\n if (Object.prototype.toString.apply(rules[i][0]) !== '[object Array]') {\n // implicit add to all inclusive start conditions\n for (k in startConditions) {\n if (startConditions[k].inclusive) {\n active_conditions.push(k);\n startConditions[k].rules.push(i);\n }\n }\n } else if (rules[i][0][0] === '*') {\n // Add to ALL start conditions\n active_conditions.push('*');\n for (k in startConditions) {\n startConditions[k].rules.push(i);\n }\n rules[i].shift();\n } else {\n // Add to explicit start conditions\n conditions = rules[i].shift();\n for (k = 0; k < conditions.length; k++) {\n if (!startConditions.hasOwnProperty(conditions[k])) {\n startConditions[conditions[k]] = {\n rules: [], inclusive: false\n };\n console.warn('Lexer Warning : \"' + conditions[k] + '\" start condition should be defined as %s or %x; assuming %x now.');\n }\n active_conditions.push(conditions[k]);\n startConditions[conditions[k]].rules.push(i);\n }\n }\n\n m = rules[i][0];\n if (typeof m === 'string') {\n for (k in macros) {\n if (macros.hasOwnProperty(k)) {\n m = m.split('{' + k + '}').join('(' + macros[k] + ')');\n }\n }\n m = new RegExp('^(?:' + m + ')', caseless ? 'i' : '');\n }\n newRules.push(m);\n if (typeof rules[i][1] === 'function') {\n rules[i][1] = String(rules[i][1]).replace(/^\\s*function \\(\\)\\s?\\{/, '').replace(/\\}\\s*$/, '');\n }\n action = rules[i][1];\n if (tokens && action.match(/return '[^']+'/)) {\n action = action.replace(/return '([^']+)'/g, tokenNumberReplacement);\n }\n \n var code = ['\\n/*! Conditions::'];\n code = code.concat(active_conditions);\n code = code.concat('*/', '\\n/*! Rule:: ');\n code = code.concat(rules[i][0]);\n code = code.concat('*/', '\\n');\n \n var match_nr = /^return\\s+('[^\\']+'|\\d+)\\s*;?$/.exec(action.trim());\n if (match_nr) {\n caseHelper.push([].concat(code, i, ':', match_nr[1]).join(' ').replace(/[\\n]/g, '\\n '));\n } else {\n actions.push([].concat('case', i, ':', code, action, '\\nbreak;').join(' '));\n }\n }\n actions.push('default:');\n actions.push(' return this.simpleCaseActionClusters[$avoiding_name_collisions];');\n actions.push('}');\n\n return newRules;\n}", "function prepareRules(rules, macros, actions, tokens, startConditions, caseless) {\n var m,\n i,\n k,\n action,\n conditions,\n newRules = [];\n\n if (macros) {\n macros = prepareMacros(macros);\n }\n\n function tokenNumberReplacement(str, token) {\n return \"return \" + (tokens[token] || \"'\" + token + \"'\");\n }\n\n actions.push('switch($avoiding_name_collisions) {');\n\n for (i = 0; i < rules.length; i++) {\n if (Object.prototype.toString.apply(rules[i][0]) !== '[object Array]') {\n // implicit add to all inclusive start conditions\n for (k in startConditions) {\n if (startConditions[k].inclusive) {\n startConditions[k].rules.push(i);\n }\n }\n } else if (rules[i][0][0] === '*') {\n // Add to ALL start conditions\n for (k in startConditions) {\n startConditions[k].rules.push(i);\n }\n\n rules[i].shift();\n } else {\n // Add to explicit start conditions\n conditions = rules[i].shift();\n\n for (k = 0; k < conditions.length; k++) {\n startConditions[conditions[k]].rules.push(i);\n }\n }\n\n m = rules[i][0];\n\n if (typeof m === 'string') {\n for (k in macros) {\n if (macros.hasOwnProperty(k)) {\n m = m.split(\"{\" + k + \"}\").join('(' + macros[k] + ')');\n }\n }\n\n m = new RegExp(\"^(?:\" + m + \")\", caseless ? 'i' : '');\n }\n\n newRules.push(m);\n\n if (typeof rules[i][1] === 'function') {\n rules[i][1] = String(rules[i][1]).replace(/^\\s*function \\(\\)\\s?\\{/, '').replace(/\\}\\s*$/, '');\n }\n\n action = rules[i][1];\n\n if (tokens && action.match(/return '[^']+'/)) {\n action = action.replace(/return '([^']+)'/g, tokenNumberReplacement);\n }\n\n actions.push('case ' + i + ':' + action + '\\nbreak;');\n }\n\n actions.push(\"}\");\n return newRules;\n} // expand macros within macros", "function newer_postprocessor(\n parse_tree,\n with_morphology,\n with_spaces,\n with_terminators,\n with_trimming,\n with_selmaho,\n with_nodes_labels,\n without_leaf_prefix,\n with_glossing\n) {\n if (!is_array(parse_tree)) return null;\n /* Building a map of node names to node value replacements */\n if (with_spaces)\n var value_substitution_map = {\"spaces\": \"_\", \"initial_spaces\": \"_\"};\n else var value_substitution_map = {};\n /* Building a map of node names to name replacements */\n var name_substitution_map = {\n \"cmene\": \"C\", \"cmevla\": \"C\", \"gismu\": \"G\", \"lujvo\": \"L\",\n \"fuhivla\": \"Z\", \"prenex\": \"PRENEX\", \"sentence\": \"BRIDI\",\n \"selbri\": \"SELBRI\", \"sumti\": \"SUMTI\"\n };\n if (!with_trimming) name_substitution_map = {};\n var special_selmaho = [\"cmevla\", \"gismu\", \"lujvo\", \"fuhivla\", \"ga_clause\",\n \"gu_clause\"];\n /** Building a node_action_for() function from the selected options **/\n if (with_morphology)\n var is_flattening_target = function (tree) { return false; };\n else var is_flattening_target = function (tree) {\n var targets = special_selmaho;\n return (among(tree[0], targets) || is_selmaho(tree[0]));\n };\n var is_branch_removal_target = function (tree) {\n if (!with_spaces && among(tree[0], [\"spaces\", \"initial_spaces\"]))\n return true;\n return (!with_terminators && is_selmaho(tree[0]) && tree.length == 1);\n };\n var whitelist = [];\n if (with_selmaho)\n whitelist = whitelist.concat(special_selmaho);\n if (with_nodes_labels)\n whitelist = whitelist.concat([\"prenex\", \"sentence\", \"selbri\", \"sumti\"]);\n var is_node_trimming_target = function (tree) {\n if (!with_trimming) return false;\n if (with_terminators && is_selmaho(tree[0]) && tree.length == 1)\n return false;\n if (with_selmaho && is_selmaho(tree[0])) return false;\n return !among(tree[0], whitelist);\n };\n var node_action_for = function (node) {\n if (is_branch_removal_target(node)) return 'DEL';\n var ft = is_flattening_target(node);\n var tt = is_node_trimming_target(node);\n if (ft && tt) return \"TRIMFLAT\";\n if (ft) return 'FLAT';\n if (tt) return 'TRIM';\n if (with_trimming && node.length == 1) return 'UNBOX';\n return 'PASS';\n };\n /* Calling process_parse_tree() with the arguments we've built for it */\n return process_parse_tree(\n parse_tree, value_substitution_map, name_substitution_map,\n node_action_for,\n (with_nodes_labels || with_selmaho) && !without_leaf_prefix,\n with_glossing\n );\n}", "function jsontreetrim(word){\n\tletterarray = word.split(\"\");\n\tnumletters = letterarray.length;\n\tevalexpression = 'prioritydic';\n\tfor(y = 0; y < numletters; y++){\n\t\tevalexpression = evalexpression + '.' + letterarray[y];\n\t}\n\tendobject = eval(evalexpression)\n\tbranchobject = eval(evalexpression)\n\ttrimword = word\n\tnumlevels = 0\n\tfor(y = 1; y < numletters; y++){\n\t\tcheckexpression = evalexpression.substring(0,evalexpression.length-2*y);\n\t\tcheckobject = eval(checkexpression)\n\t\tcheckkeys = Object.keys(checkobject)\n\t\ttrimword = trimword.substring(0,word.length-(y-1))\n\t\tif(checkkeys.length == 1){\n\t\t\tbranchobject = checkobject\n\t\t\tnumlevels += 1\n\t\t}\n\t\telse{\n\t\t\tif(numlevels > 1){\n\t\t\t\tendobject.ss = word\n\t\t\t\tbuildtrimtree(trimword, endobject)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\t\n\t\n\t//return count\n}", "function buildRules(rules) {\n return (() => {\n const result = [];\n for (const tuple of Array.from(rules)) {\n if (tuple.length < 3) {\n tuple.unshift(null);\n }\n result.push(buildRule(...Array.from(tuple || [])));\n }\n return result;\n })();\n}", "function normalizeRules(rules) {\n // if falsy value return an empty object.\n var acc = {};\n Object.defineProperty(acc, '_$$isNormalized', {\n value: true,\n writable: false,\n enumerable: false,\n configurable: false\n });\n if (!rules) {\n return acc;\n }\n // Object is already normalized, skip.\n if (isObject(rules) && rules._$$isNormalized) {\n return rules;\n }\n if (isObject(rules)) {\n return Object.keys(rules).reduce(function (prev, curr) {\n var params = [];\n if (rules[curr] === true) {\n params = [];\n }\n else if (Array.isArray(rules[curr])) {\n params = rules[curr];\n }\n else if (isObject(rules[curr])) {\n params = rules[curr];\n }\n else {\n params = [rules[curr]];\n }\n if (rules[curr] !== false) {\n prev[curr] = buildParams(curr, params);\n }\n return prev;\n }, acc);\n }\n /* istanbul ignore if */\n if (typeof rules !== 'string') {\n warn('rules must be either a string or an object.');\n return acc;\n }\n return rules.split('|').reduce(function (prev, rule) {\n var parsedRule = parseRule(rule);\n if (!parsedRule.name) {\n return prev;\n }\n prev[parsedRule.name] = buildParams(parsedRule.name, parsedRule.params);\n return prev;\n }, acc);\n}", "function normalizeRules(rules) {\n // if falsy value return an empty object.\n var acc = {};\n Object.defineProperty(acc, '_$$isNormalized', {\n value: true,\n writable: false,\n enumerable: false,\n configurable: false\n });\n if (!rules) {\n return acc;\n }\n // Object is already normalized, skip.\n if (isObject(rules) && rules._$$isNormalized) {\n return rules;\n }\n if (isObject(rules)) {\n return Object.keys(rules).reduce(function (prev, curr) {\n var params = [];\n if (rules[curr] === true) {\n params = [];\n }\n else if (Array.isArray(rules[curr])) {\n params = rules[curr];\n }\n else if (isObject(rules[curr])) {\n params = rules[curr];\n }\n else {\n params = [rules[curr]];\n }\n if (rules[curr] !== false) {\n prev[curr] = buildParams(curr, params);\n }\n return prev;\n }, acc);\n }\n /* istanbul ignore if */\n if (typeof rules !== 'string') {\n warn('rules must be either a string or an object.');\n return acc;\n }\n return rules.split('|').reduce(function (prev, rule) {\n var parsedRule = parseRule(rule);\n if (!parsedRule.name) {\n return prev;\n }\n prev[parsedRule.name] = buildParams(parsedRule.name, parsedRule.params);\n return prev;\n }, acc);\n}", "function normalizeRules(rules) {\n // if falsy value return an empty object.\n var acc = {};\n Object.defineProperty(acc, '_$$isNormalized', {\n value: true,\n writable: false,\n enumerable: false,\n configurable: false\n });\n if (!rules) {\n return acc;\n }\n // Object is already normalized, skip.\n if (isObject(rules) && rules._$$isNormalized) {\n return rules;\n }\n if (isObject(rules)) {\n return Object.keys(rules).reduce(function (prev, curr) {\n var params = [];\n if (rules[curr] === true) {\n params = [];\n }\n else if (Array.isArray(rules[curr])) {\n params = rules[curr];\n }\n else if (isObject(rules[curr])) {\n params = rules[curr];\n }\n else {\n params = [rules[curr]];\n }\n if (rules[curr] !== false) {\n prev[curr] = buildParams(curr, params);\n }\n return prev;\n }, acc);\n }\n /* istanbul ignore if */\n if (typeof rules !== 'string') {\n warn('rules must be either a string or an object.');\n return acc;\n }\n return rules.split('|').reduce(function (prev, rule) {\n var parsedRule = parseRule(rule);\n if (!parsedRule.name) {\n return prev;\n }\n prev[parsedRule.name] = buildParams(parsedRule.name, parsedRule.params);\n return prev;\n }, acc);\n }", "add(rule, prefix) {\n let prefixed = prefix + rule.name\n\n let already = rule.parent.some(\n i => i.name === prefixed && i.params === rule.params\n )\n if (already) {\n return undefined\n }\n\n let cloned = this.clone(rule, { name: prefixed })\n return rule.parent.insertBefore(rule, cloned)\n }", "static unpackMatchRules(prefix, model, array) {\n if (prefix !== array.pop()) {\n throw new Error(`Invalid magic prefix for the given array of matching lists.`);\n }\n else {\n const rulesList = [];\n for (let rulesCounter = parseInt(array.pop()); rulesCounter > 0; --rulesCounter) {\n const operationsMap = {};\n for (let operationsCounter = parseInt(array.pop()); operationsCounter > 0; --operationsCounter) {\n const path = array.pop();\n const columns = Mapping.Helper.tryPathColumns(model, path);\n if (!columns) {\n throw new Error(`Invalid matching path '${path}' for the given model.`);\n }\n else {\n const operator = array.pop();\n const schema = columns[columns.length - 1];\n this.unpackOperation(operationsMap, schema, path, operator, array);\n }\n }\n rulesList.push(operationsMap);\n }\n if (rulesList.length > 0) {\n return rulesList.length === 1 ? rulesList[0] : rulesList;\n }\n return void 0;\n }\n }", "function prepareRules(dict, actions, caseHelper, tokens, startConditions, opts) {\n var m, i, k, action, conditions,\n active_conditions,\n rules = dict.rules,\n newRules = [],\n macros = {};\n\n // Assure all options are camelCased:\n assert(typeof opts.options['case-insensitive'] === 'undefined');\n\n // Depending on the location within the regex we need different expansions of the macros:\n // one expansion for when a macro is *inside* a `[...]` and another expansion when a macro\n // is anywhere else in a regex:\n if (dict.macros) {\n macros = prepareMacros(dict.macros, opts);\n }\n\n function tokenNumberReplacement(str, token) {\n return 'return ' + (tokens[token] || '\\'' + token.replace(/'/g, '\\\\\\'') + '\\'');\n }\n\n // Make sure a comment does not contain any embedded '*/' end-of-comment marker\n // as that would break the generated code\n function postprocessComment(str) {\n if (Array.isArray(str)) {\n str = str.join(' ');\n }\n str = str.replace(/\\*\\//g, '*\\\\/'); // destroy any inner `*/` comment terminator sequence.\n return str;\n }\n\n actions.push('switch($avoiding_name_collisions) {');\n\n for (i = 0; i < rules.length; i++) {\n active_conditions = [];\n if (Object.prototype.toString.apply(rules[i][0]) !== '[object Array]') {\n // implicit add to all inclusive start conditions\n for (k in startConditions) {\n if (startConditions[k].inclusive) {\n active_conditions.push(k);\n startConditions[k].rules.push(i);\n }\n }\n } else if (rules[i][0][0] === '*') {\n // Add to ALL start conditions\n active_conditions.push('*');\n for (k in startConditions) {\n startConditions[k].rules.push(i);\n }\n rules[i].shift();\n } else {\n // Add to explicit start conditions\n conditions = rules[i].shift();\n for (k = 0; k < conditions.length; k++) {\n if (!startConditions.hasOwnProperty(conditions[k])) {\n startConditions[conditions[k]] = {\n rules: [],\n inclusive: false\n };\n console.warn('Lexer Warning : \"' + conditions[k] + '\" start condition should be defined as %s or %x; assuming %x now.');\n }\n active_conditions.push(conditions[k]);\n startConditions[conditions[k]].rules.push(i);\n }\n }\n\n m = rules[i][0];\n if (typeof m === 'string') {\n m = expandMacros(m, macros, opts);\n m = new XRegExp('^(?:' + m + ')', opts.options.caseInsensitive ? 'i' : '');\n }\n newRules.push(m);\n if (typeof rules[i][1] === 'function') {\n rules[i][1] = String(rules[i][1]).replace(/^\\s*function \\(\\)\\s?\\{/, '').replace(/\\}\\s*$/, '');\n }\n action = rules[i][1];\n if (tokens && action.match(/return '(?:\\\\'|[^']+)+'/)) {\n action = action.replace(/return '((?:\\\\'|[^']+)+)'/g, tokenNumberReplacement);\n }\n if (tokens && action.match(/return \"(?:\\\\\"|[^\"]+)+\"/)) {\n action = action.replace(/return \"((?:\\\\\"|[^\"]+)+)\"/g, tokenNumberReplacement);\n }\n\n var code = ['\\n/*! Conditions::'];\n code.push(postprocessComment(active_conditions));\n code.push('*/', '\\n/*! Rule:: ');\n code.push(postprocessComment(rules[i][0]));\n code.push('*/', '\\n');\n\n // When the action is *only* a simple `return TOKEN` statement, then add it to the caseHelpers;\n // otherwise add the additional `break;` at the end.\n //\n // Note: we do NOT analyze the action block any more to see if the *last* line is a simple\n // `return NNN;` statement as there are too many shoddy idioms, e.g.\n //\n // ```\n // %{ if (cond)\n // return TOKEN;\n // %}\n // ```\n //\n // which would then cause havoc when our action code analysis (using regexes or otherwise) was 'too simple'\n // to catch these culprits; hence we resort and stick with the most fundamental approach here:\n // always append `break;` even when it would be obvious to a human that such would be 'unreachable code'.\n var match_nr = /^return[\\s\\r\\n]+((?:'(?:\\\\'|[^']+)+')|(?:\"(?:\\\\\"|[^\"]+)+\")|\\d+)[\\s\\r\\n]*;?$/.exec(action.trim());\n if (match_nr) {\n caseHelper.push([].concat(code, i, ':', match_nr[1]).join(' ').replace(/[\\n]/g, '\\n '));\n } else {\n actions.push([].concat('case', i, ':', code, action, '\\nbreak;').join(' '));\n }\n }\n actions.push('default:');\n actions.push(' return this.simpleCaseActionClusters[$avoiding_name_collisions];');\n actions.push('}');\n\n return {\n rules: newRules,\n macros: macros\n };\n}", "function apply_rule_to_graph(graph, rule ) {\n // rule = [ order, text ]\n var rules_num = graph.rules_num;\n var order = rule[0];\n var text = rule[1];\n var current_node = graph.start_filter_node;\n var next_node;\n var letter_code;\n\n for (var level = 0, text_length = text.length; level <= text_length; level++ ) {\n if ( ! graph.letters_level[level] ) {\n graph.letters_level[level] = [];\n }\n\n // '?' is full node with special letter code '1'\n // '*' is full node with special letter code '2' at same level + link to next letter node\n\n switch ( text[level] ) {\n case undefined:\n // last pass, put 'done if last'\n add_filter( current_node, [ order, 2, undefined ] );\n break;\n case \"?\":\n // as usual but with special letter code 1\n add_filter_and_change_node();\n break;\n case \"*\":\n if ( level === (text_length-1) ) {\n // if last, put 'done'\n add_filter( current_node, [ order, 1, undefined ] );\n level++; // rule applyng done\n } else {\n // create next_node for level+ letter at level+ if it isn't exsist yet.\n // make filter for current_node linked to\n // - next_node (at level+)\n // - '*' node (at level) also linked to next letter at next_node\n var asterisk_node = graph.letters_level[level][2];\n if ( ! asterisk_node ) {\n asterisk_node = [ 2, [], graph.next_node_id ];\n graph.nodes_by_id[ graph.next_node_id ] = asterisk_node;\n graph.next_node_id++;\n }\n graph.letters_level[level][2] = asterisk_node;\n add_filter( current_node, [ order, 0, asterisk_node ] );\n level++;\n add_filter_and_change_node();\n add_filter( asterisk_node, [ order, 0, current_node ] );\n }\n break;\n default:\n // action = 0\n // make filter for current_node linked to next_node\n // + create next_node if it isn't exsist yet.\n add_filter_and_change_node();\n }\n }\n\n function add_filter_and_change_node() {\n var action = 0; // means nothing\n var letter_code;\n\n if ( ! graph.letters_level[level] ) {\n graph.letters_level[level] = [];\n }\n\n if ( text[level] === \"?\" ) {\n letter_code = 1;\n } else {\n letter_code = text[level].charCodeAt();\n }\n\n next_node = graph.letters_level[level][letter_code];\n if ( ! next_node ) {\n next_node = [ letter_code, [], graph.next_node_id ];\n graph.nodes_by_id[ graph.next_node_id ] = next_node;\n graph.next_node_id++;\n }\n\n add_filter( current_node, [ order, action, next_node ] );\n graph.letters_level[level][letter_code] = next_node;\n current_node = next_node;\n }\n\n function add_filter( node, filter ) {\n var order = filter[0];\n var action = filter[1];\n var next_node = filter[2];\n var node_filters = node[1];\n\n for (var f = 0, fl = node_filters.length; f<fl; f++) {\n var current_filter = node_filters[f];\n if ( current_filter[1] === action && current_filter[2] === next_node ) {\n current_filter[0].push( order );\n current_filter[3][order] = 1;\n return;\n }\n }\n var new_filter = [ [ order ], action, next_node, {} ];\n new_filter[3][order] = 1;\n node_filters.push(new_filter);\n }\n\n}", "function buildRules() {\n\n // Start creating a new ruleset\n var ruleset = $.deps.createRuleset();\n\n var masterSwitch = ruleset.createRule(getDGFId(\"mechanicalThrombectomyDevice\") + \" select\",\n \"not-any\",\n [\"--NOVALUE--\", \"noDevice\", \"notApplicable\"]);\n\n\n // Make this controls to be slave for the master rule\n masterSwitch.include(getDGFId(\"dac\"));\n masterSwitch.include(getDGFId(\"numberOfAttempts\"));\n\n // Some more selection dropdowns under master rule\n\n masterSwitch.include(getDGFId(\"balloonGuide\"));\n masterSwitch.include(getDGFId(\"aspirationInGuideDuringThrombectomy\"));\n masterSwitch.include(getDGFId(\"incubationOfDevice\"));\n masterSwitch.include(getDGFId(\"delayedReocclusion\"));\n masterSwitch.include(getDGFId(\"angioplasty\"));\n\n // Check that <select> value equals our choice \"yes\"\n var angioplasty = masterSwitch.createRule(getDGFId(\"angioplasty\") + \" select\", \"==\", \"yes\");\n angioplasty.include(getDGFId(\"angioplastyExtraCranial\"));\n angioplasty.include(getDGFId(\"angioplastyIntraCranial\"));\n\n // Another <select> with nested options\n masterSwitch.include(getDGFId(\"adjunctiveStenting\"));\n var adjunctiveStenting = masterSwitch.createRule(getDGFId(\"adjunctiveStenting\") + \" select\", \"==\", \"yes\");\n adjunctiveStenting.include(getDGFId(\"adjunctiveStentingExtraCranial\"));\n adjunctiveStenting.include(getDGFId(\"adjunctiveStentingIntraCranial\"));\n\n // Then add some third level options which check against checboxes\n var adjunctiveStentingExtraCranial = adjunctiveStenting.createRule(getDGFId(\"adjunctiveStentingExtraCranial\") + \" input\", \"==\", true);\n adjunctiveStentingExtraCranial.include(getDGFId(\"adjunctiveStentingExtraCranialType\"));\n\n var adjunctiveStentingIntraCranial = adjunctiveStenting.createRule(getDGFId(\"adjunctiveStentingIntraCranial\") + \" input\", \"==\", true);\n adjunctiveStentingIntraCranial.include(getDGFId(\"adjunctiveStentingIntraCranialType\"));\n\n masterSwitch.include(getDGFId(\"ticiScoreAfterThisDevice\"));\n masterSwitch.include(getDGFId(\"wasSuccessful\"));\n\n return ruleset;\n }", "static get rules() {\n\t\treturn [];\n\t}", "onRulesUpdated({ rules }) {\n this.loading.init = false;\n\n if (rules) {\n this.isActivityStepVisible = some(\n [\n 'organisation',\n 'vat',\n 'nationalIdentificationNumber',\n 'companyNationalIdentificationNumber',\n 'corporationType',\n ],\n (fieldName) => get(rules, `${fieldName}`) !== undefined,\n );\n\n let invalid = 0;\n\n Object.entries(rules).forEach(([key, value]) => {\n const modelItem = this.model[key];\n\n if (\n modelItem !== undefined &&\n (value.in &&\n !(typeof value.in[0] === 'string'\n ? value.in?.includes(modelItem)\n : !!value.in?.find((item) => item.value === modelItem)),\n value.regularExpression && modelItem\n ? !new RegExp(value.regularExpression).test(modelItem)\n : false,\n value.mandatory && !modelItem)\n ) {\n invalid += 1;\n }\n });\n\n this.isValid = invalid === 0;\n }\n }", "resetRules() {\n // noop\n }", "function makePredicate(words) {\n words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n\n if (cats.length > 3) {\n cats.sort(function (a, b) {\n return b.length - a.length;\n });\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n\n // Otherwise, simply generate a flat `switch` statement.\n\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n }", "function checkSpecialRules(strStudent, std, tch, rules, msgObj)\n {\n\t\t// Check for failure to parse\n\t\tif (!std || !std.rootNode || !tch || !tch.rootNode)\n\t\t\treturn false;\n\n // x * 1 or x + 0 is not allowed:\n if (std.rootNode.checkForOnes())\n return exitWithMsg(msgObj, message.getMsg().ones);\n if (std.rootNode.checkForZeros())\n return exitWithMsg(msgObj, message.getMsg().zeroes);\n \n if (std.rootNode instanceof tree.Division && std.rootNode.checkForDenomZeros())\n return exitWithMsg(msgObj, message.getMsg().divideZero);\n\n if (!rules) //return true;\n rules = {}; // so that we can force simplify rule later\n rules.simplify = true; // the system set up is such that the simplify rule is always on\n \n if (rules.factored)\n {\n if (!eqTools.compareFactorObjects(std.getFactors(), tch.getFactors()))\n return exitWithMsg(msgObj, message.getMsg().factor);\n\n return true; // factored trump simplify\n }\n\n if (!rules.allowNegExp && std.checkForNegativeExponents())\n return exitWithMsg(msgObj, message.getMsg().negExp);\n\n rules.simplify = true; // the system set up is such that the simplify rule is always on\n var simplified = false;\n if (rules.simplify) // no other rules necessary:\n {\n if (std.reduceFractions()) // fractions such as 6/2 can be further reduced?\n return exitWithMsg(msgObj, message.getMsg().reduce); //\"fraction needs to be reduced.\");\n else if (std.simplify(rules)) // can be further simplified?\n return exitWithMsg(msgObj, message.getMsg().simplify); //\"Expression should be simplified.\");\n else if (!std.isFullyCombined()) // is already fully combined of like terms?\n return exitWithMsg(msgObj, message.getMsg().terms); //\"All same terms need to be combined.\");\n else if (std.areRadicalsInDenominator()) // are radicals rationalized?\n return exitWithMsg(msgObj, message.getMsg().rationalize); //\"Radicals can not be in denominators.\");\n else if (std.checkPerfectPower()) // no perfect squares found?\n return exitWithMsg(msgObj, message.getMsg().perfRoots); //\"All perfect-nroot factors need to be factored out the root simble.\");\n }\n\n if (rules.descendingOrder &&\n (!std.isOrderedPolynomial()))\n return exitWithMsg(msgObj, message.getMsg().descend);\n \n simplified = true;\n \n// if (rules.allowSlop)\n// simplified = simplified & eqTools.compareNumbersWithSlop(tch, std);\n \n return simplified;\n }", "function NNF(statement){\n \n if(statement.type == \"individual\")\n return statement;\n\n else if(statement.type == \"class\")\n return statement;\n\n else if(statement.type == \"classApplication\")\n return {\n type: \"classApplication\",\n children: [\n NNF(statement.children[0]),\n NNF(statement.children[1])\n ]\n };\n\n else if(statement.type == \"subclass\")\n return {\n type: \"union\",\n children: [\n NNF({type: \"complement\", children: [statement.children[0]]}),\n NNF(statement.children[1])\n ]\n };\n\n // not sure about this one...\n // else if(statement.type == \"role\")\n // return { };\n else if(statement.type == \"role\")\n return statement;\n\n else if(statement.type == \"roleApplication\")\n return {\n type: \"roleApplication\",\n children: [\n NNF(statement.children[0]),\n NNF(statement.children[1]),\n NNF(statement.children[2])\n ]\n };\n\n else if(statement.type == \"restriction\")\n return {\n type: statement.type,\n quantifier: statement.quantifier,\n children: statement.children.map(NNF)\n }\n \n else if(statement.type == \"negation\"){\n if(statement.children[0].type == \"negation\"){\n return NNF(statement.children[0].children[0]);\n }\n else if (statement.children[0].type == \"or\"){\n console.log(\"here\");\n return NNF({\n type: \"and\",\n children: statement.children[0].children.map(function(c){ return {type: \"negation\", children: [NNF(c)]};})\n })\n }\n else if (statement.children[0].type == \"and\"){\n return NNF({\n type: \"or\",\n children: statement.children[0].children.map(function(c){ return {type: \"negation\", children: [NNF(c)]}})\n })\n }\n else if(statement.children[0].type == \"implication\"){\n return NNF({type: \"negation\", children: [NNF(statement.children[0])]});\n }\n else if ([\"individual\", \"classApplication\", \"roleApplication\"].includes(statement.children[0].type)){\n return statement;\n }\n else{\n console.error(`Taking negation of ${statement.children[0].type}?`);\n }\n }\n\n else if(statement.type == \"complement\"){\n if(statement.children[0].type == \"complement\"){\n return NNF(statement.children[0].children[0]);\n }\n else if (statement.children[0].type == \"union\"){\n return NNF({\n type: \"intersection\",\n children: statement.children[0].children.map(function(c){ return {type: \"complement\", children: [NNF(c)]};})\n })\n }\n else if (statement.children[0].type == \"intersection\"){\n return NNF({\n type: \"union\",\n children: statement.children[0].children.map(function(c){ return {type: \"complement\", children: [NNF(c)]}})\n })\n }\n\n else if ( statement.children[0].type == \"restriction\"){\n let restriction = statement.children[0];\n let [role, clazz] = restriction.children;\n if (restriction.quantifier == \"universal\"){\n return {\n type: \"restriction\",\n quantifier: \"existential\",\n children: [\n role, \n {type: \"complement\", children: [clazz]}\n ].map(NNF)\n }\n }\n else{\n return {\n type: \"restriction\",\n quantifier: \"universal\",\n children: [\n role, \n {type: \"complement\", children: [clazz]}\n ].map(NNF)\n }\n }\n }\n\n else if (statement.children[0].type == \"class\"){\n if (statement.children[0].name == \"Empty\")\n return {type: \"class\", name: \"Universe\"};\n else if (statement.children[0].name == \"Universe\")\n return {type: \"class\", name: \"Empty\"};\n return statement;\n }\n\n else if (statement.children[0].type == \"subclass\"){\n return NNF({type: \"complement\", children: [NNF(statement.children[0])]});\n }\n\n else{\n console.error(`Taking complement of ${statement.children[0].type}?`);\n }\n }\n\n else if([\"and\",\"or\",\"intersection\",\"union\"].includes(statement.type)){\n return {\n type: statement.type,\n children: statement.children.map(NNF)\n }\n }\n\n else if(statement.type == \"implication\"){\n return {\n type: \"or\",\n children: [\n {type: \"negation\", children: [NNF(statement.children[0])]},\n NNF(statement.children[1])\n ]\n }\n }\n}", "autocompleteNormalizeRules() {\n // supplement with important information including\n // option arity and sibling\n const rawRules = this._completionRules;\n const {\n options\n } = this;\n const args = this._args;\n const normalizedRules = {\n options: {},\n args: []\n };\n options.forEach(option => {\n if (option.short) {\n const reply = rawRules.options[option.long] || rawRules.options[option.short] || [];\n normalizedRules.options[option.short] = {\n arity: option.arity(),\n sibling: option.long,\n reply\n };\n normalizedRules.options[option.long] = {\n arity: option.arity(),\n sibling: option.short,\n reply\n };\n } else {\n normalizedRules.options[option.long] = {\n arity: option.arity(),\n sibling: null,\n reply: rawRules.options[option.long] || []\n };\n }\n });\n args.forEach(({\n name\n }) => {\n normalizedRules.args.push(rawRules.args[name] || []);\n });\n return normalizedRules;\n }", "function initRuleXs(rules, model) {\n return rules.map(function (r, i) {\n var conditions = r.conditions, _support = r._support, rest = __rest(r, [\"conditions\", \"_support\"]);\n var conditionXs = [];\n // if (i !== rules.length - 1) \n var conditionsFiltered = conditions.filter(function (c) { return c.feature >= 0; });\n conditionXs = conditionsFiltered.map(function (c) { return (__assign({}, c, { ruleIdx: r.idx, desc: model.categoryMathDesc(c.feature, c.category), title: model.categoryDescription(c.feature, c.category), x: 0, width: 0, height: 0, interval: model.categoryInterval(c.feature, c.category), expanded: false, range: model.meta.ranges[c.feature], \n // histRange: model.categoryHistRange(c.feature, c.category),\n isCategorical: model.meta.isCategorical[c.feature] })); });\n var _supportNew = _support ? _support : model.meta.labelNames.map(function () { return 0; });\n return __assign({}, rest, { conditions: conditionXs, height: 0, x: 0, y: 0, width: 0, expanded: false, _support: _supportNew });\n });\n }", "function analyzeWord(word, rules) {\n var syllables = splitSyllable(word),\n head = syllables[0], // syllable to process\n results = []; // result\n if (rules[head]) { // if 1st syllable exist in rules\n rules[head].forEach(function (state) { // for each possible interpet.\n var x, newRules = {};\n newRules[head] = state;\n x = analyzeWord2(syllables, newRules, { 'parts': [] });\n if (x && !x.root) { x.root = {}; } // FIXME\n if (x) { results.push(x); }\n });\n }\n return results;\n }", "function prepareRules(dict, actions, caseHelper, tokens, startConditions, opts) {\n var m, i, k, rule, action, conditions;\n var active_conditions;\n assert(Array.isArray(dict.rules));\n var rules = dict.rules.slice(0); // shallow copy of the rules array as we MAY modify it in here! \n var newRules = [];\n var macros = {};\n var regular_rule_count = 0;\n var simple_rule_count = 0;\n\n // Assure all options are camelCased:\n assert(typeof opts.options['case-insensitive'] === 'undefined');\n\n if (!tokens) {\n tokens = {};\n }\n\n if (opts.options.flex && rules.length > 0) {\n rules.push(['.', 'console.log(\"\", yytext); /* `flex` lexing mode: the last resort rule! */']);\n }\n\n // Depending on the location within the regex we need different expansions of the macros:\n // one expansion for when a macro is *inside* a `[...]` and another expansion when a macro\n // is anywhere else in a regex:\n if (dict.macros) {\n macros = prepareMacros(dict.macros, opts);\n }\n\n function tokenNumberReplacement(str, token) {\n return 'return ' + (tokens[token] || '\\'' + token.replace(/'/g, '\\\\\\'') + '\\'');\n }\n\n // Make sure a comment does not contain any embedded '*/' end-of-comment marker\n // as that would break the generated code\n function postprocessComment(str) {\n if (Array.isArray(str)) {\n str = str.join(' ');\n }\n str = str.replace(/\\*\\//g, '*\\\\/'); // destroy any inner `*/` comment terminator sequence.\n return str;\n }\n\n var routingCode = ['switch(yyrulenumber) {'];\n\n for (i = 0; i < rules.length; i++) {\n rule = rules[i].slice(0); // shallow copy: do not modify input rules\n m = rule[0];\n\n active_conditions = [];\n if (!Array.isArray(m)) {\n // implicit add to all inclusive start conditions\n for (k in startConditions) {\n if (startConditions[k].inclusive) {\n active_conditions.push(k);\n startConditions[k].rules.push(i);\n }\n }\n } else if (m[0] === '*') {\n // Add to ALL start conditions\n active_conditions.push('*');\n for (k in startConditions) {\n startConditions[k].rules.push(i);\n }\n rule.shift();\n m = rule[0];\n } else {\n // Add to explicit start conditions\n conditions = rule.shift();\n m = rule[0];\n for (k = 0; k < conditions.length; k++) {\n if (!startConditions.hasOwnProperty(conditions[k])) {\n startConditions[conditions[k]] = {\n rules: [],\n inclusive: false\n };\n console.warn('Lexer Warning:', '\"' + conditions[k] + '\" start condition should be defined as %s or %x; assuming %x now.');\n }\n active_conditions.push(conditions[k]);\n startConditions[conditions[k]].rules.push(i);\n }\n }\n\n if (typeof m === 'string') {\n m = expandMacros(m, macros, opts);\n m = new XRegExp('^(?:' + m + ')', opts.options.caseInsensitive ? 'i' : '');\n }\n newRules.push(m);\n action = rule[1];\n if (typeof action === 'function') {\n // TODO: also cope with Arrow Functions (and inline those as well?) -- see also https://github.com/zaach/jison-lex/issues/23\n action = String(action).replace(/^\\s*function\\s*\\(\\)\\s?\\{/, '').replace(/\\}\\s*$/, '');\n }\n action = action.replace(/return\\s*'((?:\\\\'|[^']+)+)'/g, tokenNumberReplacement);\n action = action.replace(/return\\s*\"((?:\\\\\"|[^\"]+)+)\"/g, tokenNumberReplacement);\n\n var code = ['\\n/*! Conditions::'];\n code.push(postprocessComment(active_conditions));\n code.push('*/', '\\n/*! Rule:: ');\n code.push(postprocessComment(rule[0]));\n code.push('*/', '\\n');\n\n // When the action is *only* a simple `return TOKEN` statement, then add it to the caseHelpers;\n // otherwise add the additional `break;` at the end.\n //\n // Note: we do NOT analyze the action block any more to see if the *last* line is a simple\n // `return NNN;` statement as there are too many shoddy idioms, e.g.\n //\n // ```\n // %{ if (cond)\n // return TOKEN;\n // %}\n // ```\n //\n // which would then cause havoc when our action code analysis (using regexes or otherwise) was 'too simple'\n // to catch these culprits; hence we resort and stick with the most fundamental approach here:\n // always append `break;` even when it would be obvious to a human that such would be 'unreachable code'.\n var match_nr = /^return[\\s\\r\\n]+((?:'(?:\\\\'|[^']+)+')|(?:\"(?:\\\\\"|[^\"]+)+\")|\\d+)[\\s\\r\\n]*;?$/.exec(action.trim());\n if (match_nr) {\n simple_rule_count++;\n caseHelper.push([].concat(code, i, ':', match_nr[1]).join(' ').replace(/[\\n]/g, '\\n '));\n } else {\n regular_rule_count++;\n routingCode.push([].concat('case', i, ':', code, action, '\\nbreak;').join(' '));\n }\n }\n if (simple_rule_count) {\n routingCode.push('default:');\n routingCode.push(' return this.simpleCaseActionClusters[yyrulenumber];');\n }\n routingCode.push('}');\n\n // only inject the big switch/case chunk when there's any `switch` or `default` branch to switch to:\n if (simple_rule_count + regular_rule_count > 0) {\n actions.push.apply(actions, routingCode);\n } else {\n actions.push('/* no rules ==> no rule SWITCH! */');\n }\n\n return {\n rules: newRules,\n macros: macros,\n\n regular_rule_count: regular_rule_count,\n simple_rule_count: simple_rule_count\n };\n}", "function tf$truthy(fr, to) {\r\n\t\t// Now we find a superset of possible rules this could apply to:\r\n\t\tvar numFrom = fr.length;\r\n\t\tif(numFrom == 0)\r\n\t\t\treturn [{ flag: LINT_FLAG.TF_ERROR, text:Print.rule(\"TF\") + \" applied without any premises!\" }];\r\n\r\n\t\tvar oldTruth = [];\r\n\t\t// In case the first rule involves expanding an implicit double-negative, we introduce it here:\r\n\t\tvar newTruth = fr.slice(); //tf$introduceDoubleNegations(fr);\r\n\r\n\t\t// These are all the possible rules that could apply in the final step of evaluation.\r\n\t\t// These are all the rules that could conceivably lead to the target sentence.\r\n\t\tvar candidatesTo = sortAndUnique(tf$lookupTo[Expressions.TYPE_SENTENCE_LETTER].concat(tf$lookupTo[to.type]), true);\r\n\r\n\t\t// We apply these rules at most MAX_DEPTH times.\r\n\t\tfor (var i = 0; i < MAX_DEPTH; ++i) {\r\n\t\t\tvar candidates = tf$lookupFrom[Expressions.TYPE_SENTENCE_LETTER];\r\n\t\t\tfor (var j = 0; j < newTruth.length; ++j) {\r\n\t\t\t\tvar t = newTruth[j];\r\n\t\t\t\t// Now we add the type of rule to the candidate list:\r\n\t\t\t\tcandidates = candidates.concat(tf$lookupFrom[t.type]);\r\n\t\t\t}\r\n\t\t\tcandidates = sortAndUnique(candidates, true);\r\n\t\t\t// If this is the last round, we only consider rules that can lead to the final step:\r\n\t\t\tif (i == MAX_DEPTH - 1) {\r\n\t\t\t\tcandidates = tf$intersection(candidates, candidatesTo);\r\n\t\t\t}\r\n\r\n\t\t\t// Now we have a list of candidates. candidate[i] is an index into tf$rules containing \r\n\t\t\t// the possible rules.\r\n\t\t\t// Now we try applying every rule in the candidate set. For each rule, we need to find\r\n\t\t\t// some mapping between expressions in (oldTruth + newTruth) and each element in the from\r\n\t\t\t// section of the rule. This mapping is found in a similar manner to the FindMapping function\r\n\t\t\t// in metalogic.js.\r\n\t\t\t// To speed up processing, we require the inclusion of at least one expression from newTruth \r\n\t\t\t// each round. This prevents rederiving already-derived expressions.\r\n\t\t\tvar allTruth = newTruth.concat(oldTruth);\r\n\t\t\tvar newTruthIndex = newTruth.length;\r\n\t\t\tvar discoveredTruth = []; // expressions we know to be true.\r\n\t\t\tfor (var j = 0; j < candidates.length; ++j) {\r\n\t\t\t\tvar rule = tf$rules[candidates[j]];\r\n\t\t\t\tdiscoveredTruth = discoveredTruth.concat(tf$applyRule(rule, allTruth, newTruthIndex));\r\n\t\t\t\t// appliedRules is a list of all discoverable truths as a result of applying this rule.\r\n\t\t\t}\r\n\r\n\t\t\t// If we didn't discover anything this round, we can't proceed. We stop.\r\n\t\t\tif(discoveredTruth.length == 0) {\r\n\t\t\t\treturn [{ flag: LINT_FLAG.TF_WARNING, text:Print.rule(\"TF\") + \" exhausted the search space without confirming this deduction.\" }];\r\n\t\t\t}\r\n\r\n\t\t\t// Now we check to see if we have reached the target expression:\r\n\t\t\tfor (var j = 0; j < discoveredTruth.length; ++j) {\r\n\t\t\t\tif(ExprEqualExact(discoveredTruth[j], to, true)) {\r\n\t\t\t\t\treturn [{ flag: LINT_FLAG.GOOD, text:Print.rule(\"TF\") + \" solver confirms this is correct.\" }];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// We shift newTruths to oldTruths and discoveredTruth to newTruths\r\n\t\t\t// We deduplicate discoveredTruth in the process.\r\n\t\t\toldTruth = oldTruth.concat(newTruth);\r\n\t\t\tnewTruth = tf$deduplicateTruth(oldTruth, discoveredTruth);\r\n\t\t}\r\n\r\n\t\treturn [{ flag: LINT_FLAG.TF_WARNING, text:Print.rule(\"TF\") + \" reached the depth limit without confirming this deduction.\" }];\r\n\t}", "function makePredicate(words) {\n words = words.split(\" \");\n var f = \"\",\n cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j) {\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n }cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) {\n return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n }f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) {\n f += \"case \" + JSON.stringify(arr[i]) + \":\";\n }f += \"return true}return false;\";\n }\n\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n\n if (cats.length > 3) {\n cats.sort(function (a, b) {\n return b.length - a.length;\n });\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\"\n\n // Otherwise, simply generate a flat `switch` statement.\n\n ;\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n}", "function buildUpIdFromRules(id, rules, computed_rules, MAX_DEPTH = DEFAULT_MAX_DEPTH, depth = 0) {\n\tif (computed_rules[id]) {\n\t\treturn computed_rules[id];\n\t}\n\n\tlet { parts } = rules[id];\n\tlet expanded_parts = parts\n\t\t.map((v) => {\n\t\t\tif (depth > MAX_DEPTH) {\n\t\t\t\t// Bail on an arbitrarily large depth\n\t\t\t\t// This can probably be computed by the longest input code, but trial and error works well enough to determine the answer\n\t\t\t\treturn undefined;\n\t\t\t} else if (typeof v === 'string') {\n\t\t\t\treturn v;\n\t\t\t} else {\n\t\t\t\treturn buildUpIdFromRules(v, rules, computed_rules, MAX_DEPTH, depth + 1);\n\t\t\t}\n\t\t})\n\t\t.filter((v) => v);\n\tcomputed_rules[id] = expanded_parts;\n\n\treturn expanded_parts;\n}", "function ruleBase() {\n\tvar node = false;\n\tvar tmp;\n\n\tif ((tmp = ruleFuncCall()) || (tmp = ruleFunc()))\n\t node = tmp;\n\telse if (accept(\"LX_STRING\")) {\n\t node = {name:_curr.name, val:_curr.val.substr(1, _curr.val.length - 2)};\n\t shift();\n\t}\n\telse if (accept(\"LX_NUMBER\")) {\n\t node = {name:_curr.name, val:parseFloat(_curr.val)};\n\t shift();\n\t} else if (accept(\"LX_ID\")) {\n\t node = {name:_curr.name, val:_curr.val};\n\t shift();\n\t} else if (accept(\"LX_LPAREN\")) {\n\t shift();\n\t node = ruleAssign();\n\t if (expect(\"LX_RPAREN\"))\n\t\tshift();\n\t} else\n\t return (false);\n\treturn (node);\n }", "function makePredicate(words) {\n if (!(words instanceof Array)) words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n // Otherwise, simply generate a flat `switch` statement.\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n}", "function makePredicate(words) {\n if (!(words instanceof Array)) words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n // Otherwise, simply generate a flat `switch` statement.\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n}", "function runRules(vmap, cmap, rmap, start, n) {\n\n var start_str = start;\n var result = \"\";\n\n for (var j = 0; j < n; j++) {\n for (var i = 0; i < start_str.length; i++) {\n // No rule found\n if (rmap[start_str[i]] == null) {\n result += start_str[i];\n } else {\n result += rmap[start_str[i]];\n }\n }\n start_str = result;\n result = \"\";\n }\n\n return start_str;\n}", "function guessSubgroups(array) {\n var arr;\n if (array.indexOf('(') >= 0) { // if there are brackets in smc prerequisite string\n arr = fixSMCGroupingIssues(array);\n arr = logical_grouping.getGroupedArray(arr, {\n 'or': 1,\n 'and': 0\n });\n } else {\n arr = logical_grouping.getGroupedArray(array, presidence);\n // make sure that all operators are in lowercase\n arr = arr.map(function(el) {\n return isOperator(el) ? el.toLowerCase() : el;\n });\n }\n\n return arr;\n}", "function semanticRules(words){\n\n var string = \"\";\n var keyword, rule;\n for(var x = 0; x < words.length; x++){\n\n keyword = words[x];\n rule = languageForest[keyword];\n\n if (rule != undefined) string += rule;\n }\n\n return string;\n}", "function Rule(data) {\n var rules = document.getElementById('rules');\n this.node = document.getElementById('rule-template').cloneNode(true);\n this.node.id = 'rule' + (Rule.next_id++);\n this.node.rule = this;\n rules.appendChild(this.node);\n this.node.hidden = false;\n\n if (data) {\n this.getElement('matcher').value = data.matcher;\n this.getElement('match-param').value = data.match_param;\n this.getElement('action').value = data.action;\n this.getElement('action-js').value = data.action_js;\n this.getElement('enabled').checked = data.enabled;\n }\n\n this.getElement('enabled-label').htmlFor = this.getElement('enabled').id =\n this.node.id + '-enabled';\n\n this.render();\n\n this.getElement('matcher').onchange = storeRules;\n this.getElement('match-param').onkeyup = storeRules;\n this.getElement('action').onchange = storeRules;\n this.getElement('action-js').onkeyup = storeRules;\n this.getElement('enabled').onchange = storeRules;\n\n var rule = this;\n this.getElement('move-up').onclick = function() {\n var sib = rule.node.previousSibling;\n rule.node.parentNode.removeChild(rule.node);\n sib.parentNode.insertBefore(rule.node, sib);\n storeRules();\n };\n this.getElement('move-down').onclick = function() {\n var parentNode = rule.node.parentNode;\n var sib = rule.node.nextSibling.nextSibling;\n parentNode.removeChild(rule.node);\n if (sib) {\n parentNode.insertBefore(rule.node, sib);\n } else {\n parentNode.appendChild(rule.node);\n }\n storeRules();\n };\n this.getElement('remove').onclick = function() {\n rule.node.parentNode.removeChild(rule.node);\n storeRules();\n };\n storeRules();\n}", "function addRules(state, newrules, rules) {\r\n var idx;\r\n for(idx in rules) {\r\n var rule = rules[idx];\r\n var include = rule.include;\r\n if(include) {\r\n if(typeof (include) !== \"string\") {\r\n Common.throwError(lexer, \"an 'include' attribute must be a string at: \" + state);\r\n }\r\n if(include[0] === \"@\") {\r\n include = include.substr(1);\r\n }// peel off starting @\r\n \r\n if(!json.tokenizer[include]) {\r\n Common.throwError(lexer, \"include target '\" + include + \"' is not defined at: \" + state);\r\n }\r\n addRules(state + \".\" + include, newrules, json.tokenizer[include]);\r\n } else {\r\n var newrule = new Rule(state);\r\n // Set up new rule attributes\r\n if(rule instanceof Array && rule.length >= 1 && rule.length <= 3) {\r\n newrule.setRegex(lexerMin, rule[0]);\r\n if(rule.length >= 3) {\r\n if(typeof (rule[1]) === \"string\") {\r\n newrule.setAction(lexerMin, {\r\n token: rule[1],\r\n next: rule[2]\r\n });\r\n } else if(typeof (rule[1]) === \"object\") {\r\n var rule1 = rule[1];\r\n rule1.next = rule[2];\r\n newrule.setAction(lexerMin, rule1);\r\n } else {\r\n Common.throwError(lexer, \"a next state as the last element of a rule can only be given if the action is either an object or a string, at: \" + state);\r\n }\r\n } else {\r\n newrule.setAction(lexerMin, rule[1]);\r\n }\r\n } else {\r\n if(!rule.regex) {\r\n Common.throwError(lexer, \"a rule must either be an array, or an object with a 'regex' or 'include' field at: \" + state);\r\n }\r\n if(rule.name) {\r\n newrule.name = string(rule.name);\r\n }\r\n if(rule.matchOnlyAtStart) {\r\n newrule.matchOnlyAtLineStart = bool(rule.matchOnlyAtLineStart);\r\n }\r\n newrule.setRegex(lexerMin, rule.regex);\r\n newrule.setAction(lexerMin, rule.action);\r\n }\r\n newrules.push(newrule);\r\n }\r\n }\r\n }", "buildRule(rule) {\n // Warn\n console.warn('buildRule should be implemented in the query class');\n\n // Check if the rule has any value\n if( isEmpty(rule.values) )\n return undefined;\n\n // Default return\n return { name: rule.name, values: rule.values };\n }", "function parseLogic(logic) {\n\t\tlogic = logic.split(\";\");\n\t\tmoves = [];\n\t\tcaptureMoves = [];\n\t\tcaptureCaptures = [];\n\t\tfirstCaptures = [];\n\t\tfirstMoves = [];\n\t\ttransformLocations = [];\n\n\t\tfor (var i = 0; i < logic.length; i++) {\n\t\t\trule = logic[i];\n\n\t\t\tregex = /^[a-zA-Z]+/g;\n\t\t\tprefixes = rule.match(regex)[0].split(\"\");\n\n\t\t\tregex = /[a-zA-Z]+[0-9]*$/g;\n\t\t\tconsole.log(rule.match(regex));\n\t\t\tvar suffixes = [];\n\t\t\tsuffixes = rule.match(regex);\n\t\t\tif ( suffixes !== null ) {\n\t\t\t\tsuffixes = suffixes[0].split(\"\");\n\t\t\t} else {\n\t\t\t\tsuffixes = [];\n\t\t\t}\n\t\t\tconsole.log(suffixes);\n\n\t\t\tregex = /[\\-0-9]+,[\\-0-9]+/g;\n\n\t\t\t// is coordinate\n\t\t\tif (rule.match(regex) !== null) {\n\t\t\t\tpos = rule.match(regex)[0].split(\",\");\n\t\t\t\tfor (var j = 0; j < pos.length; j++) {\n\t\t\t\t\tpos[j] = parseInt(pos[j]);\n\t\t\t\t}\n\n\t\t\t\tif (suffixes.includes(\"i\")) {\n\t\t\t\t\tpos.push(true);\n\t\t\t\t} else {\n\t\t\t\t\tpos.push(false);\n\t\t\t\t}\n\n\t\t\t\tif (suffixes.length > 1 ) {\t\t\t\t\n\t\t\t\t\tpos.push(suffixes[1]);\n\t\t\t\t} else {\t\t\t\n\t\t\t\t\tpos.push(64);\t\t\t\t\n\t\t\t\t}\n\n\n\t\t\t// \n\t\t\t\n\n\t\t\t\n\n\t\t\t\t// if move add to moves[]\n\t\t\t\tif (prefixes.includes(\"m\")) {\n\t\t\t\t\tmoves.push(pos);\n\t\t\t\t}\n\n\t\t\t\t// if capturemove add to captureMoves[]\n\t\t\t\tif (prefixes.includes(\"c\")) {\n\t\t\t\t\tcaptureMoves.push(pos);\n\t\t\t\t}\n\n\n\t\t\t\t// if firstMoves\n\t\t\t\tif (prefixes.includes(\"f\")) {\n\t\t\t\t\tfirstMoves.push(pos);\n\t\t\t\t}\n\n\t\t\t\t// if firstMoves\n\t\t\t\tif (prefixes.includes(\"f\") && prefixes.includes(\"c\")) {\n\t\t\t\t\tfirstCaptures.push(pos);\n\t\t\t\t}\n\t\t\t}\n\t\t\tregex = /[\\-0-9]+:[\\-0-9]+/g;\n\t\t\tif (rule.match(regex) !== null) {\n\t\t\t\tpos = rule.match(regex)[0].split(/[:]+/);\n\t\t\t\tfor (var j = 0; j < pos.length; j++) {\n\t\t\t\t\tpos[j] = parseInt(pos[j]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\n\n\t\t\t\n\n\n\t\t\tconsole.log(prefixes);\n\n\n\t\t\tif (prefixes.includes(\"t\")) {\n\t\t\t\tif (prefixes.includes(\"r\")) {\n\t\t\t\t\tpos.push(\"r\");\n\t\t\t\t\ttransformLocations.push(pos);\n\t\t\t\t} else if (prefixes.includes(\"c\")){\n\t\t\t\t\tpos.push(\"c\");\n\t\t\t\t\ttransformLocations.push(pos);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\n\n\t\treturn {\n\t\t\t\"moves\" : moves,\n\t\t\t\"captureMoves\" : captureMoves,\n\t\t\t\"firstMoves\" : firstMoves,\n\t\t\t\"firstCaptures\" : firstCaptures,\n\t\t\t\"transformLocations\" : transformLocations,\n\t\t};\n\t}", "function FIRST(rule, grammar) {\n // if rule is not in grammar, then it is a terminal\n if(!grammar[rule]) {\n return new Set([rule]);\n }\n\n let FIRST_SET = new Set([]);\n grammar[rule].forEach((productionRule) => {\n addTo(FIRST_SET, FIRST(productionRule[0], grammar));\n });\n return FIRST_SET;\n}", "addRule(rule, names) {\n if (Array.isArray(names) && !rule.isLeftRecursive) {\n if (names.includes(\"expression\")) names.push(\"simple_expression\")\n if (names.includes(\"statement\")) names.push(\"simple_statement\")\n }\n super.addRule(rule, names)\n }", "function makePredicate(words) {\n if (!(words instanceof Array)) words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function quote(word) {\n return JSON.stringify(word).replace(/[\\u2028\\u2029]/g, function (s) {\n switch (s) {\n case \"\\u2028\": return \"\\\\u2028\";\n case \"\\u2029\": return \"\\\\u2029\";\n }\n return s;\n });\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + quote(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + quote(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n if (cats.length > 3) {\n cats.sort(function (a, b) { return b.length - a.length; });\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n // Otherwise, simply generate a flat `switch` statement.\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n }", "generate() {\n this.len *= 0.5; //So the tree becomes denser instead of larger.\n this.branchValue += 1; //To ensure increased thickness of trunk.\n let nextSentence = \"\";\n for (let i = 0; i < this.sentence.length; i++) {\n let current = this.sentence.charAt(i);\n if (current === current.toLowerCase()) {\n current = current.toUpperCase();\n }\n let found = false;\n\n if (current === this.rules1.letter) {\n found = true;\n nextSentence += this.rules1.becomes;\n } else if (current === this.rules2.letter) {\n found = true;\n nextSentence += this.rules2.becomes;\n } else if (current === this.rules3.letter) {\n found = true;\n nextSentence += this.rules3.becomes;\n }\n\n if (!found) {\n nextSentence += current;\n }\n }\n this.sentence = nextSentence;\n }", "function buildRuleString(ruleId){\n let rule = allRules[ruleId];\n //console.log(rule);\n while(rule.match(/\\d+/g)){\n const otherRuleIds = rule.match(/\\d+/g);\n otherRuleIds.forEach(otherRuleId => rule = rule.replace(otherRuleId, allRules[otherRuleId]));\n }\n allRules[ruleId] = rule;\n return allRules[ruleId];\n}", "function rulesValidation(rules){\n\tif(!Array.isArray(rules)){\n\t\treturn false;\n\t}\n\tlet exists;\n\tfor(let rule in rules){\n\t\tfor(let predeChar in rules[rule].predecessor){\n\t\t\texists = false;\n\t\t\tfor(let alph in alphabet){\n\t\t\t\tif(rules[rule].predecessor[predeChar] === alphabet[alph]) exists = true;\n\t\t\t}\n\t\t\tif(exists === false) return false;\n\t\t}\n\t\tfor(let succeChar in rules[rule].successor){\n\t\t\texists = false;\n\t\t\tfor(let alph in alphabet){\n\t\t\t\tif(rules[rule].successor[succeChar] === alphabet[alph]) exists = true;\n\t\t\t}\n\t\t\tif(exists === false) return false;\n\t\t}\t\n\t}\n\tfor(let i=0;i<rules.length;i++){\n\t\tfor(let j=0;j<rules.length;j++){\n\t\t\tif(i!=j){\n\t\t\t\tif(rules[i].predecessor===rules[j].predecessor){\n\t\t\t\t\treturn false;\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\treturn true;\n}", "function makePredicate(words) {\n if (!(words instanceof Array)) words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j) if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([ words[i] ]);\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n if (cats.length > 3) {\n cats.sort(function(a, b) {\n return b.length - a.length;\n });\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n }", "function tokenFn(rules, type, noFallback, countStart) {\n\tif (type instanceof Array) {\n\t\tvar r = _getProp(type, false, rules);\n\t} else {\n\t\tvar r = (rules.hasOwnProperty(type)) ? rules[type] : 0;\n\t}\n\treturn function(t, i, tokens) {\n\t\tif (!r) return false;\n\t\tvar id;\n\t\tif (r instanceof Array) {\n\t\t\tfor (id = 0; id < r.length; id++) {\n\t\t\t\tvar rule = r[id];\n\t\t\t\tvar set = setToken(t, i, tokens, rule.tag+'Rule_'+id, rule, countStart);\n\t\t\t\tif (set) return set;\n\t\t\t}\n\t\t} else {\n\t\t\tfor (id in r) {\n\t\t\t\tvar rule = r[id];\n\t\t\t\tvar set = setToken(t, i, tokens, id, rule, countStart);\n\t\t\t\tif (set) return set;\n\t\t\t}\n\t\t}\n\t\treturn (noFallback) ? false : t;\n\t}\n}", "function parseRuleSet(ruleset) {\n ruleset.selectors.forEach(function(selector) {\n var queryString = '',\n nodes = [],\n targets = [fragment],\n parts = defaults.autoExpand ? expand(selector.parts) : selector.parts;\n parts.forEach(function(part) {\n var text = part.text\n\n // Strip browser specific selectors.\n .replace(/(:[:\\-])(?![^\\[]+[\\]])[^ >+~]+/g, '') \n\n // Strip pseudo elements and classes.\n .replace(/:(active|after|before|empty|first-letter|first-line|focus|hover|link|visited)(?![^\\[]+[\\]])/g, '') \n\n // Strip html (root) and body selectors.\n .replace(/^((:root|html)([ >]body|)|body)/g, '');\n if (!text) {\n return;\n }\n queryString += text;\n if (part instanceof parserlib.css.SelectorPart) {\n try {\n nodes = fragment.querySelectorAll('#' + id + '>' + queryString);\n }\n catch(error) {\n error.queryString = queryString;\n report(error);\n }\n if (!nodes.length) {\n var node = createNode(part);\n if (defaults.dataAttr) {\n node.setAttribute('data-selector', queryString);\n }\n \n // Test for various child pseudo classes and ensure enough nodes exist to match the selectors.\n // Plus one more to illustrate variation.\n var n = (text.match(/:nth[^(]+\\(([^)]+)\\)(?![^\\[]+[\\]])/));\n n = n ? (parseInt(n[1], 10) || 1) + 1\n : /:(first|last)-(of|child)(?![^\\[]+[\\]])/.test(text) ? 2\n : 1;\n nodes = [];\n targets.forEach(function(target) {\n var i = n;\n while (i--) {\n var clone = node.cloneNode(false);\n\n // Remember the selector for populating the node.\n clone.__selectorPart__ = text;\n target.appendChild(clone);\n nodes.push(clone);\n }\n });\n }\n }\n else if (part instanceof parserlib.css.Combinator) {\n if (/[> ]/.test(text)) {\n \n // If it's a `descendant` or `child` combinator \n // then the current nodes become the next targets.\n targets = [].slice.call(nodes);\n }\n }\n });\n });\n }", "function generateRules() {\n window.rules.forEach(rule => {\n switch (rule.type) {\n case 'show':\n window.showRule(rule);\n break;\n case 'valid':\n window.validRule(rule);\n break;\n default:\n }\n });\n}", "compile(match) {\n const { rule, prefix, items } = match\n const results = (prefix && prefix.compile()) || {}\n const name = rule.rule.argument || rule.rule.name\n results[name] = items.map(item => item.compile())\n return results\n }", "function makeFilter(styleRule) {\n if (styleRule == null) {\n return;\n }\n\n var rules = styleRule.r[0]; // TODO: handle multi-element OR properties (Studio doesn't currently support)\n var conditions = [];\n rules.forEach(function (rule) {\n // Tangram property look-up\n var prop = rule.property;\n\n // special handling for `id` and `__id` property handling between XYZ and Tangram\n if (prop === 'id') { // XYZ property `id`' is for `feature.id` (NOT `feature.properties.id`)\n // prop = '$id'; // in Tangram, this is accessed through a special `$id` property\n prop = '_feature_id'; // TODO: remove this when Tangram 0.19 is released (temp solution for 0.18.x)\n }\n else if (prop === '__id') { // XYZ property `__id` is for `feature.properties.id` (NOT `feature.id`)\n prop = 'id'; // in Tangram, this is accessed as a normal feature property\n }\n\n var value;\n if (prop[0] === '$') { // special Tangram accessor prefixed with `$`, use property name directly\n value = prop; // e.g. `$id`, `$geometry`, `$layer`, etc.\n }\n else { // regular feature property\n value = \"feature['\" + prop + \"']\"; // Tangram exposes feature properties in the `feature` object\n }\n\n // apply the logic for this operator\n switch (rule.operator) {\n case 'eq': // equals\n conditions.push((value + \" == \" + (quoteValue(rule.value))));\n break;\n case 'neq': // not equals\n conditions.push((value + \" != \" + (quoteValue(rule.value))));\n break;\n case 'lt': // less than\n conditions.push((value + \" < \" + (quoteValue(rule.value))));\n break;\n case 'gt': // greater than\n conditions.push((value + \" > \" + (quoteValue(rule.value))));\n break;\n case 'em': // is empty\n conditions.push((value + \" == null\"));\n break;\n case 'nem': // is not empty\n conditions.push((value + \" != null\"));\n break;\n }\n });\n\n if (conditions.length === 0) {\n return;\n }\n\n var filter = \"function() { return \" + (conditions.join(' && ')) + \"; }\";\n return filter;\n }", "function printRules () {\n\n\tvar d = document.getElementById(\"mainDivRule\");\n\n\twhile ( d.hasChildNodes() ) {\n\t\twhile ( d.childNodes.length >= 1 ) {\n\t\t\td.removeChild( d.firstChild ); \n\t\t} \n\t}\n\n\tvar table = document.createElement(\"table\");\n\n\tfor ( var key in systemRules ) {\n\t\tvar trow = document.createElement(\"tr\");\t\n\t\tvar tcol = document.createElement(\"td\");\n\n\t\tif ( !isLastKey (key, systemRules)) {\n\t\t\ttcol.setAttribute(\"style\",\"border-bottom:1px solid black\");\t\n\t\t}\n\n\t\ttcol.appendChild(document.createTextNode(\"IF \"));\n\t\tfor ( var key2 in systemRules[key].inputList ) {\n\t\t\tvar x = systemRules[key].inputList[key2];\n\n\t\t\tvar ns =\"\";\n\t\t\tif (x.negated){\n\t\t\t\tns = \"NOT\";\n\t\t\t} \n\n\t\t\tif ( strcmp(x.rightEl,\"(Not used)\") == 0 ) {\n\t\t\t} else {\n\t\t\t\tif ( !isFirstKey ( key2, systemRules[key].inputList ) ) {\n\t\t\t\t\ttcol.appendChild(document.createTextNode(systemRules[key].connective + \" \"));\n\t\t\t\t}\n\t\t\t\tif ( inputDivs[x.leftEl] !== undefined ) {\n\t\t\t\t\ttcol.appendChild(document.createTextNode(inputDivs[x.leftEl].varName + \" IS \" + ns + \" \" + x.rightEl + \" \"));\n\t\t\t\t} else {\n\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ( (isLastKey (key2, systemRules[key].inputList))) {\n\t\t\t\ttcol.appendChild(document.createTextNode(\"THEN \"));\n\t\t\t}\n\t\t}\n\n\t\tfor ( var key2 in systemRules[key].outputList ) {\n\t\t\tvar x = systemRules[key].outputList[key2];\n\n\t\t\tvar ns =\"\";\n\t\t\tif (x.negated){\n\t\t\t\tns = \"NOT\";\n\t\t\t} \n\n\t\t\tif ( !isFirstKey ( key2, systemRules[key].outputList ) ) {\n\t\t\t\tif ( strcmp (x.rightEl, \"(Not used)\") != 0) { \n\t\t\t\t\ttcol.appendChild(document.createTextNode(systemRules[key].connective + \" \"));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( strcmp(x.rightEl,\"(Not used)\") == 0 ) {\n\t\t\t} else {\n\t\t\t\tif ( outputDivs[x.leftEl] !== undefined ) {\n\t\t\t\t\ttcol.appendChild(document.createTextNode(outputDivs[x.leftEl].varName + \" IS \" + ns + \" \" + x.rightEl + \" \"));\n\t\t\t\t} else {\n\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t\n\n\t\ttcol.appendChild(document.createTextNode(\"(\" + systemRules[key].weight + \")\"));\t\t\t\n\n\t\tvar tcol2 = document.createElement(\"td\");\n\n\t\tif ( !isLastKey (key, systemRules)) {\n\t\t\ttcol2.setAttribute(\"style\",\"border-bottom:1px solid black\");\t\n\t\t}\n\n\t\tvar deleteButton = document.createElement(\"button\");\n\t\tdeleteButton.className = \"btn btn-danger lowMarge\";\n\t\tdeleteButton.setAttribute (\"style\",\"float:right\")\n\t\tdeleteButton.appendChild(document.createTextNode(\"Delete\"));\n\t\tdeleteButton.setAttribute(\"onclick\", \"deleteRule(\" + s + \")\");\n\t\ttcol2.appendChild(deleteButton);\n\t\t\n\t\tvar editButton = document.createElement(\"button\");\n\t\teditButton.className = \"btn btn-primary lowMarge\";\n\t\teditButton.setAttribute (\"style\",\"float:right\")\n\t\teditButton.appendChild(document.createTextNode(\"Edit\"));\n\t\tvar s = \"\\\"\"+ key +\"\\\"\";\n\t\teditButton.setAttribute(\"onclick\", \"resetRuleCreator(); editRule(\" + s + \")\");\n\t\ttcol2.appendChild(editButton);\n\n\t\ttrow.appendChild(tcol);\n\t\ttrow.appendChild(tcol2);\n\t\ttable.appendChild(trow);\n\t}\n\n\td.appendChild(table);\n\n\tif ( getLength(true) == 2 && getLength(false) == 1 ) {\n\t\tdocument.getElementById(\"ruleTableTitle\").innerHTML = \"<h4 class='smallIndent'>Rule Tables</h4>\";\n\t\tprintRulesAsTable(\"AND\");\n\t\tprintRulesAsTable(\"OR\");\n\t} else {\n\t\tdocument.getElementById(\"ruleTableTitle\").innerHTML = \"\";\n\t\tclearNode(document.getElementById(\"ruleTableDivAND\"));\n\t\tclearNode(document.getElementById(\"ruleTableDivOR\"));\t\n\t}\n\t\n\n}", "function Ruleset() {\n\n // Hold a tree of rules\n this.rules = [];\n }", "function compare_a_rules(rule1,rule2)\n{\n\t \ttmp1=Object();\n \t\ttmp2=Object();\n \t\t\n \t\ttmp1.prem=clone(rule1.premise);\n \t\ttmp1.conc=clone(rule1.conclusion);\n \t\ttmp2.prem=clone(rule2.premise);\n \t\ttmp2.conc=clone(rule2.conclusion); \t\t\n \t\t\n \t\tsub_sets_equal = compare_objects(tmp1.prem,tmp2.prem) && compare_objects(tmp1.conc,tmp2.conc);\n \t\t\n \t\ttmp1=clone(rule1);\n \t\ttmp2=clone(rule2);\n \t\ttmp1.premise=1;\n \t\ttmp1.conclusion=1;\n \t\ttmp2.premise=1;\n \t\ttmp2.conclusion=1;\t\n\treturn compare_objects(tmp1,tmp2) && sub_sets_equal;\n}", "static getRules(required = false) {\n let rules = {\n post_id: 'min:5|max:50',\n body: 'string|min:1'\n }\n\n if (required) {\n for (let key of Object.keys(rules)) {\n rules[key] = 'required|' + rules[key]\n }\n }\n\n return rules\n }", "parseRule() {\n return null;\n }", "function processRules(allText) {\n var allTextLines = allText.split(/\\r\\n|\\n/);\n var headers = allTextLines[0].split(',');\n\n for (var i=1; i<allTextLines.length; i++) {\n var data = allTextLines[i].split(',');\n if (data.length == headers.length) {\n var ruleMap = new Map();\n for (var j=0; j<headers.length; j++) {\n ruleMap.set(headers[j],data[j])\n }\n ruleLines.push(ruleMap);\n }\n }\n console.log('Rules:',ruleLines) // just to see rules at console\n}", "function _buildFilterTree(expr) {\n var c;\n var child;\n var clean = false;\n var endParen;\n var esc = false;\n var i = 0;\n var obj;\n var tree = {};\n var split;\n var val = '';\n\n if (expr.length === 0)\n return tree;\n\n // Chop the parens (the call to matchParens below gets rid of the trailer)\n if (expr.charAt(0) == '(')\n expr = expr.substring(1, expr.length - 1);\n\n //store prefix operator\n if (expr.charAt(0) === '&') {\n tree.op = 'and';\n expr = expr.substring(1);\n } else if (expr.charAt(0) === '|') {\n tree.op = 'or';\n expr = expr.substring(1);\n } else if (expr.charAt(0) === '!') {\n tree.op = 'not';\n expr = expr.substring(1);\n } else {\n tree.op = 'expr';\n }\n\n if (tree.op != 'expr') {\n tree.children = [];\n\n // logical operators are k-ary, so we go until our expression string runs\n // out (at least for this recursion level)\n while (expr.length !== 0) {\n endParen = matchParens(expr);\n\n if (endParen == expr.length - 1) {\n tree.children[i] = _buildFilterTree(expr);\n expr = '';\n } else {\n child = expr.slice(0, endParen + 1);\n expr = expr.substring(endParen + 1);\n tree.children[i] = _buildFilterTree(child);\n }\n i++;\n }\n } else {\n //else its some sort of non-logical expression, parse and return as such\n var operatorStr = '';\n tree.name = '';\n tree.value = '';\n\n\n // This parses and enforces filter syntax, which is an AttributeDescription\n // plus a filter operator, followed by (for ldapjs), anything. Note\n // that ldapjs additionally allows the '_' character in the AD, as many\n // users rely on it, even though it's non-standard\n //\n // From 4.1.5 of RFC251\n //\n // AttributeDescription ::= LDAPString\n //\n // A value of AttributeDescription is based on the following BNF:\n //\n // <AttributeDescription> ::= <AttributeType> [ \";\" <options> ]\n //\n // <options> ::= <option> | <option> \";\" <options>\n //\n // <option> ::= <opt-char> <opt-char>*\n //\n // <opt-char> ::= ASCII-equivalent letters, numbers and hyphen\n //\n // Examples of valid AttributeDescription:\n //\n // cn\n // userCertificate;binary\n\n /* JSSTYLED */\n if (!/[a-zA-Z0-9;_\\-]+[~><:]?=.+/.test(expr))\n throw new Error(expr + ' is invalid');\n\n if (expr.indexOf('~=') !== -1) {\n operatorStr = '~=';\n tree.tag = 'approxMatch';\n } else if (expr.indexOf('>=') !== -1) {\n operatorStr = '>=';\n tree.tag = 'greaterOrEqual';\n } else if (expr.indexOf('<=') !== -1) {\n operatorStr = '<=';\n tree.tag = 'lessOrEqual';\n } else if (expr.indexOf(':=') !== -1) {\n operatorStr = ':=';\n tree.tag = 'extensibleMatch';\n } else if (expr.indexOf('=') !== -1) {\n operatorStr = '=';\n tree.tag = 'equalityMatch';\n } else {\n // tree.tag = 'present';\n throw new Error('invalid filter syntax');\n }\n\n if (operatorStr === '') {\n tree.name = expr;\n } else {\n // pull out lhs and rhs of equality operator\n var splitAry = expr.split(operatorStr);\n tree.name = splitAry.shift();\n tree.value = splitAry.join(operatorStr);\n\n // substrings fall into the equality bin in the\n // switch above so we need more processing here\n if (tree.tag === 'equalityMatch') {\n if (tree.value === '*') {\n tree.tag = 'present';\n } else {\n obj = parse_substr(tree);\n tree.initial = obj.initial;\n tree.any = obj.any;\n tree['final'] = obj['final'];\n tree.tag = obj.tag || tree.tag;\n tree.value = obj.value;\n esc = obj.esc;\n clean = obj.clean;\n }\n } else if (tree.tag == 'extensibleMatch') {\n split = tree.name.split(':');\n tree.extensible = {\n matchType: split[0],\n value: tree.value\n };\n\n switch (split.length) {\n case 1:\n break;\n case 2:\n if (split[1].toLowerCase() === 'dn') {\n tree.extensible.dnAttributes = true;\n } else {\n tree.extensible.rule = split[1];\n }\n break;\n case 3:\n tree.extensible.dnAttributes = true;\n tree.extensible.rule = split[2];\n break;\n default:\n throw new Error('Invalid extensible filter');\n }\n\n switch (tree.extensible.rule) {\n case '2.5.13.4':\n case 'caseIgnoreSubstringsMatch':\n tree.extensible.attribute = tree.extensible.matchType;\n obj = parse_substr(tree);\n tree.extensible.initial = obj.initial;\n tree.extensible.any = obj.any;\n tree.extensible['final'] = obj['final'];\n tree.value = obj.value;\n esc = obj.esc;\n clean = obj.clean;\n break;\n\n case '2.5.13.2':\n case 'caseIgnoreMatch':\n tree.extensible.attribute = tree.extensible.matchType;\n break;\n default:\n // noop\n break;\n }\n }\n }\n\n // Cleanup any escape sequences\n if (!clean) {\n\n for (i = 0; i < tree.value.length; i++) {\n c = tree.value[i];\n if (esc) {\n val += c;\n esc = false;\n } else if (c === '\\\\') {\n esc = true;\n } else {\n val += c;\n }\n }\n tree.value = val;\n }\n }\n\n return tree;\n}", "function filterKnowledge(d) {\n return (d.name.indexOf(\"abstr_\") === -1) && ((d.type === \"sub-knowledge graph\") || (d.type === \"node\") || (d.type === \"root\"));\n}", "function expand(rules, dictionary, start, expansion) {\n if (rules[start]) {\n let possibleRuleSet = rules[start];\n let pickedRuleSet = rita.randomItem(possibleRuleSet);\n for (let i = 0; i < pickedRuleSet.length; i++) {\n expand(rules, dictionary, pickedRuleSet[i], expansion);\n }\n } else {\n let possibleWords = dictionary[start];\n let pickedWord = rita.randomItem(possibleWords);\n expansion.push(pickedWord);\n }\n return expansion;\n}", "function CollectSubLabelsPrepare() {\n // @TODO cache in properties; refresh & replace in properties, but less often than main processing\n // @cache sha/hashCode/simpleSum of JSON.stringify(value)\n // However, how to cache long global filter? Max 9kB per property. -label:\n // Max. allowed search filter has around 1362 characters (or equivalent in bytes?): { (is:starred -label:ZZ-✸✸ {-is:starred in:trash} label:ZZ-✸✸) (has:yellow-star -label:ZZ-Y✸ {-has:yellow-star in:trash} label:ZZ-Y✸) (has:blue-star -label:ZZ-B✸ {-has:blue-star in:trash} label:ZZ-B✸) (has:red-star -label:ZZ-R✸ {-has:red-star in:trash} label:ZZ-R✸) (has:orange-star -label:ZZ-O✸ {-has:orange-star in:trash} label:ZZ-O✸) (has:green-star -label:ZZ-G✸ {-has:green-star in:trash} label:ZZ-G✸) (has:purple-star -label:ZZ-P✸ {-has:purple-star in:trash} label:ZZ-P✸) (has:red-bang -label:ZZ-R! {-has:red-bang in:trash} label:ZZ-R!) (has:yellow-bang -label:ZZ-Y! {-has:yellow-bang in:trash} label:ZZ-Y!) (has:blue-info -label:ZZ-Bi {-has:blue-info in:trash} label:ZZ-Bi) (has:orange-guillemet -label:ZZ-O- {-has:orange-guillemet in:trash} label:ZZ-O-) (has:green-check -label:ZZ-G✔ {-has:green-check in:trash} label:ZZ-G✔) (has:purple-question -label:ZZ-P? {-has:purple-question in:trash} label:ZZ-P?) (is:starred -label:ZZ-✸✸ {-is:starred in:trash} label:ZZ-✸✸) (has:yellow-star -label:ZZ-Y✸ {-has:yellow-star in:trash} label:ZZ-Y✸) (has:blue-star -label:ZZ-B✸ {-has:blue-star in:trash} label:ZZ-B✸) (has:red-star -label:ZZ-R✸ {-has:red-star in:trash} label:ZZ-R✸) (has:orange-star -label:ZZ-O✸ {-has:orange-star in:trash} label:ZZ-O✸) (has:green-star -label:ZZ-G✸ {-has:green-star in:trash} label:ZZ-G✸) bufobufobufobufobufobufobufobufobufobufobufob}\n var originalLabels= GmailApp.getUserLabels(); // When running max. 60x on the same day, this reached a quota: \"Service invoked too many times for one day: gmail\"\n var labelNames= [];\n var originalIndexes= {}; // string labelName -> int index to originalLabels[]\n for( var i=0; i<originalLabels.length; i++ ) {\n labelNames[i]= originalLabels[i].getName();\n originalIndexes[ labelNames[i] ]= i;\n }\n \n labelNames.sort();\n // For bottom to up collection, we need the deepest child labels first, then parents.\n labelNames= labelNames.reverse();\n \n var labels= [], indexes= {}; // see return statement\n for( var i=0; i<labelNames.length; i++ ) {\n labels[i]= originalLabels[ originalIndexes[ labelNames[i] ] ];\n indexes[ labelNames[i] ]= i;\n }\n \n var parentNames= {};\n var collectorLeafName= propertyValueOrNull('label-for-collector');\n if( collectorLeafName===null ) {\n Logger.log( 'No property label-for-collector. Hence no collecting of sublabels.' );\n return;\n }\n for( var i=0; i<labelNames.length; i++ ) {\n var potentialCollectorName= labelNames[i];\n \n var indexOfSlashCollectorLeafName= potentialCollectorName.indexOf( '/'+collectorLeafName );\n if( indexOfSlashCollectorLeafName>=0 && indexOfSlashCollectorLeafName===potentialCollectorName.length-1-collectorLeafName.length ) { // since there's no string.endsWith() in Google App Script\n var parentName= potentialCollectorName.substring( 0, indexOfSlashCollectorLeafName );\n if( !(parentName in indexes) ) {\n throw new Error( 'parent folder inconsistent: ' +parentName );\n }\n parentNames[ parentName ]= true;\n }\n }\n \n var directChildNames= {}; // see return statement\n for( var i=0; i<labelNames.length; i++ ) {\n var childName= labelNames[i];\n \n var indexOfLastSlash= childName.lastIndexOf( '/' );\n if( indexOfLastSlash>0 ) {\n var parentName= childName.substring( 0, indexOfLastSlash );\n \n if( parentName in parentNames ) { // Not all parents have a direct collector subfolder.\n \n if( !(parentName in directChildNames) ) {\n directChildNames[parentName]= [];\n }\n if( childName!==parentName+'/'+collectorLeafName ) { // exclude registering collector sublabel itself\n directChildNames[parentName].push( childName );\n }\n }\n }\n }\n // directChildNames includes parents with no other child than collector sublabel. Then directChildNames[parentName] is an empty array.\n return {\n labels: labels, // In reverse alphabetical order\n indexes: indexes, // string labelName -> int index to labels[]\n parentNames: parentNames, // label name for which a direct collector sublabel exists => true\n directChildNames: directChildNames, // parentName => array[ string directChildName1, directChildName2... ]. In the same order (reverse alphabetical).\n collectorLeafName: collectorLeafName\n };\n}", "function Rule(controller, rule, callback, name) {\n this.controller = controller;\n this.rule = rule\n this.callback = callback;\n this.name = name;\n this._infix = null;\n\t\tthis.history = [];\n \n // Cached copy of the recent most score\n this.recentScore = 0;\n \n // TODO: these functions might be useful\n // this.isEnabled = true;\n // this.disable = function() { this.isEnabled = false; return this; }\n // this.enable = function() { this.isEnabled = true; return this; }\n // this.destroy = function() { this.controller._rules.remove(this); }\n\t\t\n\t\tthis.eval = function(terms) {\n var output = this._infix.clone();\n var operators = [];\n \n while(output.length > 0) {\n var token = output.shift();\n \n\t\t\t\tif(token == 'not') {\n\t\t\t\t\tvar a = operators.pop();\n\t\t\t\t\tvar c = this.controller.operators.Negate(isNaN(a) ? terms[a] : a);\n\t\t\t\t\t\n\t\t\t\t\toperators.push(c);\n\t\t\t\n } else if(token == 'or' || token == 'and') {\n var a = operators.pop();\n var b = operators.pop();\n var c = null;\n \n if( isNaN(a) && isNaN(terms[a])) {\n throw new Error(\"Unknown term '\" + a + \"'.\");\n break;\n }\n \n if( isNaN(b) && isNaN(terms[b])) {\n throw new Error(\"Unknown term '\" + b + \"'.\");\n break;\n }\n \n // Use lookup if the variable is not a number.\n a = isNaN(a) ? terms[a] : a;\n b = isNaN(b) ? terms[b] : b;\n \n // Execute Zadeh operators\n if(token == 'or') {\n c = this.controller.operators.Or(a, b);\n } else {\n c = this.controller.operators.And(a, b);\n }\n \n // Push back into stack for next iteration.\n operators.push(c);\n } else {\n operators.push(token);\n }\n }\n \n\t\t\tvar last = operators.last();\n\t\t\t\n\t\t\t// Just incase the rule only has one variable.\n\t\t\tif(isNaN(last)) {\n\t\t\t\tlast = terms[last];\n\t\t\t} \n\t\t\t\n\t\t\tthis.history.push(last);\n\n\t\t\t// Trim to some maximum size. These\n\t\t\t// values are used for debug drawing.\n\t\t\twhile(this.history.length > 80) {\n\t\t\t\tthis.history.shift();\n\t\t\t}\n\t\t\t\n\t\t\treturn last;\n\t\t};\n }", "function parseRules() {\n\tqueries = {};\n\tvar sheets = document.styleSheets;\n\tvar rules;\n\tfor (var i = 0; i < sheets.length; i++) {\n\t\tif (sheets[i].disabled) {\n\t\t\tcontinue;\n\t\t}\n\t\ttry {\n\t\t\trules = sheets[i].cssRules;\n\t\t}\n\t\tcatch(e) {\n\t\t\tcontinue;\n\t\t}\n\t\tfor (var j = 0; j < rules.length; j++) {\n\t\t\tparseRule(rules[j]);\n\t\t}\n\t}\n}", "function evalRule(ruleNum){\n let reqRule = rules.get(ruleNum);\n if (reqRule.every(isNaN) && reqRule.find(e => e == '|') == undefined){return reqRule};\n reqRule = reqRule.map(value => {\n if (isNaN(value)){\n return value;\n }\n else {\n return evalRule(value);\n };\n });\n let orIndex = reqRule.findIndex(e => e == '|');\n if (orIndex != -1){\n if (orIndex == 2){\n reqRule.splice(0, 2, cartesian(reqRule[0], reqRule[1]));\n }\n orIndex = reqRule.findIndex(e => e == '|');\n if (reqRule.length - orIndex == 3){\n reqRule.splice(orIndex+1, 2, cartesian(reqRule[orIndex+1], reqRule[orIndex+2]));\n }\n orIndex = reqRule.findIndex(e => e == '|');\n }\n if (orIndex == -1){\n reqRule = cartesian(...reqRule)\n }\n if (orIndex == 1 && reqRule.length == 3){\n reqRule.splice(1,1)\n reqRule = reqRule.flat()\n }\n rules.set(ruleNum, reqRule);\n return reqRule\n}", "function showRule(rule)\n{\n dhtml.getElementById(\"name\").value = rule.rule_name.value;\n dhtml.getElementById(\"sequence\").value = rule.rule_sequence.value;\n\n\tvar processRule = false;\n\tif(rule.rule_state.value.indexOf(\"ST_EXIT_LEVEL\") > 0)\n\t\tprocessRule = true;\n\n\tdhtml.getElementById(\"stop_processing_more_rules\").checked = processRule;\n\n \n if(rule.rule_condition.restype && rule.rule_condition.restype.value == \"RES_AND\") {\n\t\t// first try the condition as a single condition (with multiple restrictions)\n\t\tif (showCondition(rule.rule_condition) == false){\n\t\t\t// it wasn't a single condition...\n\t for(var i=0; i< rule.rule_condition.restriction.length; i++) {\n\t\t if(showCondition(rule.rule_condition.restriction[i]) == false) {\n\t\t\t alert(_(\"Unable to load a rule condition\"));\n\t\t\t\t}\n\t }\n\t\t}\n } else {\n if(showCondition(rule.rule_condition) == false) {\n alert(_(\"Unable to show the rule condition\"));\n return false;\n }\n }\n \n if(rule.rule_actions.length != 1) {\n alert(_(\"Unable to show a rule with more than one action\"));\n return false;\n }\n \n if(showAction(rule.rule_actions[0], rule.rule_state) == false) {\n alert(_(\"Unable to show the rule action\"));\n return false;\n }\n}", "function ruleslanguage(hljs) {\n return {\n name: 'Oracle Rules Language',\n keywords: {\n keyword:\n 'BILL_PERIOD BILL_START BILL_STOP RS_EFFECTIVE_START RS_EFFECTIVE_STOP RS_JURIS_CODE RS_OPCO_CODE ' +\n 'INTDADDATTRIBUTE|5 INTDADDVMSG|5 INTDBLOCKOP|5 INTDBLOCKOPNA|5 INTDCLOSE|5 INTDCOUNT|5 ' +\n 'INTDCOUNTSTATUSCODE|5 INTDCREATEMASK|5 INTDCREATEDAYMASK|5 INTDCREATEFACTORMASK|5 ' +\n 'INTDCREATEHANDLE|5 INTDCREATEOVERRIDEDAYMASK|5 INTDCREATEOVERRIDEMASK|5 ' +\n 'INTDCREATESTATUSCODEMASK|5 INTDCREATETOUPERIOD|5 INTDDELETE|5 INTDDIPTEST|5 INTDEXPORT|5 ' +\n 'INTDGETERRORCODE|5 INTDGETERRORMESSAGE|5 INTDISEQUAL|5 INTDJOIN|5 INTDLOAD|5 INTDLOADACTUALCUT|5 ' +\n 'INTDLOADDATES|5 INTDLOADHIST|5 INTDLOADLIST|5 INTDLOADLISTDATES|5 INTDLOADLISTENERGY|5 ' +\n 'INTDLOADLISTHIST|5 INTDLOADRELATEDCHANNEL|5 INTDLOADSP|5 INTDLOADSTAGING|5 INTDLOADUOM|5 ' +\n 'INTDLOADUOMDATES|5 INTDLOADUOMHIST|5 INTDLOADVERSION|5 INTDOPEN|5 INTDREADFIRST|5 INTDREADNEXT|5 ' +\n 'INTDRECCOUNT|5 INTDRELEASE|5 INTDREPLACE|5 INTDROLLAVG|5 INTDROLLPEAK|5 INTDSCALAROP|5 INTDSCALE|5 ' +\n 'INTDSETATTRIBUTE|5 INTDSETDSTPARTICIPANT|5 INTDSETSTRING|5 INTDSETVALUE|5 INTDSETVALUESTATUS|5 ' +\n 'INTDSHIFTSTARTTIME|5 INTDSMOOTH|5 INTDSORT|5 INTDSPIKETEST|5 INTDSUBSET|5 INTDTOU|5 ' +\n 'INTDTOURELEASE|5 INTDTOUVALUE|5 INTDUPDATESTATS|5 INTDVALUE|5 STDEV INTDDELETEEX|5 ' +\n 'INTDLOADEXACTUAL|5 INTDLOADEXCUT|5 INTDLOADEXDATES|5 INTDLOADEX|5 INTDLOADEXRELATEDCHANNEL|5 ' +\n 'INTDSAVEEX|5 MVLOAD|5 MVLOADACCT|5 MVLOADACCTDATES|5 MVLOADACCTHIST|5 MVLOADDATES|5 MVLOADHIST|5 ' +\n 'MVLOADLIST|5 MVLOADLISTDATES|5 MVLOADLISTHIST|5 IF FOR NEXT DONE SELECT END CALL ABORT CLEAR CHANNEL FACTOR LIST NUMBER ' +\n 'OVERRIDE SET WEEK DISTRIBUTIONNODE ELSE WHEN THEN OTHERWISE IENUM CSV INCLUDE LEAVE RIDER SAVE DELETE ' +\n 'NOVALUE SECTION WARN SAVE_UPDATE DETERMINANT LABEL REPORT REVENUE EACH ' +\n 'IN FROM TOTAL CHARGE BLOCK AND OR CSV_FILE RATE_CODE AUXILIARY_DEMAND ' +\n 'UIDACCOUNT RS BILL_PERIOD_SELECT HOURS_PER_MONTH INTD_ERROR_STOP SEASON_SCHEDULE_NAME ' +\n 'ACCOUNTFACTOR ARRAYUPPERBOUND CALLSTOREDPROC GETADOCONNECTION GETCONNECT GETDATASOURCE ' +\n 'GETQUALIFIER GETUSERID HASVALUE LISTCOUNT LISTOP LISTUPDATE LISTVALUE PRORATEFACTOR RSPRORATE ' +\n 'SETBINPATH SETDBMONITOR WQ_OPEN BILLINGHOURS DATE DATEFROMFLOAT DATETIMEFROMSTRING ' +\n 'DATETIMETOSTRING DATETOFLOAT DAY DAYDIFF DAYNAME DBDATETIME HOUR MINUTE MONTH MONTHDIFF ' +\n 'MONTHHOURS MONTHNAME ROUNDDATE SAMEWEEKDAYLASTYEAR SECOND WEEKDAY WEEKDIFF YEAR YEARDAY ' +\n 'YEARSTR COMPSUM HISTCOUNT HISTMAX HISTMIN HISTMINNZ HISTVALUE MAXNRANGE MAXRANGE MINRANGE ' +\n 'COMPIKVA COMPKVA COMPKVARFROMKQKW COMPLF IDATTR FLAG LF2KW LF2KWH MAXKW POWERFACTOR ' +\n 'READING2USAGE AVGSEASON MAXSEASON MONTHLYMERGE SEASONVALUE SUMSEASON ACCTREADDATES ' +\n 'ACCTTABLELOAD CONFIGADD CONFIGGET CREATEOBJECT CREATEREPORT EMAILCLIENT EXPBLKMDMUSAGE ' +\n 'EXPMDMUSAGE EXPORT_USAGE FACTORINEFFECT GETUSERSPECIFIEDSTOP INEFFECT ISHOLIDAY RUNRATE ' +\n 'SAVE_PROFILE SETREPORTTITLE USEREXIT WATFORRUNRATE TO TABLE ACOS ASIN ATAN ATAN2 BITAND CEIL ' +\n 'COS COSECANT COSH COTANGENT DIVQUOT DIVREM EXP FABS FLOOR FMOD FREPM FREXPN LOG LOG10 MAX MAXN ' +\n 'MIN MINNZ MODF POW ROUND ROUND2VALUE ROUNDINT SECANT SIN SINH SQROOT TAN TANH FLOAT2STRING ' +\n 'FLOAT2STRINGNC INSTR LEFT LEN LTRIM MID RIGHT RTRIM STRING STRINGNC TOLOWER TOUPPER TRIM ' +\n 'NUMDAYS READ_DATE STAGING',\n built_in:\n 'IDENTIFIER OPTIONS XML_ELEMENT XML_OP XML_ELEMENT_OF DOMDOCCREATE DOMDOCLOADFILE DOMDOCLOADXML ' +\n 'DOMDOCSAVEFILE DOMDOCGETROOT DOMDOCADDPI DOMNODEGETNAME DOMNODEGETTYPE DOMNODEGETVALUE DOMNODEGETCHILDCT ' +\n 'DOMNODEGETFIRSTCHILD DOMNODEGETSIBLING DOMNODECREATECHILDELEMENT DOMNODESETATTRIBUTE ' +\n 'DOMNODEGETCHILDELEMENTCT DOMNODEGETFIRSTCHILDELEMENT DOMNODEGETSIBLINGELEMENT DOMNODEGETATTRIBUTECT ' +\n 'DOMNODEGETATTRIBUTEI DOMNODEGETATTRIBUTEBYNAME DOMNODEGETBYNAME'\n },\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'literal',\n variants: [\n { // looks like #-comment\n begin: '#\\\\s+',\n relevance: 0\n },\n {\n begin: '#[a-zA-Z .]+'\n }\n ]\n }\n ]\n };\n}", "function ruleslanguage(hljs) {\n return {\n name: 'Oracle Rules Language',\n keywords: {\n keyword:\n 'BILL_PERIOD BILL_START BILL_STOP RS_EFFECTIVE_START RS_EFFECTIVE_STOP RS_JURIS_CODE RS_OPCO_CODE ' +\n 'INTDADDATTRIBUTE|5 INTDADDVMSG|5 INTDBLOCKOP|5 INTDBLOCKOPNA|5 INTDCLOSE|5 INTDCOUNT|5 ' +\n 'INTDCOUNTSTATUSCODE|5 INTDCREATEMASK|5 INTDCREATEDAYMASK|5 INTDCREATEFACTORMASK|5 ' +\n 'INTDCREATEHANDLE|5 INTDCREATEOVERRIDEDAYMASK|5 INTDCREATEOVERRIDEMASK|5 ' +\n 'INTDCREATESTATUSCODEMASK|5 INTDCREATETOUPERIOD|5 INTDDELETE|5 INTDDIPTEST|5 INTDEXPORT|5 ' +\n 'INTDGETERRORCODE|5 INTDGETERRORMESSAGE|5 INTDISEQUAL|5 INTDJOIN|5 INTDLOAD|5 INTDLOADACTUALCUT|5 ' +\n 'INTDLOADDATES|5 INTDLOADHIST|5 INTDLOADLIST|5 INTDLOADLISTDATES|5 INTDLOADLISTENERGY|5 ' +\n 'INTDLOADLISTHIST|5 INTDLOADRELATEDCHANNEL|5 INTDLOADSP|5 INTDLOADSTAGING|5 INTDLOADUOM|5 ' +\n 'INTDLOADUOMDATES|5 INTDLOADUOMHIST|5 INTDLOADVERSION|5 INTDOPEN|5 INTDREADFIRST|5 INTDREADNEXT|5 ' +\n 'INTDRECCOUNT|5 INTDRELEASE|5 INTDREPLACE|5 INTDROLLAVG|5 INTDROLLPEAK|5 INTDSCALAROP|5 INTDSCALE|5 ' +\n 'INTDSETATTRIBUTE|5 INTDSETDSTPARTICIPANT|5 INTDSETSTRING|5 INTDSETVALUE|5 INTDSETVALUESTATUS|5 ' +\n 'INTDSHIFTSTARTTIME|5 INTDSMOOTH|5 INTDSORT|5 INTDSPIKETEST|5 INTDSUBSET|5 INTDTOU|5 ' +\n 'INTDTOURELEASE|5 INTDTOUVALUE|5 INTDUPDATESTATS|5 INTDVALUE|5 STDEV INTDDELETEEX|5 ' +\n 'INTDLOADEXACTUAL|5 INTDLOADEXCUT|5 INTDLOADEXDATES|5 INTDLOADEX|5 INTDLOADEXRELATEDCHANNEL|5 ' +\n 'INTDSAVEEX|5 MVLOAD|5 MVLOADACCT|5 MVLOADACCTDATES|5 MVLOADACCTHIST|5 MVLOADDATES|5 MVLOADHIST|5 ' +\n 'MVLOADLIST|5 MVLOADLISTDATES|5 MVLOADLISTHIST|5 IF FOR NEXT DONE SELECT END CALL ABORT CLEAR CHANNEL FACTOR LIST NUMBER ' +\n 'OVERRIDE SET WEEK DISTRIBUTIONNODE ELSE WHEN THEN OTHERWISE IENUM CSV INCLUDE LEAVE RIDER SAVE DELETE ' +\n 'NOVALUE SECTION WARN SAVE_UPDATE DETERMINANT LABEL REPORT REVENUE EACH ' +\n 'IN FROM TOTAL CHARGE BLOCK AND OR CSV_FILE RATE_CODE AUXILIARY_DEMAND ' +\n 'UIDACCOUNT RS BILL_PERIOD_SELECT HOURS_PER_MONTH INTD_ERROR_STOP SEASON_SCHEDULE_NAME ' +\n 'ACCOUNTFACTOR ARRAYUPPERBOUND CALLSTOREDPROC GETADOCONNECTION GETCONNECT GETDATASOURCE ' +\n 'GETQUALIFIER GETUSERID HASVALUE LISTCOUNT LISTOP LISTUPDATE LISTVALUE PRORATEFACTOR RSPRORATE ' +\n 'SETBINPATH SETDBMONITOR WQ_OPEN BILLINGHOURS DATE DATEFROMFLOAT DATETIMEFROMSTRING ' +\n 'DATETIMETOSTRING DATETOFLOAT DAY DAYDIFF DAYNAME DBDATETIME HOUR MINUTE MONTH MONTHDIFF ' +\n 'MONTHHOURS MONTHNAME ROUNDDATE SAMEWEEKDAYLASTYEAR SECOND WEEKDAY WEEKDIFF YEAR YEARDAY ' +\n 'YEARSTR COMPSUM HISTCOUNT HISTMAX HISTMIN HISTMINNZ HISTVALUE MAXNRANGE MAXRANGE MINRANGE ' +\n 'COMPIKVA COMPKVA COMPKVARFROMKQKW COMPLF IDATTR FLAG LF2KW LF2KWH MAXKW POWERFACTOR ' +\n 'READING2USAGE AVGSEASON MAXSEASON MONTHLYMERGE SEASONVALUE SUMSEASON ACCTREADDATES ' +\n 'ACCTTABLELOAD CONFIGADD CONFIGGET CREATEOBJECT CREATEREPORT EMAILCLIENT EXPBLKMDMUSAGE ' +\n 'EXPMDMUSAGE EXPORT_USAGE FACTORINEFFECT GETUSERSPECIFIEDSTOP INEFFECT ISHOLIDAY RUNRATE ' +\n 'SAVE_PROFILE SETREPORTTITLE USEREXIT WATFORRUNRATE TO TABLE ACOS ASIN ATAN ATAN2 BITAND CEIL ' +\n 'COS COSECANT COSH COTANGENT DIVQUOT DIVREM EXP FABS FLOOR FMOD FREPM FREXPN LOG LOG10 MAX MAXN ' +\n 'MIN MINNZ MODF POW ROUND ROUND2VALUE ROUNDINT SECANT SIN SINH SQROOT TAN TANH FLOAT2STRING ' +\n 'FLOAT2STRINGNC INSTR LEFT LEN LTRIM MID RIGHT RTRIM STRING STRINGNC TOLOWER TOUPPER TRIM ' +\n 'NUMDAYS READ_DATE STAGING',\n built_in:\n 'IDENTIFIER OPTIONS XML_ELEMENT XML_OP XML_ELEMENT_OF DOMDOCCREATE DOMDOCLOADFILE DOMDOCLOADXML ' +\n 'DOMDOCSAVEFILE DOMDOCGETROOT DOMDOCADDPI DOMNODEGETNAME DOMNODEGETTYPE DOMNODEGETVALUE DOMNODEGETCHILDCT ' +\n 'DOMNODEGETFIRSTCHILD DOMNODEGETSIBLING DOMNODECREATECHILDELEMENT DOMNODESETATTRIBUTE ' +\n 'DOMNODEGETCHILDELEMENTCT DOMNODEGETFIRSTCHILDELEMENT DOMNODEGETSIBLINGELEMENT DOMNODEGETATTRIBUTECT ' +\n 'DOMNODEGETATTRIBUTEI DOMNODEGETATTRIBUTEBYNAME DOMNODEGETBYNAME'\n },\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'literal',\n variants: [\n { // looks like #-comment\n begin: '#\\\\s+',\n relevance: 0\n },\n {\n begin: '#[a-zA-Z .]+'\n }\n ]\n }\n ]\n };\n}", "function rule_def(peg_parser, tree_obj){\n\t\t//console.log(tree_obj);\n\t\tvar rule_name = tree_obj.rule_name.value;\n\t\tif (tree_obj.term === undefined){\n\t\t\tthrow \"Rule \" + rule_name + \" has no associated term.\";\n\t\t}\n\t\tpeg_parser.rule(rule_name, \n\t\t\tterm(peg_parser, tree_obj.term)\n\t\t);\n\t}", "static validateRequiredContent(node, rules) {\n if (!rules || rules.length === 0) {\n return [];\n }\n return rules.filter((tagName) => {\n const haveMatchingChild = node.childElements.some((child) => child.is(tagName));\n return !haveMatchingChild;\n });\n }", "static validateRequiredContent(node, rules) {\n if (!rules || rules.length === 0) {\n return [];\n }\n return rules.filter((tagName) => {\n const haveMatchingChild = node.childElements.some((child) => child.is(tagName));\n return !haveMatchingChild;\n });\n }", "preprocess(graph, graphFold = \"editor\", nest = \"no\") {\n\n // Prepare graph\n graph.unfold();\n if(graphFold == \"evidence\") {\n graph.fold_evidence();\n } else if(graphFold == \"editor\") {\n graph.fold_go_noctua(this.relations_collapsible)\n }\n\n\n // Get a list of all the singletons we start with.\n var all_starting_singletons_by_id = {};\n var sings = graph.get_singleton_nodes();\n for(let sing of sings) {\n all_starting_singletons_by_id[sing.id()] = true;\n }\n\n\n // Remove all of the undesireable rels.\n var parent_trap = {};\n var note_sink = {}; // keep the reverse lookup info of parent_trap\n if( nest && nest === 'yes' ){\n // console.log('adding nestable rels');\n this.relations_nestable[\"BFO:0000050\"] = true; // part of\n }\n\n for(let e of graph.all_edges()) {\n if(this.relations_nestable.hasOwnProperty(e.predicate_id())) {\n if(!parent_trap.hasOwnProperty(e.subject_id())) {\n parent_trap[e.subject_id()] = [];\n }\n parent_trap[e.subject_id()].push(e.object_id());\n // Note the object for later checking.\n note_sink[e.object_id()] = true;\n }\n // if(this.relations_strippable.hasOwnProperty(e.predicate_id())) {\n // graph.remove_edge(e.subject_id(),\n // e.object_id(),\n // e.predicate_id());\n // }\n }\n\n\n // If it wasn't a singleton before we started, but is one now,\n // remove it. In \"nest\" mode, only remove ones that are not\n // going to be nested.\n var eings = graph.get_singleton_nodes();\n for(let eing of eings) {\n if(!all_starting_singletons_by_id.hasOwnProperty(eing.id())) {\n if( nest && nest === 'yes' && note_sink[eing.id()] ){\n // pass\n }else{\n graph.remove_node(eing.id());\n }\n }\n };\n\n let cat_set = new Set();\n for(let enode of this.bbopGraph.all_nodes()) {\n for(let in_type of enode.types()) {\n cat_set.add(in_type.category());\n }\n }\n this.categories = Array.from(cat_set); \n }", "function Rules(options) {\n this.options = options;\n this._keep = [];\n this._remove = [];\n\n this.blankRule = {\n replacement: options.blankReplacement\n };\n\n this.keepReplacement = options.keepReplacement;\n\n this.defaultRule = {\n replacement: options.defaultReplacement\n };\n\n this.array = [];\n for (var key in options.rules) {\n this.array.push(options.rules[key]);\n }\n }", "function evaluateRules() {\n var triplesAdded = false;\n var triplesBefore = _statementCount();\n do {\n triplesAdded = false;\n // Iterate and execute rules. Break if any triples are added\n for (var i = 0; i < _rules.length && !triplesAdded; i++) {\n _store.execute(\n getPrefixesForSparql() + _rules[i].construct,\n function(success, graph) {\n if (success) {\n if (graph.length > 0) {\n console.log('Rule ' + _rules[i].rule + ' +' + graph.length);\n _store.insert(graph, function() {});\n triplesAdded = true;\n }\n }\n else\n console.log(\"Failed to execute rule \" + _rules[i].rule);\n }\n );\n }\n }\n while (triplesAdded);\n triplesAdded = _statementCount() - triplesBefore;\n console.log(\"Rule entailment evaluation: \" + triplesBefore + \" + \" + triplesAdded + \" = \" + (triplesBefore+triplesAdded));\n }", "function rules(x, aux, i, j) {\n\t\n\t\tvar t = 0;\n\t\t\n\t\tt += x[i-1][j-1];\n\t\tt += x[i][j-1];\n\t\tt += x[i+1][j-1];\n\t\tt += x[i-1][j];\n\t\tt += x[i+1][j];\n\t\tt += x[i-1][j+1];\n\t\tt += x[i][j+1];\n\t\tt += x[i+1][j+1];\n\n\t\tif(x[i][j] == 1) {\n\t\t\t\n\t\t\tif(t < 2 || t > 4)\n\t\t\t\taux[i][j] = 0;\n\t\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tif(t == 3)\n\t\t\t\taux[i][j] = 1;\n\t\t}\n\t}", "function parseRule(rule) {\n var sections = [];\n if (!( typeof rule == 'string' || rule instanceof String)) {\n tracery.addError(\"Cannot parse non-string rule \" + rule);\n return;\n }\n\n if (rule.length === 0) {\n return [];\n }\n\n var lvl = 0;\n var start = 0;\n var inTag = false;\n\n function createSection(end) {\n var section = rule.substring(start, end);\n if (section.length > 0) {\n if (inTag)\n sections.push(parseTag(section));\n else\n sections.push(section);\n }\n inTag = !inTag;\n start = end + 1;\n\n }\n\n for (var i = 0; i < rule.length; i++) {\n var c = rule.charAt(i);\n\n switch(c) {\n case '[':\n lvl++;\n break;\n case ']':\n lvl--;\n break;\n case '#':\n if (lvl === 0) {\n createSection(i);\n }\n break;\n default:\n break;\n\n }\n\n }\n\n if (lvl > 0) {\n var error = \"Too many '[' in rule \" + inQuotes(rule);\n tracery.addError(error);\n console.warn(error);\n return;\n }\n\n if (lvl < 0) {\n var error = \"Too many ']' in rule \" + inQuotes(rule);\n tracery.addError(error);\n console.warn(error);\n return;\n }\n\n if (inTag) {\n var error = \"Odd number of '#' in rule \" + inQuotes(rule);\n tracery.addError(error);\n console.warn(error);\n return;\n }\n\n createSection(rule.length);\n\n return sections;\n }", "initRules(setRequiredRules = false) {\n let rules = {}\n\n Object.keys(this.setNewItemFields()).map((Key) => {\n if (Key === 'translatables') {\n this.setNewItemFields()[Key].map((key) => {\n // generate translatable rules\n rules[key] = Object.fromEntries(this.getLocalesList().map(locale => {\n let rules = [\n () => !this.remoteErrors[key] || !this.remoteErrors[key][locale] || this.remoteErrors[key][locale][0]\n ]\n\n if (locale === this.getDefaultLocale() && setRequiredRules) {\n rules.unshift(val => !!val || this.errorMessages.required)\n }\n\n return [locale, rules]\n }, [this, key]))\n }, this)\n } else {\n this.setNewItemFields()[Key].map((key) => {\n // generate rules\n if (key !== 'id') {\n rules[key] = []\n if (setRequiredRules) {\n rules[key].push(val => !!val || this.errorMessages.required)\n }\n rules[key].push(() => !this.remoteErrors[key] || this.remoteErrors[key][0])\n }\n }, Key)\n }\n }, this)\n\n return rules\n }", "static validateOrder(children, rules, cb) {\n if (!rules) {\n return true;\n }\n let i = 0;\n let prev = null;\n for (const node of children) {\n const old = i;\n while (rules[i] && !Validator.validatePermittedCategory(node, rules[i])) {\n i++;\n }\n if (i >= rules.length) {\n /* Second check is if the order is specified for this element at all. It\n * will be unspecified in two cases:\n * - disallowed elements\n * - elements where the order doesn't matter\n * In both of these cases no error should be reported. */\n const orderSpecified = rules.find((cur) => Validator.validatePermittedCategory(node, cur));\n if (orderSpecified) {\n cb(node, prev);\n return false;\n }\n /* if this element has unspecified order the index is restored so new\n * elements of the same type can be specified again */\n i = old;\n }\n prev = node;\n }\n return true;\n }", "function matchRule(s, rule){\n\tvar len = rule ? rule.length: 0; \n\tif (len === 0)\n\t\treturn false;\n\tvar _s = s, idx = 0;\n\tif (!IX.isEmpty(rule[0])){\n\t\tidx = _s.indexOf(rule[0]);\n\t\tif (idx !== 0) \n\t\t\treturn false;\n\t\t_s = _s.substring(rule[0].length);\n\t}\n\tfor (var i=1; i<len; i++){\n\t\tif (IX.isEmpty(rule[i]))\n\t\t\tcontinue;\n\t\tidx = _s.indexOf(rule[i]);\n\t\tif (idx < 0) \n\t\t\treturn false;\n\t\t_s = _s.substring(idx+ rule[i].length);\n\t}\n\treturn true;\n}", "static validateOrder(children, rules, cb) {\n if (!rules) {\n return true;\n }\n let i = 0;\n let prev = null;\n for (const node of children) {\n const old = i;\n while (rules[i] && !Validator.validatePermittedCategory(node, rules[i], true)) {\n i++;\n }\n if (i >= rules.length) {\n /* Second check is if the order is specified for this element at all. It\n * will be unspecified in two cases:\n * - disallowed elements\n * - elements where the order doesn't matter\n * In both of these cases no error should be reported. */\n const orderSpecified = rules.find((cur) => Validator.validatePermittedCategory(node, cur, true));\n if (orderSpecified) {\n cb(node, prev);\n return false;\n }\n /* if this element has unspecified order the index is restored so new\n * elements of the same type can be specified again */\n i = old;\n }\n prev = node;\n }\n return true;\n }", "constructor(schema, rules) {\n this.schema = schema;\n this.rules = rules;\n this.tags = [];\n this.styles = [];\n rules.forEach((rule) => {\n if (rule.tag)\n this.tags.push(rule);\n else if (rule.style)\n this.styles.push(rule);\n });\n this.normalizeLists = !this.tags.some((r) => {\n if (!/^(ul|ol)\\b/.test(r.tag) || !r.node)\n return false;\n let node = schema.nodes[r.node];\n return node.contentMatch.matchType(node);\n });\n }", "function makePredicate(words, name, byFirstCharCode) {\n /*jslint plusplus: true, evil: true, unparam: true*/\n /*jshint unused: true*/\n var f = \"\\n\",\n cats = [],\n i,\n j,\n cat,\n skipPush,\n tab = \" \";\n if (!(words instanceof Array)) {\n words = words.split(\" \");\n }\n if (!byFirstCharCode) {\n for (i = 0; i < words.length; ++i) {\n skipPush = false;\n for (j = 0; j < cats.length; ++j) {\n if (cats[j][0].length === words[i].length) {\n cats[j].push(words[i]);\n skipPush = true;\n break;\n }\n }\n if (!skipPush) {\n cats.push([words[i]]);\n }\n }\n }\n function compareTo(arr, tabbing, byFirstCharCode) {\n tabbing = tabbing || \"\";\n if (arr.length === 1) {\n f += tabbing + \"return str === \" + JSON.stringify(arr[0]) + \";\\n\";\n return f;\n }\n f += tabbing + \"switch (str\" + (byFirstCharCode ? \".charCodeAt(0)\" : \"\") + \") {\\n\";\n for (j = 0; j < arr.length; ++j) {\n f += tabbing + \"case \" + (byFirstCharCode ? arr[j].charCodeAt(0) : JSON.stringify(arr[j])) + \":\\n\";\n }\n f += tabbing + \" return true;\\n\" + tabbing + \"}\\n\" + tabbing + \"return false;\\n\";\n }\n // When there are more than three length categories, an outer\n // switch first dispatches on the length,s to save on comparisons.\n if (cats.length > 3) {\n cats.sort(function (a, b) {\n return b.length - a.length;\n });\n f += tab + \"switch (str.length) {\\n\";\n for (i = 0; i < cats.length; ++i) {\n cat = cats[i];\n f += tab + \"case \" + cat[0].length + \":\\n\";\n compareTo(cat, tab + tab);\n }\n f += tab + \"}\\n\";\n // Otherwise, simply generate a flat `switch` statement.\n } else {\n compareTo(words, tab, byFirstCharCode);\n }\n\n return new Function(\"str\", f);\n }", "function buildRuleData(rule) {\n var ruleData = {\n keySet : {},\n keyPrefixes : [],\n keySuffixes : [],\n\n pathSet : {},\n pathPrefixes : [],\n pathSuffixes : [],\n\n regularExpressions : [],\n };\n\n var i;\n if (rule.keys) {\n for (i = 0; i < rule.keys.length; i++) {\n ruleData.keySet[rule.keys[i]] = true;\n }\n }\n ruleData.keyPrefixes = rule.key_prefixes || [];\n ruleData.keySuffixes = rule.key_suffixes || [];\n\n if (rule.paths) {\n for (i = 0; i < rule.paths.length; i++) {\n ruleData.pathSet[rule.paths[i]] = true;\n }\n }\n ruleData.pathPrefixes = rule.path_prefixes || [];\n ruleData.pathSuffixes = rule.path_suffixes || [];\n\n if (rule.regular_expressions) {\n for (i = 0; i < rule.regular_expressions.length; i++) {\n ruleData.regularExpressions.push(new RegExp(rule.regular_expressions[i]));\n }\n }\n return ruleData;\n}", "getTree() {\n\n var result = ['cond',\n this.predicate.getTree(),\n this.consequent.getTree(),\n ];\n\n if (this.alternate) {\n result.push(this.alternate.getTree());\n }\n\n return result;\n }", "function program(peg_parser, tree_obj){\n\t\t// process the start rule definition\n\t\trule_def(peg_parser, tree_obj.start_rule_def);\n\t\t\n\t\t// process the other rule definition\n\t\tfor (i = 0; i < tree_obj.rule_def.length; i++){\n\t\t\trule_def(peg_parser, tree_obj.rule_def[i]);\n\t\t}\n\t\t// get the name of the start rule \n\t\t// and return an application function for this rule\n\t\treturn peg_parser.rule(tree_obj.start_rule_def.rule_name.value);\n\t}", "function cnf1(expr) {\n const _ = expr;\n if (_.type === \"or\") {\n if (_.lhs.type === \"and\")\n return and(cnf1(or(_.rhs, _.lhs.rhs)), or(_.rhs, _.lhs.lhs));\n if (_.rhs.type === \"and\")\n return and(cnf1(or(_.lhs, _.rhs.lhs)), or(_.lhs, _.rhs.rhs));\n if (_.lhs.type === \"or\") return or(cnf1(_.lhs), cnf1(_.rhs));\n if (_.rhs.type === \"or\") return or(cnf1(_.lhs), cnf1(_.rhs));\n }\n\n if (_.type === \"and\") return and(cnf1(_.lhs), cnf1(_.rhs));\n\n return expr;\n}", "function ruleslanguage(hljs) {\n return {\n name: 'Oracle Rules Language',\n keywords: {\n keyword: 'BILL_PERIOD BILL_START BILL_STOP RS_EFFECTIVE_START RS_EFFECTIVE_STOP RS_JURIS_CODE RS_OPCO_CODE ' +\n 'INTDADDATTRIBUTE|5 INTDADDVMSG|5 INTDBLOCKOP|5 INTDBLOCKOPNA|5 INTDCLOSE|5 INTDCOUNT|5 ' +\n 'INTDCOUNTSTATUSCODE|5 INTDCREATEMASK|5 INTDCREATEDAYMASK|5 INTDCREATEFACTORMASK|5 ' +\n 'INTDCREATEHANDLE|5 INTDCREATEOVERRIDEDAYMASK|5 INTDCREATEOVERRIDEMASK|5 ' +\n 'INTDCREATESTATUSCODEMASK|5 INTDCREATETOUPERIOD|5 INTDDELETE|5 INTDDIPTEST|5 INTDEXPORT|5 ' +\n 'INTDGETERRORCODE|5 INTDGETERRORMESSAGE|5 INTDISEQUAL|5 INTDJOIN|5 INTDLOAD|5 INTDLOADACTUALCUT|5 ' +\n 'INTDLOADDATES|5 INTDLOADHIST|5 INTDLOADLIST|5 INTDLOADLISTDATES|5 INTDLOADLISTENERGY|5 ' +\n 'INTDLOADLISTHIST|5 INTDLOADRELATEDCHANNEL|5 INTDLOADSP|5 INTDLOADSTAGING|5 INTDLOADUOM|5 ' +\n 'INTDLOADUOMDATES|5 INTDLOADUOMHIST|5 INTDLOADVERSION|5 INTDOPEN|5 INTDREADFIRST|5 INTDREADNEXT|5 ' +\n 'INTDRECCOUNT|5 INTDRELEASE|5 INTDREPLACE|5 INTDROLLAVG|5 INTDROLLPEAK|5 INTDSCALAROP|5 INTDSCALE|5 ' +\n 'INTDSETATTRIBUTE|5 INTDSETDSTPARTICIPANT|5 INTDSETSTRING|5 INTDSETVALUE|5 INTDSETVALUESTATUS|5 ' +\n 'INTDSHIFTSTARTTIME|5 INTDSMOOTH|5 INTDSORT|5 INTDSPIKETEST|5 INTDSUBSET|5 INTDTOU|5 ' +\n 'INTDTOURELEASE|5 INTDTOUVALUE|5 INTDUPDATESTATS|5 INTDVALUE|5 STDEV INTDDELETEEX|5 ' +\n 'INTDLOADEXACTUAL|5 INTDLOADEXCUT|5 INTDLOADEXDATES|5 INTDLOADEX|5 INTDLOADEXRELATEDCHANNEL|5 ' +\n 'INTDSAVEEX|5 MVLOAD|5 MVLOADACCT|5 MVLOADACCTDATES|5 MVLOADACCTHIST|5 MVLOADDATES|5 MVLOADHIST|5 ' +\n 'MVLOADLIST|5 MVLOADLISTDATES|5 MVLOADLISTHIST|5 IF FOR NEXT DONE SELECT END CALL ABORT CLEAR CHANNEL FACTOR LIST NUMBER ' +\n 'OVERRIDE SET WEEK DISTRIBUTIONNODE ELSE WHEN THEN OTHERWISE IENUM CSV INCLUDE LEAVE RIDER SAVE DELETE ' +\n 'NOVALUE SECTION WARN SAVE_UPDATE DETERMINANT LABEL REPORT REVENUE EACH ' +\n 'IN FROM TOTAL CHARGE BLOCK AND OR CSV_FILE RATE_CODE AUXILIARY_DEMAND ' +\n 'UIDACCOUNT RS BILL_PERIOD_SELECT HOURS_PER_MONTH INTD_ERROR_STOP SEASON_SCHEDULE_NAME ' +\n 'ACCOUNTFACTOR ARRAYUPPERBOUND CALLSTOREDPROC GETADOCONNECTION GETCONNECT GETDATASOURCE ' +\n 'GETQUALIFIER GETUSERID HASVALUE LISTCOUNT LISTOP LISTUPDATE LISTVALUE PRORATEFACTOR RSPRORATE ' +\n 'SETBINPATH SETDBMONITOR WQ_OPEN BILLINGHOURS DATE DATEFROMFLOAT DATETIMEFROMSTRING ' +\n 'DATETIMETOSTRING DATETOFLOAT DAY DAYDIFF DAYNAME DBDATETIME HOUR MINUTE MONTH MONTHDIFF ' +\n 'MONTHHOURS MONTHNAME ROUNDDATE SAMEWEEKDAYLASTYEAR SECOND WEEKDAY WEEKDIFF YEAR YEARDAY ' +\n 'YEARSTR COMPSUM HISTCOUNT HISTMAX HISTMIN HISTMINNZ HISTVALUE MAXNRANGE MAXRANGE MINRANGE ' +\n 'COMPIKVA COMPKVA COMPKVARFROMKQKW COMPLF IDATTR FLAG LF2KW LF2KWH MAXKW POWERFACTOR ' +\n 'READING2USAGE AVGSEASON MAXSEASON MONTHLYMERGE SEASONVALUE SUMSEASON ACCTREADDATES ' +\n 'ACCTTABLELOAD CONFIGADD CONFIGGET CREATEOBJECT CREATEREPORT EMAILCLIENT EXPBLKMDMUSAGE ' +\n 'EXPMDMUSAGE EXPORT_USAGE FACTORINEFFECT GETUSERSPECIFIEDSTOP INEFFECT ISHOLIDAY RUNRATE ' +\n 'SAVE_PROFILE SETREPORTTITLE USEREXIT WATFORRUNRATE TO TABLE ACOS ASIN ATAN ATAN2 BITAND CEIL ' +\n 'COS COSECANT COSH COTANGENT DIVQUOT DIVREM EXP FABS FLOOR FMOD FREPM FREXPN LOG LOG10 MAX MAXN ' +\n 'MIN MINNZ MODF POW ROUND ROUND2VALUE ROUNDINT SECANT SIN SINH SQROOT TAN TANH FLOAT2STRING ' +\n 'FLOAT2STRINGNC INSTR LEFT LEN LTRIM MID RIGHT RTRIM STRING STRINGNC TOLOWER TOUPPER TRIM ' +\n 'NUMDAYS READ_DATE STAGING',\n built_in: 'IDENTIFIER OPTIONS XML_ELEMENT XML_OP XML_ELEMENT_OF DOMDOCCREATE DOMDOCLOADFILE DOMDOCLOADXML ' +\n 'DOMDOCSAVEFILE DOMDOCGETROOT DOMDOCADDPI DOMNODEGETNAME DOMNODEGETTYPE DOMNODEGETVALUE DOMNODEGETCHILDCT ' +\n 'DOMNODEGETFIRSTCHILD DOMNODEGETSIBLING DOMNODECREATECHILDELEMENT DOMNODESETATTRIBUTE ' +\n 'DOMNODEGETCHILDELEMENTCT DOMNODEGETFIRSTCHILDELEMENT DOMNODEGETSIBLINGELEMENT DOMNODEGETATTRIBUTECT ' +\n 'DOMNODEGETATTRIBUTEI DOMNODEGETATTRIBUTEBYNAME DOMNODEGETBYNAME'\n },\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'literal',\n variants: [\n {begin: '#\\\\s+[a-zA-Z\\\\ \\\\.]*', relevance: 0}, // looks like #-comment\n {begin: '#[a-zA-Z\\\\ \\\\.]+'}\n ]\n }\n ]\n };\n}", "function ruleslanguage(hljs) {\n return {\n name: 'Oracle Rules Language',\n keywords: {\n keyword: 'BILL_PERIOD BILL_START BILL_STOP RS_EFFECTIVE_START RS_EFFECTIVE_STOP RS_JURIS_CODE RS_OPCO_CODE ' +\n 'INTDADDATTRIBUTE|5 INTDADDVMSG|5 INTDBLOCKOP|5 INTDBLOCKOPNA|5 INTDCLOSE|5 INTDCOUNT|5 ' +\n 'INTDCOUNTSTATUSCODE|5 INTDCREATEMASK|5 INTDCREATEDAYMASK|5 INTDCREATEFACTORMASK|5 ' +\n 'INTDCREATEHANDLE|5 INTDCREATEOVERRIDEDAYMASK|5 INTDCREATEOVERRIDEMASK|5 ' +\n 'INTDCREATESTATUSCODEMASK|5 INTDCREATETOUPERIOD|5 INTDDELETE|5 INTDDIPTEST|5 INTDEXPORT|5 ' +\n 'INTDGETERRORCODE|5 INTDGETERRORMESSAGE|5 INTDISEQUAL|5 INTDJOIN|5 INTDLOAD|5 INTDLOADACTUALCUT|5 ' +\n 'INTDLOADDATES|5 INTDLOADHIST|5 INTDLOADLIST|5 INTDLOADLISTDATES|5 INTDLOADLISTENERGY|5 ' +\n 'INTDLOADLISTHIST|5 INTDLOADRELATEDCHANNEL|5 INTDLOADSP|5 INTDLOADSTAGING|5 INTDLOADUOM|5 ' +\n 'INTDLOADUOMDATES|5 INTDLOADUOMHIST|5 INTDLOADVERSION|5 INTDOPEN|5 INTDREADFIRST|5 INTDREADNEXT|5 ' +\n 'INTDRECCOUNT|5 INTDRELEASE|5 INTDREPLACE|5 INTDROLLAVG|5 INTDROLLPEAK|5 INTDSCALAROP|5 INTDSCALE|5 ' +\n 'INTDSETATTRIBUTE|5 INTDSETDSTPARTICIPANT|5 INTDSETSTRING|5 INTDSETVALUE|5 INTDSETVALUESTATUS|5 ' +\n 'INTDSHIFTSTARTTIME|5 INTDSMOOTH|5 INTDSORT|5 INTDSPIKETEST|5 INTDSUBSET|5 INTDTOU|5 ' +\n 'INTDTOURELEASE|5 INTDTOUVALUE|5 INTDUPDATESTATS|5 INTDVALUE|5 STDEV INTDDELETEEX|5 ' +\n 'INTDLOADEXACTUAL|5 INTDLOADEXCUT|5 INTDLOADEXDATES|5 INTDLOADEX|5 INTDLOADEXRELATEDCHANNEL|5 ' +\n 'INTDSAVEEX|5 MVLOAD|5 MVLOADACCT|5 MVLOADACCTDATES|5 MVLOADACCTHIST|5 MVLOADDATES|5 MVLOADHIST|5 ' +\n 'MVLOADLIST|5 MVLOADLISTDATES|5 MVLOADLISTHIST|5 IF FOR NEXT DONE SELECT END CALL ABORT CLEAR CHANNEL FACTOR LIST NUMBER ' +\n 'OVERRIDE SET WEEK DISTRIBUTIONNODE ELSE WHEN THEN OTHERWISE IENUM CSV INCLUDE LEAVE RIDER SAVE DELETE ' +\n 'NOVALUE SECTION WARN SAVE_UPDATE DETERMINANT LABEL REPORT REVENUE EACH ' +\n 'IN FROM TOTAL CHARGE BLOCK AND OR CSV_FILE RATE_CODE AUXILIARY_DEMAND ' +\n 'UIDACCOUNT RS BILL_PERIOD_SELECT HOURS_PER_MONTH INTD_ERROR_STOP SEASON_SCHEDULE_NAME ' +\n 'ACCOUNTFACTOR ARRAYUPPERBOUND CALLSTOREDPROC GETADOCONNECTION GETCONNECT GETDATASOURCE ' +\n 'GETQUALIFIER GETUSERID HASVALUE LISTCOUNT LISTOP LISTUPDATE LISTVALUE PRORATEFACTOR RSPRORATE ' +\n 'SETBINPATH SETDBMONITOR WQ_OPEN BILLINGHOURS DATE DATEFROMFLOAT DATETIMEFROMSTRING ' +\n 'DATETIMETOSTRING DATETOFLOAT DAY DAYDIFF DAYNAME DBDATETIME HOUR MINUTE MONTH MONTHDIFF ' +\n 'MONTHHOURS MONTHNAME ROUNDDATE SAMEWEEKDAYLASTYEAR SECOND WEEKDAY WEEKDIFF YEAR YEARDAY ' +\n 'YEARSTR COMPSUM HISTCOUNT HISTMAX HISTMIN HISTMINNZ HISTVALUE MAXNRANGE MAXRANGE MINRANGE ' +\n 'COMPIKVA COMPKVA COMPKVARFROMKQKW COMPLF IDATTR FLAG LF2KW LF2KWH MAXKW POWERFACTOR ' +\n 'READING2USAGE AVGSEASON MAXSEASON MONTHLYMERGE SEASONVALUE SUMSEASON ACCTREADDATES ' +\n 'ACCTTABLELOAD CONFIGADD CONFIGGET CREATEOBJECT CREATEREPORT EMAILCLIENT EXPBLKMDMUSAGE ' +\n 'EXPMDMUSAGE EXPORT_USAGE FACTORINEFFECT GETUSERSPECIFIEDSTOP INEFFECT ISHOLIDAY RUNRATE ' +\n 'SAVE_PROFILE SETREPORTTITLE USEREXIT WATFORRUNRATE TO TABLE ACOS ASIN ATAN ATAN2 BITAND CEIL ' +\n 'COS COSECANT COSH COTANGENT DIVQUOT DIVREM EXP FABS FLOOR FMOD FREPM FREXPN LOG LOG10 MAX MAXN ' +\n 'MIN MINNZ MODF POW ROUND ROUND2VALUE ROUNDINT SECANT SIN SINH SQROOT TAN TANH FLOAT2STRING ' +\n 'FLOAT2STRINGNC INSTR LEFT LEN LTRIM MID RIGHT RTRIM STRING STRINGNC TOLOWER TOUPPER TRIM ' +\n 'NUMDAYS READ_DATE STAGING',\n built_in: 'IDENTIFIER OPTIONS XML_ELEMENT XML_OP XML_ELEMENT_OF DOMDOCCREATE DOMDOCLOADFILE DOMDOCLOADXML ' +\n 'DOMDOCSAVEFILE DOMDOCGETROOT DOMDOCADDPI DOMNODEGETNAME DOMNODEGETTYPE DOMNODEGETVALUE DOMNODEGETCHILDCT ' +\n 'DOMNODEGETFIRSTCHILD DOMNODEGETSIBLING DOMNODECREATECHILDELEMENT DOMNODESETATTRIBUTE ' +\n 'DOMNODEGETCHILDELEMENTCT DOMNODEGETFIRSTCHILDELEMENT DOMNODEGETSIBLINGELEMENT DOMNODEGETATTRIBUTECT ' +\n 'DOMNODEGETATTRIBUTEI DOMNODEGETATTRIBUTEBYNAME DOMNODEGETBYNAME'\n },\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'literal',\n variants: [\n {begin: '#\\\\s+[a-zA-Z\\\\ \\\\.]*', relevance: 0}, // looks like #-comment\n {begin: '#[a-zA-Z\\\\ \\\\.]+'}\n ]\n }\n ]\n };\n}", "function matchStyleRules(ref) {\n var styleRules = ref.styleRules;\n var styleGroupName = ref.styleGroupName;\n var styleGroupPrefix = ref.styleGroupPrefix;\n\n var rule = styleRules.find(function (rule) { return styleGroupName === (styleGroupPrefix + \"_\" + (rule.id)); });\n var name;\n var priority = styleRules.length;\n var tgFilter;\n if (rule) {\n name = rule.name;\n priority = styleRules.findIndex(function (rule) { return styleGroupName === (styleGroupPrefix + \"_\" + (rule.id)); });\n tgFilter = makeFilter(rule); // create the Tangram filter for this style rule\n }\n return { name: name, tgFilter: tgFilter, priority: priority };\n }", "function normalize(rule) {\n // TODO:\n}", "function normalizeClauses (conf) {\n const output = {};\n const validPath = Object.keys(conf).filter(path => Array.isArray(conf[path]));\n validPath.forEach(path => {\n const validClauses = conf[path].filter(c => c.value !== '');\n if (validClauses.length) {\n output[path] = validClauses;\n }\n });\n return output;\n}", "function normalizeClauses (conf) {\n const output = {};\n const validPath = Object.keys(conf).filter(path => Array.isArray(conf[path]));\n validPath.forEach(path => {\n const validClauses = conf[path].filter(c => c.value !== '');\n if (validClauses.length) {\n output[path] = validClauses;\n }\n });\n return output;\n}", "function applyRule(node, rule) {\n switch(rule) {\n case 'idempotence':\n return idempotenceRule(node);\n break;\n case 'commutativity':\n return commutativityRule(node);\n break;\n case 'associativity':\n return associativityRule(node);\n break;\n case 'absorption':\n return absorptionRule(node);\n break;\n case 'distributivity':\n return distributivityRule(node);\n break;\n case 'negation':\n return negationRule(node);\n break;\n case 'double negation':\n return doubleNegationRule(node);\n break;\n case 'de Morgan':\n return deMorganRule(node);\n break;\n case 'implication':\n return implicationRule(node);\n case 'bi-implication':\n return biImplicationRule(node);\n break;\n }\n}", "function generateRules (subject, workflow) {\n const subjectRules = subject ? metadataToRules(subject.metadata) : {}\n const workflowRules = workflow ? getFeedbackFromTasks(workflow.tasks) : {}\n const canonicalRules = {}\n\n forEach(workflowRules, (rules, taskId) => {\n const taskRules = reduce(rules, (result, workflowRule) => {\n const matchingSubjectRule = find(subjectRules, (subjectRule) => {\n if ((subjectRule.id !== null && subjectRule.id !== undefined) &&\n (workflowRule.id !== null && workflowRule.id !== undefined)) {\n return subjectRule.id.toString() === workflowRule.id.toString()\n } else {\n if (process.browser) {\n console.warn('Feedback: Subject rule id or workflow rule id is null or undefined')\n }\n return false\n }\n })\n\n if (matchingSubjectRule) {\n const ruleStrategy = workflowRule.strategy\n const ruleGenerator = strategies[ruleStrategy].createRule\n return result.concat([ruleGenerator(matchingSubjectRule, workflowRule)])\n } else {\n return result\n }\n }, [])\n\n if (taskRules.length) {\n canonicalRules[taskId] = taskRules\n }\n })\n\n return canonicalRules\n}", "_validateValue() {\n const that = this,\n maxConditions = that.maxConditions,\n maxConditionsPerGroup = that.maxConditionsPerGroup,\n maxLevel = that.maxLevel;\n let totalConditions = 0;\n\n if (maxConditions === null && maxConditionsPerGroup === null && maxLevel === null) {\n return;\n }\n\n const value = that.value,\n finalResult = [];\n\n function isCondition(structure) {\n return structure.length === 3 && typeof structure[0] === 'string' && typeof structure[1] === 'string';\n }\n\n function process(structure, level, result) {\n let conditionsPerGroup = 0;\n\n structure.forEach(item => {\n if (Array.isArray(item)) {\n if (isCondition(item)) {\n // condition\n if (maxConditions !== null && maxConditions === totalConditions ||\n maxConditionsPerGroup !== null && maxConditionsPerGroup === conditionsPerGroup) {\n return;\n }\n\n result.push(item);\n conditionsPerGroup++;\n totalConditions++;\n }\n else {\n // inner group\n if (maxLevel !== null && maxLevel === level + 1) {\n return;\n }\n\n const group = [];\n\n result.push(group);\n process(item, level + 1, group);\n }\n }\n else {\n // operator\n result.push(item);\n }\n });\n }\n\n process(value, 0, finalResult);\n that.value = finalResult;\n }", "applyReductionRule() {\n // console.log('applyReductionRule() ' + this.id);\n if (this.branches.hasEqualBranches()) {\n this.ensureNotDeleted('applyReductionRule');\n const keepBranch = this.branches.getBranch('0');\n // move own parents to keepBranch\n const ownParents = this.parents.getAll();\n ownParents.forEach(parent => {\n // console.log('ownParent: ' + parent.id);\n const branchKey = parent.branches.getKeyOfNode(this);\n parent.branches.setBranch(branchKey, keepBranch);\n // remove parents from own list\n // this will auto-remove the connection to the other '1'-branch\n this.parents.remove(parent);\n // if parent has now two equal branches,\n // we have to apply the reduction again\n // to ensure we end in a valid state\n if (parent.branches.areBranchesStrictEqual() && parent.isInternalNode()) {\n parent.applyReductionRule();\n }\n });\n return true;\n }\n return false;\n }", "constructor(tokenizer, rules, main) {\n super(tokenizer)\n this.rules = {}\n this.main = main\n for(var r in rules) this.add(rules[r])\n \n }", "static getRules(required = false) {\n let rules = {\n sender_id: '',\n receiver_id: '',\n message: 'string|min:10'\n }\n\n if (required) {\n for (let key of Object.keys(rules)) {\n rules[key] = 'required|' + rules[key]\n }\n }\n\n return rules\n }", "static rules(){ \n return [\n new JXONObj(null),\n new JXONList(null),\n new JXONValue(null),\n new JXONAttribute(null)\n ]\n }", "blank(predicate, object) {\n let children = predicate,\n child,\n length;\n // Empty blank node\n if (predicate === undefined) children = [];\n // Blank node passed as blank(Term(\"predicate\"), Term(\"object\"))\n else if (predicate.termType) children = [{\n predicate: predicate,\n object: object\n }];\n // Blank node passed as blank({ predicate: predicate, object: object })\n else if (!('length' in predicate)) children = [predicate];\n switch (length = children.length) {\n // Generate an empty blank node\n case 0:\n return new SerializedTerm('[]');\n // Generate a non-nested one-triple blank node\n case 1:\n child = children[0];\n if (!(child.object instanceof SerializedTerm)) return new SerializedTerm(`[ ${this._encodePredicate(child.predicate)} ${this._encodeObject(child.object)} ]`);\n // Generate a multi-triple or nested blank node\n default:\n let contents = '[';\n // Write all triples in order\n for (let i = 0; i < length; i++) {\n child = children[i];\n // Write only the object is the predicate is the same as the previous\n if (child.predicate.equals(predicate)) contents += `, ${this._encodeObject(child.object)}`;\n // Otherwise, write the predicate and the object\n else {\n contents += `${(i ? ';\\n ' : '\\n ') + this._encodePredicate(child.predicate)} ${this._encodeObject(child.object)}`;\n predicate = child.predicate;\n }\n }\n return new SerializedTerm(`${contents}\\n]`);\n }\n }", "function ruleUnary() {\n\tvar node;\n\tvar tmp;\n\n\tif (accept(\"LX_MINUS\")) {\n\t node = {name:_curr.name, children:[]};\n\t node.children.push({name:\"LX_NUMBER\", val:0});\n\t shift();\n\t if (!(tmp = ruleBase()))\n\t\treturn (false);\n\t node.children.push(tmp);\n\t} else if (accept([\"LX_LNOT\", \"LX_NOT\"])) {\n\t node = {name:_curr.name, children:[]};\n\t shift();\n\t if (!(tmp = ruleBase()))\n\t\treturn (false);\n\t node.children.push(tmp);\n\t} else if (accept([\"LX_INC\", \"LX_DEC\"])) {\n\t node = {name:_curr.name, children:[]};\n\t shift();\n\t if (!expect(\"LX_ID\"))\n\t\treturn (false);\n\t node.children.push({name:_curr.name, val:_curr.val});\n\t shift();\n\t} else {\n\t if (accept(\"LX_PLUS\"))\n\t\tshift();\n\t if (!(node = ruleBase()))\n\t\treturn (false);\n\t}\n\treturn (node);\n }" ]
[ "0.5730491", "0.5643694", "0.5642104", "0.5623241", "0.5623241", "0.5518166", "0.5371532", "0.5254762", "0.5253165", "0.5227837", "0.5227837", "0.5223675", "0.520918", "0.51946497", "0.5175023", "0.5145094", "0.5109946", "0.5072813", "0.50580895", "0.50543267", "0.5037683", "0.5032426", "0.5030658", "0.50104934", "0.50009817", "0.4995513", "0.49940428", "0.49739766", "0.4917328", "0.49036103", "0.4898471", "0.48963386", "0.48963386", "0.4887333", "0.48800987", "0.48774025", "0.48662165", "0.48562354", "0.48497143", "0.48487663", "0.48482662", "0.48472732", "0.4843557", "0.4837411", "0.48227197", "0.48184842", "0.4813831", "0.48120037", "0.4781073", "0.47806138", "0.47616404", "0.4758922", "0.47556797", "0.4755373", "0.4750873", "0.47490737", "0.47478932", "0.47472295", "0.47380927", "0.47376743", "0.47337058", "0.4726918", "0.47125715", "0.47006348", "0.4689332", "0.46891817", "0.46850502", "0.46850502", "0.46765894", "0.4670033", "0.4670033", "0.466585", "0.4663745", "0.46627927", "0.46566", "0.4652886", "0.464938", "0.46480352", "0.46460718", "0.4645071", "0.46353984", "0.46323645", "0.46318755", "0.46271625", "0.46161425", "0.46065494", "0.46053246", "0.46053246", "0.45979726", "0.45651788", "0.4560339", "0.4560339", "0.45587346", "0.45520803", "0.4549149", "0.45479092", "0.45457092", "0.45454988", "0.45427775", "0.45360816", "0.45336676" ]
0.0
-1
TODO: Reimplement this in 1.0 for if (ignoreUpdate) return true;
function check(rule) { var handled = rule($injector, $location); if (!handled) return false; if (isString(handled)) $location.replace().url(handled); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shouldUpdate(_changedProperties){return!0}", "shouldUpdate(e){return!0}", "static postUpdate() {\n return false;\n }", "checkUpdate() {\n if (this.updating === true) return false\n this.hasChanged = false\n const _entityList = this.entity_items.getEntitieslist()\n if (this.hassEntities && this.hassEntities.length && this._hass) {\n this.hassEntities = _entityList\n .map((x) => this._hass.states[x.entity])\n .filter((notUndefined) => notUndefined !== undefined)\n this.hasChanged = this.entity_items.hasChanged(this.hassEntities)\n if (this.hasChanged) {\n /**\n * refresh and update the graph\n */\n this.updateGraph(true)\n }\n }\n return this.hasChanged\n }", "checkUpdate() {\n if (this.updating === true) return false\n this.hasChanged = false\n const _entityList = this.entity_items.getEntitieslist()\n if (this.hassEntities && this.hassEntities.length && this._hass) {\n this.hassEntities = _entityList\n .map((x) => this._hass.states[x.entity])\n .filter((notUndefined) => notUndefined !== undefined)\n this.hasChanged = this.entity_items.hasChanged(this.hassEntities)\n if (this.hasChanged) {\n /**\n * refresh and update the graph\n */\n this.updateGraph(true)\n }\n }\n return this.hasChanged\n }", "shouldUpdate(_changedProperties){return true;}", "shouldComponentUpdate() {\n // FIXME: Not tested\n if (+new Date() - this.lastUpdate <= 32) {\n this.lastUpdate = +new Date()\n clearTimeout(this.updateTimer)\n return true\n } else {\n this.updateTimer = setTimeout(() => {\n this.forceUpdate()\n }, 100)\n }\n return false\n }", "checkUpdate() {\n if (this.updating === true) return false\n // check if we has changes\n if (this.hassEntities && this.hassEntities.length && this._hass) {\n this.hasChanged = false\n // reload the hass entities\n this.hassEntities = this.entities\n .map((x) => this._hass.states[x.entity])\n .filter((notUndefined) => notUndefined !== undefined)\n\n // check for update and set the entity state last and update flag\n for (let entity of this.entities) {\n const h = this.hassEntities.find((x) => x.entity_id === entity.entity)\n entity.laststate = entity.state\n entity.update = false\n if (h && entity.last_changed !== h.last_changed && entity.state !== h.state) {\n entity.last_changed = h.last_changed\n entity.state = h.state\n entity.update = true\n this.hasChanged = true\n }\n }\n\n if (this.hasChanged) {\n // refresh and update the graph\n this.updateGraph(true)\n }\n return this.hasChanged\n }\n }", "check_update(value) { return (this.value != value); }", "shouldComponentUpdate(next_props){\n if (!next_props.update){\n return false;\n }\n return true;\n }", "shouldComponentUpdate() {\n\t\treturn false;\n\t}", "shouldUpdate() {\n //should update if not render before\n if (!this._lastRender) {\n return true;\n }\n // make sure this have no side effect to this component\n const html = this.getTemplate().call(this, (this.getData()));\n return (html != this._lastRender.html) || !this._isSameMountPoint(this.getMountPoint(), this._lastRender.mountPoint);\n }", "get canUpdate() {\n return this._canUpdate;\n }", "shouldUpdate(_changedProperties) {\n return true;\n }", "shouldUpdate(_changedProperties) {\n return true;\n }", "shouldUpdate(_changedProperties) {\n return true;\n }", "shouldUpdate(_changedProperties) {\n return true;\n }", "shouldComponentUpdate() {\n if (this.lastUpdatedAt) {\n const diff = new Date().valueOf() - this.lastUpdatedAt;\n const shouldRender = diff > 1000;\n\n if (!shouldRender && !this.forceRenderTimer) {\n this.forceRenderTimer = setTimeout(() => {\n this.forceUpdate();\n this.forceRenderTimer = null;\n }, 1000 - diff);\n }\n return shouldRender;\n } else {\n return true;\n }\n }", "shouldComponentUpdate() {\n if (this.lastUpdatedAt) {\n const diff = new Date().valueOf() - this.lastUpdatedAt;\n const shouldRender = diff > 1000;\n\n if (!shouldRender && !this.forceRenderTimer) {\n this.forceRenderTimer = setTimeout(() => {\n this.forceUpdate();\n this.forceRenderTimer = null;\n }, 1000 - diff);\n }\n return shouldRender;\n } else {\n return true;\n }\n }", "validateUpdate(selector){\n for(const update of this.#updateCollection){\n if(update.selector === selector){\n return true\n }\n }\n return false\n }", "shouldUpdate() {\n return this.active;\n }", "function manuallyCheckForUpdate() {\r\n\tcheckForUpdate(true);\r\n} //End manual update check", "mapShouldUpdate() {\n var difference = + new Date() - Global.lastRefreshTimestamp;\n\n if (difference < Config.REFRESH_THRESHOLD) {\n return false;\n }\n\n return true;\n }", "_checkUpdateIsAble () {\n function error (parameter) {\n throw new Error (`Parameter '${parameter}' is forbidden in UPDATE query`)\n }\n if (this._selectStr.length > 1) error('only')\n if (this._orderStr) error('orderBy')\n if (this._limitStr) error('limit')\n if (this._offsetStr) error('offset')\n return true\n }", "shouldComponentUpdate(nxtProps, nxtState) {\n const { data, loading } = this.props;\n if (data.length > 0 && !loading) {\n return false;\n }\n return true;\n }", "isDirty() {\r\n\r\n // resume\r\n return false;\r\n }", "validateBeforeUpdate (id, newData, prevData) { return true }", "shouldSendReminderUpdate() {\n const d = new Date();\n const revisedOffset = d.valueOf() - this.updatedAt.valueOf();\n if (revisedOffset < 183 * 24 * 3600 * 1000) { // if not revised during 6 months\n return false;\n }\n if (this.remindedUpdate) {\n const remindedOffset = d.valueOf() - this.remindedUpdate.valueOf();\n if (remindedOffset < 183 * 24 * 3600 * 1000) {\n return false;\n }\n }\n return true;\n }", "function shouldRunUpdater(vni, isStale) { \n // TODO: May add different policies in the future.\n return (!isStale) && haveAllInputs(vni) && dataIsGood(vni);\n}", "shouldUpdate(_changedProperties) {\n return true;\n }", "enableUpdating(_requestedUpdate) {\n }", "checkAndUpdate() {\n console.log(\"sub class must implement checkAndUpdate function\");\n return false;\n }", "isModified() {\n return this.wasModified;\n }", "updateHook() {\n return true;\n }", "shouldComponentUpdate() {\n return false;\n }", "update_server(){\n return this.get_value()!=this.properties.value\n }", "cancelUpdate() {\n let addon = addonFor(this);\n if (addon._updateCheck) {\n addon._updateCheck.cancel();\n return true;\n }\n return false;\n }", "isModified() {\n if (!this.head) return Promise.resolve(true);\n return Promise.resolve(this.state.isModified); // return Promise.resolve(this.state.hash !== this.head.hash);\n }", "function hasFeedUpdated(feed, jFeed) {\r\n // if the feed isn't updated then we don't need to do anything\r\n if (feed.updated != \"\" && jFeed.updated != \"\" && feed.updated === jFeed.updated) {\r\n return false;\r\n }\r\n\r\n feed.updated = jFeed.updated;\r\n return true;\r\n}", "shouldComponentUpdate(){\n\t\tconsole.log('Should component update')\n\t\treturn true;\n\t}", "hasChanged() {\n return this.cacheHasChanged;\n }", "function validateLiveUpdates() {\n const current = new Date();\n const currentDate = current.toISOString().slice(0, 10);\n\n if (formData[\"liveUpdating\"]\n && currentDate > formData[\"enddatetime\"]) {\n return false;\n }\n\n return true;\n }", "function shouldUpdate (entity) {\n if (!entity.dirty) return false\n if (!entity.component.shouldUpdate) return true\n var nextProps = entity.pendingProps\n var nextState = entity.pendingState\n var bool = entity.component.shouldUpdate(entity.context, nextProps, nextState)\n return bool\n }", "get allowIndexUpdate() {\n return this.props.url != null\n }", "isConsistent() {\n return !this.inconsistentAt;\n }", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "async __enqueueUpdate() {\n this.isUpdatePending = true;\n try {\n await this.__updatePromise;\n } catch (e) {\n Promise.reject(e);\n }\n const result2 = this.scheduleUpdate();\n if (result2 != null) {\n await result2;\n }\n return !this.isUpdatePending;\n }", "function shouldUpdate (entity) {\n\t if (!entity.dirty) return false\n\t if (!entity.component.shouldUpdate) return true\n\t var nextProps = entity.pendingProps\n\t var nextState = entity.pendingState\n\t var bool = entity.component.shouldUpdate(entity.context, nextProps, nextState)\n\t return bool\n\t }", "get canUpdate() {\n return super.canUpdate || this.canUpdateProjectBindings;\n }", "isExisting(): boolean {\n return this.existing;\n }", "shouldUpdate(_changedProperties) {\n return super.shouldUpdate();\n }", "function confirmChanges() {\r\n return (isChanged ||\r\n isPageDataChanged());\r\n}", "function commandHasChanges() {\n if (jumbotronIsOpen) {\n if (document.getElementById(\"commitChanges\").disabled) {\n //no changes\n return false;\n } else {\n //changes\n return true;\n }\n } else {\n return false;\n }\n}", "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "function isUpdateOperator(op) {\n return UPDATE_OPERATORS.indexOf(op) >= 0;\n}", "async _enqueueUpdate(){this._updateState=this._updateState|STATE_UPDATE_REQUESTED;try{// Ensure any previous update has resolved before updating.\n// This `await` also ensures that property changes are batched.\nawait this._updatePromise;}catch(e){// Ignore any previous errors. We only care that the previous cycle is\n// done. Any error should have been handled in the previous update.\n}const result=this.performUpdate();// If `performUpdate` returns a Promise, we await it. This is done to\n// enable coordinating updates with a scheduler. Note, the result is\n// checked to avoid delaying an additional microtask unless we need to.\nif(result!=null){await result;}return !this._hasRequestedUpdate;}", "_updateIsDirty() {\n if (!this.hasRendered) return;\n\n const commentContent = this.getCommentContent();\n const attachmentsElement = this.shadowRoot.querySelector('mr-upload');\n this.isDirty = !isEmptyObject(this.delta) || Boolean(commentContent) ||\n attachmentsElement.hasAttachments;\n }", "shouldComponentUpdate(newProps) {\n let componentShouldUpdate = false;\n\n if (this.props.polls && newProps.polls) {\n if (this.props.polls.length !== newProps.polls.length) {\n return true;\n }\n\n this.props.polls.map((poll, key) => {\n if (poll._id !== newProps.polls[key]._id) {\n componentShouldUpdate = true;\n }\n });\n } else {\n return true;\n }\n\n return componentShouldUpdate;\n }", "function _check_if_exist_change(){\n try{\n if(win.action_for_custom_report == 'add_job_custom_report'){\n return true;\n }\n var is_make_changed = false;\n if(_is_make_changed){\n is_make_changed = true;\n }\n return is_make_changed;\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _check_if_exist_change');\n return false; \n } \n }", "shouldComponentUpdate(newProps, newState) {\n // console.log(\"=========================> shouldComponentUpdate\", newProps, newState);\n return true;\n }", "shouldRerender(newProps) {\n if (newProps.disabled !== this.props.disabled) return true\n // TODO: we should still detect when the document has changed,\n // see https://github.com/substance/substance/issues/543\n return false\n }", "shouldRerender(newProps) {\n if (newProps.disabled !== this.props.disabled) return true\n // TODO: we should still detect when the document has changed,\n // see https://github.com/substance/substance/issues/543\n return false\n }", "shouldComponentUpdate (...args) {\n return shouldComponentUpdate.apply(this, args)\n }", "shouldComponentUpdate(newProps) {\n return this.props.patientID !== newProps.patientID;\n // return true;\n }", "isEncrypted() {\n return this.getRecentUpdate().is_encrypted;\n }", "willUpdate() {\n }", "isDirtyFromRelationships(model, cached, relDiff) {\n return relDiff.length > 0;\n }", "get hasPersistableChanges() {\n return this.isPersistable && !ObjectHelper.isEmpty(this.rawModificationData);\n }", "forceUpdate() {\n return this._startUpdate();\n }", "function judgeDataIsModified(){\r\n \tif(changeDateTxt.getValue()!=changeDateTxtCopy){\r\n \t\treturn false;\r\n \t}\r\n \tif(endInfoType.getValue()!=endInfoTypeCopy){\r\n \t\treturn false;\r\n \t}\r\n \tif(reasonLift.getValue()!=reasonLiftCopy){\r\n \t\treturn false;\r\n \t}\r\n \tif(fileGoWhere.getValue()!=fileGoWhereCopy){\r\n \t\treturn false;\r\n \t}\r\n \tif(relationInsure.getValue()!=relationInsureCopy){\r\n \t\treturn false;\r\n \t}\r\n \tif(txtAreaEndMemo.getValue()!=txtAreaEndMemoCopy){\r\n \t\treturn false;\r\n \t}\r\n \treturn true;\r\n \t\r\n }", "static updated (elem, previousProps) {\n // The 'previousProps' will be undefined if it is the initial render.\n if (!previousProps) {\n return true;\n }\n\n // The 'previousProps' will always contain all of the keys.\n //\n // Use classic loop because:\n // 'for ... in' skips symbols and 'for ... of' is not working yet with IE!?\n // for (let nameOrSymbol of getPropNamesAndSymbols(previousProps)) {\n const namesAndSymbols = getPropNamesAndSymbols(previousProps);\n for (let i = 0; i < namesAndSymbols.length; i++) {\n const nameOrSymbol = namesAndSymbols[i];\n\n // With Object.is NaN is equal to NaN\n if (!objectIs(previousProps[nameOrSymbol], elem[nameOrSymbol])) {\n return true;\n }\n }\n\n return false;\n }", "static updated (elem, previousProps) {\n // The 'previousProps' will be undefined if it is the initial render.\n if (!previousProps) {\n return true;\n }\n\n // The 'previousProps' will always contain all of the keys.\n //\n // Use classic loop because:\n // 'for ... in' skips symbols and 'for ... of' is not working yet with IE!?\n // for (let nameOrSymbol of getPropNamesAndSymbols(previousProps)) {\n const namesAndSymbols = getPropNamesAndSymbols(previousProps);\n for (let i = 0; i < namesAndSymbols.length; i++) {\n const nameOrSymbol = namesAndSymbols[i];\n\n // With Object.is NaN is equal to NaN\n if (!objectIs(previousProps[nameOrSymbol], elem[nameOrSymbol])) {\n return true;\n }\n }\n\n return false;\n }", "wasModelUpdated() {\n return !_.isEqual(this.baseModel, this.model)\n }", "function qe(t, e) {\n return void 0 !== t.updateTime ? e instanceof rn && e.version.isEqual(t.updateTime) : void 0 === t.exists || t.exists === e instanceof rn;\n}", "shouldComponentUpdate (nextProps, nextState) {\n return nextState.update;\n }", "hasChanged() {\n return this.__changed;\n }", "isUpdatePossible(timecard){\n let flag = true;\n\n if(timecard != null){\n let temp_timecard = companydata.getTimecard(timecard.timecard_id);\n let tempEmp_id = temp_timecard.emp_id;\n let allTimecards = companydata.getAllTimecard(tempEmp_id);\n allTimecards.forEach(tc => {\n if (this.prepareTimecardDate(timecard.start_time) == this.prepareTimecardDate(tc.start_time)) {\n if(timecard.timecard_id != tc.timecard_id){\n flag = false;\n }\n }\n });\n }\n return flag;\n }", "needsUpdate() {\n // Call subclass lifecycle method\n return (\n this.internalState.needsUpdate ||\n this.hasUniformTransition() ||\n this.shouldUpdateState(this._getUpdateParams())\n );\n // End lifecycle method\n }", "async update() {\n this.emit('updating');\n for (let retry = 0; retry < UPDATE_RETRIES; retry++) {\n Log('update:', retry);\n try {\n if (await this.connect()) {\n await this.read();\n return true;\n }\n }\n catch (e) {\n Log(e);\n Log('error during update');\n this._validated = false;\n this.detach();\n }\n }\n return false;\n }", "function confirmChanges() {\r\n return isChanged;\r\n}", "shouldComponentUpdate(newProps, newState) {\n return (\n (JSON.stringify(this.state) != JSON.stringify(newState))\n || (JSON.stringify(this.props)) != JSON.stringify(newProps)\n );\n }", "function returnTrue() {\n\t\t\treturn true;\n\t\t}", "function returnTrue() {\n\t\t\treturn true;\n\t\t}", "function returnTrue() {\n\t\t\treturn true;\n\t\t}", "function returnTrue() {\n\t\t\treturn true;\n\t\t}", "shouldComponentUpdate(){\n if(this.props.debug)console.log(\"Child - shouldComponentUpdate\");\n return false; // this ensures parent render wont render this component\n }", "shouldComponentUpdate() {\n return false;\n }", "shouldComponentUpdate() {\n return false;\n }" ]
[ "0.7105626", "0.7050719", "0.69493055", "0.682208", "0.682208", "0.67618763", "0.67406535", "0.66837424", "0.66770184", "0.66511285", "0.66488194", "0.66349554", "0.66027045", "0.65562", "0.651765", "0.651765", "0.651765", "0.6485472", "0.6485472", "0.64641124", "0.64309895", "0.63779324", "0.637407", "0.6354364", "0.6353251", "0.6307344", "0.6304351", "0.6302951", "0.62679315", "0.62637407", "0.6263714", "0.62626743", "0.6259511", "0.6259476", "0.62590486", "0.62558544", "0.62429416", "0.62341416", "0.6233797", "0.62311727", "0.6217562", "0.62170696", "0.6213118", "0.6212218", "0.619981", "0.6195173", "0.6195173", "0.6195173", "0.6195173", "0.6195173", "0.6195173", "0.6195173", "0.6195173", "0.6195173", "0.6195138", "0.61924046", "0.61905676", "0.6171737", "0.61592263", "0.6154373", "0.6152441", "0.61414903", "0.61414903", "0.61414903", "0.61414903", "0.61414903", "0.61414903", "0.61367685", "0.61309946", "0.6118932", "0.6117964", "0.6115483", "0.6104293", "0.60976696", "0.60976696", "0.6094198", "0.6086417", "0.6070259", "0.606918", "0.6061194", "0.60554", "0.6048153", "0.60475075", "0.60442823", "0.60442823", "0.603908", "0.603687", "0.6036109", "0.6013504", "0.6004066", "0.5994467", "0.5988719", "0.59760886", "0.59535176", "0.594038", "0.594038", "0.594038", "0.594038", "0.5935052", "0.5934062", "0.5934062" ]
0.0
-1
Checks text to see if it looks like a glob.
function isGlob (text) { return text.indexOf('*') > -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isGlob (text) {\n\t return text.indexOf('*') > -1;\n\t }", "function isGlob (text) {\n\t return text.indexOf('*') > -1;\n\t }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n\t\t\treturn text.indexOf('*') > -1;\n\t\t}", "function isGlob(text) {\n return text.indexOf('*') > -1;\n }", "function isGlob(text) {\n return text.indexOf('*') > -1;\n }", "function isGlob(str) {\n var chars = { \"{\": \"}\", \"(\": \")\", \"[\": \"]\" };\n /* eslint-disable-next-line max-len */\n var regex = /\\\\(.)|(^!|\\*|[\\].+)]\\?|\\[[^\\\\\\]]+\\]|\\{[^\\\\}]+\\}|\\(\\?[:!=][^\\\\)]+\\)|\\([^|]+\\|[^\\\\)]+\\))/;\n if (str === \"\") {\n return false;\n }\n var match;\n while ((match = regex.exec(str))) {\n if (match[2])\n return true;\n var idx = match.index + match[0].length;\n // if an open bracket/brace/paren is escaped,\n // set the index to the next closing character\n var open_1 = match[1];\n var close_1 = open_1 ? chars[open_1] : null;\n if (open_1 && close_1) {\n var n = str.indexOf(close_1, idx);\n if (n !== -1) {\n idx = n + 1;\n }\n }\n str = str.slice(idx);\n }\n return false;\n }", "isGlobstar() {\n return this.#patternList[this.#index] === GLOBSTAR;\n }", "function isFile$1(pattern) {\n return (pattern == '*' || pattern.indexOf('.') !== -1);\n}", "function checkGlobPrefix(glob) {\n return glob.startsWith(\"**/\") ? glob : `**/${glob}`;\n}", "static match_star(c, regexp, text) {\n while (true) {\n if (Util.match_here(regexp, text)) {\n return true;\n }\n if (!(text && (text[0] === c || c === '.'))) {\n return false;\n }\n text = text.slice(1);\n }\n }", "static match_star(c, regexp, text) {\n while (true) {\n if (Util.match_here(regexp, text)) {\n return true;\n }\n if (!(text && (text[0] === c || c === '.'))) {\n return false;\n }\n text = text.slice(1);\n }\n }", "function doesStateMatchGlob (glob) {\n\t var globSegments = glob.split('.'),\n\t segments = $state.$current.name.split('.');\n\n\t //match greedy starts\n\t if (globSegments[0] === '**') {\n\t segments = segments.slice(indexOf(segments, globSegments[1]));\n\t segments.unshift('**');\n\t }\n\t //match greedy ends\n\t if (globSegments[globSegments.length - 1] === '**') {\n\t segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n\t segments.push('**');\n\t }\n\n\t if (globSegments.length != segments.length) {\n\t return false;\n\t }\n\n\t //match single stars\n\t for (var i = 0, l = globSegments.length; i < l; i++) {\n\t if (globSegments[i] === '*') {\n\t segments[i] = '*';\n\t }\n\t }\n\n\t return segments.join('') === globSegments.join('');\n\t }", "function globStringToRegex(str) {\r\n return new RegExp(preg_quote(str).replace(/\\\\\\*/g, '.*').replace(/\\\\\\?/g, '.'), 'g');\r\n}", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob(glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(segments.indexOf(globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(segments.indexOf(globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n\t\t\tvar globSegments = glob.split('.'),\n\t\t\t\tsegments = $state.$current.name.split('.');\n\n\t\t\t//match single stars\n\t\t\tfor (var i = 0, l = globSegments.length; i < l; i++) {\n\t\t\t\tif (globSegments[i] === '*') {\n\t\t\t\t\tsegments[i] = '*';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//match greedy starts\n\t\t\tif (globSegments[0] === '**') {\n\t\t\t\tsegments = segments.slice(indexOf(segments, globSegments[1]));\n\t\t\t\tsegments.unshift('**');\n\t\t\t}\n\t\t\t//match greedy ends\n\t\t\tif (globSegments[globSegments.length - 1] === '**') {\n\t\t\t\tsegments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n\t\t\t\tsegments.push('**');\n\t\t\t}\n\n\t\t\tif (globSegments.length != segments.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn segments.join('') === globSegments.join('');\n\t\t}", "function globToRegex(glob) {\n const tokens = ['^'];\n let inGroup;\n\n for (let i = 0; i < glob.length; ++i) {\n const c = glob[i];\n\n if (escapeGlobChars.has(c)) {\n tokens.push('\\\\' + c);\n continue;\n }\n\n if (c === '*') {\n const beforeDeep = glob[i - 1];\n let starCount = 1;\n\n while (glob[i + 1] === '*') {\n starCount++;\n i++;\n }\n\n const afterDeep = glob[i + 1];\n const isDeep = starCount > 1 && (beforeDeep === '/' || beforeDeep === undefined) && (afterDeep === '/' || afterDeep === undefined);\n\n if (isDeep) {\n tokens.push('((?:[^/]*(?:\\/|$))*)');\n i++;\n } else {\n tokens.push('([^/]*)');\n }\n\n continue;\n }\n\n switch (c) {\n case '?':\n tokens.push('.');\n break;\n\n case '{':\n inGroup = true;\n tokens.push('(');\n break;\n\n case '}':\n inGroup = false;\n tokens.push(')');\n break;\n\n case ',':\n if (inGroup) {\n tokens.push('|');\n break;\n }\n\n tokens.push('\\\\' + c);\n break;\n\n default:\n tokens.push(c);\n }\n }\n\n tokens.push('$');\n return new RegExp(tokens.join(''));\n}", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function globMatch (pattern, subject) {\n let px = 0 // [p]attern inde[x]\n let sx = 0 // [s]ubject inde[x]\n let nextPx = 0\n let nextSx = 0\n while (px < pattern.length || sx < subject.length) {\n if (px < pattern.length) {\n const c = pattern[px]\n switch (c) {\n default: // ordinary character\n if (sx < subject.length && subject[sx] === c) {\n px++\n sx++\n continue\n }\n break\n case '?':\n if (sx < subject.length) {\n px++\n sx++\n continue\n }\n break\n case '*':\n nextPx = px\n nextSx = sx + 1\n px++\n continue\n }\n }\n if (nextSx > 0 && nextSx <= subject.length) {\n px = nextPx\n sx = nextSx\n continue\n }\n return false\n }\n return true\n}", "function doesStateMatchGlob (glob) {\n\t var globSegments = glob.split('.'),\n\t segments = $state.$current.name.split('.');\n\n\t //match single stars\n\t for (var i = 0, l = globSegments.length; i < l; i++) {\n\t if (globSegments[i] === '*') {\n\t segments[i] = '*';\n\t }\n\t }\n\n\t //match greedy starts\n\t if (globSegments[0] === '**') {\n\t segments = segments.slice(indexOf(segments, globSegments[1]));\n\t segments.unshift('**');\n\t }\n\t //match greedy ends\n\t if (globSegments[globSegments.length - 1] === '**') {\n\t segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n\t segments.push('**');\n\t }\n\n\t if (globSegments.length != segments.length) {\n\t return false;\n\t }\n\n\t return segments.join('') === globSegments.join('');\n\t }", "function doesStateMatchGlob(glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.'),\n i = 0;\n\n // match single stars\n for (i = 0; i < globSegments.length; i += 1) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n // match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(_.indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n\n // match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(_.indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length !== segments.length) { return false; }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function globStringToRegex(str) {\n return new RegExp(`^${escapeRegExp(str)\n .replace(/\\\\\\*/g, '.*')\n .replace(/\\\\\\?/g, '.')}$`);\n}", "function globStringToRegex(str) {\n return new RegExp(\n pregQuote(str).replace(/\\\\\\*/g, '.*').replace(/\\\\\\?/g, '.'),\n 'g',\n )\n}", "function glob(path_pattern)\n{\n\tvar path_parts = path_pattern.replace(new RegExp(\"/\", \"g\"), \"\\\\\").split(\"\\\\\");\n\tvar p;\n\tvar base = \"\";\n\tvar is_pat_re = /\\*/;\n\n//STDOUT.WriteLine(\"glob: \" + path_pattern);\n\n\tif (FSO.FileExists(path_pattern)) {\n\t\treturn new Array(path_pattern);\n\t}\n\t\n\t// first, build as much as possible that doesn't have a pattern\n\tfor (p = 0; p < path_parts.length; p++) {\n\t\tif (path_parts[p].match(is_pat_re))\n\t\t\tbreak;\n\t\tif (p)\n\t\t\tbase += \"\\\\\";\n\t\tbase += path_parts[p];\t\n\t}\n\n\treturn _inner_glob(base, p, path_parts);\n}", "function globToRegexp(glob, opts) {\n if (typeof glob !== 'string') {\n throw new TypeError('Expected a string');\n }\n\n var str = String(glob);\n\n // The regexp we are building, as a string.\n var reStr = \"\";\n\n // Whether we are matching so called \"extended\" globs (like bash) and should\n // support single character matching, matching ranges of characters, group\n // matching, etc.\n var extended = opts ? !!opts.extended : false;\n\n // When globstar is _false_ (default), '/foo/*' is translated a regexp like\n // '^\\/foo\\/.*$' which will match any string beginning with '/foo/'\n // When globstar is _true_, '/foo/*' is translated to regexp like\n // '^\\/foo\\/[^/]*$' which will match any string beginning with '/foo/' BUT\n // which does not have a '/' to the right of it.\n // E.g. with '/foo/*' these will match: '/foo/bar', '/foo/bar.txt' but\n // these will not '/foo/bar/baz', '/foo/bar/baz.txt'\n // Lastely, when globstar is _true_, '/foo/**' is equivelant to '/foo/*' when\n // globstar is _false_\n var globstar = opts ? !!opts.globstar : false;\n\n // If we are doing extended matching, this boolean is true when we are inside\n // a group (eg {*.html,*.js}), and false otherwise.\n var inGroup = false;\n\n // RegExp flags (eg \"i\" ) to pass in to RegExp constructor.\n var flags = opts && typeof opts.flags === \"string\" ? opts.flags : \"\";\n\n var c;\n for (var i = 0, len = str.length; i < len; i++) {\n c = str[i];\n\n switch (c) {\n case \"\\\\\":\n case \"/\":\n case \"$\":\n case \"^\":\n case \"+\":\n case \".\":\n case \"(\":\n case \")\":\n case \"=\":\n case \"!\":\n case \"|\":\n reStr += \"\\\\\" + c;\n break;\n\n case \"?\":\n if (extended) {\n reStr += \".\";\n break;\n }\n\n case \"[\":\n case \"]\":\n if (extended) {\n reStr += c;\n break;\n }\n\n case \"{\":\n if (extended) {\n inGroup = true;\n reStr += \"(\";\n break;\n }\n\n case \"}\":\n if (extended) {\n inGroup = false;\n reStr += \")\";\n break;\n }\n\n case \",\":\n if (inGroup) {\n reStr += \"|\";\n break;\n }\n reStr += \"\\\\\" + c;\n break;\n\n case \"*\":\n // Move over all consecutive \"*\"'s.\n // Also store the previous and next characters\n var prevChar = str[i - 1];\n var starCount = 1;\n while (str[i + 1] === \"*\") {\n starCount++;\n i++;\n }\n var nextChar = str[i + 1];\n\n if (!globstar) {\n // globstar is disabled, so treat any number of \"*\" as one\n reStr += \".*\";\n } else {\n // globstar is enabled, so determine if this is a globstar segment\n var isGlobstar = starCount > 1 // multiple \"*\"'s\n && (prevChar === \"/\" || prevChar === undefined) // from the start of the segment\n && (nextChar === \"/\" || nextChar === undefined); // to the end of the segment\n\n if (isGlobstar) {\n // it's a globstar, so match zero or more path segments\n reStr += \"((?:[^/]*(?:\\/|$))*)\";\n i++; // move over the \"/\"\n } else {\n // it's not a globstar, so only match one path segment\n reStr += \"([^/]*)\";\n }\n }\n break;\n\n default:\n reStr += c;\n }\n }\n\n // When regexp 'g' flag is specified don't\n // constrain the regular expression with ^ & $\n if (!flags || !~flags.indexOf('g')) {\n reStr = \"^\" + reStr + \"$\";\n }\n\n return new RegExp(reStr, flags);\n }", "function glob0(pattern) {\n let matches = []\n\n if (!hasMeta(pattern)) {\n if (stat(pattern)) {\n return [pattern]\n }\n return matches\n }\n\n // dirname, basename\n let volumeLen = volumeNameLen(pattern)\n let i = pattern.length - 1\n while (i >= volumeLen && !isPathSep(pattern, i)) {\n i--\n }\n let dir = pattern.substr(0,i+1)\n let file = pattern.substr(i+1)\n\n ;[volumeLen, dir] = cleanGlobPath(dir, volumeLen)\n\n if (!hasMeta(dir.substr(volumeLen))) {\n _glob(dir, file, matches)\n } else {\n // Prevent infinite recursion. See golang issue 15879.\n if (dir == pattern) {\n throw new GlobError()\n }\n const m = glob0(dir) // :string[]\n for (let d of m) {\n _glob(d, file, matches)\n }\n }\n\n return matches\n}", "function isGlobMatch(globString, targetString) {\n if (typeof targetString === 'string' && typeof globString === 'string' && globString.indexOf('*') !== -1) {\n let regex;\n if (regexMap.has(globString)) {\n regex = regexMap.get(globString);\n }\n else {\n regex = new RegExp(`^${globString.replace(/\\*/g, '.*')}$`);\n regexMap.set(globString, regex);\n }\n return regex.test(targetString);\n }\n else {\n return globString === targetString;\n }\n}", "function normalizeGlob(glob, _a) {\n var _b = (_a === void 0 ? {} : _a).globstar, globstar = _b === void 0 ? false : _b;\n if (glob.match(/\\0/g)) {\n throw new Error(\"Glob contains invalid characters: \\\"\" + glob + \"\\\"\");\n }\n if (!globstar) {\n return normalize$2(glob);\n }\n var s = SEP_PATTERN.source;\n var badParentPattern = new RegExp(\"(?<=(\" + s + \"|^)\\\\*\\\\*\" + s + \")\\\\.\\\\.(?=\" + s + \"|$)\", \"g\");\n return normalize$2(glob.replace(badParentPattern, \"\\0\")).replace(/\\0/g, \"..\");\n }", "function isExtglobChar(ch) {\n return ch === '!' || ch === '@' || ch === '*' || ch === '?' || ch === '+';\n}", "function isExtglobChar(ch) {\n return ch === '!' || ch === '@' || ch === '*' || ch === '?' || ch === '+';\n}", "function isExtglobChar(ch) {\n return ch === '!' || ch === '@' || ch === '*' || ch === '?' || ch === '+';\n}", "function isExtglobChar(ch) {\n return ch === '!' || ch === '@' || ch === '*' || ch === '?' || ch === '+';\n}", "function glob(/* patterns... */) {\n return glob.pattern.apply(null, arguments);\n }", "function nameCheck(name) {\n if (name.indexOf('\\\\') !== -1) {\n return false;\n }\n\n var reg = new RegExp('[*:/?<>\\\"|\\\\x5c]', 'g');\n if (reg.test(name)) {\n // invalid file or folder name.\n return false;\n }\n return true;\n}", "function globMatch(file, globs) {\n for (let i = 0; i < globs.length; i += 1) {\n if (minimatch(file, globs[i])) {\n return true;\n }\n }\n return false;\n}", "function regexpPattern(pattern) {\n if (!pattern) {\n return pattern;\n }\n // A very simplified glob transform which allows passing legible strings like\n // \"myPath/*.js\" instead of a harder to read RegExp like /\\/myPath\\/.*\\.js/.\n if (typeof pattern === 'string') {\n pattern = pattern.replace(/\\./g, '\\\\.').replace(/\\*/g, '.*');\n if (pattern[0] !== '/') {\n pattern = '/' + pattern;\n }\n return new RegExp(pattern);\n }\n if (typeof pattern.test === 'function') {\n return pattern;\n }\n throw new Error(\n 'flow-remove-types: ' +\n 'includes and excludes must be RegExp or path strings. Got: ' +\n pattern,\n );\n}", "function isFileName(str) {\r\n var pattern = \"\\\\/:*?\\\"<>|\"; // illegal characters \\ / : * ? \" < > |\r\n\r\n if (str == null || str.length == 0 || str.length > 255) return false;\r\n\r\n var i = 0;\r\n for (i = 0; i < str.length; i++) {\r\n if (pattern.indexOf(str.substr(i, 1)) >= 0) return false;\r\n }\r\n return true;\r\n}", "fnmatch(pattern) {\n if (pattern.indexOf('*') === -1) {\n return filename => pattern === filename;\n } else {\n let reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n let escaped = pattern.replace(reRegExpChar, '\\\\$&');\n let matcher = new RegExp('^' + escaped.replace(/\\\\\\*/g, '.*') + '$');\n return filename => matcher.test(filename);\n }\n }", "function hasAsterisk(string){\n // Checks to see if an asterisk\n if (string.indexOf('*') !== -1){\n return true;\n }\n }", "function WildcardMatcher(text, separator) {\n this.text = text = text || '';\n this.hasWild = ~text.indexOf('*');\n this.separator = separator;\n this.parts = text.split(separator);\n}", "prepareGlobs(globs, projectRootPath) {\n const output = [];\n\n for (let pattern of globs) {\n // we need to replace path separators by slashes since globs should\n // always use always slashes as path separators.\n pattern = pattern.replace(new RegExp(`\\\\${path.sep}`, 'g'), '/');\n\n if (pattern.length === 0) {\n continue;\n }\n\n const projectName = path.basename(projectRootPath);\n\n // The user can just search inside one of the opened projects. When we detect\n // this scenario we just consider the glob to include every file.\n if (pattern === projectName) {\n output.push('**/*');\n continue;\n }\n\n if (pattern.startsWith(projectName + '/')) {\n pattern = pattern.slice(projectName.length + 1);\n }\n\n if (pattern.endsWith('/')) {\n pattern = pattern.slice(0, -1);\n }\n\n output.push(pattern);\n output.push(pattern.endsWith('/**') ? pattern : `${pattern}/**`);\n }\n\n return output;\n }", "function isMatch(text, pattern) {\n\t\tlet strLen = text.length;\n\t\tlet patLen = pattern.length;\n\t\tlet pati = 0, stri = 0;\n\t\twhile (pati < patLen || stri < strLen) {\n\t\t\tif (pati + 1 < patLen && pattern.charAt(pati + 1) == '*') {\n\t\t\t\twhile (stri < strLen && text.charAt(stri) == pattern.charAt(pati))\n\t\t\t\t\tstri++;\n\t\t\t \tpati += 2;\n\t\t\t} else if (stri < strLen && pati < patLen\n\t\t\t\t\t&& text.charAt(stri) == pattern.charAt(pati)) {\n\t\t\t\tstri++;\n\t\t\t\tpati++;\n\t\t\t} else return false;\n\t\t}\n\t\treturn true;\n\t}", "function checkFileTypes(menu, entry, text) {\n if (entry === null) {\n return \"unknown\";\n }\n var type = determineFileType(entry, text);\n if (type === \"yui\") {\n menu.addMenuItem(YUITEST_CMD, \"\", Menus.LAST);\n } else if (type === \"jasmine\") {\n menu.addMenuItem(JASMINETEST_CMD, \"\", Menus.LAST);\n } else if (type === \"qunit\") {\n menu.addMenuItem(QUNITTEST_CMD, \"\", Menus.LAST);\n } else if (type === \"script\") {\n menu.addMenuItem(SCRIPT_CMD, \"\", Menus.LAST);\n } else if (type === \"node\") {\n menu.addMenuItem(NODETEST_CMD, \"\", Menus.LAST);\n } else if (enableHtml && type === \"html\") {\n menu.addMenuItem(VIEWHTML_CMD, \"\", Menus.LAST);\n }\n if (type === \"generate\") {\n menu.addMenuItem(GENERATE_JASMINE_CMD, \"\", Menus.LAST);\n menu.addMenuItem(GENERATE_QUNIT_CMD, \"\", Menus.LAST);\n menu.addMenuItem(GENERATE_YUI_CMD, \"\", Menus.LAST);\n }\n }", "function determineFileType(fileEntry, text) {\n if (text && text.match(/^#!/) !== null) {\n return \"script\";\n } else if (text && fileEntry && fileEntry.fullPath && fileEntry.fullPath.match(/\\.js$/)) {\n if (text.match(/brackets-xunit:\\s*yui/i) !== null) {\n return \"yui\";\n } else if (text.match(/define\\(/i) && text.match(/describe\\s*\\(/)) {\n return \"jasmine\";\n } else if (text.match(/brackets-xunit:\\s*jasmine-node/i)) {\n return \"node\";\n } else if (text.match(/brackets-xunit:\\s*jasmine/i) !== null) {\n return \"jasmine\";\n } else if (text.match(/brackets-xunit:\\s*qunit/i) !== null) {\n return \"qunit\";\n } else if (text.match(/describe\\s*\\(/) && text.match(/it\\s*\\(/)) {\n return \"jasmine\";\n } else if (text.match(/YUI\\s*\\(/) && text.match(/Test\\.Runner\\.run\\s*\\(/)) {\n return \"yui\";\n } else if (text.match(/test\\s*\\(/) && text.match(/ok\\s*\\(/)) {\n return \"qunit\";\n } else {\n return \"generate\";\n }\n } else if (fileEntry && fileEntry.fullPath && fileEntry.fullPath.match(/\\.html$/)) {\n return \"html\";\n } else {\n return \"unknown\";\n }\n }", "static globEscape(s) {\n return (IS_WINDOWS ? s : s.replace(/\\\\/g, '\\\\\\\\')) // escape '\\' on Linux/macOS\n .replace(/(\\[)(?=[^/]+\\])/g, '[[]') // escape '[' when ']' follows within the path segment\n .replace(/\\?/g, '[?]') // escape '?'\n .replace(/\\*/g, '[*]'); // escape '*'\n }", "static globEscape(s) {\n return (IS_WINDOWS ? s : s.replace(/\\\\/g, '\\\\\\\\')) // escape '\\' on Linux/macOS\n .replace(/(\\[)(?=[^/]+\\])/g, '[[]') // escape '[' when ']' follows within the path segment\n .replace(/\\?/g, '[?]') // escape '?'\n .replace(/\\*/g, '[*]'); // escape '*'\n }", "static globEscape(s) {\n return (IS_WINDOWS ? s : s.replace(/\\\\/g, '\\\\\\\\')) // escape '\\' on Linux/macOS\n .replace(/(\\[)(?=[^/]+\\])/g, '[[]') // escape '[' when ']' follows within the path segment\n .replace(/\\?/g, '[?]') // escape '?'\n .replace(/\\*/g, '[*]'); // escape '*'\n }", "static globEscape(s) {\n return (IS_WINDOWS ? s : s.replace(/\\\\/g, '\\\\\\\\')) // escape '\\' on Linux/macOS\n .replace(/(\\[)(?=[^/]+\\])/g, '[[]') // escape '[' when ']' follows within the path segment\n .replace(/\\?/g, '[?]') // escape '?'\n .replace(/\\*/g, '[*]'); // escape '*'\n }", "static globEscape(s) {\n return (IS_WINDOWS ? s : s.replace(/\\\\/g, '\\\\\\\\')) // escape '\\' on Linux/macOS\n .replace(/(\\[)(?=[^/]+\\])/g, '[[]') // escape '[' when ']' follows within the path segment\n .replace(/\\?/g, '[?]') // escape '?'\n .replace(/\\*/g, '[*]'); // escape '*'\n }", "static globEscape(s) {\n return (IS_WINDOWS ? s : s.replace(/\\\\/g, '\\\\\\\\')) // escape '\\' on Linux/macOS\n .replace(/(\\[)(?=[^/]+\\])/g, '[[]') // escape '[' when ']' follows within the path segment\n .replace(/\\?/g, '[?]') // escape '?'\n .replace(/\\*/g, '[*]'); // escape '*'\n }", "function isText (file) {\n const ext = extname(file)\n return TEXT_EXTENSIONS.indexOf(ext) !== -1\n}", "function wildcardToRegExp (s) {\n\t return new RegExp('^' + s.split(/\\*+/).map(regExpEscape).join('.*') + '$');\n\t}", "function mimeMatchFunc(inputType) {\n\t\t\t\t\t\tvar mimeMatch = inputType.match(/^([^/]+)\\/(.*)$/);\n\t\t\t\t\t\treturn function(acceptType) {\n\t\t\t\t\t\t\treturn ((acceptType == inputType) || (mimeMatch && acceptType == mimeMatch[1] + \"/*\") || (acceptType == \"*/*\"));\n\t\t\t\t\t\t};\n\t\t\t\t\t}", "function globber(root, fileName) {\n\n return new BbPromise(function(resolve, reject) {\n\n const opts = { ignore: [\n `${root}/_meta/**`,\n `**/node_modules/**`\n ]};\n\n return glob(`${root}/**/${fileName}`, opts, function (err, files) {\n if (err) return reject(err);\n resolve(files);\n });\n });\n}", "function matches(pattern, relPath) {\n if (_.isRegExp(pattern)) {\n return relPath.match(pattern);\n }\n\n assert.ok(_.isString(pattern));\n\n if (pattern.charAt(0) === files.pathSep) {\n return relPath.indexOf(pattern.slice(1)) === 0;\n }\n\n return relPath.indexOf(pattern) !== -1;\n}", "function includesWithGlob(originalInput, stringToFind, originalOpts) {\n // maybe we can end prematurely:\n if (!originalInput.length || !stringToFind.length) {\n return false; // because nothing can be found in it\n }\n const opts = { ...defaults, ...originalOpts };\n const input = typeof originalInput === \"string\"\n ? [originalInput]\n : Array.from(originalInput);\n if (typeof stringToFind === \"string\") {\n return input.some((val) => matcher.isMatch(val, stringToFind, { caseSensitive: opts.caseSensitive }));\n }\n // array then.\n if (opts.arrayVsArrayAllMustBeFound === \"any\") {\n return stringToFind.some((stringToFindVal) => input.some((val) => matcher.isMatch(val, stringToFindVal, {\n caseSensitive: opts.caseSensitive,\n })));\n }\n return stringToFind.every((stringToFindVal) => input.some((val) => matcher.isMatch(val, stringToFindVal, {\n caseSensitive: opts.caseSensitive,\n })));\n}", "function glob_getStrictPath(path) {\n var index = path.indexOf('*');\n if (index === -1) {\n console.error('glob.js [path is not a glob pattern]', path);\n return null;\n }\n return path.substring(0, path.lastIndexOf('/', index) + 1);\n}", "function hasTextMimetype(types) {\n if (!types) return true;\n for (let i = 0; i < types.length; i++) {\n if (types[i] === \"Text\" || types[i] === \"text/plain\") return true;\n }\n\n return false;\n }", "static match_here(regexp, text) {\n var cur, next;\n [cur, next] = [regexp[0], regexp[1]];\n if (regexp.length === 0) {\n return true;\n }\n if (next === '*') {\n return Util.match_star(cur, regexp.slice(2), text);\n }\n if (cur === '$' && !next) {\n return text.length === 0;\n }\n if (text && (cur === '.' || cur === text[0])) {\n return Util.match_here(regexp.slice(1), text.slice(1));\n }\n return false;\n }", "static match_here(regexp, text) {\n var cur, next;\n cur = \"\";\n next = \"\";\n [cur, next] = [regexp[0], regexp[1]];\n if (regexp.length === 0) {\n return true;\n }\n if (next === '*') {\n return Util.match_star(cur, regexp.slice(2), text);\n }\n if (cur === '$' && !next) {\n return text.length === 0;\n }\n if (text && (cur === '.' || cur === text[0])) {\n return Util.match_here(regexp.slice(1), text.slice(1));\n }\n return false;\n }", "function cmd(str, pattern, options) {\n var valid = ['dotglob', 'extglob', 'failglob', 'globstar', 'nocaseglob', 'nullglob'];\n var args = [];\n\n for (var key in options) {\n if (options.hasOwnProperty(key) && valid.indexOf(key) !== -1) {\n args.push('-O', key);\n }\n }\n args.push('-c', 'IFS=$\"\\n\"; if [[ \"' + str + '\" = ' + pattern + ' ]]; then echo true; fi');\n return args;\n}", "function hasTextMimetype(types) {\n if (!types) return true;\n for (var i = 0; i < types.length; i++) {\n if (types[i] === \"Text\" || types[i] === \"text/plain\") return true;\n }\n\n return false;\n }", "function hasTextMimetype(types) {\n if (!types) return true;\n for (var i = 0; i < types.length; i++) {\n if (types[i] === \"Text\" || types[i] === \"text/plain\") return true;\n }\n\n return false;\n }" ]
[ "0.8552022", "0.8552022", "0.8545122", "0.8545122", "0.8545122", "0.8545122", "0.8545122", "0.8545122", "0.8545122", "0.8545122", "0.8545122", "0.8545122", "0.8545122", "0.8545122", "0.8545122", "0.8545122", "0.8545122", "0.8545122", "0.8545122", "0.8545122", "0.8545122", "0.8540708", "0.8522321", "0.8522321", "0.71423024", "0.66930217", "0.6071446", "0.5968336", "0.5967329", "0.59401727", "0.5933678", "0.5926501", "0.5898707", "0.5898707", "0.5898707", "0.589849", "0.5897837", "0.5857312", "0.5850648", "0.58475745", "0.58475745", "0.58475745", "0.58475745", "0.58475745", "0.58475745", "0.58475745", "0.58475745", "0.58475745", "0.58475745", "0.58475745", "0.58475745", "0.58475745", "0.58475745", "0.58475745", "0.58469254", "0.584581", "0.5843232", "0.5824204", "0.5792813", "0.57684016", "0.57472515", "0.573173", "0.5709866", "0.56611204", "0.5633153", "0.558975", "0.558975", "0.558975", "0.558975", "0.5504876", "0.54960155", "0.5469681", "0.5383755", "0.5354001", "0.53214556", "0.53050864", "0.5293649", "0.5254874", "0.52306163", "0.5178081", "0.51300436", "0.5127047", "0.5127047", "0.5127047", "0.5127047", "0.5127047", "0.5127047", "0.51166314", "0.5097855", "0.5073217", "0.50542575", "0.5047447", "0.5046167", "0.5027148", "0.50164866", "0.50028837", "0.49945417", "0.49908563", "0.4985198", "0.4985198" ]
0.8545789
2
Returns true if glob matches current $state name.
function doesStateMatchGlob (glob) { var globSegments = glob.split('.'), segments = $state.$current.name.split('.'); //match single stars for (var i = 0, l = globSegments.length; i < l; i++) { if (globSegments[i] === '*') { segments[i] = '*'; } } //match greedy starts if (globSegments[0] === '**') { segments = segments.slice(indexOf(segments, globSegments[1])); segments.unshift('**'); } //match greedy ends if (globSegments[globSegments.length - 1] === '**') { segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE); segments.push('**'); } if (globSegments.length != segments.length) { return false; } return segments.join('') === globSegments.join(''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(segments.indexOf(globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(segments.indexOf(globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n\t var globSegments = glob.split('.'),\n\t segments = $state.$current.name.split('.');\n\n\t //match single stars\n\t for (var i = 0, l = globSegments.length; i < l; i++) {\n\t if (globSegments[i] === '*') {\n\t segments[i] = '*';\n\t }\n\t }\n\n\t //match greedy starts\n\t if (globSegments[0] === '**') {\n\t segments = segments.slice(indexOf(segments, globSegments[1]));\n\t segments.unshift('**');\n\t }\n\t //match greedy ends\n\t if (globSegments[globSegments.length - 1] === '**') {\n\t segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n\t segments.push('**');\n\t }\n\n\t if (globSegments.length != segments.length) {\n\t return false;\n\t }\n\n\t return segments.join('') === globSegments.join('');\n\t }", "function doesStateMatchGlob (glob) {\n\t var globSegments = glob.split('.'),\n\t segments = $state.$current.name.split('.');\n\n\t //match greedy starts\n\t if (globSegments[0] === '**') {\n\t segments = segments.slice(indexOf(segments, globSegments[1]));\n\t segments.unshift('**');\n\t }\n\t //match greedy ends\n\t if (globSegments[globSegments.length - 1] === '**') {\n\t segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n\t segments.push('**');\n\t }\n\n\t if (globSegments.length != segments.length) {\n\t return false;\n\t }\n\n\t //match single stars\n\t for (var i = 0, l = globSegments.length; i < l; i++) {\n\t if (globSegments[i] === '*') {\n\t segments[i] = '*';\n\t }\n\t }\n\n\t return segments.join('') === globSegments.join('');\n\t }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob(glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob(glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.'),\n i = 0;\n\n // match single stars\n for (i = 0; i < globSegments.length; i += 1) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n // match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(_.indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n\n // match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(_.indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length !== segments.length) { return false; }\n\n return segments.join('') === globSegments.join('');\n }", "function doesStateMatchGlob (glob) {\n\t\t\tvar globSegments = glob.split('.'),\n\t\t\t\tsegments = $state.$current.name.split('.');\n\n\t\t\t//match single stars\n\t\t\tfor (var i = 0, l = globSegments.length; i < l; i++) {\n\t\t\t\tif (globSegments[i] === '*') {\n\t\t\t\t\tsegments[i] = '*';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//match greedy starts\n\t\t\tif (globSegments[0] === '**') {\n\t\t\t\tsegments = segments.slice(indexOf(segments, globSegments[1]));\n\t\t\t\tsegments.unshift('**');\n\t\t\t}\n\t\t\t//match greedy ends\n\t\t\tif (globSegments[globSegments.length - 1] === '**') {\n\t\t\t\tsegments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n\t\t\t\tsegments.push('**');\n\t\t\t}\n\n\t\t\tif (globSegments.length != segments.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn segments.join('') === globSegments.join('');\n\t\t}", "isGlobstar() {\n return this.#patternList[this.#index] === GLOBSTAR;\n }", "function globMatch(file, globs) {\n for (let i = 0; i < globs.length; i += 1) {\n if (minimatch(file, globs[i])) {\n return true;\n }\n }\n return false;\n}", "function isGlob(str) {\n var chars = { \"{\": \"}\", \"(\": \")\", \"[\": \"]\" };\n /* eslint-disable-next-line max-len */\n var regex = /\\\\(.)|(^!|\\*|[\\].+)]\\?|\\[[^\\\\\\]]+\\]|\\{[^\\\\}]+\\}|\\(\\?[:!=][^\\\\)]+\\)|\\([^|]+\\|[^\\\\)]+\\))/;\n if (str === \"\") {\n return false;\n }\n var match;\n while ((match = regex.exec(str))) {\n if (match[2])\n return true;\n var idx = match.index + match[0].length;\n // if an open bracket/brace/paren is escaped,\n // set the index to the next closing character\n var open_1 = match[1];\n var close_1 = open_1 ? chars[open_1] : null;\n if (open_1 && close_1) {\n var n = str.indexOf(close_1, idx);\n if (n !== -1) {\n idx = n + 1;\n }\n }\n str = str.slice(idx);\n }\n return false;\n }", "function isState(item, state) {\n var value = (item.State || \"\").toLowerCase();\n if (angular.isArray(state)) {\n return state.some(function (stateText) { return _.startsWith(value, stateText); });\n }\n else {\n return _.startsWith(value, state);\n }\n }", "function isGlobMatch(globString, targetString) {\n if (typeof targetString === 'string' && typeof globString === 'string' && globString.indexOf('*') !== -1) {\n let regex;\n if (regexMap.has(globString)) {\n regex = regexMap.get(globString);\n }\n else {\n regex = new RegExp(`^${globString.replace(/\\*/g, '.*')}$`);\n regexMap.set(globString, regex);\n }\n return regex.test(targetString);\n }\n else {\n return globString === targetString;\n }\n}", "matcher(filename) {\n const { dir, name } = path.parse(filename);\n\n if (dir === rulesDirectoryPath && ![rulesDirectoryIndexFilename, ...usedRules].includes(name)) {\n return true;\n }\n\n return false;\n }", "function match_pattern(state, pattern, player) {\n for(var idx1 = 0; idx1 < state.length; idx1++) {\n for(var idx2 = 0; idx2 < state[idx1].length; idx2++) {\n var matches = match_pattern_at(state, pattern, player, idx1, idx2);\n if(matches) {\n return true;\n }\n }\n }\n return false;\n}", "function isGlob (text) {\n\t return text.indexOf('*') > -1;\n\t }", "function isGlob (text) {\n\t return text.indexOf('*') > -1;\n\t }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n\t\t\treturn text.indexOf('*') > -1;\n\t\t}", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob (text) {\n return text.indexOf('*') > -1;\n }", "function isGlob(text) {\n return text.indexOf('*') > -1;\n }", "function isGlob(text) {\n return text.indexOf('*') > -1;\n }", "function matchesState(thisInput, thisCampus) {\n try {\n const stateName = stateCodes[thisCampus.state].toUpperCase();\n return thisCampus.state.includes(thisInput) || stateName.includes(thisInput);\n } catch (e) {\n if (e instanceof TypeError) {\n /* eslint-disable no-console */\n console.log('Error: Typo in code_schools.yaml on the back-end under the `state` field');\n /* eslint-disable no-console */\n return false;\n }\n // Unknown error issue\n return e;\n }\n }", "fnmatch(pattern) {\n if (pattern.indexOf('*') === -1) {\n return filename => pattern === filename;\n } else {\n let reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n let escaped = pattern.replace(reRegExpChar, '\\\\$&');\n let matcher = new RegExp('^' + escaped.replace(/\\\\\\*/g, '.*') + '$');\n return filename => matcher.test(filename);\n }\n }", "function checkGlobPrefix(glob) {\n return glob.startsWith(\"**/\") ? glob : `**/${glob}`;\n}", "isOpen() {\n return this.$store.state.selectedDirectory.includes(this.item.path);\n }", "function isStateExist(stateName) {\r\n var states = $state.get();\r\n var isExist = false;\r\n if (states instanceof Array && typeof stateName === 'string' && stateName !== '') {\r\n states.filter(function(state) {\r\n if (state.name === stateName) {\r\n isExist = true;\r\n return;\r\n }\r\n });\r\n }\r\n return isExist;\r\n }", "function import_isState ( name, value ) {\n var\n i = 0,\n tagKeyTest\n ;\n // all key tests must fail, in order to be a state\n for (; tagKeyTest = import_tagKeyTests[i]; i++) {\n if (\n (\n tagKeyTest.r &&\n tagKeyTest.r.test(name)\n ) ||\n (\n tagKeyTest.f &&\n tagKeyTest.f(name, value)\n )\n ) {\n return 0;\n }\n }\n return 1;\n }", "function matches(pattern, relPath) {\n if (_.isRegExp(pattern)) {\n return relPath.match(pattern);\n }\n\n assert.ok(_.isString(pattern));\n\n if (pattern.charAt(0) === files.pathSep) {\n return relPath.indexOf(pattern.slice(1)) === 0;\n }\n\n return relPath.indexOf(pattern) !== -1;\n}", "function pathIsActive(pathname,currentPathname){ // Normalize leading slash for consistency. Leading slash on pathname has\n// already been normalized in isActive. See caveat there.\nif(currentPathname.charAt(0)!=='/'){currentPathname='/'+currentPathname;} // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n// `/foo` as active, but in this case, we would already have failed the\n// match.\nif(pathname.charAt(pathname.length-1)!=='/'){pathname+='/';}if(currentPathname.charAt(currentPathname.length-1)!=='/'){currentPathname+='/';}return currentPathname===pathname;}", "function state_check(state){\n\tfor (var i = 0; i < ufo_data.length; i++){\n\t\tif (ufo_data[i].state === state){\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "markFollowGlobstar() {\n if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)\n return false;\n this.#followGlobstar = false;\n return true;\n }", "function pathIsActive(pathname, currentPathname) {\r\n\t // Normalize leading slash for consistency. Leading slash on pathname has\r\n\t // already been normalized in isActive. See caveat there.\r\n\t if (currentPathname.charAt(0) !== '/') {\r\n\t currentPathname = '/' + currentPathname;\r\n\t }\r\n\t\r\n\t // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\r\n\t // `/foo` as active, but in this case, we would already have failed the\r\n\t // match.\r\n\t if (pathname.charAt(pathname.length - 1) !== '/') {\r\n\t pathname += '/';\r\n\t }\r\n\t if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\r\n\t currentPathname += '/';\r\n\t }\r\n\t\r\n\t return currentPathname === pathname;\r\n\t}", "function pathIsActive(pathname, currentPathname) {\n // Normalize leading slash for consistency. Leading slash on pathname has\n // already been normalized in isActive. See caveat there.\n if (currentPathname.charAt(0) !== '/') {\n currentPathname = '/' + currentPathname;\n } // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n // `/foo` as active, but in this case, we would already have failed the\n // match.\n\n\n if (pathname.charAt(pathname.length - 1) !== '/') {\n pathname += '/';\n }\n\n if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n currentPathname += '/';\n }\n\n return currentPathname === pathname;\n}", "function pathIsActive(pathname, currentPathname) {\n\t // Normalize leading slash for consistency. Leading slash on pathname has\n\t // already been normalized in isActive. See caveat there.\n\t if (currentPathname.charAt(0) !== '/') {\n\t currentPathname = '/' + currentPathname;\n\t }\n\t\n\t // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n\t // `/foo` as active, but in this case, we would already have failed the\n\t // match.\n\t if (pathname.charAt(pathname.length - 1) !== '/') {\n\t pathname += '/';\n\t }\n\t if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n\t currentPathname += '/';\n\t }\n\t\n\t return currentPathname === pathname;\n\t}", "function pathIsActive(pathname, currentPathname) {\n\t // Normalize leading slash for consistency. Leading slash on pathname has\n\t // already been normalized in isActive. See caveat there.\n\t if (currentPathname.charAt(0) !== '/') {\n\t currentPathname = '/' + currentPathname;\n\t }\n\t\n\t // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n\t // `/foo` as active, but in this case, we would already have failed the\n\t // match.\n\t if (pathname.charAt(pathname.length - 1) !== '/') {\n\t pathname += '/';\n\t }\n\t if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n\t currentPathname += '/';\n\t }\n\t\n\t return currentPathname === pathname;\n\t}", "function pathIsActive(pathname, currentPathname) {\n\t // Normalize leading slash for consistency. Leading slash on pathname has\n\t // already been normalized in isActive. See caveat there.\n\t if (currentPathname.charAt(0) !== '/') {\n\t currentPathname = '/' + currentPathname;\n\t }\n\t\n\t // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n\t // `/foo` as active, but in this case, we would already have failed the\n\t // match.\n\t if (pathname.charAt(pathname.length - 1) !== '/') {\n\t pathname += '/';\n\t }\n\t if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n\t currentPathname += '/';\n\t }\n\t\n\t return currentPathname === pathname;\n\t}", "function pathIsActive(pathname, currentPathname) {\n\t // Normalize leading slash for consistency. Leading slash on pathname has\n\t // already been normalized in isActive. See caveat there.\n\t if (currentPathname.charAt(0) !== '/') {\n\t currentPathname = '/' + currentPathname;\n\t }\n\t\n\t // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n\t // `/foo` as active, but in this case, we would already have failed the\n\t // match.\n\t if (pathname.charAt(pathname.length - 1) !== '/') {\n\t pathname += '/';\n\t }\n\t if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n\t currentPathname += '/';\n\t }\n\t\n\t return currentPathname === pathname;\n\t}", "function pathIsActive(pathname, currentPathname) {\n\t // Normalize leading slash for consistency. Leading slash on pathname has\n\t // already been normalized in isActive. See caveat there.\n\t if (currentPathname.charAt(0) !== '/') {\n\t currentPathname = '/' + currentPathname;\n\t }\n\t\n\t // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n\t // `/foo` as active, but in this case, we would already have failed the\n\t // match.\n\t if (pathname.charAt(pathname.length - 1) !== '/') {\n\t pathname += '/';\n\t }\n\t if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n\t currentPathname += '/';\n\t }\n\t\n\t return currentPathname === pathname;\n\t}", "function pathIsActive(pathname, currentPathname) {\n\t // Normalize leading slash for consistency. Leading slash on pathname has\n\t // already been normalized in isActive. See caveat there.\n\t if (currentPathname.charAt(0) !== '/') {\n\t currentPathname = '/' + currentPathname;\n\t }\n\t\n\t // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n\t // `/foo` as active, but in this case, we would already have failed the\n\t // match.\n\t if (pathname.charAt(pathname.length - 1) !== '/') {\n\t pathname += '/';\n\t }\n\t if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n\t currentPathname += '/';\n\t }\n\t\n\t return currentPathname === pathname;\n\t}", "function pathIsActive(pathname, currentPathname) {\n\t // Normalize leading slash for consistency. Leading slash on pathname has\n\t // already been normalized in isActive. See caveat there.\n\t if (currentPathname.charAt(0) !== '/') {\n\t currentPathname = '/' + currentPathname;\n\t }\n\t\n\t // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n\t // `/foo` as active, but in this case, we would already have failed the\n\t // match.\n\t if (pathname.charAt(pathname.length - 1) !== '/') {\n\t pathname += '/';\n\t }\n\t if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n\t currentPathname += '/';\n\t }\n\t\n\t return currentPathname === pathname;\n\t}", "function pathIsActive(pathname, currentPathname) {\n\t // Normalize leading slash for consistency. Leading slash on pathname has\n\t // already been normalized in isActive. See caveat there.\n\t if (currentPathname.charAt(0) !== '/') {\n\t currentPathname = '/' + currentPathname;\n\t }\n\t\n\t // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n\t // `/foo` as active, but in this case, we would already have failed the\n\t // match.\n\t if (pathname.charAt(pathname.length - 1) !== '/') {\n\t pathname += '/';\n\t }\n\t if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n\t currentPathname += '/';\n\t }\n\t\n\t return currentPathname === pathname;\n\t}", "function pathIsActive(pathname, currentPathname) {\n\t // Normalize leading slash for consistency. Leading slash on pathname has\n\t // already been normalized in isActive. See caveat there.\n\t if (currentPathname.charAt(0) !== '/') {\n\t currentPathname = '/' + currentPathname;\n\t }\n\t\n\t // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n\t // `/foo` as active, but in this case, we would already have failed the\n\t // match.\n\t if (pathname.charAt(pathname.length - 1) !== '/') {\n\t pathname += '/';\n\t }\n\t if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n\t currentPathname += '/';\n\t }\n\t\n\t return currentPathname === pathname;\n\t}", "function pathIsActive(pathname, currentPathname) {\n\t // Normalize leading slash for consistency. Leading slash on pathname has\n\t // already been normalized in isActive. See caveat there.\n\t if (currentPathname.charAt(0) !== '/') {\n\t currentPathname = '/' + currentPathname;\n\t }\n\t\n\t // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n\t // `/foo` as active, but in this case, we would already have failed the\n\t // match.\n\t if (pathname.charAt(pathname.length - 1) !== '/') {\n\t pathname += '/';\n\t }\n\t if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n\t currentPathname += '/';\n\t }\n\t\n\t return currentPathname === pathname;\n\t}", "function pathIsActive(pathname, currentPathname) {\n\t // Normalize leading slash for consistency. Leading slash on pathname has\n\t // already been normalized in isActive. See caveat there.\n\t if (currentPathname.charAt(0) !== '/') {\n\t currentPathname = '/' + currentPathname;\n\t }\n\t\n\t // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n\t // `/foo` as active, but in this case, we would already have failed the\n\t // match.\n\t if (pathname.charAt(pathname.length - 1) !== '/') {\n\t pathname += '/';\n\t }\n\t if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n\t currentPathname += '/';\n\t }\n\t\n\t return currentPathname === pathname;\n\t}", "function pathIsActive(pathname, currentPathname) {\n\t // Normalize leading slash for consistency. Leading slash on pathname has\n\t // already been normalized in isActive. See caveat there.\n\t if (currentPathname.charAt(0) !== '/') {\n\t currentPathname = '/' + currentPathname;\n\t }\n\t\n\t // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n\t // `/foo` as active, but in this case, we would already have failed the\n\t // match.\n\t if (pathname.charAt(pathname.length - 1) !== '/') {\n\t pathname += '/';\n\t }\n\t if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n\t currentPathname += '/';\n\t }\n\t\n\t return currentPathname === pathname;\n\t}", "function pathIsActive(pathname, currentPathname) {\n\t // Normalize leading slash for consistency. Leading slash on pathname has\n\t // already been normalized in isActive. See caveat there.\n\t if (currentPathname.charAt(0) !== '/') {\n\t currentPathname = '/' + currentPathname;\n\t }\n\t\n\t // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n\t // `/foo` as active, but in this case, we would already have failed the\n\t // match.\n\t if (pathname.charAt(pathname.length - 1) !== '/') {\n\t pathname += '/';\n\t }\n\t if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n\t currentPathname += '/';\n\t }\n\t\n\t return currentPathname === pathname;\n\t}", "function pathIsActive(pathname, currentPathname) {\n\t // Normalize leading slash for consistency. Leading slash on pathname has\n\t // already been normalized in isActive. See caveat there.\n\t if (currentPathname.charAt(0) !== '/') {\n\t currentPathname = '/' + currentPathname;\n\t }\n\t\n\t // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n\t // `/foo` as active, but in this case, we would already have failed the\n\t // match.\n\t if (pathname.charAt(pathname.length - 1) !== '/') {\n\t pathname += '/';\n\t }\n\t if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n\t currentPathname += '/';\n\t }\n\t\n\t return currentPathname === pathname;\n\t}", "function pathIsActive(pathname, currentPathname) {\n\t // Normalize leading slash for consistency. Leading slash on pathname has\n\t // already been normalized in isActive. See caveat there.\n\t if (currentPathname.charAt(0) !== '/') {\n\t currentPathname = '/' + currentPathname;\n\t }\n\t\n\t // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n\t // `/foo` as active, but in this case, we would already have failed the\n\t // match.\n\t if (pathname.charAt(pathname.length - 1) !== '/') {\n\t pathname += '/';\n\t }\n\t if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n\t currentPathname += '/';\n\t }\n\t\n\t return currentPathname === pathname;\n\t}", "function pathIsActive(pathname, currentPathname) {\n\t // Normalize leading slash for consistency. Leading slash on pathname has\n\t // already been normalized in isActive. See caveat there.\n\t if (currentPathname.charAt(0) !== '/') {\n\t currentPathname = '/' + currentPathname;\n\t }\n\t\n\t // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n\t // `/foo` as active, but in this case, we would already have failed the\n\t // match.\n\t if (pathname.charAt(pathname.length - 1) !== '/') {\n\t pathname += '/';\n\t }\n\t if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n\t currentPathname += '/';\n\t }\n\t\n\t return currentPathname === pathname;\n\t}", "inPath(state) {\n if (state === this.state) {\n return true;\n }\n else if (this.parent === null) {\n return false;\n }\n else {\n return this.parent.inPath(state);\n }\n }", "function pathIsActive(pathname, currentPathname) {\n // Normalize leading slash for consistency. Leading slash on pathname has\n // already been normalized in isActive. See caveat there.\n if (currentPathname.charAt(0) !== '/') {\n currentPathname = '/' + currentPathname;\n }\n\n // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n // `/foo` as active, but in this case, we would already have failed the\n // match.\n if (pathname.charAt(pathname.length - 1) !== '/') {\n pathname += '/';\n }\n if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n currentPathname += '/';\n }\n\n return currentPathname === pathname;\n}", "function pathIsActive(pathname, currentPathname) {\n // Normalize leading slash for consistency. Leading slash on pathname has\n // already been normalized in isActive. See caveat there.\n if (currentPathname.charAt(0) !== '/') {\n currentPathname = '/' + currentPathname;\n }\n\n // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n // `/foo` as active, but in this case, we would already have failed the\n // match.\n if (pathname.charAt(pathname.length - 1) !== '/') {\n pathname += '/';\n }\n if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n currentPathname += '/';\n }\n\n return currentPathname === pathname;\n}", "function pathIsActive(pathname, currentPathname) {\n // Normalize leading slash for consistency. Leading slash on pathname has\n // already been normalized in isActive. See caveat there.\n if (currentPathname.charAt(0) !== '/') {\n currentPathname = '/' + currentPathname;\n }\n\n // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n // `/foo` as active, but in this case, we would already have failed the\n // match.\n if (pathname.charAt(pathname.length - 1) !== '/') {\n pathname += '/';\n }\n if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n currentPathname += '/';\n }\n\n return currentPathname === pathname;\n}", "function pathIsActive(pathname, currentPathname) {\n // Normalize leading slash for consistency. Leading slash on pathname has\n // already been normalized in isActive. See caveat there.\n if (currentPathname.charAt(0) !== '/') {\n currentPathname = '/' + currentPathname;\n }\n\n // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n // `/foo` as active, but in this case, we would already have failed the\n // match.\n if (pathname.charAt(pathname.length - 1) !== '/') {\n pathname += '/';\n }\n if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n currentPathname += '/';\n }\n\n return currentPathname === pathname;\n}", "function pathIsActive(pathname, currentPathname) {\n // Normalize leading slash for consistency. Leading slash on pathname has\n // already been normalized in isActive. See caveat there.\n if (currentPathname.charAt(0) !== '/') {\n currentPathname = '/' + currentPathname;\n }\n\n // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n // `/foo` as active, but in this case, we would already have failed the\n // match.\n if (pathname.charAt(pathname.length - 1) !== '/') {\n pathname += '/';\n }\n if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n currentPathname += '/';\n }\n\n return currentPathname === pathname;\n}", "function pathIsActive(pathname, currentPathname) {\n // Normalize leading slash for consistency. Leading slash on pathname has\n // already been normalized in isActive. See caveat there.\n if (currentPathname.charAt(0) !== '/') {\n currentPathname = '/' + currentPathname;\n }\n\n // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n // `/foo` as active, but in this case, we would already have failed the\n // match.\n if (pathname.charAt(pathname.length - 1) !== '/') {\n pathname += '/';\n }\n if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n currentPathname += '/';\n }\n\n return currentPathname === pathname;\n}", "function pathIsActive(pathname, currentPathname) {\n // Normalize leading slash for consistency. Leading slash on pathname has\n // already been normalized in isActive. See caveat there.\n if (currentPathname.charAt(0) !== '/') {\n currentPathname = '/' + currentPathname;\n }\n\n // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n // `/foo` as active, but in this case, we would already have failed the\n // match.\n if (pathname.charAt(pathname.length - 1) !== '/') {\n pathname += '/';\n }\n if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n currentPathname += '/';\n }\n\n return currentPathname === pathname;\n}", "function pathIsActive(pathname, currentPathname) {\n // Normalize leading slash for consistency. Leading slash on pathname has\n // already been normalized in isActive. See caveat there.\n if (currentPathname.charAt(0) !== '/') {\n currentPathname = '/' + currentPathname;\n }\n\n // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n // `/foo` as active, but in this case, we would already have failed the\n // match.\n if (pathname.charAt(pathname.length - 1) !== '/') {\n pathname += '/';\n }\n if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n currentPathname += '/';\n }\n\n return currentPathname === pathname;\n}", "function pathIsActive(pathname, currentPathname) {\n // Normalize leading slash for consistency. Leading slash on pathname has\n // already been normalized in isActive. See caveat there.\n if (currentPathname.charAt(0) !== '/') {\n currentPathname = '/' + currentPathname;\n }\n\n // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n // `/foo` as active, but in this case, we would already have failed the\n // match.\n if (pathname.charAt(pathname.length - 1) !== '/') {\n pathname += '/';\n }\n if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n currentPathname += '/';\n }\n\n return currentPathname === pathname;\n}", "function pathIsActive(pathname, currentPathname) {\n // Normalize leading slash for consistency. Leading slash on pathname has\n // already been normalized in isActive. See caveat there.\n if (currentPathname.charAt(0) !== '/') {\n currentPathname = '/' + currentPathname;\n }\n\n // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n // `/foo` as active, but in this case, we would already have failed the\n // match.\n if (pathname.charAt(pathname.length - 1) !== '/') {\n pathname += '/';\n }\n if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n currentPathname += '/';\n }\n\n return currentPathname === pathname;\n}", "function pathIsActive(pathname, currentPathname) {\n // Normalize leading slash for consistency. Leading slash on pathname has\n // already been normalized in isActive. See caveat there.\n if (currentPathname.charAt(0) !== '/') {\n currentPathname = '/' + currentPathname;\n }\n\n // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n // `/foo` as active, but in this case, we would already have failed the\n // match.\n if (pathname.charAt(pathname.length - 1) !== '/') {\n pathname += '/';\n }\n if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n currentPathname += '/';\n }\n\n return currentPathname === pathname;\n}", "function pathIsActive(pathname, currentPathname) {\n // Normalize leading slash for consistency. Leading slash on pathname has\n // already been normalized in isActive. See caveat there.\n if (currentPathname.charAt(0) !== '/') {\n currentPathname = '/' + currentPathname;\n }\n\n // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n // `/foo` as active, but in this case, we would already have failed the\n // match.\n if (pathname.charAt(pathname.length - 1) !== '/') {\n pathname += '/';\n }\n if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n currentPathname += '/';\n }\n\n return currentPathname === pathname;\n}", "function pathIsActive(pathname, currentPathname) {\n // Normalize leading slash for consistency. Leading slash on pathname has\n // already been normalized in isActive. See caveat there.\n if (currentPathname.charAt(0) !== '/') {\n currentPathname = '/' + currentPathname;\n }\n\n // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n // `/foo` as active, but in this case, we would already have failed the\n // match.\n if (pathname.charAt(pathname.length - 1) !== '/') {\n pathname += '/';\n }\n if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n currentPathname += '/';\n }\n\n return currentPathname === pathname;\n}", "function pathIsActive(pathname, currentPathname) {\n // Normalize leading slash for consistency. Leading slash on pathname has\n // already been normalized in isActive. See caveat there.\n if (currentPathname.charAt(0) !== '/') {\n currentPathname = '/' + currentPathname;\n }\n\n // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n // `/foo` as active, but in this case, we would already have failed the\n // match.\n if (pathname.charAt(pathname.length - 1) !== '/') {\n pathname += '/';\n }\n if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n currentPathname += '/';\n }\n\n return currentPathname === pathname;\n}", "function pathIsActive(pathname, currentPathname) {\n // Normalize leading slash for consistency. Leading slash on pathname has\n // already been normalized in isActive. See caveat there.\n if (currentPathname.charAt(0) !== '/') {\n currentPathname = '/' + currentPathname;\n }\n\n // Normalize the end of both path names too. Maybe `/foo/` shouldn't show\n // `/foo` as active, but in this case, we would already have failed the\n // match.\n if (pathname.charAt(pathname.length - 1) !== '/') {\n pathname += '/';\n }\n if (currentPathname.charAt(currentPathname.length - 1) !== '/') {\n currentPathname += '/';\n }\n\n return currentPathname === pathname;\n}" ]
[ "0.8139529", "0.813723", "0.813723", "0.813723", "0.8132876", "0.81316024", "0.8119199", "0.8119199", "0.8119199", "0.8119199", "0.8119199", "0.8119199", "0.8119199", "0.8119199", "0.8119199", "0.8119199", "0.8119199", "0.8119199", "0.8119199", "0.8119199", "0.8119199", "0.8051794", "0.8027117", "0.8010221", "0.6172596", "0.57713443", "0.5662623", "0.5643956", "0.5643559", "0.5503795", "0.5502167", "0.5497007", "0.5497007", "0.5496739", "0.549641", "0.5467498", "0.5467498", "0.5467498", "0.5467498", "0.5467498", "0.5467498", "0.5467498", "0.5467498", "0.5467498", "0.5467498", "0.5467498", "0.5467498", "0.5467498", "0.5467498", "0.5467498", "0.5467498", "0.5467498", "0.5467498", "0.5467498", "0.54495054", "0.54495054", "0.5446661", "0.5425459", "0.5418314", "0.5367565", "0.5312063", "0.5306545", "0.52939415", "0.5286528", "0.5284678", "0.5261806", "0.52489865", "0.5238325", "0.5238058", "0.5238058", "0.5238058", "0.5238058", "0.5238058", "0.5238058", "0.5238058", "0.5238058", "0.5238058", "0.5238058", "0.5238058", "0.5238058", "0.5238058", "0.5238058", "0.5238058", "0.5238058", "0.5223658", "0.5213995", "0.5213995", "0.5213995", "0.5213995", "0.5213995", "0.5213995", "0.5213995", "0.5213995", "0.5213995", "0.5213995", "0.5213995", "0.5213995", "0.5213995", "0.5213995", "0.5213995" ]
0.8124761
6
Handles the case where a state which is the target of a transition is not found, and the user can optionally retry or defer the transition
function handleRedirect(redirect, state, params, options) { /** * @ngdoc event * @name ui.router.state.$state#$stateNotFound * @eventOf ui.router.state.$state * @eventType broadcast on root scope * @description * Fired when a requested state **cannot be found** using the provided state name during transition. * The event is broadcast allowing any handlers a single chance to deal with the error (usually by * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler, * you can see its three properties in the example. You can use `event.preventDefault()` to abort the * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value. * * @param {Object} event Event object. * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties. * @param {State} fromState Current state object. * @param {Object} fromParams Current state params. * * @example * * <pre> * // somewhere, assume lazy.state has not been defined * $state.go("lazy.state", {a:1, b:2}, {inherit:false}); * * // somewhere else * $scope.$on('$stateNotFound', * function(event, unfoundState, fromState, fromParams){ * console.log(unfoundState.to); // "lazy.state" * console.log(unfoundState.toParams); // {a:1, b:2} * console.log(unfoundState.options); // {inherit:false} + default options * }) * </pre> */ var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params); if (evt.defaultPrevented) { $urlRouter.update(); return TransitionAborted; } if (!evt.retry) { return null; } // Allow the handler to return a promise to defer state lookup retry if (options.$retry) { $urlRouter.update(); return TransitionFailed; } var retryTransition = $state.transition = $q.when(evt.retry); retryTransition.then(function() { if (retryTransition !== $state.transition) return TransitionSuperseded; redirect.options.$retry = true; return $state.transitionTo(redirect.to, redirect.toParams, redirect.options); }, function() { return TransitionAborted; }); $urlRouter.update(); return retryTransition; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleRedirect(redirect, state, params, options) {\n\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params),\n retryTransition;\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n\n retryTransition = $state.transition = $q.when($q.defer('ng_ui_router_when_$StateProvider_study_invoke'), evt.retry);\n\n retryTransition.then(\n function () {\n if (retryTransition !== $state.transition) { return TransitionSuperseded; }\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n },\n function () {\n return TransitionAborted;\n }\n );\n $urlRouter.update();\n\n return retryTransition;\n }", "performTransition (trans) {\n if (trans === Transition.NullTransition) {\n return\n }\n const id = this.currentState.GetOutputState(trans)\n if (id === StateId.NullStateId) {\n return\n }\n // Update currentState\n this.currentStateId = id\n const state = this.states.find((s) => s.Id === id)\n if (state !== undefined) {\n // Post processing of old state\n this.currentState.DoBeforeLeaving()\n this.currentState = state\n // Reset the state to its desired condition before it can reason or act\n this.currentState.DoBeforeEntering()\n }\n }", "function handleRedirect(redirect, state, params, options) {\n\t\t\t\t/**\n\t\t\t\t * @ngdoc event\n\t\t\t\t * @name ui.router.state.$state#$stateNotFound\n\t\t\t\t * @eventOf ui.router.state.$state\n\t\t\t\t * @eventType broadcast on root scope\n\t\t\t\t * @description\n\t\t\t\t * Fired when a requested state **cannot be found** using the provided state name during transition.\n\t\t\t\t * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n\t\t\t\t * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n\t\t\t\t * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n\t\t\t\t * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n\t\t\t\t *\n\t\t\t\t * @param {Object} event Event object.\n\t\t\t\t * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n\t\t\t\t * @param {State} fromState Current state object.\n\t\t\t\t * @param {Object} fromParams Current state params.\n\t\t\t\t *\n\t\t\t\t * @example\n\t\t\t\t *\n\t\t\t\t * <pre>\n\t\t\t\t * // somewhere, assume lazy.state has not been defined\n\t\t\t\t * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n\t\t\t\t *\n\t\t\t\t * // somewhere else\n\t\t\t\t * $scope.$on('$stateNotFound',\n\t\t\t\t * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n\t\t\t\t * </pre>\n\t\t\t\t */\n\t\t\t\tvar evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n\t\t\t\tif (evt.defaultPrevented) {\n\t\t\t\t\t$urlRouter.update();\n\t\t\t\t\treturn TransitionAborted;\n\t\t\t\t}\n\n\t\t\t\tif (!evt.retry) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t// Allow the handler to return a promise to defer state lookup retry\n\t\t\t\tif (options.$retry) {\n\t\t\t\t\t$urlRouter.update();\n\t\t\t\t\treturn TransitionFailed;\n\t\t\t\t}\n\t\t\t\tvar retryTransition = $state.transition = $q.when(evt.retry);\n\n\t\t\t\tretryTransition.then(function() {\n\t\t\t\t\tif (retryTransition !== $state.transition) return TransitionSuperseded;\n\t\t\t\t\tredirect.options.$retry = true;\n\t\t\t\t\treturn $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n\t\t\t\t}, function() {\n\t\t\t\t\treturn TransitionAborted;\n\t\t\t\t});\n\t\t\t\t$urlRouter.update();\n\n\t\t\t\treturn retryTransition;\n\t\t\t}", "function handleRedirect(redirect, state, params, options) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateNotFound\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when a requested state **cannot be found** using the provided state name during transition.\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n *\n * @param {Object} event Event object.\n * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n * @param {State} fromState Current state object.\n * @param {Object} fromParams Current state params.\n *\n * @example\n *\n * <pre>\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n *\n * // somewhere else\n * $scope.$on('$stateNotFound',\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n * </pre>\n */\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n var retryTransition = $state.transition = $q.when(evt.retry);\n\n retryTransition.then(function () {\n if (retryTransition !== $state.transition) return TransitionSuperseded;\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n }, function () {\n return TransitionAborted;\n });\n $urlRouter.update();\n\n return retryTransition;\n }", "function handleRedirect(redirect, state, params, options) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateNotFound\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when a requested state **cannot be found** using the provided state name during transition.\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n *\n * @param {Object} event Event object.\n * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n * @param {State} fromState Current state object.\n * @param {Object} fromParams Current state params.\n *\n * @example\n *\n * <pre>\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n *\n * // somewhere else\n * $scope.$on('$stateNotFound',\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n * </pre>\n */\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n var retryTransition = $state.transition = $q.when(evt.retry);\n\n retryTransition.then(function() {\n if (retryTransition !== $state.transition) return TransitionSuperseded;\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n }, function() {\n return TransitionAborted;\n });\n $urlRouter.update();\n\n return retryTransition;\n }", "function handleRedirect(redirect, state, params, options) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateNotFound\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when a requested state **cannot be found** using the provided state name during transition.\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n *\n * @param {Object} event Event object.\n * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n * @param {State} fromState Current state object.\n * @param {Object} fromParams Current state params.\n *\n * @example\n *\n * <pre>\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n *\n * // somewhere else\n * $scope.$on('$stateNotFound',\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n * </pre>\n */\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n var retryTransition = $state.transition = $q.when(evt.retry);\n\n retryTransition.then(function() {\n if (retryTransition !== $state.transition) return TransitionSuperseded;\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n }, function() {\n return TransitionAborted;\n });\n $urlRouter.update();\n\n return retryTransition;\n }", "function handleRedirect(redirect, state, params, options) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateNotFound\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when a requested state **cannot be found** using the provided state name during transition.\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n *\n * @param {Object} event Event object.\n * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n * @param {State} fromState Current state object.\n * @param {Object} fromParams Current state params.\n *\n * @example\n *\n * <pre>\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n *\n * // somewhere else\n * $scope.$on('$stateNotFound',\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n * </pre>\n */\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n var retryTransition = $state.transition = $q.when(evt.retry);\n\n retryTransition.then(function() {\n if (retryTransition !== $state.transition) {\n $rootScope.$broadcast('$stateChangeCancel', redirect.to, redirect.toParams, state, params);\n return TransitionSuperseded;\n }\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n }, function() {\n return TransitionAborted;\n });\n $urlRouter.update();\n\n return retryTransition;\n }", "function handleRedirect(redirect, state, params, options) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateNotFound\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when a requested state **cannot be found** using the provided state name during transition.\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n *\n * @param {Object} event Event object.\n * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n * @param {State} fromState Current state object.\n * @param {Object} fromParams Current state params.\n *\n * @example\n *\n * <pre>\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n *\n * // somewhere else\n * $scope.$on('$stateNotFound',\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n * </pre>\n */\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n var retryTransition = $state.transition = $q.when(evt.retry);\n\n retryTransition.then(function() {\n if (retryTransition !== $state.transition) {\n $rootScope.$broadcast('$stateChangeCancel', redirect.to, redirect.toParams, state, params);\n return TransitionSuperseded;\n }\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n }, function() {\n return TransitionAborted;\n });\n $urlRouter.update();\n\n return retryTransition;\n }", "function handleRedirect(redirect, state, params, options) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateNotFound\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when a requested state **cannot be found** using the provided state name during transition.\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n *\n * @param {Object} event Event object.\n * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n * @param {State} fromState Current state object.\n * @param {Object} fromParams Current state params.\n *\n * @example\n *\n * <pre>\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n *\n * // somewhere else\n * $scope.$on('$stateNotFound',\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n * </pre>\n */\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n var retryTransition = $state.transition = $q.when(evt.retry);\n\n retryTransition.then(function() {\n if (retryTransition !== $state.transition) {\n $rootScope.$broadcast('$stateChangeCancel', redirect.to, redirect.toParams, state, params);\n return TransitionSuperseded;\n }\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n }, function() {\n return TransitionAborted;\n });\n $urlRouter.update();\n\n return retryTransition;\n }", "function handleRedirect(redirect, state, params, options) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateNotFound\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when a requested state **cannot be found** using the provided state name during transition.\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n *\n * @param {Object} event Event object.\n * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n * @param {State} fromState Current state object.\n * @param {Object} fromParams Current state params.\n *\n * @example\n *\n * <pre>\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n *\n * // somewhere else\n * $scope.$on('$stateNotFound',\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n * </pre>\n */\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n var retryTransition = $state.transition = $q.when(evt.retry);\n\n retryTransition.then(function() {\n if (retryTransition !== $state.transition) return TransitionSuperseded;\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n }, function() {\n return TransitionAborted;\n });\n $urlRouter.update();\n\n return retryTransition;\n }", "function handleRedirect(redirect, state, params, options) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateNotFound\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when a requested state **cannot be found** using the provided state name during transition.\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n *\n * @param {Object} event Event object.\n * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n * @param {State} fromState Current state object.\n * @param {Object} fromParams Current state params.\n *\n * @example\n *\n * <pre>\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n *\n * // somewhere else\n * $scope.$on('$stateNotFound',\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n * </pre>\n */\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n var retryTransition = $state.transition = $q.when(evt.retry);\n\n retryTransition.then(function() {\n if (retryTransition !== $state.transition) return TransitionSuperseded;\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n }, function() {\n return TransitionAborted;\n });\n $urlRouter.update();\n\n return retryTransition;\n }", "function handleRedirect(redirect, state, params, options) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateNotFound\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when a requested state **cannot be found** using the provided state name during transition.\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n *\n * @param {Object} event Event object.\n * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n * @param {State} fromState Current state object.\n * @param {Object} fromParams Current state params.\n *\n * @example\n *\n * <pre>\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n *\n * // somewhere else\n * $scope.$on('$stateNotFound',\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n * </pre>\n */\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n var retryTransition = $state.transition = $q.when(evt.retry);\n\n retryTransition.then(function() {\n if (retryTransition !== $state.transition) return TransitionSuperseded;\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n }, function() {\n return TransitionAborted;\n });\n $urlRouter.update();\n\n return retryTransition;\n }", "function handleRedirect(redirect, state, params, options) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateNotFound\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when a requested state **cannot be found** using the provided state name during transition.\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n *\n * @param {Object} event Event object.\n * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n * @param {State} fromState Current state object.\n * @param {Object} fromParams Current state params.\n *\n * @example\n *\n * <pre>\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n *\n * // somewhere else\n * $scope.$on('$stateNotFound',\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n * </pre>\n */\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n var retryTransition = $state.transition = $q.when(evt.retry);\n\n retryTransition.then(function() {\n if (retryTransition !== $state.transition) {\n $rootScope.$broadcast('$stateChangeCancel', redirect.to, redirect.toParams, state, params);\n return TransitionSuperseded;\n }\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n }, function() {\n return TransitionAborted;\n });\n $urlRouter.update();\n\n return retryTransition;\n }", "function handleRedirect(redirect, state, params, options) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateNotFound\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when a requested state **cannot be found** using the provided state name during transition.\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n *\n * @param {Object} event Event object.\n * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n * @param {State} fromState Current state object.\n * @param {Object} fromParams Current state params.\n *\n * @example\n *\n * <pre>\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n *\n * // somewhere else\n * $scope.$on('$stateNotFound',\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n * </pre>\n */\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n var retryTransition = $state.transition = $q.when(evt.retry);\n\n retryTransition.then(function() {\n if (retryTransition !== $state.transition) return TransitionSuperseded;\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n }, function() {\n return TransitionAborted;\n });\n $urlRouter.update();\n\n return retryTransition;\n }", "function handleRedirect(redirect, state, params, options) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateNotFound\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when a requested state **cannot be found** using the provided state name during transition.\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n *\n * @param {Object} event Event object.\n * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n * @param {State} fromState Current state object.\n * @param {Object} fromParams Current state params.\n *\n * @example\n *\n * <pre>\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n *\n * // somewhere else\n * $scope.$on('$stateNotFound',\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n * </pre>\n */\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n var retryTransition = $state.transition = $q.when(evt.retry);\n\n retryTransition.then(function() {\n if (retryTransition !== $state.transition) return TransitionSuperseded;\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n }, function() {\n return TransitionAborted;\n });\n $urlRouter.update();\n\n return retryTransition;\n }", "function handleRedirect(redirect, state, params, options) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateNotFound\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when a requested state **cannot be found** using the provided state name during transition.\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n *\n * @param {Object} event Event object.\n * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n * @param {State} fromState Current state object.\n * @param {Object} fromParams Current state params.\n *\n * @example\n *\n * <pre>\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n *\n * // somewhere else\n * $scope.$on('$stateNotFound',\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n * </pre>\n */\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n var retryTransition = $state.transition = $q.when(evt.retry);\n\n retryTransition.then(function() {\n if (retryTransition !== $state.transition) return TransitionSuperseded;\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n }, function() {\n return TransitionAborted;\n });\n $urlRouter.update();\n\n return retryTransition;\n }", "function handleRedirect(redirect, state, params, options) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateNotFound\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when a requested state **cannot be found** using the provided state name during transition.\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n *\n * @param {Object} event Event object.\n * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n * @param {State} fromState Current state object.\n * @param {Object} fromParams Current state params.\n *\n * @example\n *\n * <pre>\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n *\n * // somewhere else\n * $scope.$on('$stateNotFound',\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n * </pre>\n */\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n var retryTransition = $state.transition = $q.when(evt.retry);\n\n retryTransition.then(function() {\n if (retryTransition !== $state.transition) {\n $rootScope.$broadcast('$stateChangeCancel', redirect.to, redirect.toParams, state, params);\n return TransitionSuperseded;\n }\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n }, function() {\n return TransitionAborted;\n });\n $urlRouter.update();\n\n return retryTransition;\n }", "function handleRedirect(redirect, state, params, options) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateNotFound\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when a requested state **cannot be found** using the provided state name during transition.\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n *\n * @param {Object} event Event object.\n * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n * @param {State} fromState Current state object.\n * @param {Object} fromParams Current state params.\n *\n * @example\n *\n * <pre>\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n *\n * // somewhere else\n * $scope.$on('$stateNotFound',\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n * </pre>\n */\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n var retryTransition = $state.transition = $q.when(evt.retry);\n\n retryTransition.then(function() {\n if (retryTransition !== $state.transition) {\n $rootScope.$broadcast('$stateChangeCancel', redirect.to, redirect.toParams, state, params);\n return TransitionSuperseded;\n }\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n }, function() {\n return TransitionAborted;\n });\n $urlRouter.update();\n\n return retryTransition;\n }", "function handleRedirect(redirect, state, params, options) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateNotFound\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when a requested state **cannot be found** using the provided state name during transition.\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n *\n * @param {Object} event Event object.\n * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n * @param {State} fromState Current state object.\n * @param {Object} fromParams Current state params.\n *\n * @example\n *\n * <pre>\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n *\n * // somewhere else\n * $scope.$on('$stateNotFound',\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n * </pre>\n */\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n var retryTransition = $state.transition = $q.when(evt.retry);\n\n retryTransition.then(function() {\n if (retryTransition !== $state.transition) {\n $rootScope.$broadcast('$stateChangeCancel', redirect.to, redirect.toParams, state, params);\n return TransitionSuperseded;\n }\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n }, function() {\n return TransitionAborted;\n });\n $urlRouter.update();\n\n return retryTransition;\n }", "function handleRedirect(redirect, state, params, options) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateNotFound\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when a requested state **cannot be found** using the provided state name during transition.\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n *\n * @param {Object} event Event object.\n * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n * @param {State} fromState Current state object.\n * @param {Object} fromParams Current state params.\n *\n * @example\n *\n * <pre>\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n *\n * // somewhere else\n * $scope.$on('$stateNotFound',\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n * </pre>\n */\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n var retryTransition = $state.transition = $q.when(evt.retry);\n\n retryTransition.then(function() {\n if (retryTransition !== $state.transition) return TransitionSuperseded;\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n }, function() {\n return TransitionAborted;\n });\n $urlRouter.update();\n\n return retryTransition;\n }", "function handleRedirect(redirect, state, params, options) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateNotFound\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when a requested state **cannot be found** using the provided state name during transition.\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n *\n * @param {Object} event Event object.\n * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n * @param {State} fromState Current state object.\n * @param {Object} fromParams Current state params.\n *\n * @example\n *\n * <pre>\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n *\n * // somewhere else\n * $scope.$on('$stateNotFound',\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n * </pre>\n */\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n var retryTransition = $state.transition = $q.when(evt.retry);\n\n retryTransition.then(function() {\n if (retryTransition !== $state.transition) return TransitionSuperseded;\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n }, function() {\n return TransitionAborted;\n });\n $urlRouter.update();\n\n return retryTransition;\n }", "function handleRedirect(redirect, state, params, options) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateNotFound\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when a requested state **cannot be found** using the provided state name during transition.\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n *\n * @param {Object} event Event object.\n * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n * @param {State} fromState Current state object.\n * @param {Object} fromParams Current state params.\n *\n * @example\n *\n * <pre>\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n *\n * // somewhere else\n * $scope.$on('$stateNotFound',\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n * </pre>\n */\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n var retryTransition = $state.transition = $q.when(evt.retry);\n\n retryTransition.then(function() {\n if (retryTransition !== $state.transition) {\n $rootScope.$broadcast('$stateChangeCancel', redirect.to, redirect.toParams, state, params);\n return TransitionSuperseded;\n }\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n }, function() {\n return TransitionAborted;\n });\n $urlRouter.update();\n\n return retryTransition;\n }", "function handleRedirect(redirect, state, params, options) {\n\t /**\n\t * @ngdoc event\n\t * @name ui.router.state.$state#$stateNotFound\n\t * @eventOf ui.router.state.$state\n\t * @eventType broadcast on root scope\n\t * @description\n\t * Fired when a requested state **cannot be found** using the provided state name during transition.\n\t * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n\t * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n\t * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n\t * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n\t *\n\t * @param {Object} event Event object.\n\t * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n\t * @param {State} fromState Current state object.\n\t * @param {Object} fromParams Current state params.\n\t *\n\t * @example\n\t *\n\t * <pre>\n\t * // somewhere, assume lazy.state has not been defined\n\t * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n\t *\n\t * // somewhere else\n\t * $scope.$on('$stateNotFound',\n\t * function(event, unfoundState, fromState, fromParams){\n\t * console.log(unfoundState.to); // \"lazy.state\"\n\t * console.log(unfoundState.toParams); // {a:1, b:2}\n\t * console.log(unfoundState.options); // {inherit:false} + default options\n\t * })\n\t * </pre>\n\t */\n\t var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n\t if (evt.defaultPrevented) {\n\t $urlRouter.update();\n\t return TransitionAborted;\n\t }\n\n\t if (!evt.retry) {\n\t return null;\n\t }\n\n\t // Allow the handler to return a promise to defer state lookup retry\n\t if (options.$retry) {\n\t $urlRouter.update();\n\t return TransitionFailed;\n\t }\n\t var retryTransition = $state.transition = $q.when(evt.retry);\n\n\t retryTransition.then(function() {\n\t if (retryTransition !== $state.transition) return TransitionSuperseded;\n\t redirect.options.$retry = true;\n\t return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n\t }, function() {\n\t return TransitionAborted;\n\t });\n\t $urlRouter.update();\n\n\t return retryTransition;\n\t }", "function handleRedirect(redirect, state, params, options) {\n\t /**\n\t * @ngdoc event\n\t * @name ui.router.state.$state#$stateNotFound\n\t * @eventOf ui.router.state.$state\n\t * @eventType broadcast on root scope\n\t * @description\n\t * Fired when a requested state **cannot be found** using the provided state name during transition.\n\t * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n\t * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n\t * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n\t * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n\t *\n\t * @param {Object} event Event object.\n\t * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n\t * @param {State} fromState Current state object.\n\t * @param {Object} fromParams Current state params.\n\t *\n\t * @example\n\t *\n\t * <pre>\n\t * // somewhere, assume lazy.state has not been defined\n\t * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n\t *\n\t * // somewhere else\n\t * $scope.$on('$stateNotFound',\n\t * function(event, unfoundState, fromState, fromParams){\n\t * console.log(unfoundState.to); // \"lazy.state\"\n\t * console.log(unfoundState.toParams); // {a:1, b:2}\n\t * console.log(unfoundState.options); // {inherit:false} + default options\n\t * })\n\t * </pre>\n\t */\n\t var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n\t if (evt.defaultPrevented) {\n\t $urlRouter.update();\n\t return TransitionAborted;\n\t }\n\n\t if (!evt.retry) {\n\t return null;\n\t }\n\n\t // Allow the handler to return a promise to defer state lookup retry\n\t if (options.$retry) {\n\t $urlRouter.update();\n\t return TransitionFailed;\n\t }\n\t var retryTransition = $state.transition = $q.when(evt.retry);\n\n\t retryTransition.then(function() {\n\t if (retryTransition !== $state.transition) return TransitionSuperseded;\n\t redirect.options.$retry = true;\n\t return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n\t }, function() {\n\t return TransitionAborted;\n\t });\n\t $urlRouter.update();\n\n\t return retryTransition;\n\t }", "stateTransition(){return}", "function ignoredHook(trans) {\n\t var ignoredReason = trans._ignoredReason();\n\t if (!ignoredReason)\n\t return;\n\t trace_1.trace.traceTransitionIgnored(trans);\n\t var pending = trans.router.globals.transition;\n\t // The user clicked a link going back to the *current state* ('A')\n\t // However, there is also a pending transition in flight (to 'B')\n\t // Abort the transition to 'B' because the user now wants to be back at 'A'.\n\t if (ignoredReason === 'SameAsCurrent' && pending) {\n\t pending.abort();\n\t }\n\t return rejectFactory_1.Rejection.ignored().toPromise();\n\t}", "function ignoredHook(trans) {\n var ignoredReason = trans._ignoredReason();\n if (!ignoredReason)\n return;\n trace_1.trace.traceTransitionIgnored(trans);\n var pending = trans.router.globals.transition;\n // The user clicked a link going back to the *current state* ('A')\n // However, there is also a pending transition in flight (to 'B')\n // Abort the transition to 'B' because the user now wants to be back at 'A'.\n if (ignoredReason === 'SameAsCurrent' && pending) {\n pending.abort();\n }\n return rejectFactory_1.Rejection.ignored().toPromise();\n}", "function ignoredHook(trans) {\n var ignoredReason = trans._ignoredReason();\n if (!ignoredReason)\n return;\n trace_1.trace.traceTransitionIgnored(trans);\n var pending = trans.router.globals.transition;\n // The user clicked a link going back to the *current state* ('A')\n // However, there is also a pending transition in flight (to 'B')\n // Abort the transition to 'B' because the user now wants to be back at 'A'.\n if (ignoredReason === 'SameAsCurrent' && pending) {\n pending.abort();\n }\n return rejectFactory_1.Rejection.ignored().toPromise();\n}", "transitionTo(state) {\n logger.debug(`Transaction state transition ${currentState} --> ${state}`)\n\n if (!VALID_STATE_TRANSITIONS[currentState].includes(state)) {\n throw new KafkaJSNonRetriableError(\n `Transaction state exception: Invalid transition ${currentState} --> ${state}`\n )\n }\n\n stateMachine.emit('transition', { to: state, from: currentState })\n currentState = state\n }", "trigger(event) {\r\n var states = this.config.states,\r\n prop = this.currentState,\r\n state = states[prop];\r\n if (event in state.transitions) {\r\n this.currentState = state.transitions[event];\r\n this.history.push(this.currentState);\r\n this.cancelled = [];\r\n }\r\n else throw new Error(\"State doesn't exist\");\r\n \r\n }", "trigger(event) {\r\n const { transitions } = this.states[this.currentState];\r\n const state = transitions[event];\r\n if (!state) {\r\n throw new Error(\"Transition event not found\");\r\n }\r\n \r\n this.updateState(state);\r\n }", "checkOnTransition() {\n this.timeout = 0;\n if( ! this.transitionStarted) {\n console.warn('Transition failed to start for: ', this.cssName, this.target);\n this.cleanup();\n this.events.emit('complete', transitionEvent(this));\n }\n }", "function defaultTransitionErrorHandler(error) {\n throw error; // This error probably originated in a transition hook.\n}", "function transition(state, event) {\n return machine.states[state]?.on?.[event] || state;\n}", "function checkTransitionFromHooks(matches, transition) {\n var promise = Promise.resolve();\n\n reversedArray(matches).forEach(function (match) {\n promise = promise.then(function () {\n var handler = match.route.props.handler;\n\n if (!transition.isCancelled && handler.willTransitionFrom)\n return handler.willTransitionFrom(transition, match.component);\n });\n });\n\n return promise;\n}", "function invalidTransitionHook(trans) {\n if (!trans.valid()) {\n throw new Error(trans.error());\n }\n}", "function invalidTransitionHook(trans) {\n if (!trans.valid()) {\n throw new Error(trans.error());\n }\n}", "function Transition(path, retry) {\n this.path = path;\n this.abortReason = null;\n // TODO: Change this to router.retryTransition(transition)\n this.retry = retry.bind(this);\n}", "function Transition(path, retry) {\n this.path = path;\n this.abortReason = null;\n // TODO: Change this to router.retryTransition(transition)\n this.retry = retry.bind(this);\n}", "function Transition(path, retry) {\n this.path = path;\n this.abortReason = null;\n // TODO: Change this to router.retryTransition(transition)\n this.retry = retry.bind(this);\n}", "function Transition(path, retry) {\n this.path = path;\n this.abortReason = null;\n // TODO: Change this to router.retryTransition(transition)\n this.retry = retry.bind(this);\n}", "function notFound(state) {\n log('State not found: {0}', state);\n\n if (states.notFound) setState(states.notFound);\n else throw new Error ('State \"' + state + '\" could not be found');\n }", "function defaultAbortedTransitionHandler(transition) {\n var reason = transition.abortReason;\n\n if (reason instanceof Redirect) {\n replaceWith(reason.to, reason.params, reason.query);\n } else {\n goBack();\n }\n}", "trigger(event) {\r\n if(this._config.states[this._state].transitions[event]){\r\n this._state = this._config.states[this._state].transitions[event];\r\n this._history.push(this._state);\r\n }else{\r\n throw new Error;\r\n }\r\n }", "function transition (state, event) {\n return machine.states[state]\n ?.on?.[event] || state;\n\n // switch (state) {\n // case 'active':\n // switch (event) {\n // case 'click':\n // return 'inactive'\n // default:\n // return state;\n // }\n // case 'inactive':\n // switch (event) {\n // case 'click':\n // return 'active'\n // default:\n // return state;\n // }\n // default:\n // return state;\n // }\n}", "function invalidTransitionHook(trans) {\n\t if (!trans.valid()) {\n\t throw new Error(trans.error());\n\t }\n\t}", "onSnapshotTransitionPress() {\n const { addresses, shouldPreventAction, password, selectedAccountName, t } = this.props;\n if (!shouldPreventAction) {\n const genFn = getMultiAddressGenFn();\n getSeedFromKeychain(password, selectedAccountName)\n .then((seed) => {\n if (seed === null) {\n throw new Error('Error');\n } else {\n this.props.transitionForSnapshot(seed, addresses, genFn);\n }\n })\n .catch((err) => console.error(err));\n } else {\n this.props.generateAlert('error', t('global:pleaseWait'), t('global:pleaseWaitExplanation'));\n }\n }", "runOneStepForwards() {\n this.stateHistory.nextState();\n }", "function checkTransitionToHooks(matches, transition) {\n var promise = Promise.resolve();\n\n matches.forEach(function (match, index) {\n promise = promise.then(function () {\n var handler = match.route.props.handler;\n\n if (!transition.isCancelled && handler.willTransitionTo)\n return handler.willTransitionTo(transition, match.params);\n });\n });\n\n return promise;\n}", "function Transition(path, retry) {\n\t this.path = path;\n\t this.abortReason = null;\n\t // TODO: Change this to router.retryTransition(transition)\n\t this.retry = retry.bind(this);\n\t}", "function Transition(path, retry) {\n\t this.path = path;\n\t this.abortReason = null;\n\t // TODO: Change this to router.retryTransition(transition)\n\t this.retry = retry.bind(this);\n\t}", "function Transition(path, retry) {\n\t this.path = path;\n\t this.abortReason = null;\n\t // TODO: Change this to router.retryTransition(transition)\n\t this.retry = retry.bind(this);\n\t}", "isValidateLocation() {\n return !this.state.transitioning && !this.props.delay\n }", "trigger(event) {\r\n var currentState = this.getState();\r\n var newState = this.states[currentState].transitions[event];\r\n if (newState) {\r\n this.changeState(newState);\r\n this.statesUndone.clear();\r\n }\r\n else throw new Error(\"This event can't be triggered.\");\r\n }", "trigger(event) {\r\n for (let key in this.states[this.state].transitions){\r\n if (key==event) {\r\n this.statesStack.append(this.state);\r\n this.state=this.states[this.state].transitions[key];\r\n this.undoStack.clear();\r\n return this;\r\n }\r\n }\r\n\r\n throw new Error();\r\n \r\n }", "function skip(transition) {\n us = function() {\n return transition();\n };\n }", "trigger(event) {\r\n if(this.config.states[this.currentState].transitions[event] === undefined){\r\n throw new Error('Event is undefined by config. So, Fuck Off!');\r\n }\r\n this.prevState = this.currentState;\r\n this.currentState = this.config.states[this.currentState].transitions[event];\r\n }", "transition(name) {\n const AUTO_SAVE_KEYS = ['city'];\n return new Promise((resolve, reject) => {\n this.save(AUTO_SAVE_KEYS).then(() => {\n let veto = this.checkTransitionVetos(name);\n if (veto) {\n reject(veto);\n } else {\n let data;\n if (name === 'reject') {\n data = {\n message: '',\n notify: true,\n };\n } else if (name === 'setFeedback') {\n data = {\n data: {\n answer: this.state.petition.city_answer,\n token: this.state.petition.response_token,\n }\n };\n }\n PetitionEventAPI.trigger(this.state.petition.id, name, data).then((response) => {\n this.setState({\n petition: response.data,\n });\n resolve();\n }).catch((response) => {\n reject(apiError(response));\n });\n }\n }).catch((response) => {\n reject(apiError(response));\n });\n });\n }", "_runTransitionHooks(nextState) {\n var hooks = this._getTransitionHooks(nextState);\n var nextLocation = this.nextLocation;\n\n try {\n for (var i = 0, len = hooks.length; i < len; ++i) {\n hooks[i]();\n\n if (this.nextLocation !== nextLocation)\n break; // No need to proceed further.\n }\n } catch (error) {\n this.handleError(error);\n return false;\n }\n\n // Allow the transition if nextLocation hasn't changed.\n return this.nextLocation === nextLocation;\n }", "function onInvalidInput() {\n\n transition(\"ERROR_INPUT\");\n\n }", "trigger(event) {\r\n if (!this.config.states[this.state].transitions.hasOwnProperty(event)) {\r\n throw new Error();\r\n }\r\n\r\n switch (event) {\r\n\r\n case 'study' :\r\n this.changeState('busy');\r\n this.prev = (this.prev) ? 'normal' : false;\r\n this.next.pop();\r\n this.possibleRedoCount++;\r\n break;\r\n\r\n case 'get_tired' :\r\n this.changeState('sleeping');\r\n this.prev = 'busy';\r\n this.next.pop();\r\n this.possibleRedoCount++;\r\n break;\r\n\r\n case 'get_hungry' :\r\n this.changeState('hungry');\r\n this.prev = (this.prev == 'busy') ? 'busy' : 'sleeping';\r\n this.next.pop();\r\n this.possibleRedoCount++;\r\n break;\r\n\r\n case 'eat' :\r\n case 'get up' :\r\n this.changeState('normal');\r\n this.next.pop();\r\n this.possibleRedoCount++;\r\n break;\r\n }\r\n }", "prepareNextState() {\n this.gameOrchestrator.changeState(new CheckGameOverState(this.gameOrchestrator));\n }", "trigger(event) { \r\n if (this.config.states[this.config.initial].transitions[event] == undefined) {\r\n throw new Error(\"Event: fail check\");\r\n }\r\n this.config.initial = this.config.states[this.config.initial].transitions[event]\r\n this.undoArr.push(this.config.initial)\r\n this.hack++\r\n return this.config.initial\r\n }", "function isUnattempted (e) {\n return !e.stateChange\n}", "function Transition() {\n\n /**\n * The list of transitions associated to a state\n * @private\n */\n var _transitions = {};\n\n /**\n * Add a new transition\n * @private\n * @param {String} event the event that will trigger the transition\n * @param {Function} action the function that is executed\n * @param {Object} scope [optional] the scope in which to execute the action\n * @param {String} next [optional] the name of the state to transit to.\n * @returns {Boolean} true if success, false if the transition already exists\n */\n this.add = function add(event, action, scope, next) {\n\n var arr = [];\n\n if (_transitions[event]) {\n return false;\n }\n\n if (typeof event == \"string\" &&\n typeof action == \"function\") {\n\n arr[0] = action;\n\n if (typeof scope == \"object\") {\n arr[1] = scope;\n }\n\n if (typeof scope == \"string\") {\n arr[2] = scope;\n }\n\n if (typeof next == \"string\") {\n arr[2] = next;\n }\n\n _transitions[event] = arr;\n return true;\n }\n\n return false;\n };\n\n /**\n * Check if a transition can be triggered with given event\n * @private\n * @param {String} event the name of the event\n * @returns {Boolean} true if exists\n */\n this.has = function has(event) {\n return !!_transitions[event];\n };\n\n /**\n * Get a transition from it's event\n * @private\n * @param {String} event the name of the event\n * @return the transition\n */\n this.get = function get(event) {\n return _transitions[event] || false;\n };\n\n /**\n * Execute the action associated to the given event\n * @param {String} event the name of the event\n * @param {params} params to pass to the action\n * @private\n * @returns false if error, the next state or undefined if success (that sounds weird)\n */\n this.event = function event(newEvent) {\n var _transition = _transitions[newEvent];\n if (_transition) {\n _transition[0].apply(_transition[1], toArray(arguments).slice(1));\n return _transition[2];\n } else {\n return false;\n }\n };\n}", "trigger(event) { // stackOperations = 0\r\n\r\n var isChange = false;\r\n for (var key in this.config.states[this.activeState].transitions) {\r\n if (key === event) {\r\n this.changeState(this.config.states[this.activeState].transitions[event]);\r\n isChange = true;\r\n }\r\n }\r\n\r\n if (!isChange) {\r\n throw new Error(\"Incorrect event\");\r\n }\r\n }", "function NextActorState(model, actor_state, inputs) {\n var groups = FilteredGroupsThatIncludeState(model.groups, actor_state.state_name)\n var animation_state = model.states[actor_state.state_name]\n\n var matching_transition = model.transitions.find( (transition) => {\n var is_any_state = transition.from == \"any\"\n var matches_group_name = groups.find( (group) => { return group == transition.from } ) != null\n var matches_state_name = transition.from == actor_state.state_name\n var directions_match = StringArraysHaveCommonElements(inputs, transition.input)\n\n var state_is_excluded = false\n if (transition.excluding != null) {\n state_is_excluded = transition.excluding.reduce((acc, name) => {\n return acc || (name == actor_state.state_name || (groups.find( (group) => { group == name } )))\n }, false)\n }\n\n return (is_any_state || matches_group_name || matches_state_name) && directions_match && !state_is_excluded\n })\n\n var next_state_name = actor_state.state_name\n var next_frame_index = actor_state.frame_index\n\n if (matching_transition != null) {\n var next_state = model.states[matching_transition.to]\n if (next_state != null) {\n next_state_name = matching_transition.to\n if (matching_transition.no_reset != true) {\n next_frame_index = 0\n } else {\n next_frame_index = next_frame_index + 1\n if (next_frame_index >= next_state.frames.length) {\n next_frame_index = 0\n }\n }\n } else {\n // State doesn't exist, go to default\n next_state_name = model.default_state\n next_frame_index = 0\n }\n } else {\n next_frame_index = actor_state.frame_index + 1\n if (next_frame_index >= animation_state.frames.length) {\n if (animation_state.next != null) {\n next_state_name = animation_state.next\n } else {\n next_state_name = model.default_state\n }\n next_frame_index = 0\n }\n }\n\n var new_actor_state = {...actor_state}\n new_actor_state.state_name = next_state_name\n new_actor_state.frame_index = next_frame_index\n\n return new_actor_state\n}", "transitionCompleted() {\n // implement if needed\n }", "function cancelOnTransitionEnd(ev) {\n if (ev.target !== this) return;\n cancelTransition();\n }", "function cancelOnTransitionEnd(ev) {\n if (ev.target !== this) return;\n cancelTransition();\n }", "trigger(event) {\r\n if (this.config.states[this.currentState].transitions[event]) {\r\n this.currentState = this.config.states[this.currentState].transitions[event];\r\n this.history.push(this.currentState);\r\n this.isRedo = false;\r\n } else {\r\n throw new Error();\r\n }\r\n }", "function isFirstTransition() {\n return previousState == null;\n }", "function delayTransitionInComplete() { \n\t\t//setTimeout(transitionInComplete, 0);\n\t\ttransitionInComplete();\n\t}", "function _resolveTransition() {\n var transition = _transitionQueue[0];\n var promise;\n\n _logTransition('Resolving', transition);\n\n if (transition.cancel) {\n _logTransition('Cancelled', transition);\n\n promise = Promise.resolve(_NO_CHANGE_OBJECT);\n } else {\n promise = _executeTransition(transition);\n }\n\n return promise.then(function (params) {\n var done = _transitionQueue.shift();\n\n _logTransition('Done with', done);\n\n if (params[_HAS_CHANGED] === true) {\n // Build the window title that will appear in the browser history\n var titleInfo = _buildTitle(rootRouter);\n\n var title;\n\n if (titleInfo.title !== '') {\n title = titleInfo.title;\n } else if (_originalTitle && _originalTitle.length > 0) {\n title = _originalTitle;\n\n if (titleInfo.segment !== '') {\n title += _TITLE_SEP + titleInfo.segment;\n }\n } else {\n title = titleInfo.segment;\n }\n\n if (title !== window.document.title) {\n window.document.title = title;\n }\n }\n\n dispatchTransitionedToState(params);\n return params;\n }, function (error) {\n _transitionQueue = [];\n Logger.error('Error when executing transition: %o', error);\n dispatchTransitionedToState(_NO_CHANGE_OBJECT);\n return Promise.reject(error);\n });\n }", "function Transition(path, retry) {\n this.path = path;\n this.abortReason = null;\n this.isAborted = false;\n this.retry = retry.bind(this);\n this._promise = null;\n}", "function notFound(state) {\n logger.log('State not found: {0}', state);\n\n if (options.notFound)\n return setState(leafStates[options.notFound] || options.notFound, {});\n else throw new Error ('State \"' + state + '\" could not be found');\n }", "function become(newState) {\n if (acceptableStates.indexOf(newState) === -1) {\n console.log(newState + ' is not an acceptable state');\n return;\n }\n state = newState;\n}", "trigger(event) {\r\n let changeState = true;\r\n let eventSuccess = false;\r\n let history = this.history;\r\n let active = this.active;\r\n historyChange = false;\r\n if (!this.events.includes(event) || this.flagError) {\r\n changeState = false;\r\n eventSuccess = true;\r\n this.flagError = true;\r\n throw new Error('!ERROR!');\r\n return;\r\n }\r\n if ( !this.flagError ) {\r\n if (active == 'hungry' && changeState != false) {\r\n switch (event) {\r\n case 'eat': this.changeState('normal');\r\n break;\r\n case 'study': this.changeState('normal');\r\n this.changeState('busy');\r\n break;\r\n case 'get_tired': this.changeState('normal');\r\n this.changeState('busy');\r\n this.changeState('sleeping');\r\n break;\r\n default: this.reset();\r\n }\r\n changeState = false;\r\n } \r\n if (active == 'normal' && changeState != false) {\r\n switch (event) {\r\n case 'study': this.changeState('busy');\r\n break;\r\n case 'get_tired': this.changeState('busy');\r\n this.changeState('sleeping');\r\n break;\r\n case 'get_hungry': this.changeState('busy');\r\n this.changeState('hungry');\r\n break;\r\n default: this.reset();\r\n }\r\n changeState = false;\r\n }\r\n if (active == 'sleeping' && changeState != false) {\r\n switch (event) {\r\n case 'get_hungry': this.changeState('hungry');\r\n break;\r\n case 'get_up': this.changeState('normal');\r\n break;\r\n case 'study': this.changeState('normal');\r\n this.changeState('busy');\r\n break;\r\n default: this.reset();\r\n } \r\n changeState = false;\r\n }\r\n if (active == 'busy' && changeState != false) {\r\n switch (event) {\r\n case 'get_hungry': this.changeState('hungry');\r\n break;\r\n case 'get_tired': this.changeState('sleeping');\r\n break;\r\n default: this.reset();\r\n }\r\n changeState = false;\r\n }\r\n }\r\n }", "trigger(event) {\r\n\r\n var temp = this.config.states[this.state].transitions[event];\r\n this.changeState(temp);\r\n }", "function solveRestOfBoard() {\n if (BoardModel.state._priorState) {\n BoardModel.state = BoardModel.state._priorState;\n BoardView.renderState(BoardModel.state, 50);\n\n setTimeout(function() {\n // Show the next step in 40ms.\n solveRestOfBoard();\n }, 40);\n }\n else {\n BoardModel.state.computeCanMove();\n }\n }", "handleChange() {\n this.transitionCheckState_();\n }", "function handleInvalidStateChanges(newState) {\n if (!isValidState(newState)) {\n signalChangeFailed(\"'\" + newState + \"' is not a valid state\", newState)\n\n return false;\n }\n\n if (!isValidTransition(currentState, newState)) {\n signalChangeFailed(\"'\" + currentState + \"' cannot transition to '\" + newState + \"'\", newState)\n\n return false;\n }\n\n return true;\n }", "onBalanceIncompletePress() {\n const genFn = getMultiAddressGenFn();\n const { transitionAddresses, password, selectedAccountName } = this.props;\n const currentIndex = transitionAddresses.length;\n this.props.setBalanceCheckFlag(false);\n setTimeout(() => {\n getSeedFromKeychain(password, selectedAccountName).then((seed) => {\n if (seed === null) {\n throw new Error('Error');\n } else {\n this.props.generateAddressesAndGetBalance(seed, currentIndex, genFn);\n }\n });\n }, 300);\n }", "function getTransition(state, key) {\n\t\t\treturn state.lookup[key];\n\t\t}", "onRejected(r) {\r\n //once settled can't go back\r\n if (this.state === states[0]) {\r\n this.state = states[2];\r\n this.reason = r;\r\n //notify waiting promises about reject\r\n this.backtrackTheChainR();\r\n }\r\n }", "function loadCurrentOrDefaultState() {\r\n var currentStateUrl = $location.$$url || '/home';\r\n var currentStateUrlAndQuery = currentStateUrl.split('?');\r\n var query = currentStateUrlAndQuery[1];\r\n currentStateUrl = currentStateUrlAndQuery[0];\r\n var currentStateName = currentStateUrl.split('/');\r\n currentStateName.shift();\r\n currentStateName = currentStateName.join('.');\r\n var stateParamsObj = convertQueryToStateParamsObj(query);\r\n if (isStateExist(currentStateName)) {\r\n $state.go(currentStateName, stateParamsObj);\r\n } else {\r\n $state.go('home', stateParamsObj);\r\n }\r\n }", "function completeOnTransitionEnd(ev) {\n if (ev.target !== this) return;\n transitionComplete();\n }", "function completeOnTransitionEnd(ev) {\n if (ev.target !== this) return;\n transitionComplete();\n }", "function system_throw_on_invalid_id(state, id){\n if(state[id] === undefined){\n console.log(state);\n throw new Error(\"Cannot find the id: \" + id + \" in State!\");\n }\n}", "changeState(state) {\r\n let possibleStates = ['normal', 'busy', 'hungry', 'sleeping'];\r\n let errorCount = 0;\r\n for (let index = 0; index < possibleStates.length; index++) {\r\n const element = possibleStates[index];\r\n if (state === element) {\r\n errorCount++\r\n }\r\n }\r\n if(errorCount === 0) {\r\n throw new Error(\"State: fail check\");\r\n } \r\n this.config.initial = state\r\n this.undoArr.push(this.config.initial)\r\n return this.config.initial \r\n }", "stateChangeHandlerFulfilled(event, actionId) {\n if (this.stateChangeHandlersReservations[event] === undefined ||\n this.stateChangeHandlers[event] === undefined) {\n let err = \"\";\n if (this.stateChangeHandlersReservations[event] === undefined) {\n err += `No promise reservation for event=${event}. `;\n }\n if (this.stateChangeHandlers[event] === undefined) {\n err += `No handler for event=${event}. `;\n }\n logger.error(new StateChangeHandlerReserved_1.StateChangeHandlerReservedException(this.logCtx(actionId, event, err)));\n }\n this.stateChangeHandlersReservations[event] = undefined;\n this.stateChangeHandlers[event] = undefined;\n }", "function checkIfTransitionIsValid (v,w,name,g) {\n try {\n let transition = g.edge(v,w, name).elem;\n } catch(e) {\n if(e instanceof TypeError) {\n return false;\n } \n }\n return true;\n}", "function goto_next_state(was_result_expected) {\n\tif (!has_error_occurred) {\n\t var cit = cookie_investigating_tabs[my_tab_id];\n\t cit.bool_state_in_progress = false;\n\t return next_state(was_result_expected);\n\t}\n\n\treturn \"st_terminate\";\n }", "function runTransitionFromHooks(matches, transition) {\n var promise = Promise.resolve();\n\n reversedArray(matches).forEach(function (match) {\n promise = promise.then(function () {\n var handler = match.route.props.handler;\n\n if (!transition.isAborted && handler.willTransitionFrom)\n return handler.willTransitionFrom(transition, match.component);\n });\n });\n\n return promise;\n}", "async _step() {\n\t\t// Close our stand if it was open\n\t\tthis.close_stand();\n\n\t\tfor (let state of this.states) {\n\t\t\tif (state.predicate && !state.predicate()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tthis.state.name = state.name;\n\t\t\twindow.set_message(state.name);\n\t\t\tawait this._current_state();\n\t\t\treturn;\n\t\t}\n\n\t\tLogging.error('No states found!')\n\t\tthis.stop();\n\t}", "_doTransitionToIdle() {\n return false\n }", "trigger(event) {\r\n let state = this.states[this.currentState];\r\n if (!state.transitions[event]) throw new SyntaxError (\"there is no state\");\r\n this.history.splice(this.step+1);\r\n this.changeState(state.transitions[event]);\r\n }", "prepareTransition() {\n this.setState({isLoading: true});\n\n clearTimeout(this.loadingTimerId);\n this.loadingTimerId = setTimeout(() => this.setState({isLoading: false}), 150);\n }", "onTransitionEnd () {\n this.setState((prevState) => {\n return prevState.movingTo ? this.silentState : {}\n })\n\n // set next index if transition buffer has something else\n if (this.transitionBuffer.length > 0) {\n this.gotoSlide(this.transitionBuffer.shift())\n } else {\n // re-start autoplay\n this.setAutoPlay()\n }\n }", "trigger(event) {\r\n var tr = this.config.states[this.activeState].transitions;\r\n if (tr[event] == undefined) {\r\n throw new Error(\"yryjinug\")\r\n }\r\n this.history1.push(this.activeState);\r\n this.activeState = this.config.states[this.activeState].transitions[event];\r\n this.history2 = [];\r\n\r\n\r\n }" ]
[ "0.649119", "0.64288294", "0.62691057", "0.62201154", "0.6141503", "0.6141503", "0.6141503", "0.6141503", "0.6141503", "0.6141503", "0.6141503", "0.6141503", "0.6141503", "0.6141503", "0.6141503", "0.6141503", "0.6141503", "0.6141503", "0.6141503", "0.6141503", "0.6141503", "0.6141503", "0.61050195", "0.61050195", "0.59978336", "0.59367603", "0.5925114", "0.5925114", "0.5887655", "0.5825662", "0.5815281", "0.57255375", "0.5697182", "0.56854606", "0.5641389", "0.55426323", "0.55426323", "0.5527505", "0.5527505", "0.5527505", "0.5527505", "0.55265", "0.5502121", "0.55009717", "0.54750943", "0.5455439", "0.54410446", "0.5429231", "0.54281145", "0.54256564", "0.54256564", "0.54256564", "0.5407679", "0.5404979", "0.54015815", "0.5397347", "0.53896314", "0.5384974", "0.53783137", "0.53673935", "0.53540295", "0.53499335", "0.53340757", "0.5319378", "0.52931184", "0.5290225", "0.5274766", "0.52727693", "0.52643836", "0.52643836", "0.5244116", "0.5238179", "0.5218863", "0.5209957", "0.5200202", "0.5192471", "0.5169073", "0.51690525", "0.51341003", "0.5115511", "0.5107152", "0.5101367", "0.50952405", "0.508772", "0.5081074", "0.50733346", "0.5055421", "0.5055421", "0.50475687", "0.50416356", "0.50303864", "0.5026397", "0.5024485", "0.5000236", "0.49953234", "0.49911025", "0.49900928", "0.4988573", "0.49883124", "0.49813852" ]
0.6146717
4
Return true if there are no differences in nonsearch (path/object) params, false if there are differences
function nonSearchParamsEqual(fromAndToState, fromParams, toParams) { // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params. function notSearchParam(key) { return fromAndToState.params[key].location != "search"; } var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam); var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys)); var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams); return nonQueryParamSet.$$equals(fromParams, toParams); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n\t // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n\t function notSearchParam(key) {\n\t return fromAndToState.params[key].location != \"search\";\n\t }\n\t var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n\t var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n\t var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n\t return nonQueryParamSet.$$equals(fromParams, toParams);\n\t }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n\t\t\t\t// Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n\t\t\t\tfunction notSearchParam(key) {\n\t\t\t\t\treturn fromAndToState.params[key].location != \"search\";\n\t\t\t\t}\n\t\t\t\tvar nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n\t\t\t\tvar nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n\t\t\t\tvar nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n\t\t\t\treturn nonQueryParamSet.$$equals(fromParams, toParams);\n\t\t\t}", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location !== \"search\";\n }\n\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam),\n nonQueryParams = _.pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys)),\n nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "anyDiff() {\n if (this.diff) return true;\n const anyFileDiff = this.files.some(file => file.diff);\n if (anyFileDiff) return true;\n const anyFolderDiff = this.folders.some(folder => folder.anyDiff());\n if (anyFolderDiff) return true;\n return false;\n }", "function check_params(params){\n for(var i=0; i < params.length; i ++){\n if(!params_search[params[i]]){\n return false\n }\n }\n return true;\n }", "function areThereMissingPathsInParams(paths, parameters) {\n let missingFields = false;\n for (let path of paths) {\n if (!parameters.hasOwnProperty(path)) missingFields = true;\n }\n return missingFields;\n}", "anyDiff() {\n if (this.diff) return true;\n const anyFolderDiff = this.folders.some(folder => folder.anyDiff());\n if (anyFolderDiff) return true;\n return false;\n }", "function notSearchParam(key) {\n\t return fromAndToState.params[key].location != \"search\";\n\t }", "function hasDifferences(a, b) {\n return JSON.stringify(a) !== JSON.stringify(b)\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n\t\t\t\t\treturn fromAndToState.params[key].location != \"search\";\n\t\t\t\t}", "function paramsAreEqual(oldParams, newParams) {\n let newParamsArray = Object.getOwnPropertyNames(newParams)\n .filter((prop) => {\n return newParams[prop] !== null && prop !== 'bbox';\n })\n .map((prop) => {\n return [prop, newParams[prop]];\n });\n let oldParamsArray = Object.getOwnPropertyNames(oldParams)\n .filter((prop) => {\n return oldParams[prop] !== null && prop !== 'bbox';\n })\n .map((prop) => {\n return [prop, oldParams[prop]];\n });\n return JSON.stringify(newParamsArray.sort()) ===\n JSON.stringify(oldParamsArray.sort());\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location !== \"search\";\n }", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n // Duck-typing as a necessary condition.\n if (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n return false;\n } // Brand-checking and more duck-typing as optional condition.\n\n\n return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function shallowEqual(object1, object2) {\n if(\n (object1['searchTerm'] !== object2['searchTerm']) ||\n (object1['richtext'] !== object2['richtext']) ||\n (object1['buttonsCount'] !== object2['buttonsCount']) ||\n (object1['imagesCount'] !== object2['imagesCount']) ||\n (object1['links'] !== object2['links']) ||\n (object1['listing'] !== object2['listing']) ||\n (object1['typeName'] !== object2['typeName'])\n ) {\n return false\n } else {\n return true\n }\n }", "function isURLSearchParams(obj) {\n // Duck-typing as a necessary condition.\n if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n return false;\n }\n\n // Brand-checking and more duck-typing as optional condition.\n return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function partialDeepEqual(a, b) {\r\n if (a === b) {\r\n return true;\r\n }\r\n\r\n if (typeof a !== typeof b) {\r\n return false;\r\n }\r\n\r\n if (a && b && typeof a === 'object' && typeof b === 'object') {\r\n return !Object.keys(b).some(function (key) {\r\n return !partialDeepEqual(a[key], b[key]);\r\n });\r\n }\r\n\r\n return false;\r\n}", "isWhereMergeable(a, b) {\n for (let key in a) {\n let valueA = a[key];\n if (key in b) {\n let valueB = b[key];\n if (typeof valueA === 'object' && typeof valueB === 'object') {\n if (!this.isWhereMergeable(valueA, valueB)) {\n // console.log(valueA, valueB, key, false);\n return false;\n }\n } else {\n // console.log(valueA, valueB, key, false, 1);\n return false;\n }\n }\n }\n\n return true;\n }", "function checkParameters(params) {\n for (let i = 0; i < params.length; i++)\n if (params[i] === undefined)\n return false;\n \n return true;\n}", "samePagination (oldPag, newPag) {\n // eslint-disable-next-line no-unused-vars\n for (let prop in newPag) {\n if (newPag[prop] !== oldPag[prop]) {\n return false\n }\n }\n return true\n }", "function isURLSearchParams$1(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "inputPathsEqual(a, b) {\n if (a == null || b == null) {\n return a == null === (b == null);\n }\n\n return a.length === b.length && a.every((item, index) => {\n return b[index] === item;\n });\n }", "_areDifferent(a, b) {\n if (a instanceof Date) {\n if (b instanceof Date) {\n return a.getTime() !== b.getTime();\n }\n else if (typeof b === 'string') {\n try {\n return a.getTime() !== new Date(b).getTime();\n }\n catch (err) {\n //\n }\n }\n\n return true;\n }\n\n if (b instanceof Date) {\n if (typeof a === 'string') {\n try {\n return b.getTime() !== new Date(a).getTime();\n }\n catch (err) {\n //\n }\n }\n return true;\n }\n\n if (typeof a !== 'object' || typeof a !== typeof b) {\n if (a !== b) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n if (JSON.stringify(a) !== JSON.stringify(b)) {\n return true;\n }\n else {\n return false;\n }\n }\n }", "function checkSameParams(a, b) {\r\n for (const key of a.keys) {\r\n if (!key.optional && !b.keys.find(isSameParam.bind(null, key)))\r\n return warn(`Alias \"${b.record.path}\" and the original record: \"${a.record.path}\" should have the exact same param named \"${key.name}\"`);\r\n }\r\n for (const key of b.keys) {\r\n if (!key.optional && !a.keys.find(isSameParam.bind(null, key)))\r\n return warn(`Alias \"${b.record.path}\" and the original record: \"${a.record.path}\" should have the exact same param named \"${key.name}\"`);\r\n }\r\n}", "function checkSameParams(a, b) {\r\n for (const key of a.keys) {\r\n if (!key.optional && !b.keys.find(isSameParam.bind(null, key)))\r\n return warn(`Alias \"${b.record.path}\" and the original record: \"${a.record.path}\" should have the exact same param named \"${key.name}\"`);\r\n }\r\n for (const key of b.keys) {\r\n if (!key.optional && !a.keys.find(isSameParam.bind(null, key)))\r\n return warn(`Alias \"${b.record.path}\" and the original record: \"${a.record.path}\" should have the exact same param named \"${key.name}\"`);\r\n }\r\n}", "function matches(target, props){\n\t // can't use \"object/every\" because of circular dependency\n\t var result = true;\n\t forOwn(props, function(val, key){\n\t if (target[key] !== val) {\n\t // break loop at first difference\n\t return (result = false);\n\t }\n\t });\n\t return result;\n\t }", "function objectCompare(object1, object2) {\n let equal = true;\n if (object2) {\n Object.keys(object1).forEach(p => {\n if (\n object1[p] === '' &&\n object2[p] !== undefined &&\n object2[p] !== ''\n ) {\n equal = false;\n } else if (object1[p] !== '' && object2[p] === undefined) {\n equal = false;\n } else if (object1[p] !== '' && object2[p] !== undefined) {\n if (object1[p] !== object2[p]) {\n equal = false;\n }\n }\n });\n }\n return equal;\n }", "function deepEqual(a,b) \n{\n//two inputs ob ojects\n\tif (a === b) return true; //this is true when these share same value prop.\n\tif (a == null || typeof a !=\"object\" || b == null || typeof b !=\"object\" ) //Null =/ null\n\t\treturn false; //this checks if they dont equal\n\n\tvar a_count = 0, b_count = 0; //counters for loop iteration\n\tfor(var properties in a)\n\t\ta_count++;\n\tfor( var properties in b) \n\t{\n\t\tb_count++;\n\t\n\tif(!(properties in a) || !deepEqual(a[properties], b[properties]))\n\t\treturn false;\n\t}\nreturn a_count === b_count;\n}", "function paramIsEmpty(paramObj) {\n\treturn Object.keys(paramObj).length === 0;\n}", "function sameProps(objA, objB) {\n var keysA = Object.keys(objA)\n var keysB = Object.keys(objB)\n\n if (keysA.length !== keysB.length)\n return false\n\n for (var i = 0; i < keysA.length; i++) {\n if (keysA[i] !== keysB[i])\n return false\n }\n\n return true\n}", "function validParams (params) {\t\n\tfor(var param in params){\n\t\tif(!params[param])\n\t\t\treturn false;\n\t}\n\treturn true;\n}", "function isEqual(a, b) {\n if (a.Subtype !== b.Subtype || a.Params.CheckSum.toString() !== b.Params.CheckSum.toString() || a.Params.Size !== b.Params.Size || a.Params.CreationDate !== b.Params.CreationDate || a.Params.ModDate !== b.Params.ModDate) {\n return false;\n }\n\n return true;\n}", "deepEqual(a, b) {\n // If two \n if(a === b) {\n return true\n }; \n\n // Check for any condition that would cause args not to be equal\n if(a === null || b === null || typeof a != 'object' || typeof b != 'object') {\n return false\n };\n\n // Check for equality in number of properties and properties themselves\n var propsA = 0, \n propsB = 0;\n\n for(var prop in a) {\n propsA += 1;\n\n for (var prop in b) {\n propsB += 1;\n if (!(prop in a) || !this.deepEqual(a[prop], b[prop])) {\n return false;\n }\n }\n }\n\n return propsInA == propsInB;\n }", "isDiffText(a, b) {\n return !isEmpty(a) && !isEmpty(b) ? (b !== a) : true;\n }", "function compareProps(obj1, obj2) {\n for (let prop in obj1) {\n /////// if ne demek istiyorr!(......)\n if (!(prop in obj2) || obj1[prop] !== obj2[prop]) {\n return false;\n }\n }\n return true;\n}", "static updated (elem, previousProps) {\n // The 'previousProps' will be undefined if it is the initial render.\n if (!previousProps) {\n return true;\n }\n\n // The 'previousProps' will always contain all of the keys.\n //\n // Use classic loop because:\n // 'for ... in' skips symbols and 'for ... of' is not working yet with IE!?\n // for (let nameOrSymbol of getPropNamesAndSymbols(previousProps)) {\n const namesAndSymbols = getPropNamesAndSymbols(previousProps);\n for (let i = 0; i < namesAndSymbols.length; i++) {\n const nameOrSymbol = namesAndSymbols[i];\n\n // With Object.is NaN is equal to NaN\n if (!objectIs(previousProps[nameOrSymbol], elem[nameOrSymbol])) {\n return true;\n }\n }\n\n return false;\n }", "static updated (elem, previousProps) {\n // The 'previousProps' will be undefined if it is the initial render.\n if (!previousProps) {\n return true;\n }\n\n // The 'previousProps' will always contain all of the keys.\n //\n // Use classic loop because:\n // 'for ... in' skips symbols and 'for ... of' is not working yet with IE!?\n // for (let nameOrSymbol of getPropNamesAndSymbols(previousProps)) {\n const namesAndSymbols = getPropNamesAndSymbols(previousProps);\n for (let i = 0; i < namesAndSymbols.length; i++) {\n const nameOrSymbol = namesAndSymbols[i];\n\n // With Object.is NaN is equal to NaN\n if (!objectIs(previousProps[nameOrSymbol], elem[nameOrSymbol])) {\n return true;\n }\n }\n\n return false;\n }", "function isJustScrollingToNewPage(prevOptions, options) {\n if (!prevOptions) {\n // It's a new search, or we just popped back from a different view.\n return false;\n }\n\n // Compare every field except for 'page' and 'release_time'.\n // There might be better ways to achieve this.\n let tmpPrevOptions = { ...prevOptions };\n tmpPrevOptions.page = -1;\n tmpPrevOptions.release_time = '';\n\n let tmpOptions = { ...options };\n tmpOptions.page = -1;\n tmpOptions.release_time = '';\n\n return JSON.stringify(tmpOptions) === JSON.stringify(tmpPrevOptions);\n }", "static softEquals(a, b) {\n if (!a && !b) {\n return true;\n }\n if (!a || !b) {\n return false;\n }\n return (a.searchText === b.searchText\n && a.matchCase === b.matchCase\n && a.wordSeparators === b.wordSeparators\n && a.modelVersionId === b.modelVersionId);\n }", "function objectsAreDifferent(dominantObject: Object, slaveObject: Object) : boolean {\n for (const key:string in dominantObject) {\n if (!dominantObject.hasOwnProperty(key)) {\n continue;\n }\n\n const dominantKeyValue: any = dominantObject[key];\n const slaveKeyValue: any = slaveObject[key];\n\n if (!slaveKeyValue) {\n return true;\n }\n\n if (typeof dominantKeyValue === 'object') {\n return objectsAreDifferent(dominantKeyValue, slaveKeyValue);\n }\n\n if (dominantKeyValue !== slaveKeyValue) {\n return true;\n }\n }\n\n return false;\n}", "sameJSONStructure(o1, o2) {\n var equal = true;\n for (var i in o1) {\n if (!o2.hasOwnProperty(i)) {\n equal = false;\n }\n }\n\n return equal;\n }" ]
[ "0.67805964", "0.67467237", "0.6649275", "0.6638825", "0.6638825", "0.6638825", "0.6638825", "0.6638825", "0.6638825", "0.6638825", "0.6638825", "0.6638825", "0.6638825", "0.6638825", "0.6638825", "0.6638825", "0.6638825", "0.6429205", "0.634342", "0.63095033", "0.6238424", "0.6231619", "0.62248135", "0.6219735", "0.6214984", "0.6214984", "0.6214984", "0.6214984", "0.6214984", "0.6214984", "0.6214984", "0.6214984", "0.6214984", "0.6214984", "0.6214984", "0.6214984", "0.6214984", "0.6214984", "0.61778015", "0.61653835", "0.6121561", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.6029492", "0.60100055", "0.60064846", "0.59815216", "0.5960375", "0.593821", "0.58249635", "0.58223563", "0.58032036", "0.5749822", "0.57344276", "0.5675657", "0.5675657", "0.56624365", "0.56616724", "0.56026644", "0.55901307", "0.5582704", "0.557994", "0.5551552", "0.5543626", "0.5536802", "0.5522482", "0.5522072", "0.5522072", "0.55206305", "0.55005425", "0.5499582", "0.54970914" ]
0.6690745
2
Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.
function notSearchParam(key) { return fromAndToState.params[key].location != "search"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n\t // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n\t function notSearchParam(key) {\n\t return fromAndToState.params[key].location != \"search\";\n\t }\n\t var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n\t var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n\t var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n\t return nonQueryParamSet.$$equals(fromParams, toParams);\n\t }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n\t\t\t\t// Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n\t\t\t\tfunction notSearchParam(key) {\n\t\t\t\t\treturn fromAndToState.params[key].location != \"search\";\n\t\t\t\t}\n\t\t\t\tvar nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n\t\t\t\tvar nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n\t\t\t\tvar nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n\t\t\t\treturn nonQueryParamSet.$$equals(fromParams, toParams);\n\t\t\t}", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location !== \"search\";\n }\n\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam),\n nonQueryParams = _.pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys)),\n nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function notSearchParam(key) {\n\t\t\t\t\treturn fromAndToState.params[key].location != \"search\";\n\t\t\t\t}", "function notSearchParam(key) {\n\t return fromAndToState.params[key].location != \"search\";\n\t }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location !== \"search\";\n }", "function check_params(params){\n for(var i=0; i < params.length; i ++){\n if(!params_search[params[i]]){\n return false\n }\n }\n return true;\n }", "function paramsAreEqual(oldParams, newParams) {\n let newParamsArray = Object.getOwnPropertyNames(newParams)\n .filter((prop) => {\n return newParams[prop] !== null && prop !== 'bbox';\n })\n .map((prop) => {\n return [prop, newParams[prop]];\n });\n let oldParamsArray = Object.getOwnPropertyNames(oldParams)\n .filter((prop) => {\n return oldParams[prop] !== null && prop !== 'bbox';\n })\n .map((prop) => {\n return [prop, oldParams[prop]];\n });\n return JSON.stringify(newParamsArray.sort()) ===\n JSON.stringify(oldParamsArray.sort());\n }", "function paramDiff(oldParams, newParams) {\n var diff = {},\n oldParams = oldParams || {};\n\n for (var name in oldParams)\n if (oldParams[name] != newParams[name]) diff[name] = 1;\n\n for (var name in newParams)\n if (oldParams[name] != newParams[name]) diff[name] = 1;\n\n return diff;\n }", "function Query_If_RangeHasChanged(){\n\n var sFrom = document.getElementById(\"txt_dtmFrom\").value;\n var sTo = document.getElementById(\"txt_dtmTo\").value;\n\n if(sFrom != sParamDateFrom || sTo != sParamDateTo)\n ExecuteNewSearch();\n}", "_entityVerify (entity, params, inputSearch) {\n\t\treturn params.reduce((valid, param) => {\n\t\t\tif (!valid)\n\t\t\t\treturn false\n\n\t\t\tif (param.operator === '$' && param.descriptor.type === String)\n\t\t\t\tparam.operator = '$in'\n\n\t\t\tlet attrValue\n\n\t\t\tif (entity instanceof Array && param.attr.match(/\\./)) {\n\t\t\t\tconst attr = param.attr.split('.').slice(1).join('.')\n\t\t\t\tattrValue = entity.genres.map(g => this._getAttr(attr, entity))\n\t\t\t} else {\n\t\t\t\tattrValue = entity[param.attr]\n\t\t\t}\n\n\t\t\tif (param.descriptor.searchSepAnd && inputSearch.match(param.descriptor.searchSepAnd)) {\n\t\t\t\tconst values = param.value.split(param.descriptor.searchSepAnd)\n\t\t\t\t\t.map(value => this._verify(attrValue, param.operator, value))\n\n\t\t\t\treturn values.reduce((p, valid) => p && valid, true)\n\t\t\t} else if (param.descriptor.searchSepOr && inputSearch.match(param.descriptor.searchSepOr)) {\n\t\t\t\tconst values = param.value.split(param.descriptor.searchSepOr)\n\t\t\t\t\t.map(value => this._verify(attrValue, param.operator, value))\n\n\t\t\t\treturn values.reduce((p, valid) => p || valid, false)\n\t\t\t}\n\n\t\t\treturn this._verify(attrValue, param.operator, param.value)\n\t\t}, true)\n\t}", "_validateParams(method, params) {\n for (let param in this._paramTypes[method]) {\n if (typeof params[param] !== this._paramTypes[method][param]) {\n return false;\n }\n }\n return true;\n }", "function checkSameParams(a, b) {\r\n for (const key of a.keys) {\r\n if (!key.optional && !b.keys.find(isSameParam.bind(null, key)))\r\n return warn(`Alias \"${b.record.path}\" and the original record: \"${a.record.path}\" should have the exact same param named \"${key.name}\"`);\r\n }\r\n for (const key of b.keys) {\r\n if (!key.optional && !a.keys.find(isSameParam.bind(null, key)))\r\n return warn(`Alias \"${b.record.path}\" and the original record: \"${a.record.path}\" should have the exact same param named \"${key.name}\"`);\r\n }\r\n}", "function checkSameParams(a, b) {\r\n for (const key of a.keys) {\r\n if (!key.optional && !b.keys.find(isSameParam.bind(null, key)))\r\n return warn(`Alias \"${b.record.path}\" and the original record: \"${a.record.path}\" should have the exact same param named \"${key.name}\"`);\r\n }\r\n for (const key of b.keys) {\r\n if (!key.optional && !a.keys.find(isSameParam.bind(null, key)))\r\n return warn(`Alias \"${b.record.path}\" and the original record: \"${a.record.path}\" should have the exact same param named \"${key.name}\"`);\r\n }\r\n}", "function checkParameters(params) {\n for (let i = 0; i < params.length; i++)\n if (params[i] === undefined)\n return false;\n \n return true;\n}", "_entityVerifyOr (entity, params, inputSearch) {\n\t\treturn params.reduce((valid, and) => {\n\t\t\tif (valid) return true\n\t\t\treturn this._entityVerify(entity, and, inputSearch)\n\t\t}, false)\n\t}", "getQueryParams(filters) {\n var params = [];\n if (filters.from !== null && filters.from !== undefined) {\n params.push([\"from_date\", filters.from,]);\n }\n if (filters.to !== null && filters.to !== undefined) {\n params.push([\"to_date\", filters.to,]);\n }\n var queryString = new URLSearchParams(params).toString();\n if (queryString === \"\") {\n return queryString;\n }\n return \"?\" + queryString;\n }", "function isSameState(newState, newParams) {\n var state, params, diff;\n\n if (transition) {\n state = transition.to;\n params = transition.toParams;\n }\n else {\n state = currentState;\n params = currentParams;\n }\n\n diff = paramDiff(params, newParams);\n\n return (newState == state) && (objectSize(diff) == 0);\n }", "function validParams (params) {\t\n\tfor(var param in params){\n\t\tif(!params[param])\n\t\t\treturn false;\n\t}\n\treturn true;\n}", "samePagination (oldPag, newPag) {\n // eslint-disable-next-line no-unused-vars\n for (let prop in newPag) {\n if (newPag[prop] !== oldPag[prop]) {\n return false\n }\n }\n return true\n }", "function setupDateQuery( params ) {\n if( 'all' !== params.dateFrom ) {\n // we will not always provide a time range\n if( !params.duration && !params.dateTo ) {\n params.duration = 'day';\n }\n\n if( 'now' === params.dateFrom ) {\n params.dateFrom = moment();\n } else if( 'today' === params.dateFrom ) {\n params.dateFrom = moment().startOf( 'day' );\n }\n\n if( params.duration ) {\n params.dateFrom = moment( params.dateFrom );\n if( !params.dateFrom.isValid() ) {\n return false;\n }\n }\n }\n return true;\n }", "hasParams() {\n precondition.ensureNotNull('this.ctxPtr', this.ctxPtr);\n\n let proxyResult;\n proxyResult = Module._vscf_message_info_custom_params_has_params(this.ctxPtr);\n\n const booleanResult = !!proxyResult;\n return booleanResult;\n }", "checkParams(params) {\n if(params) {\n for(let i=0; i<params.length; i++) {\n if(params[i]==null) {\n return {\n check: false,\n res: error.params\n };\n }\n }\n }\n return {\n check: true\n };\n }", "function paramQuerySearch() {\n var params = getParam(\"paramQuery\");\n parameterSearch(params);\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function validateCommonParams(params, onSuccess, onError) {\n var countRegExp = /^\\d+$/;\n var errors = [];\n\n // validate _count\n if (params._count) {\n // _count should be an integer\n if (!countRegExp.test(params._count)) {\n errors.push(validationErrors.INVALID_COUNT);\n }\n }\n // FHIR _sort param takes different forms (_sort=propName, _sort:asc=propName, _sort:desc=propName) // this is reflected in the query as three different query parameters.\n if (hasMoreThanOneSortParameter(params)) {\n // FHIR supports multiple _sort parameters but JDS does not, so we allow only one _sort query parameter.\n errors.push(validationErrors.TOO_MANY_SORT_PARAMS);\n }\n if (errors.length > 0) {\n onError(errors);\n } else {\n onSuccess(); // all common parameters passed validation\n }\n}", "checkSearchParam(search) {\n check(search, String);\n }", "function isURLSearchParams(obj) {\n // Duck-typing as a necessary condition.\n if (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n return false;\n } // Brand-checking and more duck-typing as optional condition.\n\n\n return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function validateQueryEndpoints(params) {\n var startNode = null;\n var endNode = null;\n if (params.hasStart()) {\n startNode = params.getIndexStartValue();\n }\n if (params.hasEnd()) {\n endNode = params.getIndexEndValue();\n }\n if (params.getIndex() === KEY_INDEX) {\n var tooManyArgsError = 'Query: When ordering by key, you may only pass one argument to ' +\n 'startAt(), endAt(), or equalTo().';\n var wrongArgTypeError = 'Query: When ordering by key, the argument passed to startAt(), startAfter(), ' +\n 'endAt(), endBefore(), or equalTo() must be a string.';\n if (params.hasStart()) {\n var startName = params.getIndexStartName();\n if (startName !== MIN_NAME) {\n throw new Error(tooManyArgsError);\n }\n else if (typeof startNode !== 'string') {\n throw new Error(wrongArgTypeError);\n }\n }\n if (params.hasEnd()) {\n var endName = params.getIndexEndName();\n if (endName !== MAX_NAME) {\n throw new Error(tooManyArgsError);\n }\n else if (typeof endNode !== 'string') {\n throw new Error(wrongArgTypeError);\n }\n }\n }\n else if (params.getIndex() === PRIORITY_INDEX) {\n if ((startNode != null && !isValidPriority(startNode)) ||\n (endNode != null && !isValidPriority(endNode))) {\n throw new Error('Query: When ordering by priority, the first argument passed to startAt(), ' +\n 'startAfter() endAt(), endBefore(), or equalTo() must be a valid priority value ' +\n '(null, a number, or a string).');\n }\n }\n else {\n Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"assert\"])(params.getIndex() instanceof PathIndex ||\n params.getIndex() === VALUE_INDEX, 'unknown index type.');\n if ((startNode != null && typeof startNode === 'object') ||\n (endNode != null && typeof endNode === 'object')) {\n throw new Error('Query: First argument passed to startAt(), startAfter(), endAt(), endBefore(), or ' +\n 'equalTo() cannot be an object.');\n }\n }\n}", "function isJustScrollingToNewPage(prevOptions, options) {\n if (!prevOptions) {\n // It's a new search, or we just popped back from a different view.\n return false;\n }\n\n // Compare every field except for 'page' and 'release_time'.\n // There might be better ways to achieve this.\n let tmpPrevOptions = { ...prevOptions };\n tmpPrevOptions.page = -1;\n tmpPrevOptions.release_time = '';\n\n let tmpOptions = { ...options };\n tmpOptions.page = -1;\n tmpOptions.release_time = '';\n\n return JSON.stringify(tmpOptions) === JSON.stringify(tmpPrevOptions);\n }", "function filterParams(oldParam, newParam, store) {\n if (!_.isEqual(removeProp(oldParam, 'page'), removeProp(newParam, 'page'))) {\n const filter = _.isEmpty(newParam) ? initalState.filter : newParam;\n store.dispatch(fetchFilter(filter));\n }\n}", "function isURLSearchParams(obj) {\n // Duck-typing as a necessary condition.\n if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n return false;\n }\n\n // Brand-checking and more duck-typing as optional condition.\n return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams$1(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function checkParams(cb) {\n if (Array.isArray(request.params)) {\n\t //since were limiting to two request we're only taking first two items from params array\n makeRequests(request.params.slice(0, 2));\n } else {\n if (typeof request.params === 'string') {\n makeSingleRequest(request.params);\n }\n }\n}", "function get_all_url_params(exclude_params) {\n var params = {};\n\n if (location.search) {\n var parts = location.search.substring(1).split('&');\n\n for (var i = 0; i < parts.length; i++) {\n var nv = parts[i].split('=');\n if (!nv[0] || exclude_params.includes(nv[0])) continue;\n params[nv[0]] = nv[1] || true;\n }\n }\n\n return params;\n }", "function hasUrlParameters() {\n return countUrlParameters() > 0;\n}", "function meetFilters(result, params) {\n\n var allFiltersMet = [];\n\n params.forEach(function(param) {\n switch(param.name) {\n case 'min':\n if(result.price >= param.value) {\n allFiltersMet.push(true);\n }\n break;\n\n case 'max':\n if(result.price <= param.value) {\n allFiltersMet.push(true);\n }\n break;\n\n case 'stars':\n if(result.stars == param.value) {\n allFiltersMet.push(true);\n }\n break;\n\n case 'location':\n if(result.location.toLowerCase() == param.value.toLowerCase()) {\n allFiltersMet.push(true);\n }\n break;\n\n case 'type':\n if(result.type.toLowerCase() == param.value.toLowerCase()) {\n allFiltersMet.push(true);\n }\n break;\n }\n });\n\n if(allFiltersMet.length == params.length) {\n return true;\n }\n\n return false;\n}", "function shouldSearch(query){\n return query && query.length > 2;\n}", "toUrlParams(query) {\n\t\tconsole.debug(query)\n\t\tconst params = {\n\t\t\tfr : query.offset,\n\t\t\tsz : query.size,\n\t\t\tcids : query.collectionId\n\t\t}\n\n\t\tif(query.searchLayers) {\n\t\t\tconst sl = Object.keys(query.searchLayers).filter((l) => {\n\t\t\t\treturn query.searchLayers[l];\n\t\t\t});\n\t\t\tif(sl.length > 0) {\n\t\t\t\tparams['sl'] = sl.join(',');\n\t\t\t}\n\t\t}\n\n\t\tif(query.term) {\n\t\t\tparams['st'] = query.term;\n\t\t}\n\n\t\tif(query.dateRange) {\n\t\t\tlet dr = query.dateRange.field + '__';\n\t\t\tdr += query.dateRange.start + '__';\n\t\t\tdr += query.dateRange.end;\n\t\t\tparams['dr'] = dr;\n\t\t}\n\n\t\tif(query.fieldCategory) {\n params['fc'] ='';\n query.fieldCategory.map(function(item){\n params['fc'] += item.id + '|';\n\t\t\t});\n params['fc'] = params['fc'].slice(0, -1);\n\t\t}\n\n\t\tlet sf = []\n\t\tif(query.selectedFacets) {\n\t\t\tsf = Object.keys(query.selectedFacets).map((key) => {\n\t\t\t\treturn query.selectedFacets[key].map((value) => {\n\t\t\t\t\treturn key + '|' + value;\n\t\t\t\t})\n\t\t\t});\n\t\t\tparams['sf'] = sf.join(',');\n\t\t}\n\n\t\tif(query.sort) {\n\t\t\tlet s = query.sort.field + '__';\n\t\t\ts += query.sort.order;\n\t\t\tparams['s'] = s;\n\t\t}\n\t\treturn params;\n\t}", "function areToAndFromEmpty(frm, t){\n //If the ruleFrom and ruleTo text areas are empty warn the user then drop out of this function\n if (frm == '' && t == '') {\n errorMessages.value(\"Both parts of the rule are formatted incorrectly\");\n return true;\n }//end if replacement text boxes are empty\n //Otherwise if From text box is empty warn the user and drop out of function\n\telse if (frm == ''){\n errorMessages.value(\"Before rule is formatted incorrectly\" + \"\\n\" + \"Is it empty or missing [ or ]?\" );\n return true;\n }//end else if from is empty\n //Otherwise if the To box is empty warn the user and drop out of function\n\telse if (t == ''){\n errorMessages.value(\"After rule is formatted incorrectly\");\n return true;\n }//end else if to is empty\n else{\n return false;\n }\n}", "function systemVmGetSearchParams() {\n var moreCriteria = [];\t\n\n\tvar searchInput = $(\"#basic_search\").find(\"#search_input\").val();\t \n if (searchInput != null && searchInput.length > 0) {\t \n moreCriteria.push(\"&keyword=\"+todb(searchInput));\t \n } \n\n\tvar $advancedSearchPopup = getAdvancedSearchPopupInSearchContainer();\n\tif ($advancedSearchPopup.length > 0 && $advancedSearchPopup.css(\"display\") != \"none\" ) {\t \n\t\tvar state = $advancedSearchPopup.find(\"#adv_search_state\").val();\n\t\tif (state!=null && state.length > 0) \n\t\t\tmoreCriteria.push(\"&state=\"+todb(state));\t\t\n\t\t\t\t\n\t\tvar zone = $advancedSearchPopup.find(\"#adv_search_zone\").val();\t\n\t if (zone!=null && zone.length > 0) \n\t\t\tmoreCriteria.push(\"&zoneId=\"+zone);\t\n\t\t\n\t\tif ($advancedSearchPopup.find(\"#adv_search_pod_li\").css(\"display\") != \"none\") {\t\n\t\t var pod = $advancedSearchPopup.find(\"#adv_search_pod\").val();\t\t\n\t if (pod!=null && pod.length > 0) \n\t\t\t moreCriteria.push(\"&podId=\"+pod);\n } \n\t} \t\n\t\n\treturn moreCriteria.join(\"\"); \n}" ]
[ "0.81149995", "0.8104819", "0.8103427", "0.80860364", "0.80860364", "0.80860364", "0.80860364", "0.80860364", "0.80860364", "0.80860364", "0.80860364", "0.80860364", "0.80860364", "0.80860364", "0.80860364", "0.80860364", "0.80860364", "0.801133", "0.64896494", "0.6423284", "0.63937664", "0.63937664", "0.63937664", "0.63937664", "0.63937664", "0.63937664", "0.63937664", "0.63937664", "0.63937664", "0.63937664", "0.63937664", "0.63937664", "0.63937664", "0.63937664", "0.6275629", "0.62047046", "0.61730605", "0.573429", "0.5564153", "0.5552753", "0.55279887", "0.5279851", "0.5279851", "0.52687764", "0.5261966", "0.5241936", "0.5218589", "0.51933855", "0.5161943", "0.5126703", "0.50349087", "0.49894345", "0.496515", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.4914944", "0.49099073", "0.48933366", "0.48896307", "0.4887565", "0.48733944", "0.48416662", "0.48165688", "0.48119634", "0.4793861", "0.4786163", "0.47827965", "0.47785154", "0.47716117", "0.47674355", "0.47565937", "0.47549504" ]
0.63960177
20
Returns a set of DOM manipulation functions based on which Angular version it should use
function getRenderer(attrs, scope) { var statics = function() { return { enter: function (element, target, cb) { target.after(element); cb(); }, leave: function (element, cb) { element.remove(); cb(); } }; }; if ($animate) { return { enter: function(element, target, cb) { var promise = $animate.enter(element, null, target, cb); if (promise && promise.then) promise.then(cb); }, leave: function(element, cb) { var promise = $animate.leave(element, cb); if (promise && promise.then) promise.then(cb); } }; } if ($animator) { var animate = $animator && $animator(scope, attrs); return { enter: function(element, target, cb) {animate.enter(element, null, target); cb(); }, leave: function(element, cb) { animate.leave(element); cb(); } }; } return statics(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static injectViewPortUtils() {\n let viewPortUtilsContainer = document.createElement('div');\n let xxsView = document.createElement('div');\n let xsView = document.createElement('div');\n let smView = document.createElement('div');\n let mdView = document.createElement('div');\n let lgView = document.createElement('div');\n let xlView = document.createElement('div');\n let xxlView = document.createElement('div');\n\n viewPortUtilsContainer.classList.add(\"view-port-utils\");\n xxsView.classList.add(Constantes.XXS, \"visible-xxs\");\n xsView.classList.add(Constantes.XS, \"visible-xs\");\n smView.classList.add(Constantes.SM, \"visible-sm\");\n mdView.classList.add(Constantes.MD, \"visible-md\");\n lgView.classList.add(Constantes.LG, \"visible-lg\");\n xlView.classList.add(Constantes.XL, \"visible-xl\");\n xxlView.classList.add(Constantes.XXL, \"visible-xxl\");\n\n let viewPortUtilsDomElements = [xxsView, xsView, smView, mdView, lgView, xlView, xxlView];\n\n [...viewPortUtilsDomElements].forEach(function(element) {\n viewPortUtilsContainer.appendChild(element);\n });\n\n document.body.appendChild(viewPortUtilsContainer);\n }", "function $$jqLiteProvider() { // 3601\n this.$get = function $$jqLite() { // 3602\n return extend(JQLite, { // 3603\n hasClass: function(node, classes) { // 3604\n if (node.attr) node = node[0]; // 3605\n return jqLiteHasClass(node, classes); // 3606\n }, // 3607\n addClass: function(node, classes) { // 3608\n if (node.attr) node = node[0]; // 3609\n return jqLiteAddClass(node, classes); // 3610\n }, // 3611\n removeClass: function(node, classes) { // 3612\n if (node.attr) node = node[0]; // 3613\n return jqLiteRemoveClass(node, classes); // 3614\n } // 3615\n }); // 3616\n }; // 3617\n} // 3618", "function DOMImplementation() {\n}", "function DOMImplementation() {\n}", "function $DOM(elementHint, elementIndex){\n /* // in case non-css selector gets required \n var first_char = elementHint.match(/^./)[0];\n\tvar rest_chars = elementHint.replace(/^./, ''); */\n \t\n var str_nodes = document.querySelectorAll(elementHint);\n if (elementIndex === undefined) {\n elementIndex = 0;\n }\n\treturn str_nodes[elementIndex];\n}", "function DOMImplementation() {}", "function DOMImplementation() {}", "function DOMImplementation() {}", "function DOMImplementation() {}", "function injectRenderer2(){return getOrCreateRenderer2(getLView());}/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */ /**\n * A wrapper around a native element inside of a View.\n *\n * An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM\n * element.\n *\n * @security Permitting direct access to the DOM can make your application more vulnerable to\n * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the\n * [Security Guide](http://g.co/ng/security).\n *\n * @publicApi\n */ // Note: We don't expose things like `Injector`, `ViewContainer`, ... here,", "function addLinkFns(pre, post, attrStart, attrEnd) { // 8151\n if (pre) { // 8152\n if (attrStart) pre = groupElementsLinkFnWrapper(pre, attrStart, attrEnd); // 8153\n pre.require = directive.require; // 8154\n pre.directiveName = directiveName; // 8155\n if (newIsolateScopeDirective === directive || directive.$$isolateScope) { // 8156\n pre = cloneAndAnnotateFn(pre, {isolateScope: true}); // 8157\n } // 8158\n preLinkFns.push(pre); // 8159\n } // 8160\n if (post) { // 8161\n if (attrStart) post = groupElementsLinkFnWrapper(post, attrStart, attrEnd); // 8162\n post.require = directive.require; // 8163\n post.directiveName = directiveName; // 8164\n if (newIsolateScopeDirective === directive || directive.$$isolateScope) { // 8165\n post = cloneAndAnnotateFn(post, {isolateScope: true}); // 8166\n } // 8167\n postLinkFns.push(post); // 8168\n } // 8169\n } // 8170", "function $$jqLiteProvider(){this.$get=function $$jqLite(){return extend(JQLite,{hasClass:function hasClass(node,classes){if(node.attr)node=node[0];return jqLiteHasClass(node,classes);},addClass:function addClass(node,classes){if(node.attr)node=node[0];return jqLiteAddClass(node,classes);},removeClass:function removeClass(node,classes){if(node.attr)node=node[0];return jqLiteRemoveClass(node,classes);}});};}", "function $$jqLiteProvider(){this.$get=function $$jqLite(){return extend(JQLite,{hasClass:function hasClass(node,classes){if(node.attr)node=node[0];return jqLiteHasClass(node,classes);},addClass:function addClass(node,classes){if(node.attr)node=node[0];return jqLiteAddClass(node,classes);},removeClass:function removeClass(node,classes){if(node.attr)node=node[0];return jqLiteRemoveClass(node,classes);}});};}", "function EZglobal_domBindings()\n\t{\n\t\tObject.keys(EZ).forEach(function(key)\n\t\t{\n\t\t\tif (EZ.functions.dom[key] \t\t\t\t\t//binding already created\n\t\t\t|| EZ.dom.functions.indexOf(key) == -1) \t//not dom related function\n\t\t\t\treturn;\n\n\t\t\tvar fn = 'EZ.functions.dom.' + key + ' = function ' + key + '()\\n'\n\t\t\t\t + '{\\n'\n\t\t\t\t + ' var args = window.EZ.dom.context(this);\\n'\n\t\t\t\t + ' window.EZ.' + key + '.apply(window.EZ, args);\\n'\n\t\t\t\t + '}';\n\t\t\teval(fn);\n\t\t});\n\t}", "function DOMRenderer() {}", "function getRenderer(attrs, scope) {\n var statics = function() {\n return {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n };\n\n if ($animate) {\n return {\n enter: function(element, target, cb) {\n if (angular.version.minor > 2) {\n $animate.enter(element, null, target).then(cb);\n } else {\n $animate.enter(element, null, target, cb);\n }\n },\n leave: function(element, cb) {\n if (angular.version.minor > 2) {\n $animate.leave(element).then(cb);\n } else {\n $animate.leave(element, cb);\n }\n }\n };\n }\n\n if ($animator) {\n var animate = $animator && $animator(scope, attrs);\n\n return {\n enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n leave: function(element, cb) { animate.leave(element); cb(); }\n };\n }\n\n return statics();\n }", "function getRenderer(attrs, scope) {\n var statics = function() {\n return {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n };\n\n if ($animate) {\n return {\n enter: function(element, target, cb) {\n if (angular.version.minor > 2) {\n $animate.enter(element, null, target).then(cb);\n } else {\n $animate.enter(element, null, target, cb);\n }\n },\n leave: function(element, cb) {\n if (angular.version.minor > 2) {\n $animate.leave(element).then(cb);\n } else {\n $animate.leave(element, cb);\n }\n }\n };\n }\n\n if ($animator) {\n var animate = $animator && $animator(scope, attrs);\n\n return {\n enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n leave: function(element, cb) { animate.leave(element); cb(); }\n };\n }\n\n return statics();\n }", "function getRenderer(attrs, scope) {\n var statics = function() {\n return {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n };\n\n if ($animate) {\n return {\n enter: function(element, target, cb) {\n if (angular.version.minor > 2) {\n $animate.enter(element, null, target).then(cb);\n } else {\n $animate.enter(element, null, target, cb);\n }\n },\n leave: function(element, cb) {\n if (angular.version.minor > 2) {\n $animate.leave(element).then(cb);\n } else {\n $animate.leave(element, cb);\n }\n }\n };\n }\n\n if ($animator) {\n var animate = $animator && $animator(scope, attrs);\n\n return {\n enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n leave: function(element, cb) { animate.leave(element); cb(); }\n };\n }\n\n return statics();\n }", "function getRenderer(attrs, scope) {\n var statics = function() {\n return {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n };\n\n if ($animate) {\n return {\n enter: function(element, target, cb) {\n if (angular.version.minor > 2) {\n $animate.enter(element, null, target).then(cb);\n } else {\n $animate.enter(element, null, target, cb);\n }\n },\n leave: function(element, cb) {\n if (angular.version.minor > 2) {\n $animate.leave(element).then(cb);\n } else {\n $animate.leave(element, cb);\n }\n }\n };\n }\n\n if ($animator) {\n var animate = $animator && $animator(scope, attrs);\n\n return {\n enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n leave: function(element, cb) { animate.leave(element); cb(); }\n };\n }\n\n return statics();\n }", "function getRenderer(attrs, scope) {\n var statics = function() {\n return {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n };\n\n if ($animate) {\n return {\n enter: function(element, target, cb) {\n if (angular.version.minor > 2) {\n $animate.enter(element, null, target).then(cb);\n } else {\n $animate.enter(element, null, target, cb);\n }\n },\n leave: function(element, cb) {\n if (angular.version.minor > 2) {\n $animate.leave(element).then(cb);\n } else {\n $animate.leave(element, cb);\n }\n }\n };\n }\n\n if ($animator) {\n var animate = $animator && $animator(scope, attrs);\n\n return {\n enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n leave: function(element, cb) { animate.leave(element); cb(); }\n };\n }\n\n return statics();\n }", "function getRenderer(attrs, scope) {\n var statics = function() {\n return {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n };\n\n if ($animate) {\n return {\n enter: function(element, target, cb) {\n if (angular.version.minor > 2) {\n $animate.enter(element, null, target).then(cb);\n } else {\n $animate.enter(element, null, target, cb);\n }\n },\n leave: function(element, cb) {\n if (angular.version.minor > 2) {\n $animate.leave(element).then(cb);\n } else {\n $animate.leave(element, cb);\n }\n }\n };\n }\n\n if ($animator) {\n var animate = $animator && $animator(scope, attrs);\n\n return {\n enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n leave: function(element, cb) { animate.leave(element); cb(); }\n };\n }\n\n return statics();\n }", "function getRenderer(attrs, scope) {\n var statics = function() {\n return {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n };\n\n if ($animate) {\n return {\n enter: function(element, target, cb) {\n if (angular.version.minor > 2) {\n $animate.enter(element, null, target).then(cb);\n } else {\n $animate.enter(element, null, target, cb);\n }\n },\n leave: function(element, cb) {\n if (angular.version.minor > 2) {\n $animate.leave(element).then(cb);\n } else {\n $animate.leave(element, cb);\n }\n }\n };\n }\n\n if ($animator) {\n var animate = $animator && $animator(scope, attrs);\n\n return {\n enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n leave: function(element, cb) { animate.leave(element); cb(); }\n };\n }\n\n return statics();\n }", "function getRenderer(attrs, scope) {\n var statics = function() {\n return {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n };\n\n if ($animate) {\n return {\n enter: function(element, target, cb) {\n if (angular.version.minor > 2) {\n $animate.enter(element, null, target).then(cb);\n } else {\n $animate.enter(element, null, target, cb);\n }\n },\n leave: function(element, cb) {\n if (angular.version.minor > 2) {\n $animate.leave(element).then(cb);\n } else {\n $animate.leave(element, cb);\n }\n }\n };\n }\n\n if ($animator) {\n var animate = $animator && $animator(scope, attrs);\n\n return {\n enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n leave: function(element, cb) { animate.leave(element); cb(); }\n };\n }\n\n return statics();\n }", "function getRenderer(attrs, scope) {\n var statics = function() {\n return {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n };\n\n if ($animate) {\n return {\n enter: function(element, target, cb) {\n if (angular.version.minor > 2) {\n $animate.enter(element, null, target).then(cb);\n } else {\n $animate.enter(element, null, target, cb);\n }\n },\n leave: function(element, cb) {\n if (angular.version.minor > 2) {\n $animate.leave(element).then(cb);\n } else {\n $animate.leave(element, cb);\n }\n }\n };\n }\n\n if ($animator) {\n var animate = $animator && $animator(scope, attrs);\n\n return {\n enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n leave: function(element, cb) { animate.leave(element); cb(); }\n };\n }\n\n return statics();\n }", "function getRenderer(attrs, scope) {\n\t var statics = function() {\n\t return {\n\t enter: function (element, target, cb) { target.after(element); cb(); },\n\t leave: function (element, cb) { element.remove(); cb(); }\n\t };\n\t };\n\n\t if ($animate) {\n\t return {\n\t enter: function(element, target, cb) {\n\t if (angular.version.minor > 2) {\n\t $animate.enter(element, null, target).then(cb);\n\t } else {\n\t $animate.enter(element, null, target, cb);\n\t }\n\t },\n\t leave: function(element, cb) {\n\t if (angular.version.minor > 2) {\n\t $animate.leave(element).then(cb);\n\t } else {\n\t $animate.leave(element, cb);\n\t }\n\t }\n\t };\n\t }\n\n\t if ($animator) {\n\t var animate = $animator && $animator(scope, attrs);\n\n\t return {\n\t enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n\t leave: function(element, cb) { animate.leave(element); cb(); }\n\t };\n\t }\n\n\t return statics();\n\t }", "function getRenderer(attrs, scope) {\n var statics = {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n\n if (!!attrs.noanimation) return statics;\n\n function animEnabled(element) {\n if (ngMajorVer === 1 && ngMinorVer >= 4) return !!$animate.enabled(element);\n if (ngMajorVer === 1 && ngMinorVer >= 2) return !!$animate.enabled();\n return (!!$animator);\n }\n\n // ng 1.2+\n if ($animate) {\n return {\n enter: function(element, target, cb) {\n if (!animEnabled(element)) {\n statics.enter(element, target, cb);\n } else if (angular.version.minor > 2) {\n $animate.enter(element, null, target).then(cb);\n } else {\n $animate.enter(element, null, target, cb);\n }\n },\n leave: function(element, cb) {\n if (!animEnabled(element)) {\n statics.leave(element, cb);\n } else if (angular.version.minor > 2) {\n $animate.leave(element).then(cb);\n } else {\n $animate.leave(element, cb);\n }\n }\n };\n }\n\n // ng 1.1.5\n if ($animator) {\n var animate = $animator && $animator(scope, attrs);\n\n return {\n enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n leave: function(element, cb) { animate.leave(element); cb(); }\n };\n }\n\n return statics;\n }", "function getRenderer(attrs, scope) {\n var statics = {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n\n if (!!attrs.noanimation) return statics;\n\n function animEnabled(element) {\n if (ngMajorVer === 1 && ngMinorVer >= 4) return !!$animate.enabled(element);\n if (ngMajorVer === 1 && ngMinorVer >= 2) return !!$animate.enabled();\n return (!!$animator);\n }\n\n // ng 1.2+\n if ($animate) {\n return {\n enter: function(element, target, cb) {\n if (!animEnabled(element)) {\n statics.enter(element, target, cb);\n } else if (angular.version.minor > 2) {\n $animate.enter(element, null, target).then(cb);\n } else {\n $animate.enter(element, null, target, cb);\n }\n },\n leave: function(element, cb) {\n if (!animEnabled(element)) {\n statics.leave(element, cb);\n } else if (angular.version.minor > 2) {\n $animate.leave(element).then(cb);\n } else {\n $animate.leave(element, cb);\n }\n }\n };\n }\n\n // ng 1.1.5\n if ($animator) {\n var animate = $animator && $animator(scope, attrs);\n\n return {\n enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n leave: function(element, cb) { animate.leave(element); cb(); }\n };\n }\n\n return statics;\n }", "function getRenderer(attrs, scope) {\n var statics = {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n\n if (!!attrs.noanimation) return statics;\n\n function animEnabled(element) {\n if (ngMajorVer === 1 && ngMinorVer >= 4) return !!$animate.enabled(element);\n if (ngMajorVer === 1 && ngMinorVer >= 2) return !!$animate.enabled();\n return (!!$animator);\n }\n\n // ng 1.2+\n if ($animate) {\n return {\n enter: function(element, target, cb) {\n if (!animEnabled(element)) {\n statics.enter(element, target, cb);\n } else if (angular.version.minor > 2) {\n $animate.enter(element, null, target).then(cb);\n } else {\n $animate.enter(element, null, target, cb);\n }\n },\n leave: function(element, cb) {\n if (!animEnabled(element)) {\n statics.leave(element, cb);\n } else if (angular.version.minor > 2) {\n $animate.leave(element).then(cb);\n } else {\n $animate.leave(element, cb);\n }\n }\n };\n }\n\n // ng 1.1.5\n if ($animator) {\n var animate = $animator && $animator(scope, attrs);\n\n return {\n enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n leave: function(element, cb) { animate.leave(element); cb(); }\n };\n }\n\n return statics;\n }", "function getRenderer(attrs, scope) {\n var statics = {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n\n if (!!attrs.noanimation) return statics;\n\n function animEnabled(element) {\n if (ngMajorVer === 1 && ngMinorVer >= 4) return !!$animate.enabled(element);\n if (ngMajorVer === 1 && ngMinorVer >= 2) return !!$animate.enabled();\n return (!!$animator);\n }\n\n // ng 1.2+\n if ($animate) {\n return {\n enter: function(element, target, cb) {\n if (!animEnabled(element)) {\n statics.enter(element, target, cb);\n } else if (angular.version.minor > 2) {\n $animate.enter(element, null, target).then(cb);\n } else {\n $animate.enter(element, null, target, cb);\n }\n },\n leave: function(element, cb) {\n if (!animEnabled(element)) {\n statics.leave(element, cb);\n } else if (angular.version.minor > 2) {\n $animate.leave(element).then(cb);\n } else {\n $animate.leave(element, cb);\n }\n }\n };\n }\n\n // ng 1.1.5\n if ($animator) {\n var animate = $animator && $animator(scope, attrs);\n\n return {\n enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n leave: function(element, cb) { animate.leave(element); cb(); }\n };\n }\n\n return statics;\n }", "function hackImplementationOfElementStylingMap(index,classes,styles,directive){throw new Error('unimplemented. Should not be needed by ViewEngine compatibility');}/* END OF HACK BLOCK */ //////////////////////////", "get dateSelectorFormatFunction() {\n\t\treturn this.nativeElement ? this.nativeElement.dateSelectorFormatFunction : undefined;\n\t}", "function MdConstantFactory($sniffer,$window,$document){var vendorPrefix=$sniffer.vendorPrefix;var isWebkit=/webkit/i.test(vendorPrefix);var SPECIAL_CHARS_REGEXP=/([:\\-_]+(.))/g;var prefixTestEl=document.createElement('div');function vendorProperty(name){// Add a dash between the prefix and name, to be able to transform the string into camelcase.\n\tvar prefixedName=vendorPrefix+'-'+name;var ucPrefix=camelCase(prefixedName);var lcPrefix=ucPrefix.charAt(0).toLowerCase()+ucPrefix.substring(1);return hasStyleProperty(name)?name:// The current browser supports the un-prefixed property\n\thasStyleProperty(ucPrefix)?ucPrefix:// The current browser only supports the prefixed property.\n\thasStyleProperty(lcPrefix)?lcPrefix:name;// Some browsers are only supporting the prefix in lowercase.\n\t}function hasStyleProperty(property){return angular.isDefined(prefixTestEl.style[property]);}function camelCase(input){return input.replace(SPECIAL_CHARS_REGEXP,function(matches,separator,letter,offset){return offset?letter.toUpperCase():letter;});}var self={isInputKey:function isInputKey(e){return e.keyCode>=31&&e.keyCode<=90;},isNumPadKey:function isNumPadKey(e){return 3===e.location&&e.keyCode>=97&&e.keyCode<=105;},isNavigationKey:function isNavigationKey(e){var kc=self.KEY_CODE,NAVIGATION_KEYS=[kc.SPACE,kc.ENTER,kc.UP_ARROW,kc.DOWN_ARROW];return NAVIGATION_KEYS.indexOf(e.keyCode)!=-1;},KEY_CODE:{COMMA:188,SEMICOLON:186,ENTER:13,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,TAB:9,BACKSPACE:8,DELETE:46},CSS:{/* Constants */TRANSITIONEND:'transitionend'+(isWebkit?' webkitTransitionEnd':''),ANIMATIONEND:'animationend'+(isWebkit?' webkitAnimationEnd':''),TRANSFORM:vendorProperty('transform'),TRANSFORM_ORIGIN:vendorProperty('transformOrigin'),TRANSITION:vendorProperty('transition'),TRANSITION_DURATION:vendorProperty('transitionDuration'),ANIMATION_PLAY_STATE:vendorProperty('animationPlayState'),ANIMATION_DURATION:vendorProperty('animationDuration'),ANIMATION_NAME:vendorProperty('animationName'),ANIMATION_TIMING:vendorProperty('animationTimingFunction'),ANIMATION_DIRECTION:vendorProperty('animationDirection')},/**\n\t * As defined in core/style/variables.scss\n\t *\n\t * $layout-breakpoint-xs: 600px !default;\n\t * $layout-breakpoint-sm: 960px !default;\n\t * $layout-breakpoint-md: 1280px !default;\n\t * $layout-breakpoint-lg: 1920px !default;\n\t *\n\t */MEDIA:{'xs':'(max-width: 599px)','gt-xs':'(min-width: 600px)','sm':'(min-width: 600px) and (max-width: 959px)','gt-sm':'(min-width: 960px)','md':'(min-width: 960px) and (max-width: 1279px)','gt-md':'(min-width: 1280px)','lg':'(min-width: 1280px) and (max-width: 1919px)','gt-lg':'(min-width: 1920px)','xl':'(min-width: 1920px)','landscape':'(orientation: landscape)','portrait':'(orientation: portrait)','print':'print'},MEDIA_PRIORITY:['xl','gt-lg','lg','gt-md','md','gt-sm','sm','gt-xs','xs','landscape','portrait','print']};return self;}", "function getDirectives(element) {\n var context = loadLContext(element);\n\n if (context.directives === undefined) {\n context.directives = getDirectivesAtNodeIndex(context.nodeIndex, context.lView, false);\n } // The `directives` in this case are a named array called `LComponentView`. Clone the\n // result so we don't expose an internal data structure in the user's console.\n\n\n return context.directives === null ? [] : Object(C_Users_Abid_Loqmen_Desktop_NGforce_thesis_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(context.directives);\n}", "function $$jqLiteProvider() {\n\t\tthis.$get = function $$jqLite() {\n\t\t\treturn extend(JQLite, {\n\t\t\t\thasClass: function(node, classes) {\n\t\t\t\t\tif (node.attr) node = node[0];\n\t\t\t\t\treturn jqLiteHasClass(node, classes);\n\t\t\t\t},\n\t\t\t\taddClass: function(node, classes) {\n\t\t\t\t\tif (node.attr) node = node[0];\n\t\t\t\t\treturn jqLiteAddClass(node, classes);\n\t\t\t\t},\n\t\t\t\tremoveClass: function(node, classes) {\n\t\t\t\t\tif (node.attr) node = node[0];\n\t\t\t\t\treturn jqLiteRemoveClass(node, classes);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t}", "upgradeElements () {\n componentHandler.upgradeElements(this.$('[class*=\"mdl-js-\"]'))\n }", "function listener(eventName,listenerFn,useCapture){if(useCapture===void 0){useCapture=false;}var lView=getLView();var tNode=getPreviousOrParentTNode();var tView=lView[TVIEW];var firstTemplatePass=tView.firstTemplatePass;var tCleanup=firstTemplatePass&&(tView.cleanup||(tView.cleanup=[]));ngDevMode&&assertNodeOfPossibleTypes(tNode,3/* Element */,0/* Container */,4/* ElementContainer */);// add native event listener - applicable to elements only\nif(tNode.type===3/* Element */){var _native14=getNativeByTNode(tNode,lView);ngDevMode&&ngDevMode.rendererAddEventListener++;var renderer=lView[RENDERER];var lCleanup=getCleanup(lView);var lCleanupIndex=lCleanup.length;var useCaptureOrSubIdx=useCapture;// In order to match current behavior, native DOM event listeners must be added for all\n// events (including outputs).\nif(isProceduralRenderer(renderer)){var cleanupFn=renderer.listen(_native14,eventName,listenerFn);lCleanup.push(listenerFn,cleanupFn);useCaptureOrSubIdx=lCleanupIndex+1;}else{var wrappedListener=wrapListenerWithPreventDefault(listenerFn);_native14.addEventListener(eventName,wrappedListener,useCapture);lCleanup.push(wrappedListener);}tCleanup&&tCleanup.push(eventName,tNode.index,lCleanupIndex,useCaptureOrSubIdx);}// subscribe to directive outputs\nif(tNode.outputs===undefined){// if we create TNode here, inputs must be undefined so we know they still need to be\n// checked\ntNode.outputs=generatePropertyAliases(tNode,1/* Output */);}var outputs=tNode.outputs;var props;if(outputs&&(props=outputs[eventName])){var propsLength=props.length;if(propsLength){var lCleanup=getCleanup(lView);for(var i=0;i<propsLength;i+=2){ngDevMode&&assertDataInRange(lView,props[i]);var subscription=lView[props[i]][props[i+1]].subscribe(listenerFn);var idx=lCleanup.length;lCleanup.push(listenerFn,subscription);tCleanup&&tCleanup.push(eventName,tNode.index,idx,-(idx+1));}}}}", "function getDomElement(element,defaultElement){if(angular.isString(element)){element=$document[0].querySelector(element);}// If we have a reference to a raw dom element, always wrap it in jqLite\n\treturn angular.element(element||defaultElement);}", "function getDirectives(element) {\n const context = loadLContext(element);\n if (context.directives === undefined) {\n context.directives = getDirectivesAtNodeIndex(context.nodeIndex, context.lView, false);\n }\n // The `directives` in this case are a named array called `LComponentView`. Clone the\n // result so we don't expose an internal data structure in the user's console.\n return context.directives === null ? [] : [...context.directives];\n}", "function getDirectives(element) {\n const context = loadLContext(element);\n if (context.directives === undefined) {\n context.directives = getDirectivesAtNodeIndex(context.nodeIndex, context.lView, false);\n }\n // The `directives` in this case are a named array called `LComponentView`. Clone the\n // result so we don't expose an internal data structure in the user's console.\n return context.directives === null ? [] : [...context.directives];\n}", "function getDirectives(element) {\n const context = loadLContext(element);\n if (context.directives === undefined) {\n context.directives = getDirectivesAtNodeIndex(context.nodeIndex, context.lView, false);\n }\n // The `directives` in this case are a named array called `LComponentView`. Clone the\n // result so we don't expose an internal data structure in the user's console.\n return context.directives === null ? [] : [...context.directives];\n}", "function getDirectives(element) {\n const context = loadLContext(element);\n if (context.directives === undefined) {\n context.directives = getDirectivesAtNodeIndex(context.nodeIndex, context.lView, false);\n }\n // The `directives` in this case are a named array called `LComponentView`. Clone the\n // result so we don't expose an internal data structure in the user's console.\n return context.directives === null ? [] : [...context.directives];\n}", "function getDirectives(element) {\n const context = loadLContext(element);\n if (context.directives === undefined) {\n context.directives = getDirectivesAtNodeIndex(context.nodeIndex, context.lView, false);\n }\n // The `directives` in this case are a named array called `LComponentView`. Clone the\n // result so we don't expose an internal data structure in the user's console.\n return context.directives === null ? [] : [...context.directives];\n}", "function elementStart(index,name,attrs,localRefs){var lView=getLView();var tView=lView[TVIEW];ngDevMode&&assertEqual(lView[BINDING_INDEX],tView.bindingStartIndex,'elements should be created before any bindings ');ngDevMode&&ngDevMode.rendererCreateElement++;var _native11=elementCreate(name);ngDevMode&&assertDataInRange(lView,index-1);var tNode=createNodeAtIndex(index,3/* Element */,_native11,name,attrs||null);if(attrs){// it's important to only prepare styling-related datastructures once for a given\n// tNode and not each time an element is created. Also, the styling code is designed\n// to be patched and constructed at various points, but only up until the first element\n// is created. Then the styling context is locked and can only be instantiated for each\n// successive element that is created.\nif(tView.firstTemplatePass&&!tNode.stylingTemplate&&hasStyling(attrs)){tNode.stylingTemplate=initializeStaticContext(attrs);}setUpAttributes(_native11,attrs);}appendChild(_native11,tNode,lView);createDirectivesAndLocals(tView,lView,localRefs);// any immediate children of a component or template container must be pre-emptively\n// monkey-patched with the component view data so that the element can be inspected\n// later on using any element discovery utility methods (see `element_discovery.ts`)\nif(getElementDepthCount()===0){attachPatchData(_native11,lView);}increaseElementDepthCount();// if a directive contains a host binding for \"class\" then all class-based data will\n// flow through that (except for `[class.prop]` bindings). This also includes initial\n// static class values as well. (Note that this will be fixed once map-based `[style]`\n// and `[class]` bindings work for multiple directives.)\nif(tView.firstTemplatePass){var inputData=initializeTNodeInputs(tNode);if(inputData&&inputData.hasOwnProperty('class')){tNode.flags|=8/* hasClassInput */;}}// There is no point in rendering styles when a class directive is present since\n// it will take that over for us (this will be removed once #FW-882 is in).\nif(tNode.stylingTemplate&&(tNode.flags&8/* hasClassInput */)===0){renderInitialStylesAndClasses(_native11,tNode.stylingTemplate,lView[RENDERER]);}}", "function getDirectives(element) {\n var context = loadLContext(element);\n\n if (context.directives === undefined) {\n context.directives = getDirectivesAtNodeIndex(context.nodeIndex, context.lView, false);\n } // The `directives` in this case are a named array called `LComponentView`. Clone the\n // result so we don't expose an internal data structure in the user's console.\n\n\n return context.directives === null ? [] : _toConsumableArray(context.directives);\n }", "updateDOM(dom, view) { return false; }", "function getCreateElementHelper() {\n const renderer = ts.createIdentifier('renderer');\n const parent = ts.createIdentifier('parent');\n const namespaceAndName = ts.createIdentifier('namespaceAndName');\n const name = ts.createIdentifier('name');\n const namespace = ts.createIdentifier('namespace');\n // [namespace, name] = splitNamespace(namespaceAndName);\n const namespaceAndNameVariable = ts.createVariableDeclaration(ts.createArrayBindingPattern([namespace, name].map(id => ts.createBindingElement(undefined, undefined, id))), undefined, ts.createCall(ts.createIdentifier(\"__ngRendererSplitNamespaceHelper\" /* splitNamespace */), [], [namespaceAndName]));\n // `renderer.createElement(name, namespace)`.\n const creationCall = ts.createCall(ts.createPropertyAccess(renderer, 'createElement'), [], [name, namespace]);\n return getCreationHelper(\"__ngRendererCreateElementHelper\" /* createElement */, creationCall, renderer, parent, [namespaceAndName], [ts.createVariableStatement(undefined, ts.createVariableDeclarationList([namespaceAndNameVariable], ts.NodeFlags.Const))]);\n }", "_injectLibraryDependingOnDriver() {\n switch (this.props.driver) {\n case 'fontawesome':\n {\n const fontawesomeElm = document.querySelector('link#s-fontawesome');\n if (fontawesomeElm) return;\n const linkFontawesomeElm = document.createElement('link');\n linkFontawesomeElm.setAttribute('id', 'fontawesome');\n linkFontawesomeElm.setAttribute('rel', 'stylesheet');\n linkFontawesomeElm.setAttribute('href', this.props.fontawesomeCssUrl);\n linkFontawesomeElm.setAttribute('integrity', this.props.fontawesomeCssIntegrity);\n linkFontawesomeElm.setAttribute('crossorigin', 'anonymous');\n document.head.appendChild(linkFontawesomeElm);\n break;\n }\n\n case 'material':\n {\n const materialElm = document.querySelector('link#s-material');\n if (materialElm) return;\n const linkMaterialElm = document.createElement('link');\n linkMaterialElm.setAttribute('id', 'material');\n linkMaterialElm.setAttribute('href', 'https://fonts.googleapis.com/icon?family=Material+Icons');\n linkMaterialElm.setAttribute('rel', 'stylesheet');\n document.head.appendChild(linkMaterialElm);\n break;\n }\n\n case 'foundation':\n {\n const foundationElm = document.querySelector('link#s-foundation');\n if (foundationElm) return;\n const foundationLinkElm = document.createElement('link');\n foundationLinkElm.setAttribute('id', 'foundation');\n foundationLinkElm.setAttribute('href', this.props.fondationCssUrl);\n foundationLinkElm.setAttribute('rel', 'stylesheet');\n document.head.appendChild(foundationLinkElm);\n break;\n }\n\n default:\n // do nothing by default\n break;\n }\n }", "function getRenderer(attrs, scope) {\n var statics = function() {\n return {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n };\n\n if ($animate) {\n return {\n enter: function(element, target, cb) { $animate.enter(element, null, target, cb); },\n leave: function(element, cb) { $animate.leave(element, cb); }\n };\n }\n\n if ($animator) {\n var animate = $animator && $animator(scope, attrs);\n\n return {\n enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n leave: function(element, cb) { animate.leave(element); cb(); }\n };\n }\n\n return statics();\n }", "_createDOMElements() {\n\t\tthis.$control = $( this.template( this.controlOptions ) );\n\t\tthis.$sliderGroup = this.$control.find( '.slider-group' );\n\t\tthis.$units = this.$control.find( '.unit' );\n\t\tthis.$revert = this.$control.find( '.undo' );\n\t\tthis.$deleteSaved = this.$control.find( '.delete-saved .remove' );\n\t}", "function angularWrapper() {\n return {\n header: '(function(window, angular, undefined) {\\n \\'use strict\\';\\n',\n footer: '\\n})(window, window.angular);\\n'\n };\n}", "function _smdQSinitHtmLElements()\n\t{\n\t\tvar elementPrototype = typeof HTMLElement !== \"undefined\" ? HTMLElement.prototype : (typeof Element !== \"undefined\" ? Element.prototype : null);\n\n\t\tif (elementPrototype !== null) {\n\t\t\telementPrototype.removeClass = function (remove)\n\t\t\t{\n\t\t\t\tvar newClassName = \"\";\n\t\t\t\tvar i;\n\t\t\t\tvar classes = this.className.split(\" \");\n\t\t\t\tfor (i = 0; i < classes.length; i++) {\n\t\t\t\t\tif (classes[i] !== remove) {\n\t\t\t\t\t\tnewClassName += classes[i] + \" \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.className = newClassName.trim();\n\t\t\t};\n\t\t\telementPrototype.addClass = function (add)\n\t\t\t{\n\t\t\t\tif (this.className.indexOf(add) === -1) {\n\t\t\t\t\tthis.className = this.className + \" \" + add;\n\t\t\t\t}\n\t\t\t};\n\t\t\telementPrototype.toggleClass = function (toggle)\n\t\t\t{\n\t\t\t\tif (this.className.indexOf(toggle) === -1) {\n\t\t\t\t\tthis.addClass(toggle);\n\t\t\t\t} else {\n\t\t\t\t\tthis.removeClass(toggle);\n\t\t\t\t}\n\t\t\t};\n\t\t\telementPrototype.hasClass = function (classToCheck)\n\t\t\t{\n\t\t\t\treturn (this.className.indexOf(classToCheck) !== -1);\n\t\t\t};\n\t\t}\n\t}", "function cacheDom($container) {\n DOM.template = `\n <div class=\"app-shell-head\">\n <div class=\"app-shell-head-logo\">\n <h1>No Framework</h1>\n </div>\n <div class=\"app-shell-head-nav\">\n <ul>\n <li><a href=\"#\">Home</a></li>\n <li><a href=\"#/blog\">Blog</a></li>\n <li><a href=\"#/portfolio\">Portfolio</a></li>\n </ul>\n </div>\n </div>\n\n <div class=\"app-shell-main\">\n <div class=\"app-shell-main-content\"></div>\n </div>\n\n <div class=\"app-shell-foot\"></div>`;\n \n }", "function MdConstantFactory($sniffer, $window, $document) {\n\n var vendorPrefix = $sniffer.vendorPrefix;\n var isWebkit = /webkit/i.test(vendorPrefix);\n var SPECIAL_CHARS_REGEXP = /([:\\-_]+(.))/g;\n var prefixTestEl = document.createElement('div');\n\n function vendorProperty(name) {\n // Add a dash between the prefix and name, to be able to transform the string into camelcase.\n var prefixedName = vendorPrefix + '-' + name;\n var ucPrefix = camelCase(prefixedName);\n var lcPrefix = ucPrefix.charAt(0).toLowerCase() + ucPrefix.substring(1);\n\n return hasStyleProperty(name) ? name : // The current browser supports the un-prefixed property\n hasStyleProperty(ucPrefix) ? ucPrefix : // The current browser only supports the prefixed property.\n hasStyleProperty(lcPrefix) ? lcPrefix : name; // Some browsers are only supporting the prefix in lowercase.\n }\n\n function hasStyleProperty(property) {\n return angular.isDefined(prefixTestEl.style[property]);\n }\n\n function camelCase(input) {\n return input.replace(SPECIAL_CHARS_REGEXP, function(matches, separator, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n });\n }\n\n var self = {\n isInputKey : function(e) { return (e.keyCode >= 31 && e.keyCode <= 90); },\n isNumPadKey : function (e){ return (3 === e.location && e.keyCode >= 97 && e.keyCode <= 105); },\n isNavigationKey : function(e) {\n var kc = self.KEY_CODE, NAVIGATION_KEYS = [kc.SPACE, kc.ENTER, kc.UP_ARROW, kc.DOWN_ARROW];\n return (NAVIGATION_KEYS.indexOf(e.keyCode) != -1); \n },\n\n KEY_CODE: {\n COMMA: 188,\n SEMICOLON : 186,\n ENTER: 13,\n ESCAPE: 27,\n SPACE: 32,\n PAGE_UP: 33,\n PAGE_DOWN: 34,\n END: 35,\n HOME: 36,\n LEFT_ARROW : 37,\n UP_ARROW : 38,\n RIGHT_ARROW : 39,\n DOWN_ARROW : 40,\n TAB : 9,\n BACKSPACE: 8,\n DELETE: 46\n },\n CSS: {\n /* Constants */\n TRANSITIONEND: 'transitionend' + (isWebkit ? ' webkitTransitionEnd' : ''),\n ANIMATIONEND: 'animationend' + (isWebkit ? ' webkitAnimationEnd' : ''),\n\n TRANSFORM: vendorProperty('transform'),\n TRANSFORM_ORIGIN: vendorProperty('transformOrigin'),\n TRANSITION: vendorProperty('transition'),\n TRANSITION_DURATION: vendorProperty('transitionDuration'),\n ANIMATION_PLAY_STATE: vendorProperty('animationPlayState'),\n ANIMATION_DURATION: vendorProperty('animationDuration'),\n ANIMATION_NAME: vendorProperty('animationName'),\n ANIMATION_TIMING: vendorProperty('animationTimingFunction'),\n ANIMATION_DIRECTION: vendorProperty('animationDirection')\n },\n /**\n * As defined in core/style/variables.scss\n *\n * $layout-breakpoint-xs: 600px !default;\n * $layout-breakpoint-sm: 960px !default;\n * $layout-breakpoint-md: 1280px !default;\n * $layout-breakpoint-lg: 1920px !default;\n *\n */\n MEDIA: {\n 'xs' : '(max-width: 599px)' ,\n 'gt-xs' : '(min-width: 600px)' ,\n 'sm' : '(min-width: 600px) and (max-width: 959px)' ,\n 'gt-sm' : '(min-width: 960px)' ,\n 'md' : '(min-width: 960px) and (max-width: 1279px)' ,\n 'gt-md' : '(min-width: 1280px)' ,\n 'lg' : '(min-width: 1280px) and (max-width: 1919px)',\n 'gt-lg' : '(min-width: 1920px)' ,\n 'xl' : '(min-width: 1920px)' ,\n 'landscape' : '(orientation: landscape)' ,\n 'portrait' : '(orientation: portrait)' ,\n 'print' : 'print'\n },\n MEDIA_PRIORITY: [\n 'xl',\n 'gt-lg',\n 'lg',\n 'gt-md',\n 'md',\n 'gt-sm',\n 'sm',\n 'gt-xs',\n 'xs',\n 'landscape',\n 'portrait',\n 'print'\n ]\n };\n\n return self;\n}", "function expandShorthandsIn(jsCode) {\r\n var describeCode = \"(node => node.nodeName + (node.id ? '#' + node.id : '') + (node.classList.length ? '.' + node.classList[0] : ''))(\";\r\n if (\"ActiveXObject\" in window) { /* ie hack */\r\n describeCode = \"(function(node){ return node.nodeName + (node.id ? '#' + node.id : '') + (node.classList.length ? '.' + node.classList[0] : '') })(\";\r\n }\r\n return (jsCode\r\n .replace(/^\\$\\$\\(/g, 'document.querySelectorAll(')\r\n .replace(/^\\$\\(/g, 'document.querySelector(')\r\n .replace(/\\b\\$\\$\\(/g, 'document.querySelectorAll(')\r\n .replace(/\\b\\$\\(/g, 'document.querySelector(')\r\n .replace(/(\\;|\\,|\\(|\\)|\\+|\\-|\\*|\\/|\\=|\\<|\\>|\\||\\&|\\\\|\\s)\\$\\$\\(/g, '$1document.querySelectorAll(')\r\n .replace(/(\\;|\\,|\\(|\\)|\\+|\\-|\\*|\\/|\\=|\\<|\\>|\\||\\&|\\\\|\\s)\\$\\(/g, '$1document.querySelector(')\r\n .replace(/^eFP\\(/g, 'document.elementFromPoint(')\r\n .replace(/^eFP\\b/g, 'document.elementFromPoint.bind(document)')\r\n .replace(/\\beFP\\(/g, 'document.elementFromPoint(')\r\n .replace(/\\beFP\\b/g, 'document.elementFromPoint.bind(document)')\r\n .replace(/^gCS\\(/g, 'getComputedStyle(')\r\n .replace(/^gCS\\b/g, 'getComputedStyle.bind(window)')\r\n .replace(/^rAF\\(/g, 'requestAnimationFrame(')\r\n .replace(/^rAF\\b/g, 'requestAnimationFrame.bind(window)')\r\n .replace(/\\bgCS\\(/g, 'getComputedStyle(')\r\n .replace(/\\bgCS\\b/g, 'getComputedStyle.bind(window)')\r\n .replace(/\\brAF\\(/g, 'requestAnimationFrame(')\r\n .replace(/\\brAF\\b/g, 'requestAnimationFrame.bind(window)')\r\n .replace(/\\.gBCW\\(\\)/g, '.getBoundingClientRect().width')\r\n .replace(/\\.gBCH\\(\\)/g, '.getBoundingClientRect().height')\r\n .replace(/\\.gBCL\\(\\)/g, '.getBoundingClientRect().left')\r\n .replace(/\\.gBCT\\(\\)/g, '.getBoundingClientRect().top')\r\n .replace(/\\.gBCR\\(\\)/g, '.getBoundingClientRect().right')\r\n .replace(/\\.gBCB\\(\\)/g, '.getBoundingClientRect().bottom')\r\n .replace(/^describe\\(/g, describeCode)\r\n .replace(/\\bdescribe\\(/g, describeCode));\r\n}", "get formatFunction() {\n\t\treturn this.nativeElement ? this.nativeElement.formatFunction : undefined;\n\t}", "function getRenderer(attrs, scope) {\n\t\t\tvar statics = {\n\t\t\t\tenter: function (element, target, cb) { target.after(element); cb(); },\n\t\t\t\tleave: function (element, cb) { element.remove(); cb(); }\n\t\t\t};\n\n\t\t\tif (!!attrs.noanimation) return statics;\n\n\t\t\tfunction animEnabled(element) {\n\t\t\t\tif (ngMajorVer === 1 && ngMinorVer >= 4) return !!$animate.enabled(element);\n\t\t\t\tif (ngMajorVer === 1 && ngMinorVer >= 2) return !!$animate.enabled();\n\t\t\t\treturn (!!$animator);\n\t\t\t}\n\n\t\t\t// ng 1.2+\n\t\t\tif ($animate) {\n\t\t\t\treturn {\n\t\t\t\t\tenter: function(element, target, cb) {\n\t\t\t\t\t\tif (!animEnabled(element)) {\n\t\t\t\t\t\t\tstatics.enter(element, target, cb);\n\t\t\t\t\t\t} else if (angular.version.minor > 2) {\n\t\t\t\t\t\t\t$animate.enter(element, null, target).then(cb);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$animate.enter(element, null, target, cb);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tleave: function(element, cb) {\n\t\t\t\t\t\tif (!animEnabled(element)) {\n\t\t\t\t\t\t\tstatics.leave(element, cb);\n\t\t\t\t\t\t} else if (angular.version.minor > 2) {\n\t\t\t\t\t\t\t$animate.leave(element).then(cb);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$animate.leave(element, cb);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// ng 1.1.5\n\t\t\tif ($animator) {\n\t\t\t\tvar animate = $animator && $animator(scope, attrs);\n\n\t\t\t\treturn {\n\t\t\t\t\tenter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n\t\t\t\t\tleave: function(element, cb) { animate.leave(element); cb(); }\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn statics;\n\t\t}", "function hackImplementationOfElementStylingMap(index, classes, styles, directive) {\n throw new Error('unimplemented. Should not be needed by ViewEngine compatibility');\n}", "function hackImplementationOfElementStylingMap(index, classes, styles, directive) {\n throw new Error('unimplemented. Should not be needed by ViewEngine compatibility');\n}", "get exposedFuncs() {\n return [];\n }", "function getDetachViewHelper() {\n const renderer = ts.createIdentifier('renderer');\n const rootNodes = ts.createIdentifier('rootNodes');\n const incrementor = ts.createIdentifier('i');\n const node = ts.createIdentifier('node');\n // for (let i = 0; i < rootNodes.length; i++) {\n // const node = rootNodes[i];\n // renderer.removeChild(renderer.parentNode(node), node);\n // }\n const loopInitializer = ts.createVariableDeclarationList([ts.createVariableDeclaration(incrementor, undefined, ts.createNumericLiteral('0'))], ts.NodeFlags.Let);\n const loopCondition = ts.createBinary(incrementor, ts.SyntaxKind.LessThanToken, ts.createPropertyAccess(rootNodes, ts.createIdentifier('length')));\n // const node = rootNodes[i];\n const nodeVariableStatement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ts.createVariableDeclaration(node, undefined, ts.createElementAccess(rootNodes, incrementor))], ts.NodeFlags.Const));\n // renderer.removeChild(renderer.parentNode(node), node);\n const removeCall = ts.createCall(ts.createPropertyAccess(renderer, 'removeChild'), [], [ts.createCall(ts.createPropertyAccess(renderer, 'parentNode'), [], [node]), node]);\n const loop = ts.createFor(loopInitializer, loopCondition, ts.createPostfix(incrementor, ts.SyntaxKind.PlusPlusToken), ts.createBlock([nodeVariableStatement, ts.createExpressionStatement(removeCall)]));\n return ts.createFunctionDeclaration([], [], undefined, \"__ngRendererDetachViewHelper\" /* detachView */, [], [renderer, rootNodes].map(name => getAnyTypedParameter(name)), undefined, ts.createBlock([loop], true));\n }", "function instantiateAllDirectives(tView,lView,tNode){var start=tNode.directiveStart;var end=tNode.directiveEnd;if(!getFirstTemplatePass()&&start<end){getOrCreateNodeInjectorForNode(tNode,lView);}for(var i=start;i<end;i++){var def=tView.data[i];if(isComponentDef(def)){addComponentLogic(lView,tNode,def);}var directive=getNodeInjectable(tView.data,lView,i,tNode);postProcessDirective(lView,directive,def,i);}}", "function getRenderer(attrs, scope) {\n var statics = function() {\n return {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n };\n\n if ($animate) {\n return {\n enter: function(element, target, cb) {\n var promise = $animate.enter(element, null, target, cb);\n if (promise && promise.then) promise.then(cb);\n },\n leave: function(element, cb) {\n var promise = $animate.leave(element, cb);\n if (promise && promise.then) promise.then(cb);\n }\n };\n }\n\n if ($animator) {\n var animate = $animator && $animator(scope, attrs);\n\n return {\n enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n leave: function(element, cb) { animate.leave(element); cb(); }\n };\n }\n\n return statics();\n }", "function getRenderer(attrs, scope) {\n var statics = function() {\n return {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n };\n\n if ($animate) {\n return {\n enter: function(element, target, cb) {\n var promise = $animate.enter(element, null, target, cb);\n if (promise && promise.then) promise.then(cb);\n },\n leave: function(element, cb) {\n var promise = $animate.leave(element, cb);\n if (promise && promise.then) promise.then(cb);\n }\n };\n }\n\n if ($animator) {\n var animate = $animator && $animator(scope, attrs);\n\n return {\n enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n leave: function(element, cb) { animate.leave(element); cb(); }\n };\n }\n\n return statics();\n }", "function getRenderer(attrs, scope) {\n var statics = function() {\n return {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n };\n\n if ($animate) {\n return {\n enter: function(element, target, cb) {\n var promise = $animate.enter(element, null, target, cb);\n if (promise && promise.then) promise.then(cb);\n },\n leave: function(element, cb) {\n var promise = $animate.leave(element, cb);\n if (promise && promise.then) promise.then(cb);\n }\n };\n }\n\n if ($animator) {\n var animate = $animator && $animator(scope, attrs);\n\n return {\n enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n leave: function(element, cb) { animate.leave(element); cb(); }\n };\n }\n\n return statics();\n }", "function getRenderer(attrs, scope) {\n var statics = function() {\n return {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n };\n\n if ($animate) {\n return {\n enter: function(element, target, cb) {\n var promise = $animate.enter(element, null, target, cb);\n if (promise && promise.then) promise.then(cb);\n },\n leave: function(element, cb) {\n var promise = $animate.leave(element, cb);\n if (promise && promise.then) promise.then(cb);\n }\n };\n }\n\n if ($animator) {\n var animate = $animator && $animator(scope, attrs);\n\n return {\n enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n leave: function(element, cb) { animate.leave(element); cb(); }\n };\n }\n\n return statics();\n }", "function getRenderer(attrs, scope) {\n var statics = function() {\n return {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n };\n\n if ($animate) {\n return {\n enter: function(element, target, cb) {\n var promise = $animate.enter(element, null, target, cb);\n if (promise && promise.then) promise.then(cb);\n },\n leave: function(element, cb) {\n var promise = $animate.leave(element, cb);\n if (promise && promise.then) promise.then(cb);\n }\n };\n }\n\n if ($animator) {\n var animate = $animator && $animator(scope, attrs);\n\n return {\n enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n leave: function(element, cb) { animate.leave(element); cb(); }\n };\n }\n\n return statics();\n }", "function getRenderer(attrs, scope) {\n\t var statics = function() {\n\t return {\n\t enter: function (element, target, cb) { target.after(element); cb(); },\n\t leave: function (element, cb) { element.remove(); cb(); }\n\t };\n\t };\n\n\t if ($animate) {\n\t return {\n\t enter: function(element, target, cb) {\n\t var promise = $animate.enter(element, null, target, cb);\n\t if (promise && promise.then) promise.then(cb);\n\t },\n\t leave: function(element, cb) {\n\t var promise = $animate.leave(element, cb);\n\t if (promise && promise.then) promise.then(cb);\n\t }\n\t };\n\t }\n\n\t if ($animator) {\n\t var animate = $animator && $animator(scope, attrs);\n\n\t return {\n\t enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n\t leave: function(element, cb) { animate.leave(element); cb(); }\n\t };\n\t }\n\n\t return statics();\n\t }", "function applyProviderOverridesToNgModule(def){var _a=calcHasOverrides(def),hasOverrides=_a.hasOverrides,hasDeprecatedOverrides=_a.hasDeprecatedOverrides;if(!hasOverrides){return def;}// clone the whole view definition,\n// as it maintains references between the nodes that are hard to update.\ndef=def.factory(function(){return NOOP;});applyProviderOverrides(def);return def;function calcHasOverrides(def){var hasOverrides=false;var hasDeprecatedOverrides=false;if(providerOverrides.size===0){return{hasOverrides:hasOverrides,hasDeprecatedOverrides:hasDeprecatedOverrides};}def.providers.forEach(function(node){var override=providerOverrides.get(node.token);if(node.flags&3840/* CatProviderNoDirective */&&override){hasOverrides=true;hasDeprecatedOverrides=hasDeprecatedOverrides||override.deprecatedBehavior;}});def.modules.forEach(function(module){providerOverridesWithScope.forEach(function(override,token){if(getInjectableDef(token).providedIn===module){hasOverrides=true;hasDeprecatedOverrides=hasDeprecatedOverrides||override.deprecatedBehavior;}});});return{hasOverrides:hasOverrides,hasDeprecatedOverrides:hasDeprecatedOverrides};}function applyProviderOverrides(def){for(var i=0;i<def.providers.length;i++){var provider=def.providers[i];if(hasDeprecatedOverrides){// We had a bug where me made\n// all providers lazy. Keep this logic behind a flag\n// for migrating existing users.\nprovider.flags|=4096/* LazyProvider */;}var override=providerOverrides.get(provider.token);if(override){provider.flags=provider.flags&~3840/* CatProviderNoDirective */|override.flags;provider.deps=splitDepsDsl(override.deps);provider.value=override.value;}}if(providerOverridesWithScope.size>0){var moduleSet_1=new Set(def.modules);providerOverridesWithScope.forEach(function(override,token){if(moduleSet_1.has(getInjectableDef(token).providedIn)){var provider={token:token,flags:override.flags|(hasDeprecatedOverrides?4096/* LazyProvider */:0/* None */),deps:splitDepsDsl(override.deps),value:override.value,index:def.providers.length};def.providers.push(provider);def.providersByKey[tokenKey(token)]=provider;}});}}}", "function gatherElements(){elements={main:$element[0],scrollContainer:$element[0].querySelector('.md-virtual-repeat-container'),scroller:$element[0].querySelector('.md-virtual-repeat-scroller'),ul:$element.find('ul')[0],input:$element.find('input')[0],wrap:$element.find('md-autocomplete-wrap')[0],root:document.body};elements.li=elements.ul.getElementsByTagName('li');elements.snap=getSnapTarget();elements.$=getAngularElements(elements);inputModelCtrl=elements.$.input.controller('ngModel');}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function (node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function (node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function (node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n }", "function multiFactory(factoryFn,index,isViewProvider,isComponent$$1,f){var factory=new NodeInjectorFactory(factoryFn,isViewProvider,directiveInject);factory.multi=[];factory.index=index;factory.componentProviders=0;multiFactoryAdd(factory,f,isComponent$$1&&!isViewProvider);return factory;}", "static get scopes() {\n\t\treturn Array.from(document.querySelectorAll('.ng-scope, .ng-isolate-scope')).reduce((scopes, elm) => {\n\t\t\tconst scope = Util.getScope(elm);\n\t\t\tlet name = _.camelCase(elm.tagName);\n\t\t\t// Account for multiple components\n\t\t\tif (name in scopes) {\n\t\t\t\tname += `-${scope.$id}`;\n\t\t\t}\n\t\t\tscopes[name] = scope;\n\t\t\treturn scopes;\n\t\t}, {});\n\t}", "function $$(selectedElements){\n\n const elements = document.querySelectorAll(selectedElements);\n\n function hide() {\n elements.forEach(element => {\n element.style.display = 'none';\n });\n // ENCADIANDO OS ELEMENTOS ABAIXO, VOU TRAZER NOVAMENTE OS BTNS\n return $$(selectedElements);\n }\n function show() {\n elements.forEach(element => {\n element.style.display = 'initial';\n });\n // ENCADIANDO OS ELEMENTOS ABAIXO, VOU TRAZER NOVAMENTE OS BTNS\n return $$(selectedElements);\n }\n function on(onEvent, callback){\n elements.forEach(element => {\n element.addEventListener(onEvent, callback);\n });\n return $$(selectedElements);\n }\n function addClass(className) {\n elements.forEach(element => {\n element.classList.add(className);\n });\n return $$(selectedElements);\n\n }\n function removeClass(className) {\n elements.forEach(element => {\n element.classList.remove(className);\n });\n return $$(selectedElements);\n\n }\n\n\n\n return {\n elements,\n hide,\n show,\n on,\n addClass,\n removeClass,\n }\n\n}", "function $$jqLiteProvider() {\n\t this.$get = function $$jqLite() {\n\t return extend(JQLite, {\n\t hasClass: function(node, classes) {\n\t if (node.attr) node = node[0];\n\t return jqLiteHasClass(node, classes);\n\t },\n\t addClass: function(node, classes) {\n\t if (node.attr) node = node[0];\n\t return jqLiteAddClass(node, classes);\n\t },\n\t removeClass: function(node, classes) {\n\t if (node.attr) node = node[0];\n\t return jqLiteRemoveClass(node, classes);\n\t }\n\t });\n\t };\n\t}", "function $$jqLiteProvider() {\n\t this.$get = function $$jqLite() {\n\t return extend(JQLite, {\n\t hasClass: function(node, classes) {\n\t if (node.attr) node = node[0];\n\t return jqLiteHasClass(node, classes);\n\t },\n\t addClass: function(node, classes) {\n\t if (node.attr) node = node[0];\n\t return jqLiteAddClass(node, classes);\n\t },\n\t removeClass: function(node, classes) {\n\t if (node.attr) node = node[0];\n\t return jqLiteRemoveClass(node, classes);\n\t }\n\t });\n\t };\n\t}", "function instantiateAllDirectives(tView, lView, tNode, _native8) {\n var start = tNode.directiveStart;\n var end = tNode.directiveEnd;\n\n if (!tView.firstCreatePass) {\n getOrCreateNodeInjectorForNode(tNode, lView);\n }\n\n attachPatchData(_native8, lView);\n var initialInputs = tNode.initialInputs;\n\n for (var i = start; i < end; i++) {\n var def = tView.data[i];\n var isComponent = isComponentDef(def);\n\n if (isComponent) {\n ngDevMode && assertTNodeType(tNode, 3\n /* AnyRNode */\n );\n addComponentLogic(lView, tNode, def);\n }\n\n var directive = getNodeInjectable(lView, tView, i, tNode);\n attachPatchData(directive, lView);\n\n if (initialInputs !== null) {\n setInputsFromAttrs(lView, i - start, directive, def, tNode, initialInputs);\n }\n\n if (isComponent) {\n var componentView = getComponentLViewByIndex(tNode.index, lView);\n componentView[CONTEXT] = directive;\n }\n }\n }", "function applyPatches () {\n let applied = false;\n const patcher = [\n \"$templateCache\",\n \"nmTrades\",\n \"userCollections\",\n \"artSubscriptionService\",\n \"artResource\",\n (\n $templateCache,\n nmTrades,\n userCollections,\n artSubscriptionService,\n artResource,\n ) => {\n patchTemplates($templateCache);\n patchNMTrades(nmTrades, userCollections, artSubscriptionService);\n patchArtResource(artResource);\n applied = true;\n },\n ];\n\n angular.module(\"nmApp\").run(patcher);\n window.addEventListener(\"load\", () => {\n if (applied) return;\n debug(\"late patching\");\n const getService = angular.element(document.body).injector().get;\n const func = patcher.pop();\n func(...patcher.map(getService));\n });\n}", "function applyProviderOverridesToView(def){if(providerOverrides.size===0){return def;}var elementIndicesWithOverwrittenProviders=findElementIndicesWithOverwrittenProviders(def);if(elementIndicesWithOverwrittenProviders.length===0){return def;}// clone the whole view definition,\n// as it maintains references between the nodes that are hard to update.\ndef=def.factory(function(){return NOOP;});for(var i=0;i<elementIndicesWithOverwrittenProviders.length;i++){applyProviderOverridesToElement(def,elementIndicesWithOverwrittenProviders[i]);}return def;function findElementIndicesWithOverwrittenProviders(def){var elIndicesWithOverwrittenProviders=[];var lastElementDef=null;for(var i=0;i<def.nodes.length;i++){var nodeDef=def.nodes[i];if(nodeDef.flags&1/* TypeElement */){lastElementDef=nodeDef;}if(lastElementDef&&nodeDef.flags&3840/* CatProviderNoDirective */&&providerOverrides.has(nodeDef.provider.token)){elIndicesWithOverwrittenProviders.push(lastElementDef.nodeIndex);lastElementDef=null;}}return elIndicesWithOverwrittenProviders;}function applyProviderOverridesToElement(viewDef$$1,elIndex){for(var i=elIndex+1;i<viewDef$$1.nodes.length;i++){var nodeDef=viewDef$$1.nodes[i];if(nodeDef.flags&1/* TypeElement */){// stop at the next element\nreturn;}if(nodeDef.flags&3840/* CatProviderNoDirective */){var provider=nodeDef.provider;var override=providerOverrides.get(provider.token);if(override){nodeDef.flags=nodeDef.flags&~3840/* CatProviderNoDirective */|override.flags;provider.deps=splitDepsDsl(override.deps);provider.value=override.value;}}}}}// Notes about the algorithm:", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}", "function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}" ]
[ "0.59978056", "0.5370687", "0.5291513", "0.5291513", "0.52856857", "0.5279941", "0.5279941", "0.5279941", "0.5279941", "0.5261177", "0.525406", "0.52253544", "0.52253544", "0.51772356", "0.51582706", "0.5156552", "0.5156552", "0.5156552", "0.5156552", "0.5156552", "0.5156552", "0.5156552", "0.5156552", "0.5156552", "0.51387066", "0.5061936", "0.5061936", "0.5061936", "0.5061936", "0.5048846", "0.5047385", "0.5046385", "0.50458276", "0.5005411", "0.5005078", "0.49759936", "0.49655622", "0.4962156", "0.4962156", "0.4962156", "0.4962156", "0.4962156", "0.493088", "0.4927466", "0.49250802", "0.49199104", "0.4917322", "0.4916538", "0.4893311", "0.48895705", "0.48837024", "0.48751637", "0.48662046", "0.48611778", "0.4856158", "0.48545054", "0.4847193", "0.4847193", "0.48456135", "0.4843299", "0.48297983", "0.48266894", "0.48266894", "0.48266894", "0.48266894", "0.48266894", "0.48234382", "0.48170573", "0.48045558", "0.48028895", "0.48027617", "0.47990948", "0.47959438", "0.47852877", "0.47852877", "0.47817448", "0.47762597", "0.47727183", "0.47686863", "0.47686863", "0.47686863", "0.47686863", "0.47686863", "0.47686863", "0.47686863", "0.47686863", "0.47686863", "0.47686863", "0.47686863", "0.47686863", "0.47686863", "0.47686863", "0.47686863", "0.47686863", "0.47686863", "0.47686863", "0.47686863", "0.47686863", "0.47686863", "0.47686863" ]
0.48108473
68
Shared uiview code for both directives: Given scope, element, and its attributes, return the view's name
function getUiViewName(scope, attrs, element, $interpolate) { var name = $interpolate(attrs.uiView || attrs.name || '')(scope); var inherited = element.inheritedData('$uiView'); return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : '')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUiViewName(scope, attrs, element, $interpolate) {\n\t\tvar name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n\t\tvar inherited = element.inheritedData('$uiView');\n\t\treturn name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));\n\t}", "function getUiViewName(scope, attrs, element, $interpolate) {\n\t var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n\t var inherited = element.inheritedData('$uiView');\n\t return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));\n\t}", "function getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n var inherited = element.inheritedData('$uiView');\n return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));\n }", "function getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n var inherited = element.inheritedData('$uiView');\n return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));\n}", "function getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n var inherited = element.inheritedData('$uiView');\n return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));\n}", "function getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n var inherited = element.inheritedData('$uiView');\n return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));\n}", "function getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n var inherited = element.inheritedData('$uiView');\n return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));\n}", "function getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n var inherited = element.inheritedData('$uiView');\n return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));\n}", "function getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n var inherited = element.inheritedData('$uiView');\n return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));\n}", "function getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n var inherited = element.inheritedData('$uiView');\n return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));\n}", "function getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n var inherited = element.inheritedData('$uiView');\n return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));\n}", "function getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n var inherited = element.inheritedData('$uiView');\n return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));\n}", "function getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n var inherited = element.inheritedData('$uiView');\n return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));\n}", "function getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope),\n inherited = element.inheritedData('$uiView');\n\n return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));\n }", "function getUiViewName(scope, attrs, element, $interpolate) {\n\t var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n\t var uiViewCreatedBy = element.inheritedData('$uiView');\n\t return name.indexOf('@') >= 0 ? name : (name + '@' + (uiViewCreatedBy ? uiViewCreatedBy.state.name : ''));\n\t}", "function getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n var uiViewCreatedBy = element.inheritedData('$uiView');\n return name.indexOf('@') >= 0 ? name : (name + '@' + (uiViewCreatedBy ? uiViewCreatedBy.state.name : ''));\n}", "function getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n var uiViewCreatedBy = element.inheritedData('$uiView');\n return name.indexOf('@') >= 0 ? name : (name + '@' + (uiViewCreatedBy ? uiViewCreatedBy.state.name : ''));\n}", "function getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n var uiViewCreatedBy = element.inheritedData('$uiView');\n return name.indexOf('@') >= 0 ? name : (name + '@' + (uiViewCreatedBy ? uiViewCreatedBy.state.name : ''));\n}", "function getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n var uiViewCreatedBy = element.inheritedData('$uiView');\n return name.indexOf('@') >= 0 ? name : (name + '@' + (uiViewCreatedBy ? uiViewCreatedBy.state.name : ''));\n}", "function getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n var uiViewCreatedBy = element.inheritedData('$uiView');\n return name.indexOf('@') >= 0 ? name : (name + '@' + (uiViewCreatedBy ? uiViewCreatedBy.state.name : ''));\n}", "function getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n var uiViewCreatedBy = element.inheritedData('$uiView');\n return name.indexOf('@') >= 0 ? name : (name + '@' + (uiViewCreatedBy ? uiViewCreatedBy.state.name : ''));\n}", "function getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n var uiViewCreatedBy = element.inheritedData('$uiView');\n return name.indexOf('@') >= 0 ? name : (name + '@' + (uiViewCreatedBy ? uiViewCreatedBy.state.name : ''));\n}", "function getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n var uiViewCreatedBy = element.inheritedData('$uiView');\n return name.indexOf('@') >= 0 ? name : (name + '@' + (uiViewCreatedBy ? uiViewCreatedBy.state.name : ''));\n}", "get name() {\n const context = getLContext(this.nativeNode);\n if (context !== null) {\n const lView = context.lView;\n const tData = lView[TVIEW].data;\n const tNode = tData[context.nodeIndex];\n return tNode.value;\n }\n else {\n return this.nativeNode.nodeName;\n }\n }", "function <%= directiveName %>() {\n return {\n restrict: 'AE',\n // transclude: true,\n // scope: {\n // },\n templateUrl: 'modules/<%= moduleName %>/templates/<%= templateName %>.html',\n // link: function(scope, el, attrs, controller) {},\n // compile: function() {}\n };\n }", "function link( scope, element, attributes ) {\n\n console.log( \"User-repos layout directive linking.\" );\n\n }", "goToElementView(viewElement, viewName, pageName, variable) {\n let $el, parentDialog;\n const activePage = this.app.activePage;\n if (viewElement.length) {\n if (!this.app.isPrefabType && pageName === activePage.activePageName) {\n viewElement = this.getViewElementInActivePage(viewElement);\n }\n $el = viewElement[0].widget;\n switch ($el.widgetType) {\n case 'wm-accordionpane':\n this.showAncestors(viewElement, variable);\n $el.expand();\n break;\n case 'wm-tabpane':\n this.showAncestors(viewElement, variable);\n $el.select();\n break;\n case 'wm-segment-content':\n this.showAncestors(viewElement, variable);\n $el.navigate();\n break;\n case 'wm-panel':\n /* flip the active flag */\n $el.expanded = true;\n break;\n }\n }\n else {\n parentDialog = this.showAncestorDialog(viewName);\n setTimeout(() => {\n if (parentDialog) {\n this.goToElementView($('[name=\"' + viewName + '\"]'), viewName, pageName, variable);\n }\n });\n }\n }", "get name() {\n\t\treturn this.nativeElement ? this.nativeElement.name : undefined;\n\t}", "get view() {\n\t\treturn this.nativeElement ? this.nativeElement.view : undefined;\n\t}", "function getViewComponent(element){var context=loadLContext(element);var lView=context.lView;while(lView[PARENT]&&lView[HOST]===null){// As long as lView[HOST] is null we know we are part of sub-template such as `*ngIf`\nlView=lView[PARENT];}return lView[FLAGS]&128/* IsRoot */?null:lView[CONTEXT];}", "function directiveLocationToVisitorMethodName(loc) {\n return 'visit' + loc.replace(/([^_]*)_?/g, function (wholeMatch, part) {\n return part.charAt(0).toUpperCase() + part.slice(1).toLowerCase();\n });\n}", "function directiveLocationToVisitorMethodName(loc) {\n return 'visit' + loc.replace(/([^_]*)_?/g, function (wholeMatch, part) {\n return part.charAt(0).toUpperCase() + part.slice(1).toLowerCase();\n });\n}", "function homeController($scope, $element, $attrs) {\n // sensor = $attrs.dashLabel;\n}", "function link( scope, element, attributes ) {\n\n console.log( \"Main layout directive linking.\" );\n\n }", "static get viewClsName() {\n return 'SampleView';\n }", "get annotatedName() {\n if (this.annotation) {\n return this.annotation;\n }\n else {\n return `<${this.tagName}>`;\n }\n }", "function getName(elm){\n return elm.markupTag.name.toString();\n}", "function ViewRenderer(elemOrName) {\r\n this.lineage = [];\r\n this.dtoStack = [];\r\n this.directives = [];\r\n if (typeof elemOrName === \"string\") {\r\n if (elemOrName.substr(0, 1) === \"#\") {\r\n this.container = document.getElementById(elemOrName.substr(1));\r\n }\r\n else {\r\n this.container = document.querySelector(\"[data-name='\" + elemOrName + \"'],[data-collection='\" + elemOrName + \"'],#\" + elemOrName + \",[name=\\\"\" + elemOrName + \"\\\"]\");\r\n }\r\n if (!this.container) {\r\n throw new Error(\"Failed to locate '\" + elemOrName + \"'.\");\r\n }\r\n }\r\n else {\r\n this.container = elemOrName;\r\n }\r\n }", "function view(element) {\n removeFromView();\n element.classList.add('view'); //view class does the magic\n}", "function displayNodeName(event, element) {\r\n ctrl.data.name = element.data.name; //get comp name\r\n }", "function navTreeLink(scope, element, $attrs) {\n }", "get View() {}", "function getName(element){\n return element.attr('id').toString() /*retorna o nome do elemento*/\n }", "function getViewComponent(element) {\n var context = loadLContext(element);\n var lView = context.lView;\n while (lView[PARENT] && lView[HOST] === null) {\n // As long as lView[HOST] is null we know we are part of sub-template such as `*ngIf`\n lView = lView[PARENT];\n }\n return lView[FLAGS] & 128 /* IsRoot */ ? null : lView[CONTEXT];\n}", "function getViewComponent(element) {\n var context = loadLContext(element);\n var lView = context.lView;\n while (lView[PARENT] && lView[HOST] === null) {\n // As long as lView[HOST] is null we know we are part of sub-template such as `*ngIf`\n lView = lView[PARENT];\n }\n return lView[FLAGS] & 128 /* IsRoot */ ? null : lView[CONTEXT];\n}", "function overviews_view_name(table) {\n var parsed_table = TableNameParser.parse(table);\n parsed_table.table = '_vovw_' + parsed_table.table;\n parsed_table.schema = null;\n return TableNameParser.table_identifier(parsed_table);\n}", "function getTargetDOMElement(binding, view) {\n var target = binding.target;\n // DOM element\n if (target instanceof Element) {\n return target;\n }\n // custom element or custom attribute\n // tslint:disable-next-line:prefer-const\n for (var i = 0, ii = view.controllers.length; i < ii; i++) {\n var controller = view.controllers[i];\n if (controller.viewModel === target) {\n var element = controller.container.get(aureliaPal.DOM.Element);\n if (element) {\n return element;\n }\n throw new Error(\"Unable to locate target element for \\\"\" + binding.sourceExpression + \"\\\".\");\n }\n }\n throw new Error(\"Unable to locate target element for \\\"\" + binding.sourceExpression + \"\\\".\");\n }", "function link( $scope, element, attributes ) {\n\n console.log(\n attributes.logCreate,\n $scope.$index\n );\n\n }", "function getAttrsForDirectiveMatching(elOrTpl){var attributesMap={};elOrTpl.attributes.forEach(function(a){if(!isI18nAttribute(a.name)){attributesMap[a.name]=a.value;}});elOrTpl.inputs.forEach(function(i){attributesMap[i.name]='';});elOrTpl.outputs.forEach(function(o){attributesMap[o.name]='';});return attributesMap;}", "function dashSystemInfoWidgetController($scope, $element, $attrs) {\n\t// sensor = $attrs.dashLabel;\n}", "function link (scope, elem, attrs) {\n\n\t}", "function <%= _.classify(name) %>() {\n var vm = this;\n }", "function navListLink(scope, element, $attrs) {\n }", "function getViewComponent(element) {\n var context = loadLContext(element);\n var lView = context.lView;\n var parent;\n ngDevMode && assertLView(lView);\n while (lView[HOST] === null && (parent = getLViewParent(lView))) {\n // As long as lView[HOST] is null we know we are part of sub-template such as `*ngIf`\n lView = parent;\n }\n return lView[FLAGS] & 512 /* IsRoot */ ? null : lView[CONTEXT];\n}", "function nameAutoComplete($rootScope, $cookieStore, $http, $compile){\n\treturn {\n restrict: 'A',\n link: function (scope, element, attrs) {\n \telement.bind(\"click\", function(event) {\n \t\tautoComplete(scope, element, 'name', $cookieStore, $compile);\n \t});\n }\n }\n}", "function viewParentEl(view){var parentView=view.parent;if(parentView){return view.parentNodeDef.parent;}else{return null;}}", "view(view = 'grid') {\n\t\t\t\t\treturn view;\n\t\t\t\t}", "function overviewsViewName (table) {\n var parsedTable = TableNameParser.parse(table);\n parsedTable.table = '_vovw_' + parsedTable.table;\n parsedTable.schema = null;\n return TableNameParser.table_identifier(parsedTable);\n}", "get viewType() {\n\t\treturn this.nativeElement ? this.nativeElement.viewType : undefined;\n\t}", "function activateView(name) {\n scope[views].forEach(function (view) {\n if (view.name === name)\n view.isActive = true;\n else\n delete view.isActive;\n });\n }", "function getTargetDOMElement(binding, view) {\n var target = binding.target;\n // DOM element\n if (target instanceof Element) {\n return target;\n }\n // custom element or custom attribute\n // tslint:disable-next-line:prefer-const\n for (var i = 0, ii = view.controllers.length; i < ii; i++) {\n var controller = view.controllers[i];\n if (controller.viewModel === target) {\n var element = controller.container.get(aurelia_pal_1.DOM.Element);\n if (element) {\n return element;\n }\n throw new Error(\"Unable to locate target element for \\\"\" + binding.sourceExpression + \"\\\".\");\n }\n }\n throw new Error(\"Unable to locate target element for \\\"\" + binding.sourceExpression + \"\\\".\");\n }", "function getTargetDOMElement(binding, view) {\n var target = binding.target;\n // DOM element\n if (target instanceof Element) {\n return target;\n }\n // custom element or custom attribute\n // tslint:disable-next-line:prefer-const\n for (var i = 0, ii = view.controllers.length; i < ii; i++) {\n var controller = view.controllers[i];\n if (controller.viewModel === target) {\n var element = controller.container.get(aurelia_pal_1.DOM.Element);\n if (element) {\n return element;\n }\n throw new Error(\"Unable to locate target element for \\\"\" + binding.sourceExpression + \"\\\".\");\n }\n }\n throw new Error(\"Unable to locate target element for \\\"\" + binding.sourceExpression + \"\\\".\");\n }", "function navBarTopLink(scope, element, $attrs) {\n }", "function findViaDirective(lView,directiveInstance){// if a directive is monkey patched then it will (by default)\n// have a reference to the LView of the current view. The\n// element bound to the directive being search lives somewhere\n// in the view data. We loop through the nodes and check their\n// list of directives for the instance.\nvar tNode=lView[TVIEW].firstChild;while(tNode){var directiveIndexStart=tNode.directiveStart;var directiveIndexEnd=tNode.directiveEnd;for(var i=directiveIndexStart;i<directiveIndexEnd;i++){if(lView[i]===directiveInstance){return tNode.index;}}tNode=traverseNextElement(tNode);}return-1;}", "function attrNoDirective(){return{controller:angular.noop};}", "function updateTagNameDisplayer(element) {\n $(\"#tag-name\").text(\"<\" + element.tagName + \">\");\n}", "getClassName(){return \"Core.UI.Render.CoreView\";}", "function getName(el, prefix) {\n var name = el.getAttribute('name');\n if (!name) {\n name = prefix+'_'+util.uid();\n el.setAttribute('name', name);\n }\n return name;\n }", "function $View(text, omodel, promise, viewParent) {\n omodel || (omodel = {});\n\n var model = viewParent && viewParent.model ?\n optionsGlobal.modelreuse ?\n merge(viewParent.model, omodel)\n :\n merge(omodel, viewParent.model)\n :\n optionsGlobal.modelreuse ?\n omodel\n :\n merge({}, omodel);\n\n var view = {\n text : text,\n orginalModel : omodel,\n\n model : model,\n\n tagreturned : undefined,\n template : undefined,\n outArray : [],\n promise : promise\n };\n\n /**\n * 0. Think of everything as a view, the first template invocation, body invocations and so on\n *\n * 1. context or 'this' storage is always relative to the view. Store something on context or this,\n * and it won't exists outside that view, body, or subbodies, such as an <m:if call\n *\n * 2. model storage is relative to the executing view, body and all sub-bodies and nested render calls\n * Store something on a model and those changes will only be visible downwards, and not affect the parent views model\n * unless modelreuse is set to true. If false, then the model is remerged onto a fresh {}.\n * Ofcourse if you modify reference objects, those changes will affect both.\n *\n * 3. context.request or 'this'.request is an all spanning storage, where only one copy exist and shared\n * across templates and can be manipulated from sub templates.\n * Not thread safe, since this is an aysnchrounes library unless you preload files and such prior to a render call.\n */\n view.context = {\n // !! === BE WARNED === !!\n // EVERYTHING IN HERE SHOULD BE THREAD SAFE OR ON THE RESPONISBILITY OF THE DEVELOPER\n // SUCH AS WITH view(). IT IS INCLUDED BUT REALLY HAS NO USE AS OF NOW,\n // BUT WHO KNOWS IN THE FUTURE IF SOMEONE MIGHT NEED IT IN A TAGLIB TO DO SOME WICKED SHIT?\n // !! ================= !!\n\n model : model,\n\n request : model.request || (viewParent ? viewParent.context.request : {}),\n\n render : function(filepath, model) {\n return renderFile(filepath, model, view.promise);\n },\n\n renderText : function(text, model) {\n return renderText(text, model, view.promise);\n },\n\n renderPartial : function(text, model) {\n return renderPartial(text, model, view.promise);\n },\n\n asBody : function(text) {\n return viewAsBody(view, text);\n },\n\n lock : function() {\n return lockView(view);\n },\n\n unlock : function() {\n return unlockView (view);\n },\n\n view : view,\n MoCP : that, // In case there exists several MoCP instances\n\n // ==== Extra functions that we might make use of in taglibs ===\n util : {\n merge : merge\n }\n };\n if (model.request) {\n delete model.request;\n }\n\n return promise.view = view;\n }", "function elementName(element) {\n if (typeof element == \"string\")\n return element\n if (element.nodeType)\n return element.nodeName.toLowerCase()\n }", "function getName(elementSubtype) {\r\n\t\tif(elementSubtype === 'in') return 'in_' +app.inPortCounter;\r\n\t\tif(elementSubtype === 'out') return 'out_' +app.outPortCounter;\r\n\t\tif(elementSubtype === 'AF') return 'AF_' +app.AFCounter;\r\n\t\tif(elementSubtype === 'TTF') return 'TTF_' +app.TTFCounter;\r\n\t}", "function ElementController($scope, $location, applicationState, Choko) {\n $scope.element.template = $scope.element.template || 'templates/' + $scope.element.type + '.html';\n}", "function extractAngularId(element) {\n return element.getAttributeNames()\n .filter(x => x !== \"class\")\n .find(x => x);\n}", "function getName() {\n\t\treturn 'UI';\n\t}", "function link(scope, element, attributes) {\n // Because we are deferring the application of the Uniform plugin,\n // this will help us keep track of whether or not the plugin has been\n // applied.\n var uniformedElement = null;\n // We don't want to link-up the Uniform plugin right away as it will\n // query the DOM (Document Object Model) layout which will cause the\n // browser to repaint which will, in turn, lead to unexpected and poor\n // behaviors like forcing a scroll of the page. Since we have to watch\n // for ngModel value changes anyway, we'll defer our Uniform plugin\n // instantiation until after the first $watch() has fired.\n\n scope.$watch(attributes.ngModel, handleModelChange);\n // When the scope is destroyed, we have to teardown our jQuery plugin\n // to in order to make sure that it releases memory.\n scope.$on(\"$destroy\", handleDestroy);\n // ---\n // PRIVATE METHODS.\n // ---\n // I clean up the directive when the scope is destroyed.\n function handleDestroy() {\n // If the Uniform plugin has not yet been applied, there's nothing\n // that we have to explicitly teardown.\n if (!uniformedElement) {\n return;\n }\n uniformedElement.uniform.restore(uniformedElement);\n }\n\n // I handle changes in the ngModel value, translating it into an\n // update to the Uniform plugin.\n function handleModelChange(newValue, oldValue) {\n // If we try to call render right away, two things will go wrong:\n // first, we won't give the ngValue directive time to pipe the\n // correct value into ngModle; and second, it will force an\n // undesirable repaint of the browser. As such, we'll perform the\n // Uniform synchronization at a later point in the $digest.\n scope.$evalAsync(synchronizeUniform);\n }\n\n // I synchronize Uniform with the underlying form element.\n function synchronizeUniform() {\n // Since we are executing this at a later point in the $digest\n // life-cycle, we need to ensure that the scope hasn't been\n // destroyed in the interim period. While this is unlikely (if\n // not impossible - I haven't poured over the details of the $digest\n // in this context) it's still a good idea as it embraces the\n // nature of the asynchronous control flow.\n // --\n // NOTE: During the $destroy event, scope is detached from the\n // scope tree and the parent scope is nullified. This is why we\n // are checking for the absence of a parent scope to indicate\n // destruction of the directive.\n if (!scope.$parent) {\n return;\n }\n // If Uniform has not yet been integrated, apply it to the element.\n if (!uniformedElement) {\n return ( uniformedElement = element.uniform() );\n }\n // Otherwise, update the existing instance.\n uniformedElement.uniform.update(uniformedElement);\n }\n }", "function getHostElement(directive){return getLContext(directive)[\"native\"];}", "_findViewId(_elem) {\n while (_elem && this.isntNullOrUndefined(_elem.view_id) && (_elem !== document.body)) {\n _elem = _elem.parentNode;\n }\n return _elem;\n }", "_findViewId(_elem) {\n while (_elem && this.isntNullOrUndefined(_elem.view_id) && (_elem !== document.body)) {\n _elem = _elem.parentNode;\n }\n return _elem;\n }", "static view(v) {\n // Add history\n window.history.replaceState(State.preserve(), document.title);\n // Change views\n for (let view of Array.from(arguments)) {\n // Store view\n let element = UI.find(view);\n // Store parent\n let parent = element.parentNode;\n // Hide all\n for (let child of parent.children) {\n UI.hide(child);\n }\n // Show view\n UI.show(element);\n }\n // Add history\n window.history.pushState(State.preserve(), document.title);\n }", "getName() {\n return 'UIComponent';\n }", "function getAttrsForDirectiveMatching(elOrTpl) {\n var attributesMap = {};\n elOrTpl.attributes.forEach(function (a) {\n if (!isI18nAttribute(a.name)) {\n attributesMap[a.name] = a.value;\n }\n });\n elOrTpl.inputs.forEach(function (i) { attributesMap[i.name] = ''; });\n elOrTpl.outputs.forEach(function (o) { attributesMap[o.name] = ''; });\n return attributesMap;\n}", "function getAttrsForDirectiveMatching(elOrTpl) {\n var attributesMap = {};\n elOrTpl.attributes.forEach(function (a) {\n if (!isI18nAttribute(a.name)) {\n attributesMap[a.name] = a.value;\n }\n });\n elOrTpl.inputs.forEach(function (i) { attributesMap[i.name] = ''; });\n elOrTpl.outputs.forEach(function (o) { attributesMap[o.name] = ''; });\n return attributesMap;\n}", "function ViewChildDecorator() {}", "function ViewChildDecorator() {}", "function ViewChildDecorator() {}", "function link(scope, element, attrs) {\n scope.team = attrs.author;\n // element.text('this is the footerSection.directive directive');\n }", "function directive(name, templateFileName, transclude) {\n\ttemplateFileName = templateFileName || name;\n\tapp.directive(name, function () {\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\ttransclude: transclude,\n\t\t\ttemplateUrl: templateFileName + '.html'\n\t\t};\n\t});\n}", "function getNodeName(nodeOrAttr) {\n return nodeOrAttr.constructor.name === 'Attr' ? nodeOrAttr.name : nodeOrAttr.nodeName;\n }", "function getBindingPropName(elem) {\n let tempName = \"\";\n\n if (elem.hasAttribute(\"[(ngModel)]\")) {\n tempName = elem.getAttribute(\"[(ngModel)]\");\n } else if (elem.hasAttribute(\"[(value)]\")) {\n tempName = elem.getAttribute(\"[(value)]\");\n } else if (elem.hasAttribute(\"[value]\")) {\n tempName = elem.getAttribute(\"[value]\");\n } else {\n tempName = elem.getAttribute(\"id\");\n }\n\n //Shorten the name of the element by removing the data before '.'\n return tempName.indexOf(\".\") === -1 ?\n tempName :\n tempName.slice(tempName.indexOf(\".\") + 1, tempName.length);\n}", "function DirectiveType() {}", "get view() {\n return this._view;\n }", "get view() {\n return this._view;\n }", "function findComponentView(lView){var rootTNode=lView[HOST_NODE];while(rootTNode&&rootTNode.type===2/* View */){ngDevMode&&assertDefined(lView[DECLARATION_VIEW],'lView[DECLARATION_VIEW]');lView=lView[DECLARATION_VIEW];rootTNode=lView[HOST_NODE];}return lView;}", "function goToView(viewElement, viewName, pageName) {\n\n var $is, parentDialog;\n\n if (viewElement.length) {\n if (pageName === $rs.activePageName) {\n viewElement = getViewElementInActivePage(viewElement);\n }\n\n $is = viewElement.isolateScope();\n switch ($is._widgettype) {\n case 'wm-view':\n showAncestors(viewElement);\n ViewService.showView(viewName);\n break;\n case 'wm-accordionpane':\n showAncestors(viewElement);\n $is.expand();\n break;\n case 'wm-tabpane':\n showAncestors(viewElement);\n $is.select();\n break;\n case 'wm-segment-content':\n showAncestors(viewElement);\n $is.navigate();\n break;\n case 'wm-panel':\n /* flip the active flag */\n $is.expanded = true;\n break;\n }\n } else {\n parentDialog = showAncestorDialog(viewName);\n $timeout(function () {\n if (parentDialog) {\n goToView(WM.element('[name=\"' + viewName + '\"]'), viewName, pageName);\n }\n });\n }\n }", "function uiViewDepth(uiView) {\n\t return uiView.fqn.split(\".\").length;\n\t }", "function locateDirectiveOrProvider(tNode,lView,token,canAccessViewProviders,isHostSpecialCase){var tView=lView[TVIEW];var nodeProviderIndexes=tNode.providerIndexes;var tInjectables=tView.data;var injectablesStart=nodeProviderIndexes&65535/* ProvidersStartIndexMask */;var directivesStart=tNode.directiveStart;var directiveEnd=tNode.directiveEnd;var cptViewProvidersCount=nodeProviderIndexes>>16/* CptViewProvidersCountShift */;var startingIndex=canAccessViewProviders?injectablesStart:injectablesStart+cptViewProvidersCount;// When the host special case applies, only the viewProviders and the component are visible\nvar endIndex=isHostSpecialCase?injectablesStart+cptViewProvidersCount:directiveEnd;for(var i=startingIndex;i<endIndex;i++){var providerTokenOrDef=tInjectables[i];if(i<directivesStart&&token===providerTokenOrDef||i>=directivesStart&&providerTokenOrDef.type===token){return i;}}if(isHostSpecialCase){var dirDef=tInjectables[directivesStart];if(dirDef&&isComponentDef(dirDef)&&dirDef.type===token){return directivesStart;}}return null;}", "function _AngularName(name) {\n return (MY_NAMESPACE + '_' + name).replace(/_(\\w)/g, _Capitalize);\n\n function _Capitalize(match, letter) {\n return letter.toUpperCase();\n }\n }", "function ViewChildDecorator(){}", "get cName(){\n\t\treturn this.hasAttribute('c-name') ? this.getAttribute('c-name') : this.querySelector('input[name], textarea[name], select[name]').name;\n\t}", "function getViewSubType() {\n\t\tif (viewNameSuffix.indexOf(\"and time: \") > -1 )\n\t\t\treturn \"1\";\n\t\telse\n\t\t\treturn \"2\";\n\t}" ]
[ "0.7417891", "0.7377648", "0.7344593", "0.73376596", "0.73376596", "0.73376596", "0.73376596", "0.73376596", "0.73376596", "0.73376596", "0.73376596", "0.73376596", "0.73376596", "0.73153275", "0.72885394", "0.7270483", "0.7270483", "0.7270483", "0.7270483", "0.7270483", "0.7270483", "0.7270483", "0.7270483", "0.532508", "0.5224109", "0.520452", "0.5177925", "0.5081523", "0.50770575", "0.50653636", "0.5038223", "0.5038223", "0.49820188", "0.49707016", "0.49621364", "0.49523556", "0.4950065", "0.49250415", "0.49236917", "0.4918285", "0.48981556", "0.48916346", "0.48675147", "0.4867477", "0.4867477", "0.4842918", "0.4836709", "0.48258567", "0.47932604", "0.47784758", "0.4775256", "0.47437817", "0.47225624", "0.4716676", "0.47157568", "0.47141173", "0.47109553", "0.47083434", "0.47021034", "0.46797666", "0.46687463", "0.46687463", "0.4662475", "0.46408826", "0.46384528", "0.4636085", "0.45905483", "0.45795745", "0.45603082", "0.4550622", "0.45503968", "0.45245838", "0.4520642", "0.45058534", "0.44771555", "0.44706237", "0.44652387", "0.44652387", "0.4464333", "0.44640207", "0.4462305", "0.4462305", "0.44597372", "0.44597372", "0.44597372", "0.44530106", "0.4451438", "0.44453102", "0.44424096", "0.4438537", "0.44295093", "0.44295093", "0.44232574", "0.44100395", "0.44083616", "0.44035468", "0.44015634", "0.4401428", "0.4397328", "0.43968025" ]
0.73495334
2
Returns the depth of the deepest subtree under this node
function countSubTreeDepth(scope) { var thisLevelDepth = 0, childNodes = scope.childNodes(), childNode, childDepth, i; if (!childNodes || childNodes.length === 0) { return 0; } for (i = childNodes.length - 1; i >= 0 ; i--) { childNode = childNodes[i], childDepth = 1 + countSubTreeDepth(childNode); thisLevelDepth = Math.max(thisLevelDepth, childDepth); } return thisLevelDepth; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDepth(node) {\n let d = 0;\n while (node.left != null) {\n node = node.left;\n d++;\n }\n return d;\n}", "maxDepth () {\n\t\tif (this.root === null) return 0;\n\n\t\tconst longest = (node) => {\n\t\t\tif (node.left === null && node.right === null) return 1;\n\t\t\tif (node.left === null) return longest(node.right) + 1;\n\t\t\tif (node.right === null) return longest(node.left) + 1;\n\t\t\treturn Math.max(longest(node.left), longest(node.right)) + 1;\n\t\t};\n\n\t\treturn longest(this.root);\n\t}", "maxDepth() {\n if (!this.root) {\n return 0;\n }\n\n const solver = (node) => {\n if (node.left === null && node.right === null) {\n return 1;\n }\n if (node.left === null) {\n return solver(node.right) + 1;\n }\n if (node.right === null) {\n return solver(node.left) + 1;\n }\n return Math.max(solver(node.left), solver(node.right)) + 1;\n };\n return solver(this.root);\n }", "maxDepth() {\n if (this.root === null) return 0;\n let depth = 1;\n let nodesToVisit = [this.root];\n\n while (nodesToVisit.length){\n\n let current = nodesToVisit.pop();\n if ((current.left !== null) || current.right !== null){\n depth++;\n }\n\n if (current.left !== null){\n nodesToVisit.push(current.left);\n }\n if (current.right !== null){\n nodesToVisit.push(current.right);\n }\n }\n return depth;\n }", "function getDepth(node) {\n var currentDepth = 0;\n\n while (node != null) {\n currentDepth += 1;\n node = node.parent;\n }\n\n return currentDepth;\n}", "computeMaxDepth() {\n let d = 0;\n for (const child of this.components) {\n d = Math.max(d + 1, child.children.computeMaxDepth());\n }\n return d;\n }", "function getDepth(node) {\n if (!node) {\n return 0;\n }\n\n var left = getDepth(node.left);\n var right = getDepth(node.right);\n\n return left > right ? left + 1 : right + 1;\n}", "depth() {\n if (this.#depth !== undefined)\n return this.#depth;\n if (!this.parent)\n return (this.#depth = 0);\n return (this.#depth = this.parent.depth() + 1);\n }", "minDepth() {\n if (!this.root) {\n return 0;\n }\n const solver = (node) => {\n if (node.left === null && node.right === null) {\n return 1;\n }\n if (node.left === null) {\n return solver(node.right) + 1;\n }\n if (node.right === null) {\n return solver(node.left) + 1;\n }\n return Math.min(solver(node.left), solver(node.right)) + 1;\n };\n return solver(this.root);\n }", "minDepth () {\n\t\tif (this.root === null) return 0;\n\n\t\tconst shortest = (node) => {\n\t\t\tif (node.left === null && node.right === null) return 1;\n\t\t\tif (node.left === null) return shortest(node.right) + 1;\n\t\t\tif (node.right === null) return shortest(node.left) + 1;\n\t\t\treturn Math.min(shortest(node.left), shortest(node.right)) + 1;\n\t\t};\n\n\t\treturn shortest(this.root);\n\t}", "function computeTreeDepth(tree) {\n let depth = 0\n let p = tree\n let q = [p]\n while (q.length > 0) {\n let qq = []\n for (const x of q) {\n if (x.children) {\n for (const y of x.children) {\n qq.push(y)\n }\n }\n }\n if (qq.length > 0) depth += 1\n q = qq\n }\n\n return depth\n}", "maxDepth() {\n // check if root exists. \n if (!this.root) return 0;\n\n function minDepthLeftHelper(node) {\n // is leaf node?\n if (node.left === null && node.right === null) return 1;\n if (node.left !== null) return minDepthLeftHelper(node.left) + 1; \n }\n\n function minDepthRightHelper(node) {\n // is leaf node?\n if (node.left === null && node.right === null) return 1;\n if (node.right !== null) return minDepthLeftHelper(node.right) + 1; \n }\n\n let leftNodes = minDepthLeftHelper(this.root);\n let rightNodes = minDepthRightHelper(this.root);\n\n return Math.max(leftNodes, rightNodes);\n }", "get depth() {}", "function getMaxDepth(tree) {\n if (tree === null) {\n return 0;\n }\n\n let lDepth = getMaxDepth(tree.left);\n let rDepth = getMaxDepth(tree.right);\n\n if (lDepth > rDepth) {\n return (lDepth + 1);\n } else {\n return rDepth + 1;\n };\n ;\n}", "getDepth(n) {\r\n return this.getDepthHelper(this.head, n)\r\n }", "minDepth() {\n\n // check if root exists. \n if (!this.root) return 0;\n\n function minDepthLeftHelper(node) {\n // is leaf node?\n if (node.left === null && node.right === null) return 1;\n if (node.left !== null) return minDepthLeftHelper(node.left) + 1; \n }\n\n function minDepthRightHelper(node) {\n // is leaf node?\n if (node.left === null && node.right === null) return 1;\n if (node.right !== null) return minDepthLeftHelper(node.right) + 1; \n }\n\n let leftNodes = minDepthLeftHelper(this.root);\n let rightNodes = minDepthRightHelper(this.root);\n\n return Math.min(leftNodes, rightNodes);\n }", "minDepth() {\n\n if (this.root === null) return 0;\n let depth = 1;\n let nodesToVisit = [this.root];\n let leafFound = false;\n\n while (!leafFound){\n\n let current = nodesToVisit.shift();\n\n if ((current.left === null) && (current.right === null)){\n leafFound = true;\n }\n\n else{\n depth++;\n nodesToVisit.push(current.left);\n nodesToVisit.push(current.right);\n }\n }\n\n return depth;\n }", "get Depth() {}", "function max_depth(d){\nfunction max_depth_rec(d, depth){\n\tif( d.children ){\n\t\tvar result = 0;\n\t\tfor(var i=0; i < d.children.length; ++i){\n\t\t\ttmp = max_depth_rec(d.children[i], depth+1);\n\t\t\tresult = Math.max(result, tmp);\n\t\t}\n\t\treturn result;\n\t}else{\n\t\treturn depth;\n\t}\n}\nreturn max_depth_rec(d, 1);\n}", "function heightOfTree(root) {\n let depth = 0;\n\n const dfs = (node, levels) => {\n if (!node) return 0;\n if (levels > depth) depth = levels;\n for (let child of node.children) {\n dfs(child, levels + 1)\n }\n\n return levels;\n }\n\n dfs(root, 0)\n return depth;\n}", "function findMaxNodeDepth(node) {\n let maxDepth = node.depth; // Records depth of node\n if (node.desc != null) {\n for (let i = 0; i < node.desc.length; i++) {\n let descMax = findMaxNodeDepth(node.desc[i]); // Recursive call to find max\n if (descMax > maxDepth) {\n // depth of descendants.\n maxDepth = descMax; // Overwrites node depth if descendant depth greater\n }\n }\n }\n return maxDepth;\n}", "function heightoftree(tree) {\n if (tree.left && tree.right)\n return Math.max(heightoftree(tree.left), heightoftree(tree.right)) + 1;\n if (tree.left) return heightoftree(tree.left) + 1;\n if (tree.right) return heightoftree(tree.right) + 1;\n return 1;\n}", "findNodeDepth(targetNode, node = this.root, depth = 0) {\n if (node === targetNode) return depth\n\n if (node.children.length) {\n for (let i = 0; i < node.children.length; i++) {\n let childNode = node.children[i];\n let res = this.findNodeDepth(targetNode, childNode, depth + 1)\n if (typeof res === 'number') {\n return res\n }\n }\n }\n\n return false;\n }", "getDepth() {\n return this.depth;\n }", "getInnerDepth() {\n mustInherit();\n }", "function getDepth(ancestor, descendant) {\n var ret = 0;\n while (descendant !== ancestor) {\n ret++;\n descendant = descendant.parentNode;\n if (!descendant)\n throw new Error(\"not a descendant of ancestor!\");\n }\n return ret;\n }", "function getDepth(ancestor, descendant) {\n var ret = 0;\n while (descendant !== ancestor) {\n ret++;\n descendant = descendant.parentNode;\n if (!descendant)\n throw new Error(\"not a descendant of ancestor!\");\n }\n return ret;\n }", "function getTreeHeight(){\r\n\t\tvar res = 0;\r\n\t\tvar addingHeight = 1;\r\n\t\tif(this.name == \"\")\r\n\t\t\taddingHeight = 0;\r\n\t\t\r\n\t\tif(this.expanded){\r\n\t\t\tfor(var i = 0; i < this.childCount; i++){\r\n\t\t\t\tvar tmp = this.child[i].getHeight();\r\n\t\t\t\tif(tmp > res)\r\n\t\t\t\t\tres = tmp\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res + addingHeight;\r\n\t\t\r\n\t}", "function calcNodeLevel(node){\n if(!node.parent || node.parent.type == 'root')\n return 0;\n return calcNodeLevel(node.parent) + 1;\n}", "function diameterBST(tree) {\n let diameter = 0;\n\n function maxDepth(tree) {\n if (tree === null) return 0;\n\n let left = maxDepth(tree.left);\n let right = maxDepth(tree.right);\n\n diameter = Math.max(diameter, left + right);\n return Math.max(left, right) + 1;\n }\n\n maxDepth(tree);\n\n return diameter;\n}", "get depth() {\n\t\treturn this._depth;\n\t}", "function deepOfTree(root) {\n if (!root) return 0;\n return Math.max(deepOfTree(root.left)+1, deepOfTree(root.right)+1);\n}", "function nodeDepths(root) {\n let depthSum = 0;\n // create helper function\n function calculateNodeDepths(node, depth = 0) {\n if (node) {\n // recursive call to the left, adding 1 to the depth\n calculateNodeDepths(node.left, depth + 1);\n // add the depthSum += depth\n depthSum += depth;\n // recursive call to the right, with node.right, depthSum, depth + 1\n calculateNodeDepths(node.right, depth + 1)\n }\n return depthSum\n }\n\n calculateNodeDepths(root);\n // return the depth sum\n return depthSum;\n}", "recursiveDepthCalc(el, sum) {\n if (el.parentElement.id === 'fatherNode') {\n return sum+1;\n }\n else if (el.tagName !== 'UL') {\n return this.recursiveDepthCalc(el.parentElement, sum);\n }\n else {\n return this.recursiveDepthCalc(el.parentElement, sum + 1);\n }\n }", "size() {\n let _size = node => node === null ? 0 : 1 + _size(node.left) + _size(node.right)\n return _size(this.root)\n }", "function getDepth(token) {\n var level = 0;\n var context = token.state.context;\n while (context) {\n level++;\n context = context.prev;\n }\n return level;\n }", "function nodeDepths(root, depth = 0) {\n if (root === null) return 0;\n\treturn depth + nodeDepths(root.left, depth + 1) + nodeDepths(root.right, depth + 1);\n}", "function maxDepth(node,depth){\n\tif(('children' in node) & (node['children'].length>0)){\n\t\tm=0;\n\t\tfor(var i=0,tot=node.children.length;i<tot;i++){\n\t\t\tm = Math.max(m,maxDepth(node.children[i]));\n\t\t}\n\t\tm=m+1;\n\t\treturn m;\n\t}\n\telse {\n\t\treturn 0;\n\t}\n}", "getOuterDepth() {\n mustInherit();\n }", "function treeHeight(node) {\n\n if (!node) {\n return 0;\n }\n\n return 1 + Math.max(treeHeight(node.left), treeHeight(node.right));\n}", "getRemainingDepth() {\n return this.remainingDepth;\n }", "function getDepth(ancestor, descendant) {\n var ret = 0;\n while (descendant !== ancestor) {\n ret++;\n descendant = descendant.parentNode;\n if (!descendant)\n throw new Error(\"not a descendant of ancestor!\");\n }\n return ret;\n }", "depth() {\n return 0;\n }", "function nodeDepths(root, depth = 0) {\n if(!root) return 0\n\n return depth + nodeDepths(root.left, depth + 1) + nodeDepths(root.right, depth + 1)\n // note how this return statement is structured\n // when coming up with recursive algos that have single value solution i struggle to structure the returns\n // here you have a top level call that requires gathering info from deeper in tree to return at all\n\n}", "getUsedDepth() {\n return this.usedDepth;\n }", "function maxLevel(node,height=0){\n\tvar sum=0;\n\tif('children' in node) {\n\t\tfor(var i=0,tot=node.children.length;i<tot;i++){\n\t\t\tsum = sum+maxLevel(node.children[i],height)\n\t\t}\n\t\tsum=sum+height;\n\t}\n\treturn sum+height;\n}", "function computeDepth(dom) {\n var maxDepth = 0;\n var minDepth = 1024; // A random large number, the depth of a\n // DOM tree mostly is less than that.\n var avgDepth = 0;\n var tempNode = 0;\n var tempDepth = 0;\n\n for (var i = 0; i < dom.length; i++) {\n tempNode = dom[i];\n tempDepth = 0;\n\n while (tempNode.parentNode) {\n tempNode = tempNode.parentNode;\n tempDepth++;\n }\n\n if (maxDepth < tempDepth) {\n maxDepth = tempDepth;\n } else if (minDepth > tempDepth) {\n minDepth = tempDepth;\n }\n\n avgDepth += tempDepth;\n }\n //The avg is the depth of each node divided by the num of nodes.\n avgDepth = avgDepth / dom.length;\n\n depths = new Array(3);\n depths[0] = maxDepth;\n depths[1] = minDepth;\n depths[2] = avgDepth;\n\n return depths;\n}", "setDepthBasedOnChildren() {\n if (this.left != null) {\n this.depth = this.left.depth + 1;\n }\n if (this.right != null && this.depth <= this.right.depth) {\n this.depth = this.right.depth + 1;\n }\n }", "function maxDepth(root) {\n if (!root) {\n return null;\n }\n\n return 1 + Math.max(maxDepth(root.left), maxDepth(root.right));\n}", "function deepestChild() {\n \n var startNode = document.querySelector('#grand-node');\n var depthCount = 0;\n var currentNode = startNode;\n \n \n function findDeepest() {\n \n //...see if the actual node has children\n if (currentNode.childElementCount > 0) {\n \n currentNode = currentNode.children[0];\n depthCount += 1;\n //console.log(`Tiefe: ${depthCount}`);\n //console.log(`If... currentNode:`);\n //console.log(currentNode);\n findDeepest();\n \n } \n \n //if not, look into the next child node\n else {\n \n //console.log('Else - deepestElement. ' + currentNode);\n //console.log(currentNode);\n //return currentNode;\n \n }\n \n }\n \n findDeepest();\n return currentNode;\n \n}", "get depth() {\n return this._depth;\n }", "get depth() {\n return this._depth;\n }", "function findOrgDepth(org_id_or_node) {\n\tvar org = findOrgUnit(org_id_or_node);\n\tif(!org) return -1;\n\tvar type = findOrgType(org.ou_type());\n\tif(type) return type.depth();\n\treturn -1;\n}", "function maxDepth(root) {\n if (root){\n let left = maxDepth(root.left)\n let right = maxDepth(root.right)\n let max = left > right ? (left + 1) : (right +1)\n return max\n } else {return 0}\n}", "getHeight(node) {\n if (node == null) return -1;\n return Math.max(this.getHeight(node.left), this.getHeight(node.right)) + 1;\n }", "getHeight(){\n let maxHeight = 0;\n const stack = [{node: this, height: 0}];\n while(stack.length){\n const next = stack.pop();\n if(next.height > maxHeight){\n maxHeight = next.height;\n }\n if(next.node.left){\n stack.push({node: next.node.left, height: next.height + 1});\n }\n if(next.node.right){\n stack.push({node: next.node.right, height: next.height + 1});\n }\n }\n return maxHeight;\n }", "function getDepth (value) {\n if (value === false) {\n return 0\n }\n if (value === true || value === void 0) {\n return 1\n }\n\n const depth = parseInt(value, 10);\n return isNaN(depth) ? 0 : depth\n }", "function BSTHeight(tree) {\n if (!tree.key) return 0;\n \n let left = 0, right = 0;\n\n if (!tree.left && !tree.right) {\n return 1;\n }\n \n if (tree.left) {\n left = BSTHeight(tree.left);\n }\n\n if (tree.right) {\n right = BSTHeight(tree.right);\n }\n\n return Math.max(left, right) + 1;\n}", "function findMaxRootDist(node) {\n let maxDist = node.rootDist; // Records depth of node\n if (node.desc != null) {\n for (let i = 0; i < node.desc.length; i++) {\n let descMax = findMaxRootDist(node.desc[i]); // Recursive call to find max\n if (descMax > maxDist) {\n // depth of descendants.\n maxDist = descMax; // Overwrites node depth if descendant depth greater\n }\n }\n }\n return maxDist;\n}", "heightOfTree(root) {\n if (root === null) {\n return 0;\n }\n let leftHeight = this.heightOfTree(root.left);\n let rightHeight = this.heightOfTree(root.right);\n return 1 + Math.max(leftHeight, rightHeight)\n\n }", "GetTreeHeight() {\n return this.m_contactManager.m_broadPhase.GetTreeHeight();\n }", "function getLevelDepth( e, id, waypoint, cnt ) {\n\t\tcnt = cnt || 0;\n\t\tif ( e.id.indexOf( id ) >= 0 ) return cnt;\n\t\tif( $( e).hasClass( waypoint ) ) {\n\t\t\t++cnt;\n\t\t}\n\t\treturn e.parentNode && getLevelDepth( e.parentNode, id, waypoint, cnt );\n\t}", "function findHeight(tree) {\n //returns the height (0) if tree is empty\n if (!tree) {\n return -1;\n }\n\n //check if there's a left tree\n //check if there's a right tree\n //if there's neither, return 1\n if (!tree.left && !tree.right) {\n return 0;\n }\n //set initial value of height for comparison\n let height = 0;\n\n //if there's a left tree\n if (tree.left) {\n //define leftHeight as the value of all occurrences of this function\n //this value increments by one each time the function runs\n let leftHeight = 1 + findHeight(tree.left);\n leftHeight > height && (height = leftHeight);\n }\n if (tree.right) {\n //define rightHeight as the value of all occurrences of this function\n //this value increments by one each time the function runs\n let rightHeight = 1 + findHeight(tree.right);\n rightHeight > height && (height = rightHeight);\n }\n return height;\n}", "function getLevelDepth( e, id, waypoint, cnt ) {\n\t\tcnt = cnt || 0;\n\t\tif ( e.id.indexOf( id ) >= 0 ) return cnt;\n\t\tif( classie.has( e, waypoint ) ) {\n\t\t\t++cnt;\n\t\t}\n\t\treturn e.parentNode && getLevelDepth( e.parentNode, id, waypoint, cnt );\n\t}", "function getDepth(field) {\n return field.split(\".\").length;\n }", "function getLevelDepth( e, id, waypoint, cnt ) {\n cnt = cnt || 0;\n if ( e.id.indexOf( id ) >= 0 ) return cnt;\n if( classie.has( e, waypoint ) ) {\n ++cnt;\n }\n return e.parentNode && getLevelDepth( e.parentNode, id, waypoint, cnt );\n }", "function diameterOfBinaryTree(root) {\n let longest = 0\n getHeight(root)\n return longest\n\n function getHeight(root) {\n if (root) {\n let left = getHeight(root.left)\n let right = getHeight(root.right)\n longest = Math.max(longest, left + right) \n return Math.max(left, right) + 1\n } else {return 0}\n }\n\n}", "depth(path = this.cwd) {\n if (typeof path === 'string') {\n path = this.cwd.resolve(path);\n }\n return path.depth();\n }", "function deepestLevelValue(arr){\n var value = 0;\n\n function looping(arr){\n\n if(arr[0][0] === undefined ){\n \t return ++value;\n }\n\t for (var i = 0; i < arr.length; i++) {\n\t \tif(typeof arr[i][0] !== 'number'){\n\t\t\t value++;\n\t\t\t return looping(arr[i])\n\t\t}\n\t}\n }\n return looping(arr) \n}", "function maxDepth2(root) {\n if (!root) return 0\n\n return 1 + Math.max(maxDepth2(root.left), maxDepth2(root.right))\n}", "function getHeight(node) {\n if (node === null) {\n return -1;\n }\n let left = 1 + getHeight(node.left);\n let right = 1 + getHeight(node.right);\n return Math.max(left, right);\n}", "function findHeightTwo(tree) {\n if (tree === null) {\n return -1;\n }\n let parent = tree.parent;\n let left = findHeightTwo(tree.left);\n let right = findHeightTwo(tree.right);\n\n if (left > right) {\n return left + 1;\n } else {\n return right + 1;\n }\n}", "function checkSubTreeDepth(root) {\n if (!root) return 0\n let left = checkSubTreeDepth(root.left)\n let right = checkSubTreeDepth(root.right)\n if (Math.abs(left - right) > 1) {\n isBalanced = false\n }\n return 1 + Math.max(left, right)\n }", "function height(bst) {\n //if current node is null\n if(!bst) {\n return 0;\n } else {\n // traverse through left and right nodes until you reach null \n if (bst.left && !bst.right) {\n return 1 + height(bst.left);\n } else if (bst.right && !bst.left) {\n return 1 + height(bst.right);\n } else if (!bst.right && !bst.left) {\n return 1;\n } else {\n return 1 + max(height(bst.left), height(bst.right));\n }\n }\n}", "height(node)\n {\n //your code here\n if(node==null)\n return 0\n else{\n return 1+Math.max(this.height(node.left), this.height(node.right))\n }\n }", "function find_height(root) \n{\n let result = dfs(root);\n return result;\n}", "function _depth() { \n\t\t\t\t\treturn Math.max( Math.min( _pointA.z, _pointB.z ), 0.0001 ); \n\t\t\t\t}", "function docDepth(e) {\n if (e.parentElement === document.body) {\n return 1;\n } else {\n return 1 + docDepth(e.parentElement);\n }\n }", "function heightOf(tree, count=0){\n if (!tree){\n return count;\n } else {\n count++;\n }\n return Math.max(\n heightOf(tree.left, count),\n heightOf(tree.right, count)\n );\n}", "function countLeaves (node) {\n let count = 0\n node.forEach(n => { count += countLeaves(n) })\n return count || 1\n }", "function deepestChild(){\n\tlet grandNode = document.querySelector('div#grand-node');\n\tvar deepest = grandNode.children[0];\n\twhile(deepest.children.length > 0){\n\t\tdeepest = deepest.children[0];\n\t}\n\treturn deepest;\n}", "function maxDepth(root) {\n let maxDepth = 0\n\n function dive(node, depth = 1) {\n if (!node) {\n // If node is null then 'depth' is invalid but depth above was valid\n maxDepth = Math.max(maxDepth, depth - 1)\n return\n }\n\n // Recursively call helper function on children\n dive(node.left, depth + 1)\n dive(node.right, depth + 1)\n }\n\n dive(root)\n\n return maxDepth\n}", "function findHeight(node, counter = 0) {\n // console.log(currentNode);\n // console.log(bst);\n if (!node) {\n return counter;\n }\n //if has both\n if (node.right) {\n findHeight(node.right, counter++);\n }\n\n if (node.left) {\n findHeight(node.left, counter++);\n }\n\n return counter + 1;\n}", "function calculateTotalNodes(breath, depth) {\n return ((Math.pow(breath, depth+1)-1) / (breath-1));\n}", "function height(node) {\n if (node == null) {\n return 0;\n }\n return 1 + Math.max(height(node.left), height(node.right));\n }", "function depth(element, root) {\n var depth = 1;\n while (true) {\n if (element[0] === root[0]) {\n break;\n }\n depth++;\n element = $(element).parent().parent();\n }\n return depth;\n }", "function listOfDepth(tree) {\n return traverseAndLink(0, tree, {})\n}", "function getMaxTree(node) {}", "function getCmdMaxDepth(cmdTree, depth=0) {\n if (cmdTree.next !== undefined) {\n let depthArray = []\n for (let cmdCurr of cmdTree.next) \n depthArray.push(getCmdMaxDepth(cmdCurr, depth+1));\n return depthArray.reduce((a, b)=>{\n return Math.max(a, b);\n });\n } else {\n return depth;\n }\n}", "calculateHeightH(node) {\n if (node.key === \"null\") return 0\n else {\n var left = this.calculateHeightH(node.left);\n var right = this.calculateHeightH(node.right);\n this.treedpth = Math.max(left, right) + 1;\n } \n }", "function maxHeightOfTree(element) {\n\t\tvar height = element.outerHeight(true);\n\t\telement.children().each(function () {\n\t\t\tvar curHeight = maxHeightOfTree($(this));\n\t\t\tif (curHeight > height) {\n\t\t\t\theight = curHeight;\n\t\t\t}\n\t\t});\n\t\treturn height;\n\t}", "function compare_depth(a,b) {\n var dep1 = a.depth;\n if (dep1 == undefined){\n dep1 = 0;\n }\n var dep2 = b.depth;\n if (dep2 == undefined){\n dep2 = 0;\n }\n if (dep1 > dep2)\n return -1;\n else if (dep1 < dep2)\n return 1;\n else \n return 0;\n}", "depthFirstTraversal(fn) {\n fn(this.value);\n\n if (this.left) {\n this.left.depthFirstTraversal(fn);\n }\n\n if (this.right) {\n this.right.depthFirstTraversal(fn);\n }\n }", "height(node) {\n if (node == null) return 0;\n return node.height;\n }", "function depth(board){\r\n let count = 0;\r\n board.forEach(row => row.forEach(item => { if (item === BLANK) { count++ } } ));\r\n return count;\r\n}", "function allKindsOfNodeDepths(root) {\n if (!root) return 0\n return nodeDepths(root) + allKindsOfNodeDepths(root.left) + allKindsOfNodeDepths(root.right)\n }", "getDepth(obj, path) {\n return path.split('.').reduce((value, tag) => {\n return value[tag];\n }, obj);\n }", "getHierarchyLevel() {\n\t if (this.hierarchyLevel > -1) {\n\t return this.hierarchyLevel;\n\t }\n\t // since the template may have visual elements from different leves, output the highest value\n\t // between all sub-hierarchies\n\t if (this.visualElements.length === 0) {\n\t return 0;\n\t }\n\t const subHierarchies = this.visualElements.map(v => v.getHierarchyLevel());\n\t this.hierarchyLevel = Math.max(...subHierarchies) + 1;\n\t return this.hierarchyLevel;\n\t }", "function find_minimum_depth(root) {\n if (root === null) {\n return 0;\n }\n\n const queue = [root];\n let minimumTreeDepth = 0;\n\n while (queue.length > 0) {\n minimumTreeDepth += 1;\n const levelSize = queue.length;\n for (i = 0; i < levelSize; i++) {\n const currentNode = queue.shift();\n\n // check if this is a leaf node\n if (currentNode.left === null && currentNode.right === null) {\n return minimumTreeDepth;\n }\n // insert the children of current node in the queue\n if (currentNode.left !== null) {\n queue.push(currentNode.left);\n }\n if (currentNode.right !== null) {\n queue.push(currentNode.right);\n }\n }\n }\n}", "function find_minimum_depth(root) {\n if (root === null) {\n return 0;\n }\n\n const queue = [root];\n let minimumTreeDepth = 0;\n\n while (queue.length > 0) {\n minimumTreeDepth += 1;\n const levelSize = queue.length;\n for (i = 0; i < levelSize; i++) {\n const currentNode = queue.shift();\n\n // check if this is a leaf node\n if (currentNode.left === null && currentNode.right === null) {\n return minimumTreeDepth;\n }\n // insert the children of current node in the queue\n if (currentNode.left !== null) {\n queue.push(currentNode.left);\n }\n if (currentNode.right !== null) {\n queue.push(currentNode.right);\n }\n }\n }\n}" ]
[ "0.7437807", "0.73663795", "0.7221193", "0.71556044", "0.7095053", "0.7024685", "0.6994082", "0.6993805", "0.69005626", "0.6878678", "0.6865977", "0.68440974", "0.67443234", "0.66910386", "0.6656479", "0.65265745", "0.65050614", "0.6483216", "0.64689547", "0.6435029", "0.6384095", "0.6344781", "0.62598175", "0.6254761", "0.6248245", "0.6205587", "0.6205587", "0.6196281", "0.61862004", "0.61750966", "0.61720353", "0.61641777", "0.61547846", "0.61522883", "0.6146271", "0.61373705", "0.61372715", "0.613316", "0.6120191", "0.6119281", "0.611685", "0.6040893", "0.60104316", "0.5982174", "0.5960345", "0.59487164", "0.5930821", "0.59268725", "0.5920214", "0.5917321", "0.58960897", "0.58960897", "0.58817387", "0.5825864", "0.57750136", "0.57669014", "0.5749392", "0.57492465", "0.5747177", "0.5746935", "0.5742665", "0.5722423", "0.5694045", "0.5691509", "0.56837994", "0.5678008", "0.5668168", "0.5663042", "0.5645034", "0.56210464", "0.56027955", "0.55783564", "0.55734736", "0.5567698", "0.5567295", "0.55642205", "0.55561227", "0.55547076", "0.55266064", "0.5478536", "0.547812", "0.5476899", "0.5467562", "0.54630667", "0.546271", "0.5437629", "0.5436881", "0.5412455", "0.54082274", "0.54072523", "0.5403927", "0.5385796", "0.5374323", "0.5371271", "0.53668886", "0.53624284", "0.5350555", "0.5310117", "0.5295936", "0.5295936" ]
0.6762553
12
TODO: optimize this loop
function findFirstParentElementWithAttribute(attributeName, childObj) { // undefined if the mouse leaves the browser window if (childObj === undefined) { return null; } var testObj = childObj.parentNode, count = 1, // check for setAttribute due to exception thrown by Firefox when a node is dragged outside the browser window res = (typeof testObj.setAttribute === 'function' && testObj.hasAttribute(attributeName)) ? testObj : null; while (testObj && typeof testObj.setAttribute === 'function' && !testObj.hasAttribute(attributeName)) { testObj = testObj.parentNode; res = testObj; if (testObj === document.documentElement) { res = null; break; } count++; } return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "function loop_each_mobile(mobile, count, mobiles){\n\n //Shortlisted model best price\n var shortlisted_model_best_price;\n\n //Index of the shortlisted model inside the variants array\n var shortlisted_model_index = 0;\n\n //Index of the Shortlisted model shortlisted retailer inside the product retailers array\n var shortlisted_model_shortlisted_retailer_index;\n\n //To determine the first iteration of the loop\n var setting_flag = false;\n\n mobile.variants.forEach(identify_cheapest_variant.bind(this));\n\n function identify_cheapest_variant(element, index, array){\n\n \n\n //Call the identify cheapest retailer function for each retailer in the product retailers array\n element.product_retailers.forEach(identify_cheapest_retailer.bind(this));\n\n\n function identify_cheapest_retailer(element_inner,index_inner,array){\n\n //To make sure that the product price is not set to 0\n if(element_inner.product_pricing.special_price > 0){\n\n if(setting_flag === false){\n\n \n\n //Allocating the index to shortlisted_model_index as \n //it is the 1st iteration of the loop\n shortlisted_model_index = index;\n\n \n //Allocating the special_price to the shortlisted_model_best_price\n shortlisted_model_best_price = element_inner.product_pricing.special_price; \n\n //Allocating the index_inner to the shortlisted model retailer index\n shortlisted_model_shortlisted_retailer_index = index_inner;\n\n \n\n //Changing the setting flag to true as the first iteration is done\n setting_flag = true;\n\n }\n\n else{\n\n //After the first iteration is done\n //Now we are checking whether the price of the element is lower than the shortlisted element\n //If yes, we update the shortlisted element details\n\n //From this function, we get the shortlisted model index\n //shortlisted model best price\n //shortlisted model retailer index\n if(element_inner.product_pricing.special_price < shortlisted_model_best_price){\n\n shortlisted_model_index = index;\n shortlisted_model_best_price = element_inner.product_pricing.special_price;\n shortlisted_model_shortlisted_retailer_index = index_inner;\n\n \n }\n\n }\n\n } \n\n }//identify_cheapest_retailer ends\n\n }//identify_cheapest_variant ends\n\n this.shortlisted_model_best_price[count] = shortlisted_model_best_price;\n\n this.shortlisted_model_index[count] = shortlisted_model_index;\n\n this.shortlisted_model_shortlisted_retailer_index[count] = shortlisted_model_shortlisted_retailer_index;\n\n this.selected_variant[count] = mobile.variants[shortlisted_model_index];\n\n //Best price of the shortlisted variant\n\n //Index of the shortlisted variant\n\n //Index of the shortlisted retailer in the shortlisted variant\n\n\n //We store the index of the variant in the selected_variant\n //selected_variant is the one for which we show all the details\n //this.selected_variant = this.mobiles[index].variants[this.shortlisted_model_index];\n\n\n\n\n }", "generate(object,dataNumber){\n // keeps the current values of an object\n\n var currentObj ={},\n value ,\n checkingCond = false,\n strData = \"\",\n strArr = [],\n arr = []\n self = this;\n self.time = Date.now();\n\n for(let x = 0 ; x < dataNumber; x++){\n for( var obj of object){\n var dependentValue = currentObj[obj.dependent] || \"\",\n value = self.isNested(obj.nested,dependentValue, obj);\n\n (obj.if)? value = self.ifConditionalsExist(obj, value, dependentValue, currentObj) : '';\n\n currentObj[obj.name] = value;\n value = (obj.type == \"string\")?`'${value}'`:value;\n strData += (obj.last)?`${value}`: `${value},`;\n arr = [];\n\n\n }//for of\n\n strData = `(${strData})`;\n strArr.push(strData);\n strData = \"\";\n }\n self.returnResults(strArr);\n}", "find(terms) {\n //@TODO\n var c = 0;\n var o = new Object();\n let map4 = new Map();\n let object_array = new Array();\n\n terms.forEach(function(value){\n\n map4 = map2.get(value);\n\n if(map4 != undefined){\n map4.forEach(function(value1, key1){\n let filename = key1;\n let offset_count = value1;\n let content1 = map3.get(key1);\n\n var offset_prev= offset_count[0];\n while(content1.charAt(offset_prev)!= '\\n' && offset_prev != 0){\n offset_prev--;\n\n }\n if(offset_prev!=0){\n offset_prev++;\n }\n var offset_next = offset_count[0];\n while(content1.charAt(offset_next)!= '\\n'){\n offset_next++;\n\n }\n\n let line = content1.substring(offset_prev,offset_next);\n\n object_array.forEach(function(value){\n if(value.name == filename){\n value.score += offset_count[1];\n c = 1;\n }\n });\n\n\n if(c == 0){\n\n o = { name: filename,\n score: offset_count[1],\n lines: line + \"\\n\"\n };\n\n object_array.push(o);\n\n }\n c = 0;\n\n\n });\n }\n});\n\n object_array.sort(compareResults);\n\n\nreturn object_array;\n}", "createDataIter() {\n this.dataIter = {\n docs: [],\n docSegs: {},\n docSys: {},\n docSegSys: {},\n systems: [],\n evaluation: {},\n };\n let lastRow = null;\n const systemsSet = new Set();\n for (let rowId = 0; rowId < this.data.length; rowId++) {\n const parts = this.data[rowId];\n const doc = parts[this.DATA_COL_DOC];\n const docSegId = parts[this.DATA_COL_DOC_SEG_ID];\n const system = parts[this.DATA_COL_SYSTEM];\n systemsSet.add(system);\n const sameDoc = lastRow && (doc == lastRow[this.DATA_COL_DOC]);\n const sameDocSeg = sameDoc &&\n (docSegId == lastRow[this.DATA_COL_DOC_SEG_ID]);\n const sameDocSys = sameDoc && (system == lastRow[this.DATA_COL_SYSTEM]);\n if (!sameDoc) {\n this.dataIter.docs.push(doc);\n this.dataIter.docSegs[doc] = [];\n this.dataIter.docSys[doc] = [];\n }\n if (!sameDocSeg) {\n console.assert(!this.dataIter.docSegs[doc].includes(docSegId),\n doc, docSegId);\n this.dataIter.docSegs[doc].push(docSegId);\n }\n if (!sameDocSys && !this.dataIter.docSys[doc].includes(system)) {\n this.dataIter.docSys[doc].push(system);\n }\n lastRow = parts;\n }\n this.dataIter.systems = [...systemsSet];\n /**\n * Ensure that there are entries in docSegSys for each\n * docSegId x system.\n */\n for (const doc of this.dataIter.docs) {\n this.dataIter.docSegSys[doc] = {};\n for (const docSegId of this.dataIter.docSegs[doc]) {\n this.dataIter.docSegSys[doc][docSegId] = {};\n for (const system of this.dataIter.systems) {\n this.dataIter.docSegSys[doc][docSegId][system] = {\n rows: [-1, -1],\n segment: {},\n };\n }\n }\n }\n lastRow = null;\n let segment = null;\n for (let rowId = 0; rowId < this.data.length; rowId++) {\n const parts = this.data[rowId];\n const doc = parts[this.DATA_COL_DOC];\n const docSegId = parts[this.DATA_COL_DOC_SEG_ID];\n const system = parts[this.DATA_COL_SYSTEM];\n const metadata = parts[this.DATA_COL_METADATA];\n if (metadata.evaluation) {\n this.dataIter.evaluation = {\n ...this.dataIter.evaluation,\n ...metadata.evaluation\n };\n }\n const sameDoc = lastRow && (doc == lastRow[this.DATA_COL_DOC]);\n const sameDocSeg = sameDoc &&\n (docSegId == lastRow[this.DATA_COL_DOC_SEG_ID]);\n const sameDocSegSys = sameDocSeg &&\n (system == lastRow[this.DATA_COL_SYSTEM]);\n\n if (!sameDocSegSys) {\n this.dataIter.docSegSys[doc][docSegId][system].rows =\n [rowId, rowId + 1];\n segment = metadata.segment || {};\n } else {\n this.dataIter.docSegSys[doc][docSegId][system].rows[1] = rowId + 1;\n }\n this.dataIter.docSegSys[doc][docSegId][system].segment = segment;\n lastRow = parts;\n }\n }", "function bustSingles(arr, done) { \n let countIn = 0;\n while (countIn < 6) {\n for (let y = 0; y < arr.length; y++) { // Moving between items and searching zeros.\n for (let x = 0; x < arr[y].length; x++) {\n if (arr[y][x] === 0) {\n let range = [1, 2, 3, 4, 5, 6, 7, 8, 9];\n for (let m = 0; m < arr[y].length; m++) { // Searching range items on x.\n for (let h = 0; h < range.length; h++) {\n if (range[h] === arr[y][m]) {\n range.splice(h, 1);\n }\n }\n }\n for (let m = 0; m < arr[x].length; m++) { // Searching range items on y.\n for (let h = 0; h < range.length; h++) {\n if (range[h] === arr[m][x]) {\n range.splice(h, 1);\n }\n }\n } \n if (x < 3 && y < 3) { // Searching range items on squares.\n for (let k = 0; k < 3; k++) {\n for (let m = 0; m < 3; m++) {\n for (let h = 0; h < range.length; h++) {\n if(range[h] === arr[k][m]) {\n range.splice(h, 1);\n }\n }\n } \n } \n }\n if (x >= 3 && x < 6 && y < 3) {\n for (let k = 0 ; k < 3; k++) {\n for (let m = 3; m < 6; m++) {\n for (let h = 0; h < range.length; h++) {\n if(range[h] === arr[k][m]) {\n range.splice(h, 1);\n }\n }\n } \n } \n }\n if (x >= 6 && y < 3) {\n for (let k = 0 ; k < 3; k++) {\n for (let m = 6; m < 9; m++) {\n for (let h = 0; h < range.length; h++) {\n if(range[h] === arr[k][m]) {\n range.splice(h, 1);\n }\n }\n } \n }\n }\n if (x < 3 && y >= 3 && y < 6) {\n for (let k = 3; k < 6; k++) {\n for (let m = 0; m < 3; m++) {\n for (let h = 0; h < range.length; h++) {\n if(range[h] === arr[k][m]) {\n range.splice(h, 1);\n }\n }\n } \n } \n }\n if (x >= 3 && x < 6 && y >= 3 && y < 6) {\n for (let k = 3; k < 6; k++) {\n for (let m = 3; m < 6; m++) {\n for (let h = 0; h < range.length; h++) {\n if(range[h] === arr[k][m]) {\n range.splice(h, 1);\n }\n }\n } \n }\n }\n if (x >= 6 && y >= 3 && y < 6) {\n for (let k = 3; k < 6; k++) {\n for (let m = 6; m < 9; m++) {\n for (let h = 0; h < range.length; h++) {\n if(range[h] === arr[k][m]) {\n range.splice(h, 1);\n }\n }\n } \n } \n }\n if (x < 3 && y >= 6) {\n for (let k = 6; k < 9; k++) {\n for (let m = 0; m < 3; m++) {\n for (let h = 0; h < range.length; h++) {\n if(range[h] === arr[k][m]) {\n range.splice(h, 1);\n }\n }\n } \n } \n }\n if (x >=3 && x < 6 && y >= 6) {\n for (let k = 6; k < 9; k++) {\n for (let m = 3; m < 6; m++) {\n for (let h = 0; h < range.length; h++) {\n if(range[h] === arr[k][m]) {\n range.splice(h, 1);\n }\n }\n } \n }\n }\n if (x >= 6 && y >= 6) {\n for (let k = 6; k < 9; k++) {\n for (let m = 6; m < 9; m++) {\n for (let h = 0; h < range.length; h++) {\n if(range[h] === arr[k][m]) {\n range.splice(h, 1);\n }\n }\n } \n } \n }\n if(countIn === 5) { // On last turn on the loop define the range.\n arr[y][x] = range;\n }\n if (range.length === 1) { // If range heave only one item this item its single.\n arr[y][x] = range[0];\n }\n } \n }\n }\n countIn++\n }\n if (done) { // Recursion if done true.\n return bustHiddenSingles(arr);\n }\n return arr;\n }", "extractDocumentExistenceInfo(arr) {\n return this.chooseDocumentsDuplicate(arr.map(item => item.existenceInfo));\n }", "static mergeStories(snapshots){\n for(let i=0;i<snapshots.length;i++){\n let snap = snapshots[i];\n // loop forwards through the array except for the last element, since the last element will have ever referrer that occurs\n // don't loop over the last so we don't double count its stats\n let lastStory = snap.stories[snap.stories.length-1];\n for(let s=0;s<snap.stories.length-1;s++){\n let story = snap.stories[s];\n // merge story stats\n lastStory.views += story.views;\n lastStory.reads += story.reads;\n lastStory.claps += story.claps;\n lastStory.upvotes += story.upvotes;\n // now merge the referrers\n for(let r=0;r<story.referrers.length;r++){\n let found = false;\n for(let re=0;re<lastStory.referrers.length;re++){\n if(lastStory.referrers[re].name == story.referrers[r].name){\n lastStory.referrers[re].views += story.referrers[r].views;\n found=true;\n }\n }\n if(!found){\n lastStory.referrers.push(story.referrers[r]);\n }\n }\n }\n // for some reason undefiend seems to turn up in the list of referrals. Easier to clean it out here rather than trace its source.\n lastStory.referrers = lastStory.referrers.map(item=>{if (item != undefined) return item})\n // set only the properties we want\n snapshots[i] = {\n views: lastStory.views,\n reads: lastStory.reads,\n claps: lastStory.claps,\n upvotes: lastStory.upvotes,\n referrers: lastStory.referrers,\n snapshotTimestamp: snap.snapshotTimestamp\n }\n }\n return snapshots\n }", "findImageInfoInArrays(imageMoved) {\n let imageInfo = null;\n\n //update the image in the array too\n\n // find the image info the the arrays\n let found = this.rx1s.find((item) => {\n return item.image === imageMoved.attrs.image;\n });\n if (found) imageInfo = found;\n\n found = this.rx2s.find((item) => {\n return item.image === imageMoved.attrs.image;\n });\n if (found) imageInfo = found;\n\n found = this.rx3s.find((item) => {\n return item.image === imageMoved.attrs.image;\n });\n if (found) imageInfo = found;\n\n found = this.bandage1s.find((item) => {\n return item.image === imageMoved.attrs.image;\n });\n if (found) imageInfo = found;\n\n found = this.bandage2s.find((item) => {\n return item.image === imageMoved.attrs.image;\n });\n if (found) imageInfo = found;\n\n found = this.bandage3s.find((item) => {\n return item.image === imageMoved.attrs.image;\n });\n if (found) imageInfo = found;\n\n found = this.instrument1s.find((item) => {\n return item.image === imageMoved.attrs.image;\n });\n if (found) imageInfo = found;\n\n found = this.instrument2s.find((item) => {\n return item.image === imageMoved.attrs.image;\n });\n if (found) imageInfo = found;\n\n found = this.instrument3s.find((item) => {\n return item.image === imageMoved.attrs.image;\n });\n if (found) imageInfo = found;\n\n return imageInfo;\n\n }", "getCartsFromMap() { // loops rows of map to find carts - done once only\n // also edits the map - updates data under the carts\n // edits should be done only to map to be drawn only once\n for (let j = 0; j < this.map.length; j++) { // y\n for (let i = 0; i < this.map[j].length; i++) { // x\n if (this.map[j].charAt(i) === '>') {\n this.updateMapUnderCart(i,j, this.originalMap);\n this.addCart('>', [i, j]);\n } else if (this.map[j].charAt(i) === '<') { \n this.addCart('<', [i, j]);\n this.updateMapUnderCart(i,j, this.originalMap);\n } else if (this.map[j].charAt(i) === '^') {\n this.addCart('^', [i, j]);\n this.updateMapUnderCart(i,j, this.originalMap);\n } else if (this.map[j].charAt(i) === 'v') {\n this.addCart('v', [i, j]);\n this.updateMapUnderCart(i,j, this.originalMap);\n } \n }\n }\n }", "returnInvalidAssociations() {\n return new Promise(\n\n async (resolve, reject) => {\n try {\n //query all associations.. page 2000 rows\n \n //for each association row - validate that from/to source actually exists\n //find that layerId fromSourceId, fromGlobalId, query Count and make sure it exists. \n //find the layerId of toSourceId, toGlobalId , query count make sure it exists \n //if doesn't exist add to invalid assocaition array. \n const invalidAssociations = [];\n //objectid >= ${offset} and objectid <= ${recordCount+offset}\n let c = 0;\n let offset = 0;\n let recordCount = 2000;\n while(true) {\n const result = await this.query(500001, `1=1`, undefined, undefined, [\"*\"], \"sde.DEFAULT\", offset, recordCount)\n console.log(`Processing ${recordCount} associations`)\n //for each assocaition check if its valid\n const bar = new ProgressBar(':bar', { total: result.features.length });\n for (let i = 0 ; i < result.features.length; i++){\n const associationRow = result.features[i]\n const isValid = await this.isAssocaitionValid( associationRow);\n if (!isValid){ \n const associationGuid = v(associationRow.attributes, \"globalid\");\n invalidAssociations.push({\n \"assocaitionGuid\":associationGuid\n })\n //console.log(`Discoved an invalid assocaition. ${associationGuid}`)\n //console.log(\"x\")\n }\n \n bar.tick();\n }\n \n\n //keep asking if this is true\n if (!result.exceededTransferLimit) break;\n offset+= recordCount;\n }\n \n resolve(invalidAssociations); \n }catch (ex) {\n reject(ex);\n }\n \n \n\n }\n )\n \n\n }", "function iterate() {\n cursor.read(1000, (err, rows) => {\n if (err) return cb(err);\n\n if (!rows.length) {\n done();\n return cb();\n }\n\n for (let row of rows) {\n if (turf.lineDistance(row.geom) < 0.001) continue;\n\n row.name = row.name.filter(name => {\n if (!name.display) return false;\n return true;\n });\n\n if (!row.name.length) continue;\n\n let feat = {\n type: 'Feature',\n properties: {\n 'carmen:text': row.name,\n 'carmen:rangetype': 'tiger',\n 'carmen:parityl': [[]],\n 'carmen:parityr': [[]],\n 'carmen:lfromhn': [[]],\n 'carmen:rfromhn': [[]],\n 'carmen:ltohn': [[]],\n 'carmen:rtohn': [[]]\n },\n geometry: {\n type: 'GeometryCollection',\n geometries: [\n row.geom\n ]\n }\n };\n\n if (self.opts.country) feat.properties['carmen:geocoder_stack'] = self.opts.country;\n\n feat = self.post.feat(feat);\n if (feat) self.output.write(JSON.stringify(feat) + '\\n');\n }\n\n return iterate();\n });\n }", "forEach(iterator) {\n // don't use _.each, because we can't break out of it.\n var keys = Object.keys(this._map);\n\n for (var i = 0; i < keys.length; i++) {\n var breakIfFalse = iterator.call(\n null,\n this._map[keys[i]],\n this._idParse(keys[i])\n );\n\n if (breakIfFalse === false) {\n return;\n }\n }\n }", "preprocess () {\n this.allFound = true\n\n for (let i = 0; i < this.ids.length; i++) {\n const id = this.ids[i]\n\n if (id === null) {\n continue\n }\n\n if (id in this.overpass.cacheElements) {\n const ob = this.overpass.cacheElements[id]\n let ready = true\n\n // Feature does not exists!\n if (ob.missingObject) {\n this.featureCallback(null, null, i)\n this.ids[i] = null\n continue\n }\n\n // for bounds option, if object is (partly) loaded, but outside call\n // featureCallback with 'false'\n if (this.options.bounds) {\n const intersects = this.geojsonBounds ? ob.intersects(this.geojsonBounds) : ob.intersects(this.options.bounds)\n if (intersects === 0 || (!ob.bounds && ob.properties | defines.BBOX)) {\n this.featureCallback(null, false, i)\n this.ids[i] = null\n continue\n }\n }\n\n // not fully loaded\n if ((ob !== false && ob !== null) && (this.options.properties & ob.properties) !== this.options.properties) {\n ready = false\n }\n\n // if sort is set in options maybe defer calling featureCallback\n if (ready) {\n this.receiveObject(ob)\n this.featureCallback(null, ob, i)\n this.ids[i] = null\n continue\n }\n } else {\n // Illegal ID\n if (id !== null && !id.match(/^[nwr][0-9]+$/)) {\n this.featureCallback(null, null, i)\n this.ids[i] = null\n continue\n }\n }\n\n this.allFound = false\n }\n }", "getRelatedRecords(results, dataStore){\n const relationships = this.relationships;\n let cnt = 0, finalCnt = 0; \n if(relationships && relationships.length > 0 ){\n results.map(result => { \n relationships.map(relation=>{\n cnt = 0;\n let relatedStore = dataStore[relation.model];\n let key = (relation.in_current === true) ? relation.primary_key : relation.foreign_key;\n let val = (relation.in_current === true) ? result[relation.foreign_key] : result[relation.primary_key];\n let items = this.getRelatedValue(relatedStore,key,val);\n items.map(item => {\n cnt++;\n let k = `${[relation.model]}_${cnt}`;\n if(k in result){\n cnt = finalCnt+1;\n }\n k = `${[relation.model]}_${cnt}`;\n //result[[relation.model]] = item[relation.return_value];\n result[k] = item[relation.return_value];\n finalCnt = cnt;\n }); \n }); \n });\n }\n return results;\n }", "function iterate() {\n cursor.read(1000, (err, rows) => {\n if (err) return cb(err);\n\n if (!rows.length) {\n done();\n return cb();\n }\n\n rows.forEach((row) => {\n if (!row.name.some(name => { return name.display.trim().length })) return;\n\n let feat = {\n type: 'Feature',\n properties: {\n 'carmen:text': row.name,\n 'carmen:addressnumber': []\n },\n geometry: {\n type: 'GeometryCollection',\n geometries: [{\n type: 'MultiPoint',\n coordinates: []\n }]\n }\n };\n\n const units = new Units();\n\n row.geom.coordinates.forEach((coord) => {\n let num = units.decode(coord.pop());\n\n if (!num || !num.output) return;\n\n feat.properties['carmen:addressnumber'].push(num.num);\n feat.geometry.geometries[0].coordinates.push(coord);\n });\n\n if (feat.geometry.geometries[0].coordinates.length) {\n feat.properties['carmen:addressnumber'] = [ feat.properties['carmen:addressnumber'] ];\n\n if (self.opts.country) feat.properties['carmen:geocoder_stack'] = self.opts.country;\n feat = self.post.feat(feat);\n\n if (feat) self.output.write(JSON.stringify(feat) + '\\n');\n }\n });\n\n return iterate();\n });\n }", "coin_conversion(grams_of_silver){\n let output = [];\n let coins_big_to_little = this.coins.ranged_items.sort((a,b) => {\n return b.value_in_grams_of_silver - a.value_in_grams_of_silver; \n })\n // console.log('number_of_coins',coins_big_to_little.length);\n \n\n coins_big_to_little.forEach((coin,index) => {\n let coin_val = coin.value_in_grams_of_silver;\n // check to see if it's the last coin\n // express the value in last coin\n if(index == (coins_big_to_little.length-1)){\n if(grams_of_silver > 0){\n output.push({\n coin: coin, \n number: (grams_of_silver/coin_val)\n });\n \n }\n } else if (grams_of_silver >= coin_val){\n output.push({\n coin: coin, \n number: (Math.floor(grams_of_silver/coin_val))\n });\n grams_of_silver = grams_of_silver % coin_val;\n }\n });\n return output;\n }", "function getClipNames (seq, sequences) {\n for (var k = 0; k < sequences.length; k++) {\n // $.pype.log('getClipNames seq.guid ' + seq.guid );\n // $.pype.log(' getClipNames sequences[k].id ' + sequences[k].sequenceID );\n if (seq.guid === sequences[k].sequenceID) {\n // $.pype.log('Sequence ' + seq.name + ' has ' + app.project.sequences[k].videoTracks.numTracks +' video tracks' );\n // $.pype.log('Sequence ' + seq.name + ' has ' + app.project.sequences[k].audioTracks.numTracks +' audio tracks' );\n\n // VIDEO CLIPS IN SEQUENCES\n for (var l = 0; l < sequences[k].videoTracks.numTracks; l++) {\n var videoTrack = seq.getVideoTrackAt(l);\n // $.pype.log(seq.name + ' has video track '+ videoTrack.name + ' at index ' + l);\n var clipCounter = 0;\n var numOfClips = app.project.sequences[k].videoTracks[l].clips.numTracks;\n // $.pype.log('\\n' + bin.name + ' ' + seq.name + ' ' + videoTrack.name + ' has ' + numOfClips + ' clips');\n for (var m = 0; m < numOfClips; m++) {\n // var clip = app.project.sequences[k].videoTracks[l].clips[m];\n // $.pype.log('clips in video tracks: ' + m + ' - ' + clip); TrackItem, doesn't have name property\n // if a clip was deleted and another one added, the index of the new one is one or more higher\n while (clipCounter < numOfClips) { // undefined because of old clips\n if (videoTrack.getItemAt(m).name) {\n clipCounter++;\n // $.pype.log('getClipNames ' + seq.name + ' ' + videoTrack.name + ' has ' + videoTrack.getItemAt(m).name); Object\n\n for (var s = 0; s < sequences.length; s++) {\n if (seq.guid === sequences[s].sequenceID) {\n sequences[s].clipNames.push(videoTrack.getItemAt(m).name);\n }\n }\n }\n m++;\n }\n }\n }\n // $.pype.log('jsx after video loop clipsInSequences:' + clipsInSequences);\n\n // AUDIO CLIPS IN SEQUENCES\n for (var l = 0; l < sequences[k].audioTracks.numTracks; l++) {\n var audioTrack = seq.getAudioTrackAt(l);\n // $.pype.log(bin.name + ' ' + seq.name + ' has audio track '+ audioTrack.name + ' at index ' + l);\n // $.pype.log('\\n' + bin.name + ' ' + seq.name + ' ' + audioTrack.name + ' has ' + app.project.sequences[k].audioTracks[l].clips.numTracks + ' clips');\n clipCounter = 0;\n numOfClips = app.project.sequences[k].audioTracks[l].clips.numTracks;\n\n for (var m = 0; m < numOfClips; m++) {\n var clip = app.project.sequences[k].audioTracks[l].clips[m];\n $.pype.log('clips in audio tracks: ' + m + ' - ' + clip);\n // if a clip was deleted and another one added, the index of the new one is one or more higher\n while (clipCounter < numOfClips) { // undefined because of old clips\n if (audioTrack.getItemAt(m).name) {\n clipCounter++;\n // $.pype.log(seq.name + ' ' + audioTrack.name + ' has ' + audioTrack.getItemAt(m).name);\n\n for (var s = 0; s < sequences.length; s++) {\n if (seq.guid === sequences[s].sequenceID) {\n sequences[s].clipNames.push(audioTrack.getItemAt(m).name);\n }\n }\n }\n m++;\n }\n }\n }\n } // end if\n } // end for\n } // end getClipNames", "function getPlayers(result)\n{\n let currentWeek = result['status']['transactionScoringPeriod']\n for (i in result['transactions'])\n {\n if (result['transactions'][i]['status'] == \"EXECUTED\")\n {\n let id = result['transactions'][i]['id']\n let time = result['transactions'][i]['proposedDate']\n let team = result['transactions'][i]['teamId']\n \n for (j in result['transactions'][i]['items'])\n {\n let type = result['transactions'][i]['items'][j]['type']\n if (type != \"LINEUP\" && type != \"DRAFT\")\n {\n let playerId = result['transactions'][i]['items'][j]['playerId']\n for(k in result['players'])\n {\n if (playerId == result['players'][k]['player']['id'])\n {\n let name = result['players'][k]['player']['fullName']\n let pos = result['players'][k]['player']['defaultPositionId']\n if (pos == 1)\n pos = 'QB'\n else if (pos == 2)\n pos = 'RB'\n else if (pos == 3)\n pos = 'WR'\n else if (pos == 4)\n pos = 'TE'\n else if (pos == 16) \n pos = 'D/ST'\n let proTeam = result['players'][k]['player']['proTeamId']\n for (t in result['teams'])\n {\n if (result['teams'][t]['id'] == team)\n team = result['teams'][t]['location'] + \" \" + result['teams'][t]['nickname']\n }\n for (entry in nflTeams)\n {\n if (nflTeams[entry][\"id\"] == proTeam)\n {\n proTeam = nflTeams[entry][\"name\"]\n break\n } \n } \n list.push({Id:id, Type:type, Name:name, Team:team, proTeam:proTeam, Pos:pos, Time:time})\n break;\n }\n }\n }\n }\n }\n }\n if (++week <= currentWeek)\n {\n main() //Gets the next week transactions if that week hasn't started\n }\n else\n {\n list.sort((a,b) => (a.Time <= b.Time) ? 1 : -1) //Sorts the transactions with the most recent first \n generatePages() \n fillTable() \n } \n}", "function compute(){\n var newLocations = locations;\n newLocations.forEach(function(currentValue,currentIndex){\n for(num in currentValue.loc){\n if (num == \"latitude\"){\n var c = currentValue.loc.latitude;\n lat.push(c);\n } else if (num == \"longitude\") {\n var d = currentValue.loc.longitude;\n lon.push(d);\n }\n }\n});\n}", "async function process_bbox(bbox_array) {\n for (let new_latlng of bbox_array) {\n await find_bbox(new_latlng, lang).then(nuovi => {\n total_points = total_points.concat(nuovi)\n })\n }\n return total_points;\n }", "function nextValues() {\n if (nextBlogs.length > 0) {\n var countNum = currentBlogs.length;\n for (var i=0;i<countNum;i++) {\n prevBlogs.unshift(currentBlogs[currentBlogs.length - 1]);\n currentBlogs.pop();\n //if there is a blog we assume there is a title\n prevTitles.unshift(currentTitles[currentTitles.length - 1]);\n currentTitles.pop();\n }\n for (var i=0;i<4;i++) {\n if (nextBlogs.length > 0) {\n currentBlogs.push(nextBlogs[0]);\n nextBlogs.shift();\n \n currentTitles.push(nextTitles[0]);\n nextTitles.shift();\n } \n }\n writeValues(); \n }\n\n}", "generarMapa(){\n this.counterId = 1;\n this.salaActual = new Sala(true,NaN, NaN, \"0.txt\", 0 ,this.counterId);\n this.counterId++;\n var listaNodosAActualizar = [this.salaActual];\n this.inicio = this.salaActual;\n while (listaNodosAActualizar.length > 0)\n {\n var proximaProfundida = [];\n listaNodosAActualizar.forEach(sala => {\n\n var derecha = false, izquierda = false ,arriba = false ,abajo = false;\n //Genara la sala de la izuierda, que no necesariamente se va a utilizar\n if(sala.izquierda == null)\n {\n sala.izquierda = this.generarSala(posicionSala.izquierda, sala);\n izquierda = true;\n }\n\n //Genara la sala de la derecha\n if(sala.derecha == null) {\n sala.derecha = this.generarSala(posicionSala.derecha, sala);\n derecha = true;\n }\n //Genera la sala de arriba\n if(sala.arriba == null) {\n sala.arriba = this.generarSala(posicionSala.arriba, sala);\n arriba = true;\n }\n //genera la sala de abajo\n if(sala.abajo == null) {\n sala.abajo = this.generarSala(posicionSala.abajo, sala);\n abajo = true;\n }\n //Los mete en la proxima generacion\n if(izquierda) proximaProfundida.push(sala.izquierda);\n if(derecha) proximaProfundida.push(sala.derecha);\n if(arriba) proximaProfundida.push(sala.arriba);\n if(abajo) proximaProfundida.push(sala.abajo);\n\n\n\n\n });\n proximaProfundida = proximaProfundida.filter(x=> x.depth <= 3 );\n proximaProfundida = proximaProfundida.filter(x => x != this.inicio);\n listaNodosAActualizar = proximaProfundida;\n\n }\n }", "preprocess () {\n let items = []\n if (this.lokiQuery) {\n items = this.overpass.db.find(this.lokiQuery)\n }\n\n for (let i = 0; i < items.length; i++) {\n if (this.options.limit && this.count >= this.options.limit) {\n this.loadFinish = true\n return\n }\n\n const id = items[i].id\n\n if (!(id in this.overpass.cacheElements)) {\n continue\n }\n const ob = this.overpass.cacheElements[id]\n\n if (id in this.doneFeatures) {\n continue\n }\n\n // maybe we need an additional check\n if (this.lokiQueryNeedMatch && !this.filterQuery.match(ob)) {\n continue\n }\n\n // also check the object directly if it intersects the bbox - if possible\n if (ob.intersects(this.bounds) < 2) {\n continue\n }\n\n if ((this.options.properties & ob.properties) === this.options.properties) {\n this.receiveObject(ob)\n this.featureCallback(null, ob)\n }\n }\n\n if (this.options.limit && this.count >= this.options.limit) {\n this.loadFinish = true\n }\n }", "findNeighbors(i, j) {\n this.Neighbors.enumerate().forEach(neighbor => {\n let yOffset;\n let xOffset;\n let piece = this.pieces[i][j];\n let point = new Point(piece.point.x + this.Neighbors[neighbor].x, piece.point.y + this.Neighbors[neighbor].y);\n let check = this.hashmap.getPointFromMap(point, this.pieces);\n if (check !== null) {\n this.pieces[i][j].neighbors.push(\n () => this.hashmap.getPointFromMap(point, this.pieces)\n //check\n );\n }\n });\n }", "function processStep() {\r\n finished = true;\r\n for (var i = 0; i < searchResults.length; ++i) {\r\n for (var j = 0; j < searchResults[i].length; ++j) {\r\n for (var k = 0; k < searchResults[i][j].length; ++k) {\r\n\t\t\t\t//wyciagniecie z obiektow reprezentujacych znalezione rekordy informacji potrzebnych do rozszerzenia podslowa\r\n var searchedSeed = searchResults[i][j][k];\r\n var moveLeft = searchedSeed.moveLeft;\r\n var indexInDbSet = searchedSeed.index - moveLeft;\r\n var indexInSequence = i - moveLeft;\r\n var databaseSet = databaseSets[searchedSeed.DbSetNr];\r\n var seed = searchedSeed.seed;\r\n var currScore = searchedSeed.score;\r\n if (currScore >= tresholdC&&seed.length<sequence.length) { //przetwarzamy tylko rekordy o minimalnej zgodności\r\n var result = expand(seed,sequence,databaseSet,indexInSequence, indexInDbSet, matrix,currScore);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//jezeli udało się rozszerzyć chociaz jeden rekord to nie skonczylismy\r\n\t\t\t\t\tif(result.expandedLeft || result.expandedRight)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfinished = false; \r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n //logika aktualizujaca rekord w searchResults - do napisania\r\n searchResults[i][j][k].score = result.newScore;\r\n\t\t\t\t\t//aktualizacja wskaznika pokazujacego o ile slowo zostalo rozszerzone w lewo\r\n\t\t\t\t\tif(result.expandedLeft)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tsearchResults[i][j][k].moveLeft = searchResults[i][j][k].moveLeft + 1; \r\n\t\t\t\t\t}\r\n\t\t\t\t\tsearchResults[i][j][k].seed = result.newSeed; \r\n }\r\n }\r\n }\r\n }\r\n if(finished) alert(\"Wykonano wszystkie kroki algorytmu, możesz przejść do kolejnego etapu.\")\r\n}", "function process(data) {\n\tvar positions = [];\n\tdata.forEach (function (a, i) {\n\t\tdata.forEach (function (b, j){\n\t\t\tif (a + b === 0) {positions.push ( i + \",\" + j )}\n\t\t});\n\t\treturn positions\n\t});\n\t// positions.forEach (function (a) {\n\t// \tconsole.log(\"Here you go \" + a)\n\t// });\n\tconsole.log(positions)\n}", "function initImg() {\r\n for (let key in data.planes) {\r\n if (data.planes.hasOwnProperty(key)) {\r\n (function() {\r\n var planes = data.planes[key];\r\n if (planes.number > 0) {\r\n var plane_img = document.querySelectorAll('.plane-img');\r\n plane_img[planes.queue - 1].style.opacity = '1';\r\n\r\n };\r\n\r\n })()\r\n }\r\n }\r\n}", "noOfferProducts(productsListFromProps) {\n if (productsListFromProps.length > 0 && this.props.company && this.props.company.offers.items.length > 0) {\n let coOffers;\n this.props.company.offers.items.forEach((item) => { coOffers = coOffers + item.productID + ';;' });\n const l = productsListFromProps.length;\n let indexedProductsNoOffer = [];\n let count = 0;\n for (let x = 0; x < l; x++) {\n if (!coOffers.includes(productsListFromProps[x].id)) {\n indexedProductsNoOffer.push({\n seqNumb: count++,\n details: productsListFromProps[x]\n })\n }\n }\n return indexedProductsNoOffer;\n } else {\n return this.allProducts(productsListFromProps);\n }\n }", "clean() {\n if (this._index < this._length - 1) {\n let index = this._index;\n let newHREFs = [];\n this._hrefs.some(c_hrefs => {\n let newCHrefs = [];\n let result = c_hrefs[1].some(href => {\n // if index is still greater or equal to 0\n // then keep the reference else stop the loop\n if (index-- >= 0) {\n newCHrefs.push(href);\n return false;\n }\n return true;\n });\n if (newCHrefs.length) {\n newHREFs.push([c_hrefs[0], newCHrefs]);\n }\n return result;\n });\n this._hrefs = newHREFs;\n this._length = this._index + 1;\n }\n }", "function runThisFunction(){\r\n var offset = 0;\r\n \r\n //any time exception?\r\n if (stop_in.check == true){\r\n var index = names.indexOf(stop_in.name);\r\n var aux_ids = []; var aux_names = [];\r\n \r\n for (var i = index; i < ids.length;i++) aux_ids.push(ids[i]);\r\n for (var i = index; i < names.length;i++) aux_names.push(names[i]);\r\n \r\n ids = aux_ids;\r\n names = aux_names; \r\n offset = (stop_in.offset + 1) * 1000;\r\n }\r\n \r\n \r\n for (var i = 0; i < ids.length; i++){\r\n podioToDrive_xlsx(ids[i], names[i],limit,offset);\r\n offset = 0;\r\n }\r\n}", "addContent(name, content) {\n //@TODO\n let word_map = new Map();\n let word_count = new Map();\n\t let map_filename = new Map();\n this.words(content);\n\n map3.set(name,content);\n\n let word_offset = [];\n let match;\n\n\n while(match = WORD_REGEX.exec(content)){\n if(!this.noise_words.has(match[0])){\n match[0] = normalize(match[0]);\n var offset = match.index;\n var word = match[0];\n\n if(!word_map.has(match[0])){\n word_map.set(match[0], match.index);\n word_count.set(match[0],1)\n }\n else{\n word_count.set(match[0],word_count.get(match[0])+1);\n }\n\n }\n }\n\n word_map.forEach(function(value,key){\n map_filename.clear();\n\n var array_temp1 = [];\n array_temp1.push(value);\n array_temp1.push(word_count.get(key));\n\n\t if(map2.has(key)){\n\t let filename_offscount = map2.get(key);\n\t filename_offscount.set(name,array_temp1);\n\t\t filename_offscount.forEach(function(value,key){\n\n\t\t });\n\t\t map2.set(key, filename_offscount);\n\n\t }\n\t else{\n map2.set(key, new Map().set(name, array_temp1));}\n\n });\n }", "function seperateMaterials(invoice)\n{\n // invoicearr => invoiceno => materials : []\n // count no of materials in each invoice\n var c = 0;\n\n // find gst cess and have count\n\n console.log(\"In voice Number: \"+invoice);\n let arr = invoicearr[invoice];\n // console.log(arr);\n var materialArr = [];\n let mindex = {};\n arr.forEach((elem,i) => { \n // find gst cess\n // incr counter\n \n if (i == 0)\n {\n console.log(\"New Invoice data---\");\n // console.log(elem);\n }\n if (elem.match(/Slno(\\s)+(RITC)(\\s+)/))\n {\n // console.log(elem);\n }\n if (elem.match(/GST Cess(\\s+)(\\d+)(\\/)(\\d+)/))\n {\n c++;\n mindex[c] = i;\n }\n let s = findsurCharge(elem);\n if (s)\n {\n // console.log(\"S: \" + s)\n }\n });\n // console.log(\"Materials for invoice: \" + invoice + \" is \" + c);\n // console.log(mindex);\n for (let j in mindex)\n {\n // console.log(mindex[j]);\n // get the index of start of material and print start of material\n // console.log(arr[mindex[j] - 10]);\n let materialObj = {};\n let str = \"\";\n str += arr[mindex[j] - 11].trim() + \"### \";\n str += arr[mindex[j] - 10].trim();\n str += arr[mindex[j] - 9].trim();\n // str += arr[mindex[j] - 8].trim();\n // str += arr[mindex[j] - 7].trim() + \" ###\";\n // matearr.push(str);\n\n // index of material\n materialObj.materialNo = findMaterialIndex(str);\n // HSN code\n materialObj.HSNCode = findMaterialRITC(str);\n //BCD Amt(RS)\n materialObj.BCD = findBCD(arr[mindex[j] - 8].trim());\n //Ass value\n materialObj.AssVal = findAssVal(arr[mindex[j] - 7].trim());\n //Social Welfare Surcharge\n materialObj.surCharge = findsurCharge(arr[mindex[j] - 2].trim());\n //IGST\n materialObj.IGST = findIGST(arr[mindex[j] - 1].trim());\n //des\n let desObj = findDes(str);\n // console.log(desObj);\n materialObj.desOfGoods = desObj.desOfGoods;\n materialObj.partCode = desObj.partCode;\n materialObj.quantity = desObj.quantity;\n\n materialObj.invoice = invoice;\n let invobj = invoiceDetails.find(xx => xx.invoice === invoice);\n materialObj.invoiceDate = invobj.vendorDate;\n materialObj.vendorName = invobj.vendorName;\n materialObj.boeNo = boeNo;\n materialObj.boeDate = boeDate;\n materialObj.inVoiValue = invobj.inVoiValue;\n materialObj.exchangeRate = invobj.exchangeRate;\n materialObj.CHA = invobj.CHA;\n materialObj.amtInINR = findAmtINR(materialObj.exchangeRate, materialObj.inVoiValue);\n materialObj.cntryOrg = cntryOrg;\n materialObj.airBillNo = airBillNo;\n materialObj.airBillDt = airBillDt;\n materialArr.push(materialObj);\n }\n console.log(materialArr);\n}", "function list_transcribe(){\n\t\tfor(element in input.list){\n\t\t\tindex = 0\n\t\t\twhile(input.list[element] != alphabet[index]){\n\t\t\t\tindex += 1;\n\t\t\t}\n\t\t\tinput.transcribedsingle.push(index);\n\t\t}\n}", "scanStructures() { \n // let structures = _.map(this.room.find(FIND_MY_STRUCTURES), x=>x.id);\n // let myStructures = Object.keys(this.structures);\n // if (structures.length > myStructures.length) {\n // let diff = _.difference(structures, myStructures);\n // let that = this;\n // // console.log(\"DIFF: \" + diff);\n // _.forEach(diff, function(structure) {\n // // console.log(\"Structureid to add: \" + structure);\n // that.structures[structure] = {};\n // });\n // }\n }", "getReachableComponents(left, top, right, bottom) {\n let ret = [];\n for (let y = top; y < bottom; y++) {\n for (let x = left; x < right; x++) {\n const component = this.componentAtPixel(x, y);\n if (component < 0)\n continue;\n if (ret.indexOf(component) >= 0)\n continue;\n if (!this.componentIsValid(component)) {\n console.log('found invalid component in subrect');\n return [];\n }\n mergeArray(ret, [component]);\n }\n }\n if (ret.length == 0) {\n console.log('no components found');\n return ret;\n }\n console.log('found ' + ret.length + ' components in box');\n // expand with reachable valid components\n let todo = Array.from(ret); // copy array\n let invalid = [];\n while (todo.length > 0) {\n console.log(todo);\n let found = []; // IDs found this iteration\n for (let i = 0; i < todo.length; i++) {\n let reachable = this.findNearbyQuick(todo[i]);\n for (let j = 0; j < reachable.length; j++) {\n const nearcomp = reachable[j];\n if (invalid.indexOf(nearcomp) >= 0)\n continue;\n if (ret.indexOf(nearcomp) < 0 &&\n found.indexOf(nearcomp) < 0) {\n if (!this.componentIsValid(nearcomp)) {\n invalid.push(nearcomp);\n continue;\n }\n found.push(nearcomp);\n }\n }\n }\n ret = ret.concat(found);\n todo = found;\n }\n return ret;\n }", "extractReferences(index, count, first_object_id) {\n let _refs = [];\n let res = { result: null, start_index: -1, end_index: index };\n for (let i = 0; count === -1 || i < count; ++i) {\n res = util_1.Util.readNextWord(this.data, res.end_index + 1);\n let pointer = util_1.Util.extractNumber(res.result, 0).result;\n res = util_1.Util.readNextWord(this.data, res.end_index + 1);\n let generation = util_1.Util.extractNumber(res.result, 0).result;\n res = util_1.Util.readNextWord(this.data, res.end_index + 1);\n let ptr_flag = res.result;\n let isFree = ptr_flag[0] === 102; // 102 = f\n _refs.push({\n id: first_object_id + i,\n pointer: pointer,\n generation: generation,\n free: isFree,\n update: !isFree\n });\n // if the word trailer occurs stop since we reached the end\n if (this.data[util_1.Util.skipSpaces(this.data, res.end_index + 1)] === 116) {\n break;\n }\n }\n return { refs: _refs, end_index: res.end_index };\n }", "getAllNextPositions(color) {\n let allNextPositions = []\n //for all chesspieces\n for (var i = 0; i < this.allChesspieces.length; i++) {\n var piece = this.allChesspieces[i]\n if (piece.isAlive && piece.pieceColor === color) {\n piece.update()\n let blocks = piece.fetchNextPositions()\n for (var j = 0; j < blocks[\"x\"].length; j++) {\n allNextPositions.push([piece.curPosX, piece.curPosY, blocks[\"x\"][j], blocks[\"y\"][j], piece.constructor.name, piece])\n }\n }\n }\n return allNextPositions;\n }", "updateCritical(){\n let valDoc = Object.values(this.props.doc.data);\n for(let a of valDoc){\n if(a.unit === undefined){\n for(let b of Object.values(a)){\n if(this.getCriticalELement(b)){\n this.isCritical = true;\n }\n }\n } else {\n if(this.getCriticalELement(a)){\n this.isCritical = true;\n }\n }\n }\n }", "prepareCollectablesData(foundedGlyphs, selectedGlyphs) {\n let collectablesArray = collectables.glyphs.map(element => {\n if (foundedGlyphs) {\n var founded = foundedGlyphs.some(\n elementFounded => elementFounded === element.id\n );\n\n if (selectedGlyphs) {\n var selected = selectedGlyphs.some(\n elementSelected => elementSelected === element.id\n );\n }\n\n var icon = benediction.find(bene => {\n if (bene.id === element.id) {\n return bene.img\n }\n })\n }\n return {\n name: element.name,\n icon: icon,\n id: element.id,\n found: founded ? founded : false,\n selected: selected ? selected : false \n };\n });\n return collectablesArray;\n }", "function grp(eNfa, nfa)\n{var listWord=[];\n \n \n for(var i=0; i<eNfa.length; i++)\n {\n for(var j=0; j<nfa.trans.length; j++)\n {\n \n if(eNfa[i]==nfa.trans[j].src)\n {\n listWord.push({enumString: nfa.trans[j].ch, enumNfa:nfa.trans[j].dest});\n \n\n }\n }\n }\n // console.log(\"listword size: \"+ listWord.length);\n return listWord; \n \n}", "function main() {\n const v1 = [];\n for (let v11 = 0; v11 < 7; v11++) {\n for (let v16 = 0; v16 != 100; v16++) {}\n for (let v18 = -0.0; v18 < 7; v18 = v18 || 13.37) {\n const v21 = Math.max(-339,v18);\n v1.fill();\n undefined % v21;\n }\n }\n}", "async function process1(start, params) {\n // console.log(params)\n let careerLink = params.joburl;\n let dataSet = await allLinksApi(careerLink);\n dataSet = JSON.parse(dataSet)\n let joburl = careerLink;\n let links = dataSet;\n if (dataSet.hasOwnProperty('success')) {\n links = dataSet.success\n }\n let domain = await domainGetter(joburl)\n if (domain.indexOf('workday') >= 0 || domain.indexOf('icims') >= 0)\n return links;\n let jobs = [],\n noJobs = [];\n await Promise.all(\n links.map(async data => {\n if (!endsWithUrl(data.Link)) {\n jobs.push(data)\n } else {\n noJobs.push(data)\n }\n })\n )\n // return {jobs,noJobs}\n let totalJobsCount = jobs.length,\n noJobsCount = noJobs.length,\n totalLinks = links.length\n let indexSelector = 1;\n if (totalJobsCount > 50) {\n indexSelector = Math.round(totalJobsCount / 50);\n if (indexSelector <= 1) {\n indexSelector = 2\n }\n };\n console.log(\"jobs..............................\")\n console.log(jobs)\n var jobUrls = _.uniq(_.map(jobs, 'Link'));\n console.log(\"joburls.................................\");\n console.log(jobUrls);\n console.log(indexSelector)\n let HCSCheck = [];\n for (let i = 0; i < jobUrls.length; i++) {\n if (i % indexSelector == 0 && jobUrls[indexSelector * i] != null) {\n HCSCheck.push(jobUrls[indexSelector * i]);\n }\n }\n console.log(\"hcs check\")\n console.log(HCSCheck)\n var mostCommonString = await mostCommonSubstring(HCSCheck);\n console.log(\"1st common string\", mostCommonString)\n // let is_commonString=await Promise.all(\n var is_commonString = \"\";\n jobSelectors.forEach(selector => {\n if ((mostCommonString.toLowerCase().indexOf(selector.toLowerCase()) != -1 || selector.toLowerCase().indexOf(mostCommonString.toLowerCase()) != -1) && mostCommonString != \"\") {\n is_commonString = selector;\n }\n\n })\n // )\n console.log(\"iscommon string\", is_commonString)\n // console.log(is_commonString)\n if (is_commonString != \"\") {\n let jobUrls2 = await jobs.filter(element => {\n return element.Link.includes(mostCommonString)\n });\n return {\n \"HCS\": mostCommonString,\n \"allLinks\": links,\n \"perfectJobs\": jobUrls2,\n \"perfectJobCount\": jobUrls2.length\n }\n } else {\n\n let htmlJobs = []\n await Promise.all(\n jobUrls.map(async url => {\n if (jobUrls.indexOf(url) % indexSelector == 0) {\n let data = await apiRequestFuntionForHTML(start, url, '/htmlPlainText', false);\n data.url = url;\n htmlJobs.push(data);\n }\n })\n )\n log(start, joburl, \"HTML JOBS DONE\");\n let pc_api = roundround(pc);\n let pageCheckJob = [],\n pageCheckNoJob = []\n await Promise.all(\n htmlJobs.map(async data => {\n // console.log(data.url+\" is came for processing\");\n API_URI = pc_api()\n // console.log(API_URI)\n let pageCheck = await IS_Job(data.url, data.jobBody, API_URI);\n pageCheck = JSON.parse(pageCheck);\n // console.log(pageCheck.Status+\" is came for processing\");\n if (pageCheck.Status == true) {\n\n pageCheckJob.push(data.url)\n } else {\n pageCheckNoJob.push(data.url)\n }\n })\n )\n log(start, joburl, \"PAGE CHECK DONE\");\n\n\n mostCommonString = await mostCommonSubstring(pageCheckJob);\n jobUrls2 = await jobs.filter(element => {\n return element.Link.includes(mostCommonString)\n });\n // console.log(jobUrls2);\n console.log(mostCommonString)\n\n return {\n \"HCS\": mostCommonString,\n \"allLinks\": links,\n \"pageCeckUrls\": pageCheckJob,\n \"perfectJobs\": jobUrls2,\n \"perfectJobCount\": jobUrls2.length\n }\n }\n\n}", "function numbers (){\n memory.map((each,index)=>{\n \n if(d.test(each) && d.test(memory[index+1])){\n memory.splice(index,1)\n memory[index]= each+memory[index];\n numbers()\n }\n })\n }", "gatherMatchingBlocks(matches) {\n this.nullifyMatchesInGridArray(matches);\n\n let beingSwapped = matches.filter(e => e.beingSwapped);\n const arrTypes = [...new Set(matches.map(m => m.id))];\n\n /* in this case this is automatch and we need to set target\n blocks for each match so that the rest of certain color can \n go to target block position\n */\n\n // array of all matches types... for example [\"ball_red\", \"ball_green\"] etc.\n for (let _id of arrTypes) {\n if (beingSwapped.map(m => m.id).includes(_id)) { continue; }\n console.log(_id);\n let currentMatchItems = matches.filter(e => e.id === _id);\n let central = Math.floor(currentMatchItems.length / 2);\n let centralItem = matches.indexOf(matches.find(m => m === currentMatchItems[central]));\n matches[centralItem].beingSwapped = true; //?? might cause problems!!!!\n beingSwapped.push(matches[centralItem]);\n }\n\n for (let m = 0; m < beingSwapped.length; m++) {\n let thisColorMatchesIds = matches.filter(e => e.id === beingSwapped[m].id);\n for (let e = 0; e < thisColorMatchesIds.length; e++) {\n let targetBlock = thisColorMatchesIds.filter(x => x.beingSwapped)[0];\n let tweenTarget = this.blocks[thisColorMatchesIds[e].row][thisColorMatchesIds[e].col];\n\n if (!thisColorMatchesIds[e].beingSwapped) {\n let newX = this.globalBlocksPositions[targetBlock.row][targetBlock.col].x;\n let newY = this.globalBlocksPositions[targetBlock.row][targetBlock.col].y;\n TweenMax.to(tweenTarget.blockImg, .2, {\n x: newX,\n y: newY,\n alpha: 0,\n ease: Linear.easeNone,\n onComplete: () => { }\n });\n }\n else {\n TweenMax.to(tweenTarget.blockImg, .2, {\n alpha: 0,\n delay: .2,\n onComplete: () => { }\n });\n }\n }\n }\n }", "getVertexes(cb) {\n\n //returns 3 hexes associated to one vertex\n const calcVert = (i,j, dirOne, dirTwo) => {\n return cb([\n this.pieces[i][j], //first item in array is always real\n this.hashmap.getPointFromMap(new Point(this.pieces[i][j].point.x + Neighbors[dirOne].x, this.pieces[i][j].point.y + Neighbors[dirOne].y), this.pieces),\n this.hashmap.getPointFromMap(new Point(this.pieces[i][j].point.x + Neighbors[dirTwo].x, this.pieces[i][j].point.y + Neighbors[dirTwo].y), this.pieces),\n ])\n }\n\n //helper methods to find all 6 vertexes surrounding hex\n const calcTopLeft = (i, j) => calcVert(i, j, Dir.LEFT, Dir.TOP_LEFT);\n const calcTop = (i, j) => calcVert(i, j, Dir.TOP_LEFT, Dir.TOP_RIGHT);\n const calcTopRight = (i, j) => calcVert(i, j, Dir.TOP_RIGHT, Dir.RIGHT);\n const calcBottomLeft = (i, j) => calcVert(i, j, Dir.LEFT, Dir.BOTTOM_LEFT);\n const calcBottom = (i, j) => calcVert(i, j, Dir.BOTTOM_LEFT, Dir.BOTTOM_RIGHT);\n const calcBottomRight = (i, j) => calcVert(i, j, Dir.RIGHT, Dir.BOTTOM_RIGHT);\n\n let vertexes = [];\n for (let i = 1; i < this.pieces.length - 1; i++) {\n let one = [], two = [], three = [], four = []; // array to hold each row of vertexes\n\n //build two rows at a time\n //for first half of map, grab top and top left vertexes and push to array,\n //mirror that for second half of hex map\n for (let j = 1; j < this.pieces[i].length - 1; j++) {\n if (i < Math.floor(this.pieces.length / 2)) {\n one.push( calcTop(i, j) );\n two.push( calcTopLeft(i, j));\n if (j === this.pieces[i].length - 2) {\n two.push(calcTopRight(i, j)); //at last index, get the odd corner indexes\n }\n\n } else if (i === Math.floor(this.pieces.length / 2)) {\n one.push( calcTop(i, j) );\n two.push( calcTopLeft(i, j));\n three.push(calcBottomLeft(i, j));\n four.push(calcBottom(i, j));\n if (j === this.pieces[i].length - 2) {\n two.push(calcTopRight(i, j));\n three.push(calcBottomRight(i, j));\n }\n } else {\n one.push(calcBottomLeft(i, j));\n two.push(calcBottom(i, j));\n if (j === this.pieces[i].length - 2) {\n one.push(calcBottomRight(i, j));\n }\n }\n }\n vertexes.push(one, two);\n if (i === Math.floor(this.pieces.length / 2)) {\n vertexes.push(three, four);\n }\n }\n return vertexes; //this is an array of arrays of arrays\n }", "function dataSplittor_Occ__06(parsed_data, occ_pid_1, avail_pid_1, occ_pid_2, avail_pid_2, occ_pid_all, avail_pid_all, mon_pid_all) {\n let x=0; let y=0; let z=0; \n\n for (let i = 1; i <= parsed_data.length; i++) {\n if (i <= 6) {\n occ_pid_all[x] = parsed_data[i-1].occ;\n avail_pid_all[x] = parsed_data[i-1].avail;\n mon_pid_all[x] = parsed_data[i-1].mon;\n\n x+=1\n }\n if ((i > 6) && (i <= 12)) {\n occ_pid_1[y] = parsed_data[i-1].occ;\n avail_pid_1[y] = parsed_data[i-1].avail;\n\n y+=1\n }\n if (i > 12) {\n occ_pid_2[z] = parsed_data[i-1].occ;\n avail_pid_2[z] = parsed_data[i-1].avail;\n\n z+=1\n }\n }\n delete (x,y,z);\n \n}", "initNeighbors() {\n this.hashmap = new HashPoints(this.pieces);\n this.pieces.forEach((row, i) => {\n row.forEach((piece, j) => {\n //if (piece instanceof Dock) piece.calcDir(j, i, this);\n this.findNeighbors(i, j);\n })\n });\n }", "async batchMinedPayments( )\n {\n var self = this ;\n\n var unbatched_pmnts = await self.mongoInterface.findAll('balance_payment',{batchId: null})\n\n\n var batchedPayments = 0;\n\n\n const MIN_PAYMENTS_IN_BATCH = 5; //5\n\n if( unbatched_pmnts.length >= MIN_PAYMENTS_IN_BATCH)\n {\n\n\n var batchData = {\n id: web3utils.randomHex(32),\n confirmed: false\n }\n\n await self.mongoInterface.upsertOne('payment_batch',{id: batchData.id}, batchData )\n\n\n\n var paymentsToBatch = unbatched_pmnts.slice(0,25) //max to batch is 25\n\n for( var element of paymentsToBatch ) {\n\n element.batchId = batchData.id;\n\n await self.mongoInterface.upsertOne('balance_payment',{id: element.id}, element )\n\n batchedPayments++;\n\n }\n\n\n }\n\n return {success:true,batchedPayments:batchedPayments} ;\n }", "async function noiVinsmoke($) {\n var setList = [];\n\n $('.NonLiveMarket .MarketT').each((i, ele) => {\n var topHead = $(ele).find('.MarketHd .SubHead span').html();\n\n var dataList = [];\n var marketBdHtml = $(ele).find('.MarketBd').children();\n var leagueName = '';\n\n $(marketBdHtml).each((bdI, bdEle) => {\n var tagName = $(bdEle).prop('tagName');\n if (tagName == 'DIV') { // .MarketLea\n leagueName = $(bdEle).find('.SubHeadT').html();\n } else { // table\n var tableHtml = $(bdEle).find('tr');\n var matchList = [];\n $(tableHtml).each((tbI, tbEle) => {\n // console.log('--------------------');\n var aList = $(tbEle).find('td a');\n var findLink = $(tbEle).find('td.Icons a');\n var times = $(tbEle).find('td').find('.DateTimeTxt').find('span');\n var dateInfo = times[0];\n var timeInfo = times[1];\n var date = $(dateInfo).html();\n var time = $(timeInfo).html();\n \n var link = $(findLink).attr('href');\n // console.log(link);\n \n var smallObj = {};\n \n if (topHead == '1X2') {\n var leftObj = aList[0];\n var midObj = aList[1];\n var rightData = aList[2];\n \n var oddsLLeft = $(leftObj).find('.OddsL').html();\n var oddsRLeft = $(leftObj).find('.OddsR').html();\n \n var drawText = $(midObj).find('.OddsL').html();\n var drawScore = $(midObj).find('.OddsR').html();\n \n var oddsLRight = $(rightData).find('.OddsL').html();\n var oddsRight = $(rightData).find('.OddsR').html();\n \n smallObj = {\n time: date + '' + time,\n left: [oddsLLeft, oddsRLeft],\n mid: [drawText, drawScore],\n right: [oddsLRight, oddsRight],\n link: link\n };\n } else {\n var leftObj = aList[0];\n var rightData = aList[1];\n \n var oddsLLeft = $(leftObj).find('.OddsL').html();\n var oddsMLeft = $(leftObj).find('.OddsM').html();\n var oddsRLeft = $(leftObj).find('.OddsR').html();\n \n var oddsLRight = $(rightData).find('.OddsL').html();\n var oddsMRight = $(rightData).find('.OddsM').html();\n var oddsRight = $(rightData).find('.OddsR').html();\n \n smallObj = {\n time: date + '' + time,\n left: [\n oddsLLeft,\n oddsMLeft,\n oddsRLeft\n ],\n right: [\n oddsLRight,\n oddsMRight,\n oddsRight\n ],\n link: link\n };\n }\n\n // console.log(smallObj);\n matchList.push(smallObj);\n });\n\n var lObj = {\n league_name: leagueName,\n match_datas: matchList\n };\n\n dataList.push(lObj);\n }\n });\n\n var obj = {\n top_head: topHead,\n datas: dataList\n };\n\n // console.log(obj);\n setList.push(obj);\n });\n\n var structureString = JSON.stringify(setList);\n // console.log(structureString);\n\n const dirName = another.createName();\n const createdAt = another.createdAt();\n var sql = \"INSERT INTO ffp_list (dir_name, content, created_at) VALUES ('\" + dirName + \"', '\" + structureString + \"', '\" + createdAt + \"');\";\n\n connection.query(sql, async (err, result) => {\n if (err) {\n const createdAt = another.createdAt();\n another.nvsOpenAndAppendFile('log.html', createdAt + ' : Main INSERT ffp_list error DB : ' + err.message + '<br>\\n');\n\n connection.end();\n process.exit();\n } else {\n // console.log(result);\n const hrefList = [];\n let href = '';\n var sql = '';\n let qStringInsert = '';\n\n $('.NonLiveMarket .Icons a').each((i, ele) => {\n href = ele.attribs.href;\n // console.log($(this).html(), href);\n if (hrefList.indexOf(href) == -1) {\n var realFileName = 'link-' + another.twoDigit(i) + '.html';\n hrefList.push(href);\n\n const code = dirName + '-' + realFileName; // 20200412-0021-link-7.html\n const numList = code.split('-');\n const lymd = numList[0]; // 20200412\n const hm = numList[1]; // 0021\n const ymd = lymd.substring(2, 8); // 200412\n const fData = numList[3]; // 7.html\n const f = fData.split('.')[0]; // 7\n\n const id = ymd + '' + hm + '' + f; // 20041200217\n // console.log(id);\n\n sql = \"('\" + id + \"', '\" + code + \"', '\" + href + \"', '\" + dirName + \"', '\" + realFileName + \"', '', '\" + createdAt + \"')\";\n qStringInsert += (qStringInsert) ? ',' + sql : sql;\n }\n });\n\n var sqlInsert = \"INSERT INTO ffp_detail (id, `code`, link, dir_name, file_name, content, created_at) VALUES \";\n sqlInsert += qStringInsert;\n sqlInsert += ';';\n\n if (qStringInsert != '') {\n // await another.nvsOpenAndAppendFile('log.html', createdAt + ' : Main Insert Detail info : ' + sqlInsert + '<br>\\n');\n\n connection.query(sqlInsert, async (err, result) => {\n if (err) {\n const createdAt = another.createdAt();\n await another.nvsOpenAndAppendFile('log.html', createdAt + ' : Main Insert Detail error DB : ' + err.message + '<br>\\n');\n\n connection.end();\n process.exit();\n } else {\n // console.log(result);\n connection.end();\n process.exit();\n }\n });\n } else {\n // console.log(result);\n connection.end();\n process.exit();\n }\n\n }\n });\n}", "initializeJunctionPhases () {\n for (let i = 0; i < this.n - 1; i ++) {\n let u1 = this.sculpture.units.children[i];\n let u2 = this.sculpture.units.children[i+1];\n if (u1.isEmpty || u2.isEmpty) {\n continue;\n }\n\n }\n }", "_pickAllAliveCellsByAGOrder(callback) {\n this.cells.forEach(c=>c.done=false);\n let nextCell;\n while (nextCell = this.checkSequence.reduce((ret, cellid)=>{\n const tgt = this.cells[cellid];\n return (!(tgt.done || tgt.isDead) && (!ret || (ret.ag < tgt.ag))) ? tgt : ret;\n }, null)) {\n if (!nextCell) break;\n callback(nextCell);\n nextCell.done = true;\n }\n }", "function get_itinery(flight_list,start){\n let start_source = [];\n let result = [];\n \n for(let i=0;i<flight_list.length;i++){\n if(flight_list[i][0] == start){\n start_source.push(flight_list[i])\n }\n }\n \n if(start_source.length>1){\n start_source.sort((a, b) => a[1].localeCompare(b[1]))\n }\n // console.log(start_source)\n result.push(start_source[0][0])\n result.push(start_source[0][1])\n let temp = start_source[0][1];\n let side = []\n side.push(start_source[0])\n // console.log(side,\"side\")\n let total = 0 \n for(let i=0;i<flight_list.length;i++){\n for(let j=0;j<flight_list.length;j++){\n let count = 0\n if(flight_list[j][0] == temp){\n for(let flight of side){\n if(flight[0] == flight_list[j][0] && flight[1] == flight_list[j][1] ){\n count++\n // console.log(flight_list[j],\"if.....\")\n }\n }\n if(count == 0){\n side.push(flight_list[j])\n result.push(flight_list[j][1])\n temp = flight_list[j][1]\n total++\n // console.log(flight_list[j],\"2nd if.....\")\n }\n }\n \n }\n }\n \n if(total > 0){//} && side.length == flight_list.length){\n return result\n }else{\n return null\n }\n \n}", "generateBlogYearInfo()\n {\n this.blog_year_info.blog_years = [];\n this.blog_year_info.blogs = [];\n this.blog_year_info.year_info = [];\n if(this.props.data.archives != null)\n {\n // Iterate through each post, putting all found years into `years`\n _.each(this.props.data.archives.edges, edge => {\n // Concatenate the years for this blog posts to the list of the years collected till now\n this.blog_year_info.blog_years = this.blog_year_info.blog_years.concat(edge.node.fields.year);\n // Collect the blog information for each blog post in order\n this.blog_year_info.blogs.push([edge.node.frontmatter.title, edge.node.fields.year,\n edge.node.fields.slug, edge.node.fields.date]);\n });\n // Eliminate duplicate years\n this.blog_year_info.blog_years = _.sortBy(_.uniq(this.blog_year_info.blog_years));\n // Slugify characters\n slugify.charmap['+'] = 'p';\n // Generate the list of blogs for each year\n for(var index_i = 0; index_i < this.blog_year_info.blog_years.length; index_i++)\n {\n \n this.blog_year_info.year_info.push(new Array());\n for(var index_j = 0; index_j < this.blog_year_info.blogs.length; index_j++)\n {\n // If the blog has this particular year, then append the blog index to year_info array\n if(this.blog_year_info.blogs[index_j][1].indexOf(this.blog_year_info.blog_years[index_i]) > -1)\n {\n this.blog_year_info.year_info[index_i].push(index_j);\n }\n }\n }\n }\n }", "function test() {\n while (!condition) {\n let totalFull = 0;\n\n for (let i = 0; i < wardens.length; i++) {\n let l = (wardens[i].route.length);\n if (s % l !== 0) {\n wardens[i].cs = (s % l) - 1; //ARRAYS START AT ZERO!!\n } else {\n wardens[i].cs = l - 1;\n }\n wardens[i].pos = wardens[i].route[wardens[i].cs];\n }\n console.log(wardens);\n\n for (let i = 0; i < wardens.length; i++) {\n\n for (let j = 0; j < wardens.length; j++) {\n\n if (wardens[i].pos === wardens[j].pos) {\n wardens[i].gossips = swapgossip(wardens[i].gossips.concat(wardens[j].gossips));\n wardens[j].gossips = wardens[i].gossips;\n }\n\n }\n if (wardens[i].gossips.length === wardens.length) {\n totalFull++;\n }\n }\n console.log(totalFull)\n if (totalFull === wardens.length) {\n condition = true;\n\n }\n //console.log(s);\n\n\n\n\n\n\n\n\n\n\n\n\n s++;\n //wait(1000);\n\n }\n var p = document.createElement(\"p\");\n p.innerHTML = \"stops taken: \" + (s - 1);\n document.getElementById(\"result\").appendChild(p);\n}", "async function getAnimeLongData(shortData) {\n const malIdList = [];\n let isMature;\n let createMoreCardsCount = 9\n for (let i=0; i < shortData.results.length && createMoreCardsCount > 0; i++, createMoreCardsCount--) {\n const malID = shortData.results[i].mal_id;\n const animeURL = `https://api.jikan.moe/v3/anime/${malID}`;\n const fetchedAnimeLongData = await fetch(animeURL);\n const fetchedAnimeLongDataJSON = await fetchedAnimeLongData.json();\n isMature = checkDataArray(fetchedAnimeLongDataJSON, 'genres').includes('Hentai');\n // console.log(isMature);\n if (isMature && matureFilter) {\n createMoreCardsCount++\n } else {\n malIdList.push(fetchedAnimeLongDataJSON);\n await createCard(fetchedAnimeLongDataJSON, malIdList.length - 1);\n }\n // console.log(createMoreCardsCount);\n \n }\n return await malIdList;\n}", "function loopData() {\n\n}", "checkForDuplicates() {\n const alreadyChecked = [];\n for(let list of [this.state.listA, this.state.listB]) {\n for(let row of list) {\n row.isDuplicate = false;\n const duplicate = alreadyChecked.find(otherRow => otherRow.snomed.code === row.snomed.code);\n if (!row.snomed.code || duplicate) {\n row.isDuplicate = true;\n if (duplicate) duplicate.isDuplicate = true;\n } \n alreadyChecked.push(row);\n }\n }\n }", "function renderImg() {\n\n arr2 = noIterationRepeat();\n console.log('arr2', arr2);\n checkRepetition();\n\n leftImage.src = BusMall.all[arr2[0]].path;\n leftImage.title = BusMall.all[arr2[0]].name;\n leftImage.alt = BusMall.all[arr2[0]].name;\n // arr2.shift();\n // arr2.push(leftImage.alt);\n\n middleImage.src = BusMall.all[arr2[1]].path;\n middleImage.title = BusMall.all[arr2[1]].name;\n middleImage.alt = BusMall.all[arr2[1]].name;\n // arr2.shift();\n // arr2.push(middleImage.alt);\n\n rightImage.src = BusMall.all[arr2[2]].path;\n rightImage.title = BusMall.all[arr2[2]].name;\n rightImage.alt = BusMall.all[arr2[2]].name;\n // arr2.shift();\n // arr2.push(rightImage.alt);\n\n console.log(arr2);\n\n for (let i = 0; i < BusMall.all.length; i++) {\n for (let j = 0; j < arr2.length; j++) {\n\n if (BusMall.all[i].name === arr2[j]) {\n BusMall.all[i].views = BusMall.all[i].views + 1;\n }\n }\n }\n\n}", "getNumDifferentInLoop(){\n var typesOfInnerHexes= new Set();\n for (let innerHex of this.innerHexes) {\n typesOfInnerHexes.add(innerHex.identifier.name);\n\n }\n return typesOfInnerHexes.size;\n }", "mainloop() {\n this.repetitions++;\n let now = new Date().getTime();\n let relativeOriginal = now - this.realstartts;\n let relative = relativeOriginal * this.config.timeFactor;\n for (let node of this.nodes) {\n node.check(relative);\n };\n if (this.repetitions % 1000 === 0) {\n console.log(\"Repetition:\", this.repetitions, \"Relative time:\", relative);\n };\n }", "function iterateFunc(doc){cov_20g0dos6ux().f[0]++;cov_20g0dos6ux().s[9]++;console.log(JSON.stringify(doc,null,4));}", "async function main() {\n let ships = {}\n\n let ref = admin.firestore().collection(\"nmsce/Euclid/Ship\")\n // ref = ref.limit(100)\n\n let snapshot = await ref.get()\n\n for (let doc of snapshot.docs) {\n let name = doc.data().Name\n\n if (typeof name === \"string\" && name !== \"\") {\n name = name.replace(/(?:[A-Z]{2}\\d\\s)?(\\D*)$|(\\D*?)(?:\\s[A-Z]{2}\\d\\s?)?$/, \"$1$2\")\n name = name.replace(/(.*?)[XIV]+$/, \"$1\")\n\n if (typeof ships[name] === \"undefined\") {\n ships[name] = {}\n ships[name].count = 0\n ships[name].list = []\n ships[name].seed = []\n }\n\n ships[name].count++\n ships[name].list.push(doc.data().Name)\n ships[name].list.push(doc.data().Seed)\n }\n }\n\n for (let key of Object.keys(ships))\n if (ships[key].count >= 5)\n console.log(ships[key].count, ships[key].list, ships[key].seed)\n}", "function getPhotoStats(obj) {\n let imagesArray = obj.photo;\n let statArray = [];\n let locationPromises = [];\n for (image of imagesArray) {\n let imageObj = {\n 'id': image.id,\n 'src': `https://farm${image.farm}.staticflickr.com/${image.server}/${image.id}_${image.secret}.jpg`\n };\n let locationPromise = getLocation(image);\n locationPromises.push(locationPromise);\n statArray.push(imageObj);\n }\n return Promise.all(locationPromises)\n .then(locationArray => {\n locationArray.forEach(function (location, index) {\n statArray[index]['location'] = location;\n });\n // console.log(statArray.slice(0, 20));\n return statArray.slice(0, 50);\n });\n}", "async getAllResults(iterator, isHistory) {\n let allResults = []\n while (true) {\n let res = await iterator.next()\n \n if (res.value && res.value.value.toString()) {\n let jsonRes = {}\n console.log(res.value.value.toString('utf8'))\n if (isHistory && isHistory === true) {\n jsonRes.TxId = res.value.tx_id\n jsonRes.Timestamp = res.value.timestamp\n jsonRes.IsDelete = res.value.is_delete.toString()\n try {\n jsonRes.Value = JSON.parse(res.value.value.toString('utf8'))\n } catch (err) {\n console.log(err)\n jsonRes.Value = res.value.value.toString('utf8')\n }\n } else {\n jsonRes.Key = res.value.key\n try {\n jsonRes.Record = JSON.parse(res.value.value.toString('utf8'))\n } catch (err) {\n console.log(err)\n jsonRes.Record = res.value.value.toString('utf8')\n }\n }\n allResults.push(jsonRes)\n }\n if (res.done) {\n console.log('end of data')\n await iterator.close()\n console.info(allResults)\n return allResults\n }\n }\n }", "function Rn(){this.seq=[],this.map={}}// --- Utilities ---", "cheat() {\n for (let i = 1; i < this.tx.length; i++) {\n if (this.isInvolvedIn(this.tx.slice(-i)[0])) {\n this.tx.splice(-i, 1);\n }\n }\n }", "performSpecifics(onSpecificsFinished){\n if(this.#specificItems.length == 0){\n onSpecificsFinished();\n return;\n }\n let limitPerSecond = 5;\n let counter = new bpu.AsyncCounter(limitPerSecond, ()=>{\n onSpecificsFinished();\n })\n for(var i=0;i<limitPerSecond;i++){\n let limitPerSearch = 20;\n let startIndex = 0;\n let endIndex = (this.#specificItems.length > limitPerSearch ? limitPerSearch : this.#specificItems.length);\n let itemSplice = this.#specificItems.splice(startIndex,endIndex);\n let itemIds = itemSplice.map((item)=>{return item.itemId[0]})\n if(itemIds.length == 0) {\n counter.increment();\n } else {\n this.#ebay.getMultipleItems({\n itemId: itemIds,\n IncludeSelector: 'ItemSpecifics'\n }).then((data) => {\n // insert specifics data in database here JON !!\n counter.increment();\n /*\n for (let k = 0; k < data.Item.length; k++) {\n for (let l = 0; l < items[0].searchResult[0].item.length; l++) {\n if (items[0].searchResult[0].item[l].itemId[0] == data.Item[k].ItemID) {\n items[0].searchResult[0].item[l].specifics = data.Item[k].ItemSpecifics\n }\n }\n }\n if (count == chunked.length) {\n callback(items)\n }\n */\n }, (error) => {\n console.log('Failed to fetch specifics' + error);\n // if failed to fetch specifics end the items to the end of the items to search specifics array\n for(failedItem in itemSplice){\n this.#specificItems.push(failedItem);\n }\n counter.increment();\n });\n }\n } \n }", "function allCurrents(){\n let strongCurrents = [];\n for (var i = 0; i < GRID.length; i++){\n for (var j = 0; j < GRID[0].length; j++){\n if (GRID[i][j] == \"~\"){\n strongCurrents.push(indexToChar(j)+ (i+1));\n }\n }\n }\n return strongCurrents;\n}", "async function dupe(item, type) {\n let result = 0;\n if (type == 'out') \n {\n await root_out.descendants().forEach((s,i)=>{\n if (item._id == s.data._id) \n {\n if (item.firstBlock < s.data.firstBlock) {s.data.firstBlock = item.firstBlock; update_out(s)}\n result = s;\n } \n }) \n }\n else\n {\n await root_in.descendants().forEach((s,i)=>{\n if (item._id == s.data._id) \n {\n if (item.lastBlock > s.data.lastBlock) {s.data.lastBlock = item.lastBlock; update_in(s)}\n result = s;\n } \n })\n \n }\n return result\n }", "function mergeData(){\n\n var locRef={};\n var tempStatsArray = tempStats.stdout; // array with the stats info\n var entryAsset, entryStats; // variables to hold entries assets and stats\n var newStats = {}; // obj containing the new stats\n\n for(let i = 0; i < assetsData.length; i++){\n\n entryAsset = tempAssets[i]; // get Asset\n\n for(let k = 0; k < tempStatsArray.length; k++){\n\n entryStats = tempStatsArray[k]; // get stats\n\n // If there is a correspondence between Assets list and Stats list\n if(entryAsset.name === entryStats.name){\n\n // Create new stats object\n newStats = {timestamp:tempStats.timestamp, stdout: [entryStats]};\n\n // If asset has a \"vf-OS\" label and marked as \"true\"\n if( (\"vf-OS\" in entryAsset.labels) &&\n (entryAsset.labels[\"vf-OS\"] === \"true\") ){\n\n // If it has a front url\n if((\"vf-OS.frontendUri\" in entryAsset.labels) &&\n (entryAsset.labels[\"frontendUri\"] !== \"\")){ // It is a vApp\n\n // Put stats data in historyDB\n locRef = {obj: historyDB, objName:\"runningVAssets\"};\n addStatsToHistory(locRef, newStats);\n\n // Add Asset Info To History\n historyDB.runningVAssets[entryStats.name].assetDetails = tempAssets[k];\n\n } else { // If it does not have a url put it in \"Supporting Library Containers\" table\n\n // Put stats data in historyDB\n locRef = {obj: historyDB, objName:\"notRunningVAssets\"};\n addStatsToHistory(locRef, newStats);\n\n // add Asset Info To History\n historyDB.notRunningVAssets[entryStats.name].assetDetails = tempAssets[k];\n }\n\n } else { // Put it in Others Containers tables\n\n // Put stats data in historyDB\n locRef = {obj: historyDB, objName:\"otherContainers\"};\n addStatsToHistory(locRef, newStats);\n\n // Add Asset Info To History\n historyDB.otherContainers[entryStats.name].assetDetails = tempAssets[k];\n }\n\n break; // Go to next asset\n }\n }\n }\n\n // remove all data from all sets\n removeOldData();\n\n // check if it is necessary to change units scale\n changeDataScales();\n\n // reset temp variables\n tempStats = undefined;\n tempAssets = undefined;\n}", "function comprobarCajas() {\n\n for (let i = 2, posCaja = 0; i < mapa.length; i += 3)\n for (let j = 1; j < mapa[0].length; j += 4, posCaja++)\n if (!cajasDescubiertas[posCaja] && mapa[i][j].classList.contains('caja'))\n if (cajaRodeada(i, j)) {\n\n cajasDescubiertas[posCaja] = true;\n descubrirCaja(i, j, posCaja);\n\n if (contenidoCajas[posCaja] == 'cofre') {\n puntos = parseInt(puntos) + 200;\n actualizarPuntuacion();\n insertarContenidoLeyenda('contenedorMonedas', 'leyendaCajaMoneda', 'cantidadMonedas');\n }\n else if (contenidoCajas[posCaja] == 'pergamino') {\n personaje.pergamino = true;\n applyContrastToMummies();\n }\n else if (contenidoCajas[posCaja] == 'llave') {\n insertarContenidoLeyenda('contenedorLlave', 'leyendaCajaLlave', 'cantidadLlaves');\n personaje.llave = true;\n }\n else if (contenidoCajas[posCaja] == 'urna') {\n insertarContenidoLeyenda('contenedorUrna', 'leyendaCajaUrna', 'cantidadUrnas');\n personaje.urna = true;\n }\n }\n\n}", "getCurrentPlayerCoinPositionList(numEle) {\n console.log('in getPlayerPositionDataList method');\n let currentPlayerCoinsList = this.getCurrentPlayerCoins();\n let nonStartedCoinsList;\n let startedAndNonEndedCoinsList;\n let posValueOfCoinsList = [];\n if(!currentPlayerCoinsList) {\n console.log('current player coin list is empty');\n return posValueOfCoinsList;\n }\n //all coins in start area\n nonStartedCoinsList = currentPlayerCoinsList.filter(function(indCoin) {\n return indCoin.isStart === false;\n });\n //all coins which are started and not in home area\n startedAndNonEndedCoinsList = currentPlayerCoinsList.filter(function(indCoin) {\n return indCoin.isEnd === false && indCoin.isStart === true;\n });\n if(startedAndNonEndedCoinsList && startedAndNonEndedCoinsList.length !== 0) {\n posValueOfCoinList = getPropertyValuesFromObjectList(startedAndNonEndedCoinsList, 'position');\n }\n if(numEle === 1) {\n let startArrayLength = !nonStartedCoinsList ? 0 : nonStartedCoinsList.length;\n for(let i = 1; i <= startArrayLength; i++) {\n posValueOfCoinsList.push(-1);\n }\n }\n return posValueOfCoinsList;\n }", "generateProjectYearInfo()\n {\n this.project_year_info.project_years = [];\n this.project_year_info.projects = [];\n this.project_year_info.year_info = [];\n if(this.props.data.archives != null)\n {\n // Iterate through each post, putting all found years into `years`\n _.each(this.props.data.archives.edges, edge => {\n // Concatenate the years for this project posts to the list of the years collected till now\n this.project_year_info.project_years = this.project_year_info.project_years.concat(edge.node.fields.year);\n // Collect the project information for each project post in order\n this.project_year_info.projects.push([edge.node.frontmatter.title, edge.node.fields.year,\n edge.node.fields.slug, edge.node.fields.date]);\n });\n // Eliminate duplicate years\n this.project_year_info.project_years = _.reverse(_.sortBy(_.uniq(this.project_year_info.project_years)));\n // Slugify characters\n slugify.charmap['+'] = 'p';\n // Generate the list of projects for each year\n for(var index_i = 0; index_i < this.project_year_info.project_years.length; index_i++)\n {\n \n this.project_year_info.year_info.push(new Array());\n for(var index_j = 0; index_j < this.project_year_info.projects.length; index_j++)\n {\n // If the project has this particular year, then append the project index to year_info array\n if(this.project_year_info.projects[index_j][1].indexOf(this.project_year_info.project_years[index_i]) > -1)\n {\n this.project_year_info.year_info[index_i].push(index_j);\n }\n }\n }\n }\n }", "function rprtConflictedTaxon() {\n \tvar rcrdIds = [];\n for (var conflct in conflictedTaxaObj) {\n for (var role in conflictedTaxaObj[conflct]) { \t\t\t\t//console.log(\"\")\n for (var taxonName in conflictedTaxaObj[conflct][role]) { ///\tconsole.log(\"conflictedTaxaObj[conflct][role][taxonName] = %O\", conflictedTaxaObj[conflct][role][taxonName])\n if (Array.isArray(conflictedTaxaObj[conflct][role][taxonName])) {\n conflictedTaxaObj[conflct][role][taxonName] = rprtGenusConflicts(conflictedTaxaObj[conflct][role][taxonName])\n } else { rprtLevelConflicts(conflictedTaxaObj[conflct][role][taxonName]); }\n }\n }\n }\n entityObj.taxon.valRpt.shareUnqKeyWithConflictedData = conflictedTaxaObj; // console.log(\" conflicted taxa report obj = %O\", entityObj.taxon.valRpt.shareUnqKeyWithConflictedData);\n removeAffectedIntRcrds();\n\n function rprtGenusConflicts(conflictAry) {// console.log(\"-------------------rprtGenusConflicts called. ary = %O\", conflictAry)\n conflictAry = conflictAry.filter(onlyUnique);\n return replaceIdsWithRcrds(conflictAry, role); \n\n }\n function rprtLevelConflicts(taxaNameConflicts) {\n for (var parentName in taxaNameConflicts){\n taxaNameConflicts[parentName] = taxaNameConflicts[parentName].filter(onlyUnique);\n taxaNameConflicts[parentName] = replaceIdsWithRcrds(taxaNameConflicts[parentName], role);\n }\n }\n function replaceIdsWithRcrds(taxaIdAry, role) {\n var taxaObjs = role === \"subject\" ? batTaxaRefObj : objTaxaRefObj;\n return taxaIdAry.map(function(recrdId){ // console.log(\"taxaObj = %O, rcrd = %O\", taxaObjs[taxaNameMap[recrdId]], taxonRecrdObjsAry[recrdId]);\n rcrdIds.push(recrdId);\n return taxonRecrdObjsAry[recrdId];\n });\n }\n function removeAffectedIntRcrds() {\n \trcrdIds.forEach(function(id){ delete recrdsObj[id]; });\n }\n }", "getMutualFriendsBetweenFriendsOfMyFriendsAndFriendsOfDestinationFriends(myFriends, destFriends, myFriendsFriends, destFriendsFriends) {\n // if we found any link then return\n if (this.linksAreFound) {\n return;\n }\n\n let myFriendsCount = myFriends.length;\n let destFriendsCount = destFriends.length;\n let smallList = [];\n let bigList = [];\n let bigFriendsFriends = [];\n let smallCount = 0;\n let smallIsMyList = false;\n if (myFriendsCount < destFriendsCount) {\n smallList = myFriends;\n bigList = destFriends;\n smallCount = myFriendsCount;\n smallIsMyList = true;\n bigFriendsFriends = destFriendsFriends;\n }\n else {\n smallList = destFriends;\n bigList = myFriends;\n smallCount = destFriendsCount;\n bigFriendsFriends = myFriendsFriends;\n }\n\n let processedFriends = 0;\n let processedFriendsBigList = 0;\n let currentPartOfBigListProcessed = true;\n let stepByBigList = 5; //5 * 300 friends = 1500 friends\n let partOfBigList = [];\n let bigFriendsFriendsLength = this.getLengthOfArray(bigFriendsFriends);\n\n // 2 request per second\n let interval = setInterval(() => {\n if (this.maxIsReached) {\n clearInterval(interval);\n return;\n }\n\n if (currentPartOfBigListProcessed) {\n currentPartOfBigListProcessed = false;\n partOfBigList = this.getPartOfList(bigFriendsFriends, processedFriendsBigList, stepByBigList);\n processedFriends = 0;\n }\n\n let commandCode = this.getMutualCommandCode(smallList, processedFriends, this.step, partOfBigList);\n console.log('last chance');\n VK.api('execute', { code: commandCode }, (data) => {\n console.log(data);\n let response = data.response;\n\n let links = [];\n\n //go by small list\n for (name in response) {\n let friendId = name.substring(3, name.length);\n let commonFriends = response[name];\n if (commonFriends) {\n // go by big list\n commonFriends.forEach((element) => {\n if (element.common_count > 0) {\n console.log('common_count > 0');\n // go to common friends between my friends and dest' friends friends\n element.common_friends.forEach((friend) => {\n let destFriendFriend = this.getFriendsOfThisFriend(bigFriendsFriends, element.id);\n destFriendFriend.forEach((firstFriendOfDest) => {\n if (smallIsMyList) {\n links.push(new Array(this.viewer_id, friendId, friend, element.id, firstFriendOfDest, this.search_id));\n }\n else {\n links.push(new Array(this.viewer_id, firstFriendOfDest, element.id, friend, friendId, this.search_id));\n }\n });\n });\n }\n });\n }\n }\n\n if (links.length > 0) {\n this.linksAreFound = true;\n this.linksRenderer.addLinks(links);\n }\n });\n\n processedFriends += this.step;\n\n if (processedFriends >= smallCount) {\n currentPartOfBigListProcessed = false;\n processedFriendsBigList += stepByBigList;\n processedFriends = 0;\n }\n\n if (processedFriendsBigList >= bigFriendsFriendsLength) {\n clearInterval(interval);\n }\n }, 700);\n }", "static private internal function m121() {}", "updateData(data, unitType) {\n const mapped_foods = [\n \"Beef / buffalo\",\n \"Lamb / goat\",\n \"Pork\",\n \"Poultry (chicken, turkey, or any other bird meats)\", \n \"Fish (finfish)\", \n \"Crustaceans (e.g., shrimp, prawns, crabs, lobster)\", \n \"Mollusks (e.g., clams, oysters, squid, octopus)\", \n \"Butter\",\n \"Cheese\",\n \"Ice cream\", \n \"Cream\", \n \"Milk (cow's milk)\",\n \"Yogurt\", \n \"Eggs\",\n \"Potatoes\",\n \"Cassava / Other roots\", \n \"Soybean oil\", \n \"Palm oil\", \n \"Sunflower oil\",\n \"Rapeseed / canola oil\", \n \"Olive oil\", \n \"Beer\", \n \"Wine\", \n \"Coffee (Ground or whole bean)\", \n \"Sugar\" \n ];\n\n var final = [];\n // mapped_foods.forEach((food) => {\n // final.push({ food, count: 0 });\n // });\n\n // console.log(data);\n \n // console.log(foodElement);\n data.forEach((element) => {\n var elementCopy = Object.assign({}, element);\n // elementCopy = element;\n mapped_foods.forEach((foodElement) => {\n const units = element[\"What unit of weight do you prefer to answer with? This will be the unit of weight corresponding to the amount of food you purchase per week.\"];\n // console.log(element[foodElement]);\n // var convertedCount = element[foodElement[\"food\"]];\n if (units === \"Pounds (lbs)\") {\n // Units are in lbs but we want kgs\n if (unitType === \"kgs\") {\n elementCopy[foodElement] = element[foodElement] * 0.4536;\n }\n } else {\n // Units are in kgs but we want lbs\n if (unitType === \"lbs\") {\n elementCopy[foodElement] = element[foodElement] * 2.2046;\n } \n }\n });\n final.push(elementCopy);\n // element[foodElement] = element[foodElement].replace(/\\(.*\\)/, '');\n });\n \n // console.log(final[\"Pork\"]);\n return final;\n }", "function find_next (ctx)\r\n{\r\n for(var y = 0; y < 16; y++)\r\n {\r\n var next_array = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];\r\n console.log(current_array);\r\n // display current array\r\n for(var w = 0; w < current_array.length; w++)\r\n {\r\n if(current_array[w] == 1)\r\n {\r\n draw_box(ctx,x_str_pos + 10*w, y_str_pos + y*10);\r\n }\r\n }\r\n for(var x = 0; x < 32; x++)\r\n { \r\n // Third Version of code\r\n if( current_array[x] == 1 && current_array[x+2] == 0)\r\n {\r\n next_array[x+1] = 1;\r\n }\r\n if( current_array[x] == 0 && current_array[x+2] == 1)\r\n {\r\n next_array[x+1] = 1;\r\n }\r\n /*\r\n if( current_array[x] == 1) // 1??\r\n {\r\n // Second Version\r\n if(current_array[x+2] == 0) // 110\r\n {\r\n next_array[x+1] = 1;\r\n }\r\n \r\n // First Version\r\n // if(current_array[x+1] == 1) // 11?\r\n // {\r\n // // no need to check 111\r\n // if(current_array[x+2] == 0) // 110\r\n // {\r\n // next_array[x+1] = 1\r\n // }\r\n // }\r\n // else // 10?\r\n // {\r\n // // no need to check 101\r\n // if(current_array[x+2] == 0) // 100\r\n // {\r\n // next_array[x+1] = 1;\r\n // }\r\n // }\r\n }\r\n else // 0??\r\n {\r\n // Second version\r\n if(current_array[x+2] == 1) // 011\r\n {\r\n next_array[x+1] = 1;\r\n }\r\n \r\n // First Version\r\n // if(current_array[x+1] == 1) // 01?\r\n // {\r\n // if(current_array[x+2] == 1) // 011\r\n // {\r\n // next_array[x+1] = 1;\r\n // }\r\n // // no need to check 010\r\n // }\r\n // else // 00?\r\n // {\r\n // if(current_array[x+2] == 1) // 001\r\n // {\r\n // next_array[x+1] = 1;\r\n // }\r\n // // no need to check // 000\r\n // }\r\n \r\n }\r\n */\r\n }\r\n current_array = next_array;\r\n }\r\n}", "compareDNA(obj) { \n //identical variable is the number of duplicates per index of both this.dna and obj.dna arrays\n let identical = 0\n this.dna.forEach( (element, index) => element === obj.dna[index] ? identical++ : identical += 0)\n\n //percentage variable, of course finds the percentage of duplicates both arrays\n let percentage = Math.floor(identical / this.dna.length * 100)\n\n return `specimen #1 and specimen #2 have ${percentage}% DNA in common.`\n }", "function translate_obj( data ) {\n var table_data = {\"data\": []};\n for (var type_key in data) {\n var timestamp_data = data[type_key];\n\n for (var timestamp in timestamp_data) {\n var cmd_data = timestamp_data[timestamp];\n\n for (var cmd in cmd_data) {\n var status_data = cmd_data[cmd];\n console.log(page + \": parsing data from \\\"\" + type_key + \"-\" + timestamp + \"-\" + cmd + \"\\\"\");\n\n // getting all the status data sets\n additional_data = [];\n for (var status in status_data) {\n // adding code in each status object\n status_data[status][\"code\"] = status;\n // storing status into an array so that I can put it in dictionary later\n additional_data.push(status_data[status]);\n }\n\n // push into total data set\n data_set = {\"type\": type_key, \"cmd\": cmd, \"start_ts\": timestamp, \"status\": additional_data};\n table_data[\"data\"].push(data_set);\n }\n\n }\n }\n return table_data;\n}", "get_buffer(){\n while(this.current < this.means.length - 2){\n if(this.means[this.current].key == this.parent.year0 - this.parent.window+1){\n this.buffer.push(this.means[this.current])\n this.current = this.current+1\n }else{\n break\n }\n }\n this.buffer = this.buffer.filter(d => d.key < this.parent.year0+1)\n }", "function makeGen() {\n //The starting gen is igen\n // ilist1 is alist of the indices (i's in the comm lists) of the LHS objects\n n1=iList1.length;\n \n name2_money={}; // The total money affiliated with \"name2\"\n \n // The nodes and money transferred for each link \n name1_arr=[];\n name2_arr=[];\n money_arr=[];\n console.log(\"starting makeGen\");\n for (i=0; i < n1; i++) {\n i1=iList1[i];\n name1=comm_name[i1];\n tList=getAllIndexes(tran_id1,comm_id[iList1[i]]);\n moneyTot=0.;\n iStart=name1_arr.length; // The current value\n for (j=0; j<tList.length; j++ ) {\n id2=tran_id2[tList[j]];\n i2=i_comm_id[id2];\n name2=comm_name[i2];\n //if ((i<10) && (j<100)) console.log(j,tList[j],i2,id2,name2);\n money0=parseFloat(tran_amt[tList[j]]);\n if (includeLink(i1,name1,i2,name2,money0) == true) {\n // Provided we've made it this far...\n isNew=true;\n i1_test=getAllIndexes(name1_arr,name1);\n if (i1_test.length > 0) {\n for (k=0; k < i1_test.length; k++) {\n if (name2_arr[i1_test[k]] == name2) {\n i1_match=i1_test[k];\n isNew=false;\n }\n }\n }\n if (isNew == true) {\n name1_arr.push(name1); \n name2_arr.push(name2);\n money_arr.push(money0); // This is not the final value of the money, since the previous node only has a finite value\n } else {\n money_arr[i1_match]+=money0;\n }\n moneyTot+=money0;\n }\n }\n if (igen==0) {\n moneyList1[0]=moneyTot; \n totalAmt=moneyTot; // for the title\n for (k=0; k< money_arr.length; k++) {\n if (name2_arr[k] in name2_money) {\n name2_money[name2_arr[k]]+=money_arr[k];\n } else {\n name2_money[name2_arr[k]]=money_arr[k];\n }\n }\n find_top(name2_money);\n } else {\n for (k=iStart; k < money_arr.length; k++) {\n money_arr[k]=money_arr[k]*moneyList1[i]/moneyTot;\n }\n }\n } \n // Finally, update the nodes for the next time around.\n nodeList2=[];\n iList2=[];\n moneyList2=[];\n for (k=0; k < money_arr.length; k++) {\n name2=name2_arr[k];\n money2=money_arr[k];\n i2=i_comm_name[name2];\n if (name2 in nodeList2) {\n idx=nodeList2.indexOf(name2);\n moneyList2[idx]+=money2;\n } else {\n nodeList2.push(name2); \n moneyList2.push(money2);\n iList2.push(i2);\n }\n \n }\n}", "processResults (pixArray, res, colorVal, catVal, sizeVal, schemeVal, stop) {\n console.log(`hits: ${res.data.totalHits}`);\n console.log(res.data.totalHits < sizeVal * sizeVal && schemeVal !== 'Mono');\n\n\n let pix = res.data;\n for (let i = 0; i < (sizeVal * sizeVal); i++) {\n let randNum = Math.floor(Math.random() * pix.hits.length);\n if (pix.hits[randNum]) {\n pixArray.push(pix.hits[randNum]);\n pix.hits.splice(randNum, 1);\n } else {\n for (let j = 0; j < (sizeVal * sizeVal); j++) {\n pixArray.push(pix.hits[randNum]);\n }\n }\n }\n\n this.setState({\n pix: pixArray,\n size: sizeVal,\n });\n\n //if stop is false and there is resp data, check if total hits are lower than size value and do another request\n // to get more images\n if (!stop && res.data.totalHits) {\n if (res.data.totalHits < sizeVal * sizeVal && schemeVal !== 'Mono') {\n let colQuery = getScheme(colorVal, schemeVal);\n const colors = colQuery.split(\"+\");\n console.log(colors);\n console.log(`color array: ${colors}`);\n var plist = [];\n for (var i=0; i < colors.length; i++) {\n let color = colors[i];\n console.log(color);\n //create a list of promises to keep API requests from editing same data at same time\n var p = axios.get(`${base}${color}+${catVal}${page}&category=${catVal}${orientation}`);\n plist.push(p);\n }\n\n /* ***FUTURE BUG FIX:send something out to process results that can be a token to say hey make an array\n of this array with right # of objects*** */\n\n //Each API request gets data via 'res' and passes it along with other parameters to this.processResults,\n // and true sets flag to stop from running from line 81 again\n Promise.all(plist)\n .then((results) => {\n results.forEach((res) => {\n this.processResults(pixArray, res, colorVal, catVal, sizeVal, schemeVal, true);\n });\n })\n .catch((e) => {\n\n })\n }\n }\n }", "protected internal function m252() {}", "function gotData(data) {\n console.log('retrieveSong gotData');\n for (var i = 0; i < 5; i++) {\n var tempArray = [];\n lastKey[i] = Object.keys(data.val()[i]).length;\n console.log('retrieveSong gotData for1');\n for (var j = 0; j < 3; j++) {\n var randID = Math.floor(random(lastKey[i]));\n var resultURI = data.val()[i][randID][0];\n var randomFreq = Math.floor(random(10)) * 10;\n var tempArray2 = [];\n tempArray2.push(resultURI, randomFreq);\n tempArray.push(tempArray2);\n console.log('retrieveSong gotData for2');\n }\n foundSongs.push(tempArray);\n }\n // document.getElementById(\"spotifyPreviewB\").src = 'https://open.spotify.com/embed?uri=' + resultURI;\n}", "countPairsItrative(x) {\n let lastlist = Object.assign({}, this);\n let smalllistLength\n dummyList = Object.assign({}, this);\n let pairs = 0\n if (this.length < secondListlength) {\n smalllistLength = this.length\n } else {\n smalllistLength = secondListlength\n }\n for (let i = 0; i < smalllistLength; i++) {\n for (let j = 0; j < this.length; j++) {\n if (secondList.head.value + dummyList.head.value == x) {\n pairs++\n }\n if (dummyList.head.next) {\n dummyList.head = dummyList.head.next\n }\n };\n dummyList = {}\n dummyList = Object.assign({}, lastlist);\n secondList.head = secondList.head.next\n };\n console.log(pairs)\n }", "function organizingContainers(container) {\n result = POSSIBLE;\n let acumFila = 0;\n let acumColumna = 0;\n let terminar = false;\n while (result === POSSIBLE && terminar === false) {\n for (let f = 0; f < container.length; f++) {\n for (let c = 0; c < container[f].length; c++) {\n acumFila += container[f][c];\n acumColumna += container[c][f]\n }\n //console.log(acumFila);\n //console.log(acumColumna);\n if (acumFila != acumColumna) { result = IMPOSSIBLE }\n acumFila = 0;\n acumColumna = 0;\n }\n terminar = true;\n }\n\n return result;\n}", "function get_indexes() {\n var indexes = [];\n var width = inputObject.width;\n var depth = inputObject.depth;\n var dic_entries = [];\n var arch = inputObject.network_archeticture; // this should be able to get the network arch (i.e. the one you select)\n console.log('width is ', width)\n console.log('depth is ', depth)\n console.log('arch is ', arch)\n for (let i of width) {\n for (let j of depth) {\n if(arch == 'resnet'){\n for (let k of dic_ResNet_list) {\n console.log('k is ', k)\n if (k[0] == i && k[1] == j) {\n dic_entries.push(k);\n break;\n }\n }\n }\n else if (arch == 'DenseNet'){\n for (let k of dic_DenseNet_list) {\n if (k[0] == i && k[1] == j) {\n dic_entries.push(k);\n break;\n }\n }\n }\n if(arch == 'wrn'){\n for (let k of dic_wrn_list) {\n console.log('k is ', k)\n if (k[0] == i && k[1] == j) {\n dic_entries.push(k);\n break;\n }\n }\n }\n if(arch == 'vgg'){\n for (let k of dic_VGG_list) {\n console.log('k is ', k)\n if (k[0] == i && k[1] == j) {\n dic_entries.push(k);\n break;\n }\n }\n }\n\n }\n }\n if (inputObject.sort_by === 'width') {\n dic_entries.sort(cmp_width);\n } else if (inputObject.sort_by === 'depth') {\n dic_entries.sort(cmp_depth);\n } else if (inputObject.sort_by === 'param') {\n dic_entries.sort(cmp_param);\n }\n if (arch == 'resnet'){\n for (let i of dic_entries) {\n indexes.push(i[2]);\n }\n }\n else if (arch == 'DenseNet'){\n for (let i of dic_entries) {\n indexes.push(i[3]);\n }\n }\n else if (arch == 'wrn'){\n for (let i of dic_entries) {\n indexes.push(i[2]);\n }\n }\n else if (arch == 'vgg'){\n for (let i of dic_entries) {\n indexes.push(i[2]);\n }\n }\n\n console.log(\"dic entries:\", JSON.stringify(dic_entries));\n console.log(\"indexes:\", indexes);\n console.log('finish get_indexes')\n return indexes;\n}", "function replaceRelativeDates() {\n// console.log(\"replaceRelativeDates2()\");\n var marker;\n var markerID;\n var markerNames = [];\n \n for(let i=1; i<numberOfWeeks; i++) {\n marker = \"week\" + i + \"_mon\";\n replaceMarker(marker);\n\n marker = \"week\" + i + \"_tue\";\n replaceMarker(marker);\n\n marker = \"week\" + i + \"_wed\";\n replaceMarker(marker);\n\n marker = \"week\" + i + \"_thu\";\n replaceMarker(marker);\n\n marker = \"week\" + i + \"_fri\";\n replaceMarker(marker);\n\n marker = \"week\" + i + \"_sat\";\n replaceMarker(marker);\n\n marker = \"week\" + i + \"_sun\";\n replaceMarker(marker);\n }\n}", "function dataSplittor_Occ__03(parsed_data, occ_pid_1, avail_pid_1, occ_pid_2, avail_pid_2, occ_pid_all, avail_pid_all, mon_pid_all) {\n let x=0; let y=0; let z=0; \n\n for (let i = 1; i <= parsed_data.length; i++) {\n if (i <= 3) {\n occ_pid_all[x] = parsed_data[i-1].occ;\n avail_pid_all[x] = parsed_data[i-1].avail;\n mon_pid_all[x] = parsed_data[i-1].mon;\n\n x+=1\n }\n if ((i > 3) && (i <= 6)) {\n occ_pid_1[y] = parsed_data[i-1].occ;\n avail_pid_1[y] = parsed_data[i-1].avail;\n\n y+=1\n }\n if (i > 6) {\n occ_pid_2[z] = parsed_data[i-1].occ;\n avail_pid_2[z] = parsed_data[i-1].avail;\n\n z+=1\n }\n }\n delete (x,y,z);\n \n}", "function compare_for_insertions(str2, checksums2, checksums1) {\n var complete = false;\nvar pos = 0;\nvar Data = [];\nvar Pos = [];\nvar tempstr2 = str2;\nwhile (true) {\n if(checksums2.length == 0) {\n complete = true;\n }\n if(complete) {\n break;\n }\n if(checksums1[0] == checksums2[0]) {\n checksums1.shift();\n checksums2.shift();\n str2 = str2.substring(BLOCK_SIZE);\n pos = pos + BLOCK_SIZE;\n }\n else if(checksums2[0] != checksums1[0]) {\n var data = \"\";\n while(true) {\n if(checksums2.length == 0) {\n complete = true;\n break;\n }\n if(typeof(checksums1[0]) === \"undefined\") {\n data = str2.substring(0,BLOCK_SIZE);\n str2 = str2.substring(BLOCK_SIZE);\n Data.push(data);\n checksums2.shift();\n Pos.push(pos);\n pos = pos + BLOCK_SIZE;\n break;\n }\n else if(typeof(checksums1[0]) != \"undefined\" && checksums1[0] != checksums2[0]) {\n data = data + str2[0];\n str2 = str2.substring(1);\n checksums2 = get_rolling_checksums(str2);\n if(checksums2.length == 0) {\n Data.push(data);\n console.log(pos);\n Pos.push(pos);\n }\n }\n else if(checksums2[0] == checksums1[0]) {\n checksums1.shift();\n checksums2.shift();\n Data.push(data);\n Pos.push(pos);\n str2 = str2.substring(BLOCK_SIZE);\n pos = pos + data.length + BLOCK_SIZE;\n break;\n }\n else if(checksums2.length == 0) {\n Data.push(data);\n Pos.push(pos);\n complete = true;\n break;\n }\n }\n }\n}\nreturn Data+ \"SPLIT\"+ Pos;\n}", "function loop() {\n //( i = 0; i < data1.length - 4; i+=4 ) {\n\n debugger;\n\n if(i >= data1.length - 4) {\n debugger;\n clearInterval(process);\n return;\n }\n\n // Assume the first element is the smallest\n let jMin = i;\n \n // Comparisons\n for( j = i+4; j <= data1.length - 4; j+=4 ) {\n \n d1 = distance(data1[jMin], data1[jMin+1], data1[jMin+2]);\n d2 = distance(data1[j], data1[j+1], data1[j+2]);\n \n if(d2 < d1) {\n debugger;\n jMin = j;\n }\n }\n\n //Swap\n if (jMin !== i) {\n //Create copy so we don't lose the data\n let temp = [data1[i], data1[i+1], data1[i+2]];\n \n //swap first point with second.\n data1[i] = data1[jMin];\n data1[i+1] = data1[jMin+1];\n data1[i+2] = data1[jMin+2];\n\n //swap second point with original first point\n data1[jMin] = temp[0];\n data1[jMin+1] = temp[1];\n data1[jMin+2] = temp[2];\n\n }\n\n i += 4;\n ctx2.putImageData(imageData, 0, 0);\n }", "_fiterByWordCount() {\n let entitesCopy = [...this.state.entities];\n let filteredArray = [];\n let { pfa, cfa } = this.state;\n if(!pfa && !cfa) {\n filteredArray = entitesCopy;\n } else {\n let secondFilterArray = [];\n entitesCopy.forEach( entrie => {\n let titleLength = entrie.title.split(' ').length;\n if(cfa && titleLength > 5) {\n secondFilterArray.push(entrie);\n } else if(pfa && titleLength <= 5) {\n secondFilterArray.push(entrie);\n }\n });\n filteredArray = this._fiterByPoitsOrComm( cfa, secondFilterArray );\n };\n return filteredArray;\n }", "function proceed (content) {\n const arr = content.split('\\n').map(v => v.split(' '))\n const result = []\n\n arr.forEach((v, i) => {\n if (v.length === 1 && +v[0] !== 0) { //means it's Z\n result.push(arr.slice(i + 1, ((i + 1) + (+v[0]))))\n }\n })\n\n const newResult = result.map(v => {\n if (Array.isArray(v)) return v.toString()\n })\n const superNewResult = newResult.filter(v => v.length > 0)\n // const profit = getProfit(10, superNewResult)\n superNewResult.forEach(v => getProfit(v)) //I've fucked loose Z and have no time to fix it\n}", "function findMatch(){\n\n//function to get manager changes\ngetManager();\n\n//function to get department changes\ngetDept();\n\n//function to get manager/department changes\ngetBoth();\n\n//log arrays returned\n//gs.log(\"uniqueMgr = \" + uniqueMgr);\n//gs.log(\"uniqueDept = \" + uniqueDept);\n//gs.log(\"uniqueBoth = \" + uniqueBoth);\n\n\n//remove all users in uniqueBoth array from uniqueMgr array\nfor(i=0; i<uniqueMgr.length;i++){\n\tvar tf = arrayUtil.contains(uniqueBoth,uniqueMgr[i]);\n\t//gs.log(\"tf = \" + tf);\n\t//gs.log(\"uniqueBoth[i]=\" + uniqueBoth[i]);\n\tif(tf==false){\n\t\tremMgr.push(uniqueMgr[i]);\n\t\t//gs.log(\"did it push?\");\n\t}\n}\n\n//gs.log(\"remMgr = \" + remMgr);\n\n//remove all users in uniqueBoth array from uniqueDept array\nfor(i=0; i<uniqueDept.length;i++){\n\tvar tf = arrayUtil.contains(uniqueBoth,uniqueDept[i]);\n\t//gs.log(\"tf = \" + tf);\n\t//gs.log(\"uniqueBoth[i]=\" + uniqueBoth[i]);\n\tif(tf==false){\n\t\tremDept.push(uniqueDept[i]);\n\t\t//gs.log(\"did it push?\");\n\t}\n}\n\n\n\n//gs.log(\"remDept = \" + remDept);\n\n\n//get sys_id from user table \n//create catalog item for each user to audit\n//create catalog task for item in workflow - have it query department table and get all records\n//and put into the description\n\n//createItems(remMgr,mgrSysID,mgrOnly);\n\ncreateItems(remDept,deptSysID,deptOnly);\n\n}", "onGetPlayersData() {\n this.socket.on('GET_PLAYERS_DATA', (playerList) => {\n playerList.forEach((player) => {\n player.cellList.forEach((cell) => {\n let sprite = this.children.find(child => child.id === cell.id);\n if (sprite === undefined) {\n console.log(cell);\n sprite = new CellSprite(cell);\n this.addChild(sprite);\n }\n sprite.updatePos(cell.pos);\n sprite.updateCell(cell); // update size\n sprite.flag = true;\n });\n if (player.id === this.id) {\n const mx = player.cellList.reduce((acc, cell) => acc + (cell.pos.x * cell.mass), 0);\n const my = player.cellList.reduce((acc, cell) => acc + (cell.pos.y * cell.mass), 0);\n const m = player.cellList.reduce((acc, cell) => acc + cell.mass, 0);\n this.centroid.set(mx / m, my / m);\n this.updateCamera(this.centroid);\n }\n });\n\n const arr = [];\n // Store index of child which does not update in this round into arr.\n for (let i = 0; i < this.children.length; i += 1) {\n if (this.children[i].flag === false) {\n arr.push(i);\n }\n this.children[i].flag = false; // reset\n }\n // Remove child accordingly.\n arr.reverse().forEach((i) => {\n this.removeChildAt(i);\n });\n });\n }", "function metropolisNextIteration(){\n \tmetropolisJump();\n \tredraw();\n }", "examine_possibles(count) {\n let updates = 0;\n //Loop through diagonally (hitting all rows/columns in n iterations)\n for (var i = 0; i < this.size; i++) {\n let node = this.nodes[i * (this.size + 1)];\n updates += this.calculate_frequencies(node, 0, count); //Row\n updates += this.calculate_frequencies(node, 1, count); //Col\n }\n\n let inc = Math.sqrt(this.size);\n\n //Loop through top left of all sub_squares\n for (var y = 0; y < this.size; y += inc) {\n for (var x = 0; x < this.size; x += inc) {\n updates += this.calculate_frequencies(this.nodes[x_y_to_index(x, y, this.size)], 2, count); //Sqr\n }\n }\n\n return updates;\n }", "assignElementIndices() {\n // Analytics: Assign numeric index to each episode.\n let elementIndex = 0;\n\n // Reserve first elementIndex to the elevated episode, if one exists.\n if (this.elevated && this.elevated.episode) {\n this.elevated.episode.elementIndex = elementIndex++;\n }\n\n if (this.series && this.series.seasons) {\n this.series.seasons\n .filter(season => season.episodes)\n .forEach((season) => {\n season.episodes\n .forEach((episode) => episode.elementIndex = elementIndex++);\n });\n }\n }", "lookupAndMarkFound() {\n let m=0;\n for (let n=1; n<=N; n++) {\n for (let i=0;i<N; i++) {\n let fr = this.findInRow(n,i);\n if (fr.length == 1) {\n this.markAndRemove(n,fr[0].i, fr[0].j);\n m++;\n }\n let fc = this.findInColumn(n,i);\n if (fc.length == 1) {\n this.markAndRemove(n,fc[0].i, fc[0].j);\n m++;\n }\n let fb = this.findInBlock(n,i);\n if (fb.length == 1) {\n this.markAndRemove(n,fb[0].i, fb[0].j);\n m++;\n }\n }\n }\n return m;\n }" ]
[ "0.52356696", "0.5107719", "0.5054479", "0.5040774", "0.49819672", "0.49806416", "0.49708715", "0.49524462", "0.49427602", "0.49246532", "0.49150208", "0.48983902", "0.48669282", "0.48460576", "0.4840135", "0.48325846", "0.47954804", "0.47863492", "0.47842684", "0.4769622", "0.47687718", "0.4768767", "0.4767435", "0.4763242", "0.47502735", "0.47434914", "0.4738959", "0.473845", "0.47375727", "0.47342008", "0.47333923", "0.47331294", "0.47254333", "0.4724328", "0.47233716", "0.47219673", "0.47109735", "0.47065488", "0.46995255", "0.46920484", "0.46907783", "0.4684366", "0.4680669", "0.46776852", "0.46774843", "0.46692497", "0.46662876", "0.4661459", "0.46591705", "0.46559182", "0.46473584", "0.46451584", "0.46441585", "0.46433845", "0.46410614", "0.46392804", "0.4632342", "0.4626106", "0.46247345", "0.46238688", "0.46200332", "0.4616531", "0.46139628", "0.46104252", "0.46034965", "0.4601703", "0.46015087", "0.4601496", "0.46014616", "0.46001896", "0.45994908", "0.4599115", "0.4598632", "0.4597153", "0.45941576", "0.45924738", "0.459064", "0.45903862", "0.4587933", "0.4587708", "0.4586837", "0.4586587", "0.45842585", "0.45818606", "0.45799053", "0.45763543", "0.457578", "0.4575751", "0.4575457", "0.45750168", "0.4574737", "0.45661896", "0.45647416", "0.45580092", "0.4555791", "0.45532954", "0.45528275", "0.45518252", "0.4551128", "0.45486134", "0.4546898" ]
0.0
-1
TODO: merge in a single function detect supported CSS property
function detectTransformProperty() { var transformProperty = 'transform', safariPropertyHack = 'webkitTransform'; if (typeof document.body.style[transformProperty] !== 'undefined') { ['webkit', 'moz', 'o', 'ms'].every(function (prefix) { var e = '-' + prefix + '-transform'; if (typeof document.body.style[e] !== 'undefined') { transformProperty = e; return false; } return true; }); } else if (typeof document.body.style[safariPropertyHack] !== 'undefined') { transformProperty = '-webkit-transform'; } else { transformProperty = undefined; } return transformProperty; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getsupportedprop(proparray){\n var root=document.documentElement //reference root element of document\n for (var i=0; i<proparray.length; i++){ //loop through possible properties\n if (proparray[i] in root.style){ //if property exists on element (value will be string, empty string if not set)\n return proparray[i] //return that string\n }\n }\n}", "function supportsProperty(props) {\n for (var i in props) {\n if (p.guineapig.style[props[i]] !== undefined) { return true; }\n }\n return false;\n } // Thanks modernizr!", "function supportsCssCustomProperties() {\n var globalObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;\n\n if ('CSS' in globalObj) {\n return globalObj.CSS.supports('(--color: red)');\n }\n return false;\n}", "function supportsCssCustomProperties() {\n var globalObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;\n\n if ('CSS' in globalObj) {\n return globalObj.CSS.supports('(--color: red)');\n }\n return false;\n}", "function supportsCssCustomProperties() {\n var globalObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;\n\n if ('CSS' in globalObj) {\n return globalObj.CSS.supports('(--color: red)');\n }\n return false;\n}", "isSupported() {\n const isSupported = CSS.supports(\"--custom-properties\", \"custom\");\n if (!isSupported && this.debug) {\n console.warn(\"Your browser does not support custom CSS properties.\");\n }\n return isSupported;\n }", "function supportsCssCustomProperties(globalObj = window) {\n if ('CSS' in globalObj) {\n return globalObj.CSS.supports('(--color: red)');\n }\n return false;\n}", "function supportsCssCustomProperties(globalObj = window) {\n if ('CSS' in globalObj) {\n return globalObj.CSS.supports('(--color: red)');\n }\n return false;\n}", "function supportsCssCustomProperties(globalObj) {\n if (globalObj === void 0) { globalObj = window; }\n if (\"CSS\" in globalObj) {\n return globalObj.CSS.supports(\"(--color: red)\");\n }\n return false;\n}", "function cssprop(name, el){\n var supported = false,\n capitalized = name.charAt(0).toUpperCase() + name.slice(1),\n length = VENDOR_PREFIXES.length,\n style = el.style;\n\n if(typeof style[name] == \"string\"){\n supported = true;\n }else{\n while(length--){\n if(typeof style[VENDOR_PREFIXES[length] + capitalized] == \"string\"){\n supported = true;\n break;\n }\n }\n }\n return supported;\n }", "function isCSS(prop){\t\n\t\treturn (('isTransition name duration loop ease delay fillMode useAll percent transform useShortHand useHacks transformOrigin direction animationTimingFunction animationPlayState play animationIterationCount backfaceVisibility filter').indexOf(prop) === -1);\n\t}", "function setBrowserSpecificProperty(prop) {\n var style = document.body.style; // No reason for this particular tag, just want the style\n var prefixes = ['Webkit', 'Moz', 'O', 'ms', 'Khtml'];\n var ucProp = prop.charAt(0).toUpperCase() + prop.substr(1);\n var props = prefixes.map(function(prefix){return prefix + ucProp;}).concat(prop);\n\n for (var i in props) {\n if (style[props[i]] !== undefined) {\n return props[i];\n }\n }\n }", "function Util() {\n\n // retain scope\n var self = this;\n\n /**\n * Check if this browser supports a CSS property.\n *\n * Adapted from <https://gist.github.com/jackfuchs/556448>\n *\n * @author JohnG <john.gieselmann@gmail.com>\n *\n * @param str p The property name.\n *\n * @return bool Whether or not the property is supported\n */\n this.supportsCssProp = function(prop) {\n\n // get a testable element and the style attribute\n var b = document.body || document.documentElement;\n var s = b.style;\n\n // No css support detected\n if (typeof s === \"undefined\") {\n return false;\n }\n\n // Tests for standard prop\n if (typeof s[prop] === \"string\") {\n return true;\n }\n\n // Tests for vendor specific prop\n var v = [\"Moz\", \"Webkit\", \"Khtml\", \"O\", \"ms\", \"Icab\"];\n prop = prop.charAt(0).toUpperCase() + prop.substr(1);\n\n for (var i = 0; i < v.length; i++) {\n if (typeof s[v[i] + prop] === \"string\") { \n return true;\n }\n }\n\n // no support found\n return false;\n };\n\n /**\n * Test for IE browsers.\n * @var bool ieTouch\n * @var bool ie10\n */\n this.ieTouch = /MSIE.*Touch/.test(navigator.userAgent);\n this.ie10 = /MSIE 10/.test(navigator.userAgent);\n\n /**\n * Test whether or not this is a touch event compatible device.\n * @var bool touch\n */\n this.touch = /Android|BlackBerry|iPad|iPhone|iPod|Opera Mini/\n .test(navigator.userAgent) || self.ieTouch;\n\n }", "function detectTransformProperty() {\n var transformProperty = 'transform',\n safariPropertyHack = 'webkitTransform';\n if (typeof document.body.style[transformProperty] !== 'undefined') {\n\n ['webkit', 'moz', 'o', 'ms'].every(function (prefix) {\n var e = '-' + prefix + '-transform';\n if (typeof document.body.style[e] !== 'undefined') {\n transformProperty = e;\n return false;\n }\n return true;\n });\n } else if (typeof document.body.style[safariPropertyHack] !== 'undefined') {\n transformProperty = '-webkit-transform';\n } else {\n transformProperty = undefined;\n }\n return transformProperty;\n }", "function cssProperty(p, rp) {\n var b = document.body || document.documentElement,\n s = b.style;\n if (typeof s == 'undefined') { return false; }\n if (typeof s[p] == 'string') { return rp ? p : true; }\n var v = ['Moz', 'Webkit', 'Khtml', 'O', 'ms', 'Icab'],\n p = p.charAt(0).toUpperCase() + p.substr(1);\n for (var i = 0; i < v.length; i++) {\n if (typeof s[v[i] + p] == 'string') { return rp ? (v[i] + p) : true; }\n }\n return false;\n }", "function test_props_all( prop, callback ) {\n var uc_prop = prop.charAt(0).toUpperCase() + prop.substr(1),\n \n // following spec is to expose vendor-specific style properties as:\n // elem.style.WebkitBorderRadius\n // and the following would be incorrect:\n // elem.style.webkitBorderRadius\n // Webkit and Mozilla are nice enough to ghost their properties in the lowercase\n // version but Opera does not.\n \n // see more here: http://github.com/Modernizr/Modernizr/issues/issue/21\n props = [\n prop,\n 'Webkit' + uc_prop,\n 'Moz' + uc_prop,\n 'O' + uc_prop,\n 'ms' + uc_prop,\n 'Khtml' + uc_prop\n ];\n\n return !!test_props( props, callback );\n }", "function testProp(props) {\n var style = document.documentElement.style;\n\n for (var i = 0; i < props.length; i++) {\n if (props[i] in style) {\n return props[i];\n }\n }\n\n return false;\n } // @function setTransform(el: HTMLElement, offset: Point, scale?: Number)", "function objCss(o, p, v) {\r\n if (o == null) return null;\r\n if (v != null) o.style[p] = v;\r\n\r\n // Check the inline style first.\r\n var s = o.style[p];\r\n if (s != '' && s != null) {\r\n return s;\r\n }\r\n\r\n // Check MSIE's currentStyle property.\r\n if(o.currentStyle) {\r\n var s = o.currentStyle[p];\r\n if (s != '' && s != null) {\r\n return s;\r\n }\r\n }\r\n\r\n var slctrs = [\"id\", \"class\"];\r\n // Do it the hard way using styleSheets.\r\n for (var i = 0; i < slctrs.length; i++) {\r\n if (!objAtt(o, slctrs[i])) continue;\r\n s = probeCss(objAtt(o, slctrs[i]), p, slctrs[i]);\r\n if(s != '' && s != null) {\r\n return s;\r\n }\r\n }\r\n return null;\r\n\r\n // probeCss ---------------------------------------------------------------\r\n //\r\n // Return the css property p for selector s.\r\n //\r\n // s ... a selector string\r\n // p ... a css property name\r\n // t ... a css selector type (i.e, class, id or tag)\r\n function probeCss(s, p, t) {\r\n if (!s || !p || !document.styleSheets) return null;\r\n if (t == \"class\") s = '.' + s;\r\n if (t == \"id\") s = '#' + s;\r\n\r\n var css = document.styleSheets;\r\n if (css.length > 0) {\r\n // Check each style sheet.\r\n for (var i = 0; i < css.length; i++) {\r\n var rules;\r\n if (css[i].cssRules) {\r\n rules = css[i].cssRules;\r\n } else if (css[i].rules) {\r\n rules = css[i].rules;\r\n } else {\r\n return null;\r\n }\r\n\r\n if (rules.length > 0) {\r\n // Check each rule.\r\n for (var j = 0; j < rules.length; j++) {\r\n var st = rules[j].style;\r\n if (st[p] != '' && st[p] != null &&\r\n rules[j].selectorText == s) {\r\n return st[p];\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return null;\r\n }\r\n}", "function computeStyle(el, property) {\n var computedStyle, val = false\n if(document.getElementById(el) && window.getComputedStyle) {\n var element = document.getElementById(el);\n var computedStyle = window.getComputedStyle(element);\n val = computedStyle.getPropertyValue(property);\n }\n else if(document.getElementsByClassName(el)[0] && window.getComputedStyle) {\n var element = document.getElementsByClassName(el)[0];\n var computedStyle = window.getComputedStyle(element);\n val = computedStyle.getPropertyValue(property);\n }\n else if(document.getElementById(el) && el.currentStyle) {\n property = hyphen2camel(property);\n val = el.currentStyle(property)\n }\n else if(document.getElementsByClassName(el)[0] && el.currentStyle) {\n property = hyphen2camel(property);\n val = el.currentStyle(property)\n }\n return val;\n }", "function isValidCSSProperty(element, property) {\n if (typeof element.style[property] != \"undefined\") {\n return true;\n }\n \n return false;\n }", "function checkCssSupported() {\n // First, check if the 'perspective' CSS property or a vendor-prefixed\n // variant is available.\n var perspectiveProperty = prefixProperty('perspective');\n var el = document.createElement('div');\n var supported = typeof el.style[perspectiveProperty] !== 'undefined';\n\n // Certain versions of Chrome disable 3D transforms even though the CSS\n // property exists. In those cases, we use the following media query,\n // which only succeeds if the feature is indeed enabled.\n if (supported && perspectiveProperty === 'WebkitPerspective') {\n var id = '__marzipano_test_css3d_support__';\n var st = document.createElement('style');\n st.textContent = '@media(-webkit-transform-3d){#' + id + '{height: 3px;})';\n document.getElementsByTagName('head')[0].appendChild(st);\n el.id = id;\n document.body.appendChild(el);\n // The offsetHeight seems to be different than 3 at some zoom levels on\n // Chrome (and maybe other browsers). Test for > 0 instead.\n supported = el.offsetHeight > 0;\n st.parentNode.removeChild(st);\n el.parentNode.removeChild(el);\n }\n\n return supported;\n}", "function supportsCssVariables(windowObj) {\n var supportsFunctionPresent = windowObj.CSS && typeof windowObj.CSS.supports === 'function';\n if (!supportsFunctionPresent) {\n return;\n }\n\n var explicitlySupportsCssVars = windowObj.CSS.supports('--css-vars', 'yes');\n // See: https://bugs.webkit.org/show_bug.cgi?id=154669\n // See: README section on Safari\n var weAreFeatureDetectingSafari10plus = windowObj.CSS.supports('(--css-vars: yes)') && windowObj.CSS.supports('color', '#00000000');\n return explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus;\n}", "getStyleComputedProperty(element, property) {\n if (element.nodeType !== 1) {\n return [];\n }\n // NOTE: 1 DOM access here\n const window = element.ownerDocument.defaultView;\n // tslint:disable-next-line\n const css = window.getComputedStyle(element, null);\n return property ? css[property] : css;\n }", "function detectCSSFeature(featureName) {\n\t'use strict';\n\n\tvar feature = false,\n\t\tdomPrefixes = 'Moz ms Webkit'.split(' '),\n\t\telm = document.createElement('div'),\n\t\tfeatureNameCapital = null;\n\n\tfeatureName = featureName.toLowerCase();\n\tif (elm.style[featureName] !== undefined) {\n\t\tfeature = true;\n\t}\n\tif (feature === false) {\n\t\tfeatureNameCapital = featureName.charAt(0).toUpperCase() + featureName.substr(1);\n\t\tfor (var i = 0; i < domPrefixes.length; i++) {\n\t\t\tif (elm.style[domPrefixes[i] + featureNameCapital] !== undefined) {\n\t\t\t\tfeature = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn feature;\n}", "css(cssProperty, value) {\n if (arguments.length > 1) {\n /******************************************\n * If deal with a list of elements * \n * eg. select elements by class attribute *\n * then loop through all element and *\n * setting css style for each selected element *\n * */\n if (this.isNodeList) {\n // chrome has problem with for..of loop! => [Symbol.iterator] is not a function\n //for (const elem of this.self) {\n // console.log(elem);\n // this.setStyle(elem, cssProperty, value); \n //}\n for (let i =0; i < this.self.length; i++) {\n console.log(this.self[i]);\n this.setStyle(this.self[i], cssProperty, value);\n }\n }else {\n this.setStyle(this.self, cssProperty, value);\n }\n }else {\n /**\n * retrieving value of the property\n * Add a type check for the property provided => String\n * */\n if (typeof cssProperty != \"string\") throw TypeError('Not a string');\n if (this.isNodeList) {\n /**\n * return first selected element's style\n */\n for (let i =0; i < this.self.length; i++) {\n console.log(this.self[i]);\n return window.getComputedStyle(this.self[i]).getPropertyValue(cssProperty); \n }\n }else {\n }\n return window.getComputedStyle(this.self).getPropertyValue(cssProperty);\n \n }\n }", "function get_css_prop(selector, prop, fatal)\n {\n\tvar pat = selector + \".*\" + prop + \" *: *([^;]*) *;\";\n\tvar re = new RegExp(pat, 'g');\n\tvar m = get_style().match(re);\n\tassert(m || !fatal, \"get_css_prop(\" + selector + \", \" + prop + \") failed\");\n\tif (!m)\n\t return null;\n\treturn m[m.length - 1].replace(re, '$1');\n }", "function getCss(propertyInfo, value) {\n var rules = void 0;\n\n // Protect against unexpected values\n var valueType = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n if (valueType !== 'string' && valueType !== 'number') {\n if (true) {\n var name = propertyInfo.jsName;\n var encodedValue = JSON.stringify(value);\n console.error('\\uD83D\\uDCE6 ui-box: property \\u201C' + name + '\\u201D was passed invalid value \\u201C' + encodedValue + '\\u201D. Only numbers and strings are supported.');\n }\n return null;\n }\n\n var valueString = (0, _valueToString2.default)(value, propertyInfo.defaultUnit);\n\n var className = (0, _getClassName2.default)(propertyInfo, valueString);\n\n // Avoid running the prefixer when possible because it's slow\n if (propertyInfo.isPrefixed) {\n rules = (0, _prefixer2.default)(propertyInfo.jsName, valueString);\n } else {\n rules = [{ property: propertyInfo.cssName, value: valueString }];\n }\n\n var styles = void 0;\n if (false) { var rulesString; } else {\n var _rulesString = rules.map(function (rule) {\n return ' ' + rule.property + ': ' + rule.value + ';';\n }).join('\\n');\n styles = '\\n.' + className + ' {\\n' + _rulesString + '\\n}';\n }\n\n return { className: className, styles: styles };\n}", "function getCss(propertyInfo, value) {\n var rules = void 0;\n\n // Protect against unexpected values\n var valueType = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n if (valueType !== 'string' && valueType !== 'number') {\n if (true) {\n var name = propertyInfo.jsName;\n var encodedValue = JSON.stringify(value);\n console.error('\\uD83D\\uDCE6 ui-box: property \\u201C' + name + '\\u201D was passed invalid value \\u201C' + encodedValue + '\\u201D. Only numbers and strings are supported.');\n }\n return null;\n }\n\n var valueString = (0, _valueToString2.default)(value, propertyInfo.defaultUnit);\n\n var className = (0, _getClassName2.default)(propertyInfo, valueString);\n\n // Avoid running the prefixer when possible because it's slow\n if (propertyInfo.isPrefixed) {\n rules = (0, _prefixer2.default)(propertyInfo.jsName, valueString);\n } else {\n rules = [{ property: propertyInfo.cssName, value: valueString }];\n }\n\n var styles = void 0;\n if (false) { var rulesString; } else {\n var _rulesString = rules.map(function (rule) {\n return ' ' + rule.property + ': ' + rule.value + ';';\n }).join('\\n');\n styles = '\\n.' + className + ' {\\n' + _rulesString + '\\n}';\n }\n\n return { className: className, styles: styles };\n}", "function getCssProp(elem, prop) {\r\n return window.getComputedStyle(elem, null).getPropertyValue(prop);\r\n}", "function isCssCustomProperty(name) {\n return name.startsWith('--');\n}", "function isCssCustomProperty(name) {\n return name.startsWith('--');\n}", "function detectCSSFeature(featurename) {\n\n\tvar feature = false,\n\tdomPrefixes = 'Webkit Moz ms O'.split(' '),\n\telm = document.createElement('div'),\n\tfeaturenameCapital = null;\n\n\tfeaturename = featurename.toLowerCase();\n\n\tif( elm.style[featurename] !== undefined ) { feature = true; }\n\n\tif( feature === false ) {\n\t featurenameCapital = featurename.charAt(0).toUpperCase() + featurename.substr(1);\n\t for( var i = 0; i < domPrefixes.length; i++ ) {\n\t if( elm.style[domPrefixes[i] + featurenameCapital ] !== undefined ) {\n\t feature = true;\n\t break;\n\t }\n\t }\n\t}\n\treturn feature;\n}", "function checkCSSsupport(){\n\t\tvar isSupported = true;\n\t\n\t\t\tswitch(testNumber){\n\t\t\t\tcase 0:\n\t\t\t\tif (typeof document.body.style.boxShadow == \"undefined\" && typeof document.body.style.WebkitBoxShadow == \"undefined\")\n\t\t\t\t\tisSupported = false;\n\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tif (typeof document.body.style.borderRadius == \"undefined\" && typeof document.body.style.WebkitBorderRadius == \"undefined\")\n\t\t\t\t\t\tisSupported = false;\n\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tif ((typeof document.body.style.boxShadow == \"undefined\" && typeof document.body.style.WebkitBoxShadow == \"undefined\") || (typeof document.body.style.borderRadius == \"undefined\" && typeof document.body.style.WebkitBorderRadius == \"undefined\"))\n\t\t\t\t\t\tisSupported = false;\n\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tif (typeof document.body.style.opacity == \"undefined\")\n\t\t\t\t\t\tisSupported = false;\n\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tif (typeof document.body.style.visibility == \"undefined\")\n\t\t\t\t\t\tisSupported = false;\n\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tif (typeof document.body.style.width == \"undefined\" || typeof document.body.style.height == \"undefined\")\n\t\t\t\t\t\tisSupported = false;\n\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\tif (typeof document.body.style.overflow == \"undefined\")\n\t\t\t\t\t\tisSupported = false;\n\t\t\t\tbreak;\n\t\t\n\t\t\t\tcase 7:\n\t\t\t\tvar elem = document.createElement('canvas');\n\t\t\t\tif (!(elem.getContext && elem.getContext('2d')))\n\t\t\t\t\tisSupported = false;\n\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t\tvar elem = document.createElement('canvas');\n\t\t\t\t\tif (!(elem.getContext && elem.getContext('2d')))\n\t\t\t\t\t\tisSupported = false;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\n\t\t\t\tcase 9:\n\t\t\t\tif (typeof document.body.style.transform == \"undefined\" && typeof document.body.style.webkitTransform == \"undefined\")\n\t\t\t\t\tisSupported = false;\n\t\t\t\tbreak;\n\t\t\t\tcase 10:\n\t\t\t\t\tif (typeof document.body.style.transform == \"undefined\" && typeof document.body.style.webkitTransform == \"undefined\")\n\t\t\t\t\t\tisSupported = false;\n\t\t\t\tbreak;\n\t\t\t\tcase 11:\n\t\t\t\t\tif (typeof document.body.style.transform == \"undefined\" && typeof document.body.style.webkitTransform == \"undefined\")\n\t\t\t\t\t\tisSupported = false;\n\t\t\t\tbreak;\n\t\t\t\tcase 12:\n\t\t\t\t\tif (typeof document.body.style.transform == \"undefined\" && typeof document.body.style.webkitTransform == \"undefined\")\n\t\t\t\t\t\tisSupported = false;\n\t\t\t\tbreak;\n\t\t\t\tcase 13:\n\t\t\t\t\tif (typeof document.body.style.transition == \"undefined\" && typeof document.body.style.webkitTransition == \"undefined\")\n\t\t\t\t\t\tisSupported = false;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\n\t\t\t\tcase 14:\n\t\t\t\tif ((typeof document.body.style.animationName == \"undefined\" && typeof document.body.style.webkitAnimationName == \"undefined\")|| typeof document.body.style.position == \"undefined\")\n\t\t\t\t\tisSupported = false;\n\t\t\t\tbreak;\n\t\t\t\tcase 15:\n\t\t\t\t\tif ((typeof document.body.style.animationName == \"undefined\" && typeof document.body.style.webkitAnimationName == \"undefined\")|| typeof document.body.style.position == \"undefined\")\n\t\t\t\t\t\tisSupported = false;\n\t\t\t\tbreak;\n\t\t\t\tcase 16:\n\t\t\t\t\tif ((typeof document.body.style.animationName == \"undefined\" && typeof document.body.style.webkitAnimationName == \"undefined\") || typeof document.body.style.position == \"undefined\" || (typeof window.requestAnimationFrame == \"undefined\" && typeof window.webkitRequestAnimationFrame == \"undefined\"))\n\t\t\t\t\t\tisSupported = false;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn isSupported;\n\t\t\t\n\t}", "function isCssProp( path ) {\n\tconst parent = path.getParentNode();\n\tconst parentParent = path.getParentNode( 1 );\n\treturn parentParent && parent.type === 'JSXExpressionContainer' && parentParent.type === 'JSXAttribute' && parentParent.name.type === 'JSXIdentifier' && parentParent.name.name === 'css';\n}", "function computedStyle(el, prop, getComputedStyle, style) {\n getComputedStyle = window.getComputedStyle;\n style =\n // If we have getComputedStyle\n getComputedStyle ?\n // Query it\n // TODO: From CSS-Query notes, we might need (node, null) for FF\n getComputedStyle(el) :\n\n // Otherwise, we are in IE and use currentStyle\n el.currentStyle;\n if (style) {\n return style\n [\n // Switch to camelCase for CSSOM\n // DEV: Grabbed from jQuery\n // https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194\n // https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597\n prop.replace(/-(\\w)/gi, function (word, letter) {\n return letter.toUpperCase();\n })\n ];\n }\n}", "function isCssProp(path) {\n const parent = path.getParentNode();\n const parentParent = path.getParentNode(1);\n return parentParent && parent.type === \"JSXExpressionContainer\" && parentParent.type === \"JSXAttribute\" && parentParent.name.type === \"JSXIdentifier\" && parentParent.name.name === \"css\";\n}", "function test_props_all( prop, callback ) {\n var uc_prop = prop.charAt(0).toUpperCase() + prop.substr(1),\n props = [\n prop,\n 'Webkit' + uc_prop,\n 'Moz' + uc_prop,\n 'O' + uc_prop,\n 'ms' + uc_prop\n ];\n\n return !!test_props( props, callback );\n}", "function css(el, props) {\n var key, pkey;\n for (key in props) {\n if (props.hasOwnProperty(key)) {\n pkey = setBrowserSpecificProperty(key);\n if (pkey != null) {\n el.style[pkey] = props[key];\n }\n }\n }\n return el;\n }", "function PropertyDetection() {}", "function isStyleSupported(array){\n\t\tvar p,s,fake = document.createElement('div'),list = array;\n\t\tfor(p in list){\n\t\t\ts = list[p]; \n\t\t\tif(typeof fake.style[s] !== 'undefined'){\n\t\t\t\tfake = null;\n\t\t\t\treturn [s,p];\n\t\t\t}\n\t\t}\n\t\treturn [false];\n\t}", "function cs(element, csspropname, pseudoElt) {\n\tvar s = window.getComputedStyle(element, pseudoElt);\n\t\n\t// return s[csspropname]; // This cannot get custom property like '--floatbar-corner'.\n\t\n\treturn s.getPropertyValue(csspropname); // This can get custom property.\n\t\n\t// Hint: To get a value from :root{...}, use cs(document.documentElement, \"--floatbar-corner\")\n}", "function IntObject_UpdateCSSStyleProperty()\n{\n\t//has fixed property?\n\tif (this.StyleProperties && this.StyleProperties.FixedPosition)\n\t{\n\t\t//unregister this as a fixed object\n\t\t__SIMULATOR.Interpreter.NotifyFixedObject(this.DataObject.Id, this, false);\n\t}\n\t//by default: no object is CSS Enabled\n\tthis.StyleProperties = false;\n\t//retrieve out css property\n\tvar strCSS = Get_String(this.Properties[__NEMESIS_PROPERTY_STYLE], null);\n\t//valid?\n\tif (strCSS != null)\n\t{\n\t\t//could have properties, convert into an object\n\t\tthis.StyleProperties = { cssText: \"\", Original: {}, Zoom: null };\n\t\t//split it\n\t\tstrCSS = strCSS.split(\";\");\n\t\t//now loop through all of them\n\t\tfor (var iCSS = 0, cCSS = strCSS.length; iCSS < cCSS; iCSS++)\n\t\t{\n\t\t\t//split this into key value pair\n\t\t\tvar pair = strCSS[iCSS].split(\":\");\n\t\t\t//valid?\n\t\t\tif (pair.length == 2)\n\t\t\t{\n\t\t\t\t//we want to make sure we trim the key\n\t\t\t\tpair[0] = pair[0].Trim();\n\t\t\t\t//store it\n\t\t\t\tthis.StyleProperties.Original[pair[0]] = pair[1];\n\t\t\t\t//switch on it\n\t\t\t\tswitch (pair[0].toLowerCase())\n\t\t\t\t{\n\t\t\t\t\tcase \"pointer-events\":\n\t\t\t\t\t\t//only process this if we arent in designer or if the value is not \"none\"\n\t\t\t\t\t\tif (!__DESIGNER_CONTROLLER || !/none/i.test(pair[1]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//add it to the css text\n\t\t\t\t\t\t\tthis.StyleProperties.cssText += pair[0] + \":\" + pair[1] + \";\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"zoom\":\n\t\t\t\t\t\t//add it to the css text\n\t\t\t\t\t\tthis.StyleProperties.cssText += pair[0] + \":\" + pair[1] + \";\";\n\t\t\t\t\t\t//but we also need to mark this as a valid zoom object\n\t\t\t\t\t\tthis.StyleProperties.Zoom = Zoom_Register(this, pair[1]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"content\":\n\t\t\t\t\t\t//replace all url(' with url(' plus host\n\t\t\t\t\t\tpair[1] = pair[1].replace(/url\\('(?!data:)/gi, \"url('\" + __HOST_LESSON_RESOURCES);\n\t\t\t\t\t\t//add it to the css text\n\t\t\t\t\t\tthis.StyleProperties.cssText += pair[0] + \":\" + pair[1] + \";\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t//add it to the css text\n\t\t\t\t\t\tthis.StyleProperties.cssText += pair[0] + \":\" + pair[1] + \";\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//has fixed?\n\t\tif (this.StyleProperties.Original[\"position\"] == \"fixed\")\n\t\t{\n\t\t\t//assume this is fixed\n\t\t\tvar bFixed = true;\n\t\t\t//loop through the parents\n\t\t\tfor (var parent = this.Parent; parent; parent = parent.Parent)\n\t\t\t{\n\t\t\t\t//this parent a real iframe?\n\t\t\t\tif (parent.IsRealIFrame)\n\t\t\t\t{\n\t\t\t\t\t//cannot be fixed\n\t\t\t\t\tbFixed = false;\n\t\t\t\t\t//end loop\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//still fixed?\n\t\t\tif (bFixed)\n\t\t\t{\n\t\t\t\t//create fixed position marker\n\t\t\t\tthis.StyleProperties.FixedPosition = true;\n\t\t\t\t//and register with the interpreter\n\t\t\t\t__SIMULATOR.Interpreter.NotifyFixedObject(this.DataObject.Id, this, true);\n\t\t\t}\n\t\t}\n\t\t//switch on its control type tag\n\t\tswitch (Get_String(this.Properties[__NEMESIS_PROPERTY_CONTROL_TYPE], \"\").toLowerCase())\n\t\t{\n\t\t\tcase \"iframe\":\n\t\t\tcase \"frame\":\n\t\t\tcase \"frameset\":\n\t\t\t\t//not the new iFrame?\n\t\t\t\tif (!Get_Bool(this.Properties[__NEMESIS_PROPERTY_CONTROL_TYPE_FORCED], false))\n\t\t\t\t{\n\t\t\t\t\t//no isolation?\n\t\t\t\t\tif (!this.StyleProperties.Original[\"isolation\"])\n\t\t\t\t\t{\n\t\t\t\t\t\t//force it\n\t\t\t\t\t\tthis.StyleProperties.cssText += \"isolation:isolate;\";\n\t\t\t\t\t}\n\t\t\t\t\t//this ie browser (Edge and IE)\n\t\t\t\t\tif (__BROWSER_TYPE == __BROWSER_IE)\n\t\t\t\t\t{\n\t\t\t\t\t\t//no opacity?\n\t\t\t\t\t\tif (!this.StyleProperties.Original[\"opacity\"])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//force it\n\t\t\t\t\t\t\tthis.StyleProperties.cssText += \"opacity:0.99;\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//indicate that this is a real iframe\n\t\t\t\t\tthis.IsRealIFrame = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"html\":\n\t\t\t\t//get its parent object and check its tag\n\t\t\t\tswitch (this.Parent ? Get_String(this.Parent.Properties[__NEMESIS_PROPERTY_CONTROL_TYPE], \"\").toLowerCase() : \"\")\n\t\t\t\t{\n\t\t\t\t\tcase \"iframe\":\n\t\t\t\t\tcase \"frame\":\n\t\t\t\t\tcase \"frameset\":\n\t\t\t\t\t\t//not the new iFrame?\n\t\t\t\t\t\tif (!Get_Bool(this.Properties[__NEMESIS_PROPERTY_CONTROL_TYPE_FORCED], false))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//check if the parent has scrolling = no\n\t\t\t\t\t\t\tvar attributeScrollingNo = false;\n\t\t\t\t\t\t\t//obtain the parent's\n\t\t\t\t\t\t\tvar attributes = this.Parent.StyleProperties ? Get_String(this.Parent.Properties[__NEMESIS_PROPERTY_HTML_ATTRIBUTES], null) : null;\n\t\t\t\t\t\t\t//valid?\n\t\t\t\t\t\t\tif (attributes != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//parse attributes (lowercase it just in case);\n\t\t\t\t\t\t\t\tattributes = JSON.parse(attributes.toLowerCase());\n\t\t\t\t\t\t\t\t//check for scrolling\n\t\t\t\t\t\t\t\tattributeScrollingNo = !Get_Bool(attributes[\"scrolling\"], true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//we need to copy some properties into our parent\n\t\t\t\t\t\t\tvar properties = [\"overflow\", \"overflow-y\", \"overflow-x\"];\n\t\t\t\t\t\t\t//loop through properties\n\t\t\t\t\t\t\tfor (var i = properties.length; i--;)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//get property\n\t\t\t\t\t\t\t\tvar property = properties[i];\n\t\t\t\t\t\t\t\t//get our value\n\t\t\t\t\t\t\t\tvar ourValue = attributeScrollingNo ? \"hidden\" : this.StyleProperties.Original[property];\n\t\t\t\t\t\t\t\t//valid?\n\t\t\t\t\t\t\t\tif (ourValue)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//force on parent\n\t\t\t\t\t\t\t\t\tthis.Parent.StyleProperties.Original[property] = ourValue;\n\t\t\t\t\t\t\t\t\tthis.Parent.StyleProperties.cssText += property + \":\" + ourValue + \";\";\n\t\t\t\t\t\t\t\t\t//parent already loaded?\n\t\t\t\t\t\t\t\t\tif (this.Parent.HTML)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t//switch on property\n\t\t\t\t\t\t\t\t\t\tswitch (property)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tcase \"overflow\":\n\t\t\t\t\t\t\t\t\t\t\t\t//apply directly\n\t\t\t\t\t\t\t\t\t\t\t\tthis.Parent.HTML.style.overflow = ourValue;\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase \"overflow-x\":\n\t\t\t\t\t\t\t\t\t\t\t\t//apply directly\n\t\t\t\t\t\t\t\t\t\t\t\tthis.Parent.HTML.style.overflowX = ourValue;\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase \"overflow-y\":\n\t\t\t\t\t\t\t\t\t\t\t\t//apply directly\n\t\t\t\t\t\t\t\t\t\t\t\tthis.Parent.HTML.style.overflowY = ourValue;\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\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\t//regardless of whatever we do to the parent, the HTML always have a forced overflow\n\t\t\t\t\t\t\tthis.StyleProperties.Original[\"overflow\"] = \"visible\";\n\t\t\t\t\t\t\tthis.StyleProperties.Original[\"overflow-x\"] = \"visible\";\n\t\t\t\t\t\t\tthis.StyleProperties.Original[\"overflow-y\"] = \"visible\";\n\t\t\t\t\t\t\tthis.StyleProperties.cssText += \"overflow:visible;overflow-x:visible;overflow-y:visible;\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n}", "function GetStyleProperty(oElm, strCssProperty)\n{\n var strValue = \"\";\n if(document.defaultView && document.defaultView.getComputedStyle)\n {\n strValue = document.defaultView.getComputedStyle(oElm, \"\").getPropertyValue(strCssProperty);\n }\n else if(oElm.currentStyle)\n {\n strCssProperty = strCssProperty.replace(/\\-(\\w)/g, function (strMatch, p1){\n return p1.toUpperCase();\n });\n strValue = oElm.currentStyle[strCssProperty];\n }\n return strValue;\n}", "function getProperty(prop, host) {\n var targetHost = host || document.body.style;\n if (!(prop in targetHost)) {\n var char1 = prop.charAt(0).toUpperCase();\n var charLeft = prop.substr(1);\n for (var i = 0; i < vendors.length; i++) {\n var vendorProp = vendors[i] + char1 + charLeft;\n if (vendorProp in targetHost) {\n return vendorProp;\n }\n }\n }\n return prop;\n}", "function getProperty(prop, host) {\n var targetHost = host || document.body.style;\n if (!(prop in targetHost)) {\n var char1 = prop.charAt(0).toUpperCase();\n var charLeft = prop.substr(1);\n for (var i = 0; i < vendors.length; i++) {\n var vendorProp = vendors[i] + char1 + charLeft;\n if (vendorProp in targetHost) {\n return vendorProp;\n }\n }\n }\n return prop;\n}", "function curCSS(elem, prop) {\n var value,\n pixel,\n unit,\n rvpos = /^top|bottom/,\n outerProp = [\"paddingTop\", \"paddingBottom\", \"borderTop\", \"borderBottom\"],\n innerHeight,\n parent,\n i = 4; // outerProp.length\n \n if (getComputedStyle) {\n // FireFox, Chrome/Safari, Opera and IE9+\n value = getComputedStyle(elem)[prop];\n } else if (pixel = elem.style['pixel' + prop.charAt(0).toUpperCase() + prop.slice(1)]) {\n // IE and Opera support pixel shortcuts for top, bottom, left, right, height, width\n // WebKit supports pixel shortcuts only when an absolute unit is used\n value = pixel + 'px';\n } else if (prop === 'fontSize') {\n // correct IE issues with font-size\n // @see http://bugs.jquery.com/ticket/760\n value = toPx(elem, '1em', 'left', 1) + 'px';\n } else {\n // IE 8 and below return the specified style\n value = elem.currentStyle[prop];\n }\n\n // check the unit\n unit = (value.match(runit)||[])[2];\n if (unit === '%' && computedValueBug) {\n // WebKit won't convert percentages for top, bottom, left, right, margin and text-indent\n if (rvpos.test(prop)) {\n // Top and bottom require measuring the innerHeight of the parent.\n innerHeight = (parent = elem.parentNode || elem).offsetHeight;\n while (i--) {\n innerHeight -= parseFloat(curCSS(parent, outerProp[i]));\n }\n value = parseFloat(value) / 100 * innerHeight + 'px';\n } else {\n // This fixes margin, left, right and text-indent\n // @see https://bugs.webkit.org/show_bug.cgi?id=29084\n // @see http://bugs.jquery.com/ticket/10639\n value = toPx(elem, value);\n }\n } else if ((value === 'auto' || (unit && unit !== 'px')) && getComputedStyle) {\n // WebKit and Opera will return auto in some cases\n // Firefox will pass back an unaltered value when it can't be set, like top on a static element\n value = 0;\n } else if (unit && unit !== 'px' && !getComputedStyle) {\n // IE 8 and below won't convert units for us\n // try to convert using a prop that will return pixels\n // this will be accurate for everything (except font-size and some percentages)\n value = toPx(elem, value) + 'px';\n }\n return value;\n}", "function $4b05045600d115f2$var$css(hljs) {\n var FUNCTION_LIKE = {\n begin: /[\\w-]+\\(/,\n returnBegin: true,\n contains: [\n {\n className: \"built_in\",\n begin: /[\\w-]+/\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.CSS_NUMBER_MODE\n ]\n }\n ]\n };\n var ATTRIBUTE = {\n className: \"attribute\",\n begin: /\\S/,\n end: \":\",\n excludeEnd: true,\n starts: {\n endsWithParent: true,\n excludeEnd: true,\n contains: [\n FUNCTION_LIKE,\n hljs.CSS_NUMBER_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.APOS_STRING_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n {\n className: \"number\",\n begin: \"#[0-9A-Fa-f]+\"\n },\n {\n className: \"meta\",\n begin: \"!important\"\n }\n ]\n }\n };\n var AT_IDENTIFIER = \"@[a-z-]+\"; // @font-face\n var AT_MODIFIERS = \"and or not only\";\n var AT_PROPERTY_RE = /@-?\\w[\\w]*(-\\w+)*/; // @-webkit-keyframes\n var IDENT_RE = \"[a-zA-Z-][a-zA-Z0-9_-]*\";\n var RULE = {\n begin: /([*]\\s?)?(?:[A-Z_.\\-\\\\]+|--[a-zA-Z0-9_-]+)\\s*(\\/\\*\\*\\/)?:/,\n returnBegin: true,\n end: \";\",\n endsWithParent: true,\n contains: [\n ATTRIBUTE\n ]\n };\n return {\n name: \"CSS\",\n case_insensitive: true,\n illegal: /[=|'\\$]/,\n contains: [\n hljs.C_BLOCK_COMMENT_MODE,\n {\n className: \"selector-id\",\n begin: /#[A-Za-z0-9_-]+/\n },\n {\n className: \"selector-class\",\n begin: \"\\\\.\" + IDENT_RE\n },\n {\n className: \"selector-attr\",\n begin: /\\[/,\n end: /\\]/,\n illegal: \"$\",\n contains: [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE\n ]\n },\n {\n className: \"selector-pseudo\",\n begin: /:(:)?[a-zA-Z0-9_+()\"'.-]+/\n },\n // matching these here allows us to treat them more like regular CSS\n // rules so everything between the {} gets regular rule highlighting,\n // which is what we want for page and font-face\n {\n begin: \"@(page|font-face)\",\n lexemes: AT_IDENTIFIER,\n keywords: \"@page @font-face\"\n },\n {\n begin: \"@\",\n end: \"[{;]\",\n // because it doesn’t let it to be parsed as\n // a rule set but instead drops parser into\n // the default mode which is how it should be.\n illegal: /:/,\n returnBegin: true,\n contains: [\n {\n className: \"keyword\",\n begin: AT_PROPERTY_RE\n },\n {\n begin: /\\s/,\n endsWithParent: true,\n excludeEnd: true,\n relevance: 0,\n keywords: AT_MODIFIERS,\n contains: [\n {\n begin: /[a-z-]+:/,\n className: \"attribute\"\n },\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.CSS_NUMBER_MODE\n ]\n }\n ]\n },\n {\n className: \"selector-tag\",\n begin: IDENT_RE,\n relevance: 0\n },\n {\n begin: /\\{/,\n end: /\\}/,\n illegal: /\\S/,\n contains: [\n hljs.C_BLOCK_COMMENT_MODE,\n {\n begin: /;/\n },\n RULE\n ]\n }\n ]\n };\n}", "function css() { return exports.cssSyntax.extension; }", "function get(n){return getComputedStyle(n)}", "function browser() {\n\t\n\tvar isOpera = !!(window.opera && window.opera.version); // Opera 8.0+\n\tvar isFirefox = testCSS('MozBoxSizing'); // FF 0.8+\n\tvar isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;\n\t // At least Safari 3+: \"[object HTMLElementConstructor]\"\n\tvar isChrome = !isSafari && testCSS('WebkitTransform'); // Chrome 1+\n\t//var isIE = /*@cc_on!@*/false || testCSS('msTransform'); // At least IE6\n\n\tfunction testCSS(prop) {\n\t return prop in document.documentElement.style;\n\t}\n\t\n\tif (isOpera) {\n\t\t\n\t\treturn false;\n\t\t\n\t}else if (isSafari || isChrome) {\n\t\t\n\t\treturn true;\n\t\t\n\t} else {\n\t\t\n\t\treturn false;\n\t\t\n\t}\n\t\n}", "function fetchComputedStyle(el, prop, pseudo) {\n return window.getComputedStyle(el, (pseudo || null)).getPropertyValue(prop);\n }", "function get(element){return getComputedStyle(element)}", "function checkDevCSS(dev) {\n for (let technologies of dev.technologies) {\n if(technologies == 'CSS')\n return true\n }\n return false\n}", "function xGetComputedStyle(oEle, sProp, bInt)\r\n{\r\n var s, p = 'undefined';\r\n var dv = document.defaultView;\r\n if(dv && dv.getComputedStyle){\r\n s = dv.getComputedStyle(oEle,'');\r\n if (s) p = s.getPropertyValue(sProp);\r\n }\r\n else if(oEle.currentStyle) {\r\n // convert css property name to object property name for IE\r\n var i, c, a = sProp.split('-');\r\n sProp = a[0];\r\n for (i=1; i<a.length; ++i) {\r\n c = a[i].charAt(0);\r\n sProp += a[i].replace(c, c.toUpperCase());\r\n }\r\n p = oEle.currentStyle[sProp];\r\n }\r\n else return null;\r\n return bInt ? (parseInt(p) || 0) : p;\r\n}", "function _getStyle(el, property) {\n if ( window.getComputedStyle ) {\n return document.defaultView.getComputedStyle(el,null)[property]; \n }\n if ( el.currentStyle ) {\n return el.currentStyle[property];\n }\n }", "function i(t){return getComputedStyle(t)}", "function i(t){return getComputedStyle(t)}", "function i(t){return getComputedStyle(t)}", "function utilFromCssProperty(cssName) {\n\t\tif (!cssName.includes('-')) {\n\t\t\tswitch (cssName) {\n\t\t\tcase 'bgcolor': return 'backgroundColor';\n\t\t\tcase 'float': return 'cssFloat';\n\t\t\tdefault: return cssName;\n\t\t\t}\n\t\t}\n\n\t\t// Strip the leading hyphen from the `-ms-` vendor prefix, so it stays lowercased.\n\t\tconst normalized = cssName.slice(0, 4) === '-ms-' ? cssName.slice(1) : cssName;\n\n\t\treturn normalized\n\t\t\t.split('-')\n\t\t\t.map((part, i) => i === 0 ? part : part.toUpperFirst())\n\t\t\t.join('');\n\t}", "function getStyle(obj, prop) {\t return document.defaultView.getComputedStyle(obj,null).getPropertyValue(prop); }", "function styleShouldReturnComputedStylesForElement() {\n const styles = window.getComputedStyle(fixture.el.firstChild)\n const data = pseudo.style(fixture.el.firstChild, null)\n expect(Object.keys(data).length)\n .toBeGreaterThan(147) // IE9 has 148 properties\n Object.keys(data).forEach(property => {\n expect(data[property])\n .toEqual(styles[property])\n })\n}", "function vendor(el, prop) {\r\n var s = el.style\r\n , pp\r\n , i\r\n\r\n prop = prop.charAt(0).toUpperCase() + prop.slice(1)\r\n for(i=0; i<prefixes.length; i++) {\r\n pp = prefixes[i]+prop\r\n if(s[pp] !== undefined) return pp\r\n }\r\n if(s[prop] !== undefined) return prop\r\n }", "function vendor(el, prop) {\r\n var s = el.style\r\n , pp\r\n , i\r\n\r\n prop = prop.charAt(0).toUpperCase() + prop.slice(1)\r\n for(i=0; i<prefixes.length; i++) {\r\n pp = prefixes[i]+prop\r\n if(s[pp] !== undefined) return pp\r\n }\r\n if(s[prop] !== undefined) return prop\r\n }", "function _getStyle(el, property) {\n if ( window.getComputedStyle ) {\n return el.ownerDocument.defaultView.getComputedStyle(el,null)[property]; \n }\n if ( el.currentStyle ) {\n return el.currentStyle[property];\n }\n }", "function getProperties(props) {\n var re = [];\n\n $.each(props, function(key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n // Get vendor specify propertie\n if (support[key])\n key = uncamel(support[key]);\n\n if ($.inArray(key, re) === -1) { re.push(key); }\n });\n\n return re;\n }", "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;}// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a property mapped along what jQuery.cssProps suggests or to", "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;}// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a property mapped along what jQuery.cssProps suggests or to", "function css(hljs) {\n var FUNCTION_LIKE = {\n begin: /[\\w-]+\\(/,\n returnBegin: true,\n contains: [{\n className: 'built_in',\n begin: /[\\w-]+/\n }, {\n begin: /\\(/,\n end: /\\)/,\n contains: [hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, hljs.CSS_NUMBER_MODE]\n }]\n };\n var ATTRIBUTE = {\n className: 'attribute',\n begin: /\\S/,\n end: ':',\n excludeEnd: true,\n starts: {\n endsWithParent: true,\n excludeEnd: true,\n contains: [FUNCTION_LIKE, hljs.CSS_NUMBER_MODE, hljs.QUOTE_STRING_MODE, hljs.APOS_STRING_MODE, hljs.C_BLOCK_COMMENT_MODE, {\n className: 'number',\n begin: '#[0-9A-Fa-f]+'\n }, {\n className: 'meta',\n begin: '!important'\n }]\n }\n };\n var AT_IDENTIFIER = '@[a-z-]+'; // @font-face\n\n var AT_MODIFIERS = \"and or not only\";\n var AT_PROPERTY_RE = /@-?\\w[\\w]*(-\\w+)*/; // @-webkit-keyframes\n\n var IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';\n var RULE = {\n begin: /([*]\\s?)?(?:[A-Z_.\\-\\\\]+|--[a-zA-Z0-9_-]+)\\s*(\\/\\*\\*\\/)?:/,\n returnBegin: true,\n end: ';',\n endsWithParent: true,\n contains: [ATTRIBUTE]\n };\n return {\n name: 'CSS',\n case_insensitive: true,\n illegal: /[=|'\\$]/,\n contains: [hljs.C_BLOCK_COMMENT_MODE, {\n className: 'selector-id',\n begin: /#[A-Za-z0-9_-]+/\n }, {\n className: 'selector-class',\n begin: '\\\\.' + IDENT_RE\n }, {\n className: 'selector-attr',\n begin: /\\[/,\n end: /\\]/,\n illegal: '$',\n contains: [hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE]\n }, {\n className: 'selector-pseudo',\n begin: /:(:)?[a-zA-Z0-9_+()\"'.-]+/\n }, // matching these here allows us to treat them more like regular CSS\n // rules so everything between the {} gets regular rule highlighting,\n // which is what we want for page and font-face\n {\n begin: '@(page|font-face)',\n lexemes: AT_IDENTIFIER,\n keywords: '@page @font-face'\n }, {\n begin: '@',\n end: '[{;]',\n // at_rule eating first \"{\" is a good thing\n // because it doesn’t let it to be parsed as\n // a rule set but instead drops parser into\n // the default mode which is how it should be.\n illegal: /:/,\n // break on Less variables @var: ...\n returnBegin: true,\n contains: [{\n className: 'keyword',\n begin: AT_PROPERTY_RE\n }, {\n begin: /\\s/,\n endsWithParent: true,\n excludeEnd: true,\n relevance: 0,\n keywords: AT_MODIFIERS,\n contains: [{\n begin: /[a-z-]+:/,\n className: \"attribute\"\n }, hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, hljs.CSS_NUMBER_MODE]\n }]\n }, {\n className: 'selector-tag',\n begin: IDENT_RE,\n relevance: 0\n }, {\n begin: /\\{/,\n end: /\\}/,\n illegal: /\\S/,\n contains: [hljs.C_BLOCK_COMMENT_MODE, {\n begin: /;/\n }, // empty ; rule\n RULE]\n }]\n };\n}", "function css(hljs) {\n var FUNCTION_LIKE = {\n begin: /[\\w-]+\\(/, returnBegin: true,\n contains: [\n {\n className: 'built_in',\n begin: /[\\w-]+/\n },\n {\n begin: /\\(/, end: /\\)/,\n contains: [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.CSS_NUMBER_MODE,\n ]\n }\n ]\n };\n var ATTRIBUTE = {\n className: 'attribute',\n begin: /\\S/, end: ':', excludeEnd: true,\n starts: {\n endsWithParent: true, excludeEnd: true,\n contains: [\n FUNCTION_LIKE,\n hljs.CSS_NUMBER_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.APOS_STRING_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n {\n className: 'number', begin: '#[0-9A-Fa-f]+'\n },\n {\n className: 'meta', begin: '!important'\n }\n ]\n }\n };\n var AT_IDENTIFIER = '@[a-z-]+'; // @font-face\n var AT_MODIFIERS = \"and or not only\";\n var AT_PROPERTY_RE = /@\\-?\\w[\\w]*(\\-\\w+)*/; // @-webkit-keyframes\n var IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';\n var RULE = {\n begin: /(?:[A-Z\\_\\.\\-]+|--[a-zA-Z0-9_-]+)\\s*:/, returnBegin: true, end: ';', endsWithParent: true,\n contains: [\n ATTRIBUTE\n ]\n };\n\n return {\n name: 'CSS',\n case_insensitive: true,\n illegal: /[=\\/|'\\$]/,\n contains: [\n hljs.C_BLOCK_COMMENT_MODE,\n {\n className: 'selector-id', begin: /#[A-Za-z0-9_-]+/\n },\n {\n className: 'selector-class', begin: /\\.[A-Za-z0-9_-]+/\n },\n {\n className: 'selector-attr',\n begin: /\\[/, end: /\\]/,\n illegal: '$',\n contains: [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n ]\n },\n {\n className: 'selector-pseudo',\n begin: /:(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\"'.]+/\n },\n // matching these here allows us to treat them more like regular CSS\n // rules so everything between the {} gets regular rule highlighting,\n // which is what we want for page and font-face\n {\n begin: '@(page|font-face)',\n lexemes: AT_IDENTIFIER,\n keywords: '@page @font-face'\n },\n {\n begin: '@', end: '[{;]', // at_rule eating first \"{\" is a good thing\n // because it doesn’t let it to be parsed as\n // a rule set but instead drops parser into\n // the default mode which is how it should be.\n illegal: /:/, // break on Less variables @var: ...\n returnBegin: true,\n contains: [\n {\n className: 'keyword',\n begin: AT_PROPERTY_RE\n },\n {\n begin: /\\s/, endsWithParent: true, excludeEnd: true,\n relevance: 0,\n keywords: AT_MODIFIERS,\n contains: [\n {\n begin: /[a-z-]+:/,\n className:\"attribute\"\n },\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.CSS_NUMBER_MODE\n ]\n }\n ]\n },\n {\n className: 'selector-tag', begin: IDENT_RE,\n relevance: 0\n },\n {\n begin: '{', end: '}',\n illegal: /\\S/,\n contains: [\n hljs.C_BLOCK_COMMENT_MODE,\n RULE,\n ]\n }\n ]\n };\n}", "function css(hljs) {\n var FUNCTION_LIKE = {\n begin: /[\\w-]+\\(/, returnBegin: true,\n contains: [\n {\n className: 'built_in',\n begin: /[\\w-]+/\n },\n {\n begin: /\\(/, end: /\\)/,\n contains: [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.CSS_NUMBER_MODE,\n ]\n }\n ]\n };\n var ATTRIBUTE = {\n className: 'attribute',\n begin: /\\S/, end: ':', excludeEnd: true,\n starts: {\n endsWithParent: true, excludeEnd: true,\n contains: [\n FUNCTION_LIKE,\n hljs.CSS_NUMBER_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.APOS_STRING_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n {\n className: 'number', begin: '#[0-9A-Fa-f]+'\n },\n {\n className: 'meta', begin: '!important'\n }\n ]\n }\n };\n var AT_IDENTIFIER = '@[a-z-]+'; // @font-face\n var AT_MODIFIERS = \"and or not only\";\n var AT_PROPERTY_RE = /@\\-?\\w[\\w]*(\\-\\w+)*/; // @-webkit-keyframes\n var IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';\n var RULE = {\n begin: /(?:[A-Z\\_\\.\\-]+|--[a-zA-Z0-9_-]+)\\s*:/, returnBegin: true, end: ';', endsWithParent: true,\n contains: [\n ATTRIBUTE\n ]\n };\n\n return {\n name: 'CSS',\n case_insensitive: true,\n illegal: /[=\\/|'\\$]/,\n contains: [\n hljs.C_BLOCK_COMMENT_MODE,\n {\n className: 'selector-id', begin: /#[A-Za-z0-9_-]+/\n },\n {\n className: 'selector-class', begin: /\\.[A-Za-z0-9_-]+/\n },\n {\n className: 'selector-attr',\n begin: /\\[/, end: /\\]/,\n illegal: '$',\n contains: [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n ]\n },\n {\n className: 'selector-pseudo',\n begin: /:(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\"'.]+/\n },\n // matching these here allows us to treat them more like regular CSS\n // rules so everything between the {} gets regular rule highlighting,\n // which is what we want for page and font-face\n {\n begin: '@(page|font-face)',\n lexemes: AT_IDENTIFIER,\n keywords: '@page @font-face'\n },\n {\n begin: '@', end: '[{;]', // at_rule eating first \"{\" is a good thing\n // because it doesn’t let it to be parsed as\n // a rule set but instead drops parser into\n // the default mode which is how it should be.\n illegal: /:/, // break on Less variables @var: ...\n returnBegin: true,\n contains: [\n {\n className: 'keyword',\n begin: AT_PROPERTY_RE\n },\n {\n begin: /\\s/, endsWithParent: true, excludeEnd: true,\n relevance: 0,\n keywords: AT_MODIFIERS,\n contains: [\n {\n begin: /[a-z-]+:/,\n className:\"attribute\"\n },\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.CSS_NUMBER_MODE\n ]\n }\n ]\n },\n {\n className: 'selector-tag', begin: IDENT_RE,\n relevance: 0\n },\n {\n begin: '{', end: '}',\n illegal: /\\S/,\n contains: [\n hljs.C_BLOCK_COMMENT_MODE,\n RULE,\n ]\n }\n ]\n };\n}", "function css(hljs) {\n var FUNCTION_LIKE = {\n begin: /[\\w-]+\\(/, returnBegin: true,\n contains: [\n {\n className: 'built_in',\n begin: /[\\w-]+/\n },\n {\n begin: /\\(/, end: /\\)/,\n contains: [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.CSS_NUMBER_MODE,\n ]\n }\n ]\n };\n var ATTRIBUTE = {\n className: 'attribute',\n begin: /\\S/, end: ':', excludeEnd: true,\n starts: {\n endsWithParent: true, excludeEnd: true,\n contains: [\n FUNCTION_LIKE,\n hljs.CSS_NUMBER_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.APOS_STRING_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n {\n className: 'number', begin: '#[0-9A-Fa-f]+'\n },\n {\n className: 'meta', begin: '!important'\n }\n ]\n }\n };\n var AT_IDENTIFIER = '@[a-z-]+'; // @font-face\n var AT_MODIFIERS = \"and or not only\";\n var AT_PROPERTY_RE = /@-?\\w[\\w]*(-\\w+)*/; // @-webkit-keyframes\n var IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';\n var RULE = {\n begin: /([*]\\s?)?(?:[A-Z_.\\-\\\\]+|--[a-zA-Z0-9_-]+)\\s*(\\/\\*\\*\\/)?:/, returnBegin: true, end: ';', endsWithParent: true,\n contains: [\n ATTRIBUTE\n ]\n };\n\n return {\n name: 'CSS',\n case_insensitive: true,\n illegal: /[=|'\\$]/,\n contains: [\n hljs.C_BLOCK_COMMENT_MODE,\n {\n className: 'selector-id', begin: /#[A-Za-z0-9_-]+/\n },\n {\n className: 'selector-class', begin: '\\\\.' + IDENT_RE\n },\n {\n className: 'selector-attr',\n begin: /\\[/, end: /\\]/,\n illegal: '$',\n contains: [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n ]\n },\n {\n className: 'selector-pseudo',\n begin: /:(:)?[a-zA-Z0-9_+()\"'.-]+/\n },\n // matching these here allows us to treat them more like regular CSS\n // rules so everything between the {} gets regular rule highlighting,\n // which is what we want for page and font-face\n {\n begin: '@(page|font-face)',\n lexemes: AT_IDENTIFIER,\n keywords: '@page @font-face'\n },\n {\n begin: '@', end: '[{;]', // at_rule eating first \"{\" is a good thing\n // because it doesn’t let it to be parsed as\n // a rule set but instead drops parser into\n // the default mode which is how it should be.\n illegal: /:/, // break on Less variables @var: ...\n returnBegin: true,\n contains: [\n {\n className: 'keyword',\n begin: AT_PROPERTY_RE\n },\n {\n begin: /\\s/, endsWithParent: true, excludeEnd: true,\n relevance: 0,\n keywords: AT_MODIFIERS,\n contains: [\n {\n begin: /[a-z-]+:/,\n className:\"attribute\"\n },\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.CSS_NUMBER_MODE\n ]\n }\n ]\n },\n {\n className: 'selector-tag', begin: IDENT_RE,\n relevance: 0\n },\n {\n begin: /\\{/, end: /\\}/,\n illegal: /\\S/,\n contains: [\n hljs.C_BLOCK_COMMENT_MODE,\n { begin: /;/ }, // empty ; rule\n RULE,\n ]\n }\n ]\n };\n}", "function css(hljs) {\n var FUNCTION_LIKE = {\n begin: /[\\w-]+\\(/, returnBegin: true,\n contains: [\n {\n className: 'built_in',\n begin: /[\\w-]+/\n },\n {\n begin: /\\(/, end: /\\)/,\n contains: [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.CSS_NUMBER_MODE,\n ]\n }\n ]\n };\n var ATTRIBUTE = {\n className: 'attribute',\n begin: /\\S/, end: ':', excludeEnd: true,\n starts: {\n endsWithParent: true, excludeEnd: true,\n contains: [\n FUNCTION_LIKE,\n hljs.CSS_NUMBER_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.APOS_STRING_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n {\n className: 'number', begin: '#[0-9A-Fa-f]+'\n },\n {\n className: 'meta', begin: '!important'\n }\n ]\n }\n };\n var AT_IDENTIFIER = '@[a-z-]+'; // @font-face\n var AT_MODIFIERS = \"and or not only\";\n var AT_PROPERTY_RE = /@-?\\w[\\w]*(-\\w+)*/; // @-webkit-keyframes\n var IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';\n var RULE = {\n begin: /([*]\\s?)?(?:[A-Z_.\\-\\\\]+|--[a-zA-Z0-9_-]+)\\s*(\\/\\*\\*\\/)?:/, returnBegin: true, end: ';', endsWithParent: true,\n contains: [\n ATTRIBUTE\n ]\n };\n\n return {\n name: 'CSS',\n case_insensitive: true,\n illegal: /[=|'\\$]/,\n contains: [\n hljs.C_BLOCK_COMMENT_MODE,\n {\n className: 'selector-id', begin: /#[A-Za-z0-9_-]+/\n },\n {\n className: 'selector-class', begin: '\\\\.' + IDENT_RE\n },\n {\n className: 'selector-attr',\n begin: /\\[/, end: /\\]/,\n illegal: '$',\n contains: [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n ]\n },\n {\n className: 'selector-pseudo',\n begin: /:(:)?[a-zA-Z0-9_+()\"'.-]+/\n },\n // matching these here allows us to treat them more like regular CSS\n // rules so everything between the {} gets regular rule highlighting,\n // which is what we want for page and font-face\n {\n begin: '@(page|font-face)',\n lexemes: AT_IDENTIFIER,\n keywords: '@page @font-face'\n },\n {\n begin: '@', end: '[{;]', // at_rule eating first \"{\" is a good thing\n // because it doesn’t let it to be parsed as\n // a rule set but instead drops parser into\n // the default mode which is how it should be.\n illegal: /:/, // break on Less variables @var: ...\n returnBegin: true,\n contains: [\n {\n className: 'keyword',\n begin: AT_PROPERTY_RE\n },\n {\n begin: /\\s/, endsWithParent: true, excludeEnd: true,\n relevance: 0,\n keywords: AT_MODIFIERS,\n contains: [\n {\n begin: /[a-z-]+:/,\n className:\"attribute\"\n },\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.CSS_NUMBER_MODE\n ]\n }\n ]\n },\n {\n className: 'selector-tag', begin: IDENT_RE,\n relevance: 0\n },\n {\n begin: /\\{/, end: /\\}/,\n illegal: /\\S/,\n contains: [\n hljs.C_BLOCK_COMMENT_MODE,\n { begin: /;/ }, // empty ; rule\n RULE,\n ]\n }\n ]\n };\n}", "function n(e){return getComputedStyle(e)}", "function getStyle(el, cssprop) {\n if (el.currentStyle) //IE\n return el.currentStyle[cssprop];\n else if (document.defaultView && document.defaultView.getComputedStyle) //Firefox\n return document.defaultView.getComputedStyle(el, \"\")[cssprop];\n else\n return el.style[cssprop];\n}", "function getProperties(props) {\n var re = [];\n\n $.each(props, function(key) {\n key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n key = $.transit.propertyMap[key] || $.cssProps[key] || key;\n key = uncamel(key); // Convert back to dasherized\n\n // Get vendor specify propertie\n if (support[key])\n key = uncamel(support[key]);\n\n if ($.inArray(key, re) === -1) {\n re.push(key);\n }\n });\n\n return re;\n }", "function toCSSProps(prop) {\n var props = [prop];\n var eng = k.engines.indexOf(Monocle.Browser.engine);\n if (eng) {\n var pf = k.prefixes[eng];\n if (pf) {\n props.push(pf+prop);\n }\n }\n return props;\n }", "function styleDetector(style, rule, isFallback) {\n for (var prop in style) {\n var value = style[prop];\n\n if (Array.isArray(value)) {\n // Check double arrays to avoid recursion.\n if (!Array.isArray(value[0])) {\n if (prop === 'fallbacks') {\n for (var index = 0; index < style.fallbacks.length; index++) {\n style.fallbacks[index] = styleDetector(style.fallbacks[index], rule, true);\n }\n\n continue;\n }\n\n style[prop] = processArray(value, prop, propArray, rule); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n }\n } else if (typeof value === 'object') {\n if (prop === 'fallbacks') {\n style.fallbacks = styleDetector(style.fallbacks, rule, true);\n continue;\n }\n\n style[prop] = objectToArray(value, prop, rule, isFallback); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n } // Maybe a computed value resulting in an empty string\n else if (style[prop] === '') delete style[prop];\n }\n\n return style;\n}", "function styleDetector(style, rule, isFallback) {\n for (var prop in style) {\n var value = style[prop];\n\n if (Array.isArray(value)) {\n // Check double arrays to avoid recursion.\n if (!Array.isArray(value[0])) {\n if (prop === 'fallbacks') {\n for (var index = 0; index < style.fallbacks.length; index++) {\n style.fallbacks[index] = styleDetector(style.fallbacks[index], rule, true);\n }\n\n continue;\n }\n\n style[prop] = processArray(value, prop, propArray, rule); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n }\n } else if (typeof value === 'object') {\n if (prop === 'fallbacks') {\n style.fallbacks = styleDetector(style.fallbacks, rule, true);\n continue;\n }\n\n style[prop] = objectToArray(value, prop, rule, isFallback); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n } // Maybe a computed value resulting in an empty string\n else if (style[prop] === '') delete style[prop];\n }\n\n return style;\n}", "function styleDetector(style, rule, isFallback) {\n for (var prop in style) {\n var value = style[prop];\n\n if (Array.isArray(value)) {\n // Check double arrays to avoid recursion.\n if (!Array.isArray(value[0])) {\n if (prop === 'fallbacks') {\n for (var index = 0; index < style.fallbacks.length; index++) {\n style.fallbacks[index] = styleDetector(style.fallbacks[index], rule, true);\n }\n\n continue;\n }\n\n style[prop] = processArray(value, prop, propArray, rule); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n }\n } else if (typeof value === 'object') {\n if (prop === 'fallbacks') {\n style.fallbacks = styleDetector(style.fallbacks, rule, true);\n continue;\n }\n\n style[prop] = objectToArray(value, prop, rule, isFallback); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n } // Maybe a computed value resulting in an empty string\n else if (style[prop] === '') delete style[prop];\n }\n\n return style;\n}", "function getProperties(props) {\n\t var re = [];\n\t\n\t $.each(props, function(key) {\n\t key = $.camelCase(key); // Convert \"text-align\" => \"textAlign\"\n\t key = $.transit.propertyMap[key] || $.cssProps[key] || key;\n\t key = uncamel(key); // Convert back to dasherized\n\t\n\t // Get vendor specify propertie\n\t if (support[key])\n\t key = uncamel(support[key]);\n\t\n\t if ($.inArray(key, re) === -1) { re.push(key); }\n\t });\n\t\n\t return re;\n\t }", "function vendor(el, prop) {\n var s = el.style\n , pp\n , i\n\n prop = prop.charAt(0).toUpperCase() + prop.slice(1)\n for(i=0; i<prefixes.length; i++) {\n pp = prefixes[i]+prop\n if(s[pp] !== undefined) return pp\n }\n if(s[prop] !== undefined) return prop\n }", "function vendor(el, prop) {\n var s = el.style\n , pp\n , i\n\n prop = prop.charAt(0).toUpperCase() + prop.slice(1)\n for(i=0; i<prefixes.length; i++) {\n pp = prefixes[i]+prop\n if(s[pp] !== undefined) return pp\n }\n if(s[prop] !== undefined) return prop\n }", "function vendor(el, prop) {\n var s = el.style\n , pp\n , i\n\n prop = prop.charAt(0).toUpperCase() + prop.slice(1)\n for(i=0; i<prefixes.length; i++) {\n pp = prefixes[i]+prop\n if(s[pp] !== undefined) return pp\n }\n if(s[prop] !== undefined) return prop\n }", "function vendor(el, prop) {\n var s = el.style\n , pp\n , i\n\n prop = prop.charAt(0).toUpperCase() + prop.slice(1)\n for(i=0; i<prefixes.length; i++) {\n pp = prefixes[i]+prop\n if(s[pp] !== undefined) return pp\n }\n if(s[prop] !== undefined) return prop\n }", "function vendor(el, prop) {\n var s = el.style\n , pp\n , i\n\n prop = prop.charAt(0).toUpperCase() + prop.slice(1)\n for(i=0; i<prefixes.length; i++) {\n pp = prefixes[i]+prop\n if(s[pp] !== undefined) return pp\n }\n if(s[prop] !== undefined) return prop\n }", "function vendor(el, prop) {\n var s = el.style\n , pp\n , i\n\n prop = prop.charAt(0).toUpperCase() + prop.slice(1)\n for(i=0; i<prefixes.length; i++) {\n pp = prefixes[i]+prop\n if(s[pp] !== undefined) return pp\n }\n if(s[prop] !== undefined) return prop\n }", "function vendor(el, prop) {\n var s = el.style\n , pp\n , i\n\n prop = prop.charAt(0).toUpperCase() + prop.slice(1)\n for(i=0; i<prefixes.length; i++) {\n pp = prefixes[i]+prop\n if(s[pp] !== undefined) return pp\n }\n if(s[prop] !== undefined) return prop\n }", "function vendor(el, prop) {\n var s = el.style\n , pp\n , i\n\n prop = prop.charAt(0).toUpperCase() + prop.slice(1)\n for(i=0; i<prefixes.length; i++) {\n pp = prefixes[i]+prop\n if(s[pp] !== undefined) return pp\n }\n if(s[prop] !== undefined) return prop\n }", "function vendor(el, prop) {\n var s = el.style\n , pp\n , i\n\n prop = prop.charAt(0).toUpperCase() + prop.slice(1)\n for(i=0; i<prefixes.length; i++) {\n pp = prefixes[i]+prop\n if(s[pp] !== undefined) return pp\n }\n if(s[prop] !== undefined) return prop\n }", "function vendor(el, prop) {\n var s = el.style\n , pp\n , i\n\n prop = prop.charAt(0).toUpperCase() + prop.slice(1)\n for(i=0; i<prefixes.length; i++) {\n pp = prefixes[i]+prop\n if(s[pp] !== undefined) return pp\n }\n if(s[prop] !== undefined) return prop\n }", "function vendor(el, prop) {\n var s = el.style\n , pp\n , i\n\n prop = prop.charAt(0).toUpperCase() + prop.slice(1)\n for(i=0; i<prefixes.length; i++) {\n pp = prefixes[i]+prop\n if(s[pp] !== undefined) return pp\n }\n if(s[prop] !== undefined) return prop\n }", "function vendor(el, prop) {\n var s = el.style\n , pp\n , i\n\n prop = prop.charAt(0).toUpperCase() + prop.slice(1)\n for(i=0; i<prefixes.length; i++) {\n pp = prefixes[i]+prop\n if(s[pp] !== undefined) return pp\n }\n if(s[prop] !== undefined) return prop\n }", "function getStyle(el, cssprop){\n\t\tif (el.currentStyle) {\n\t\t\treturn el.currentStyle[cssprop];\n\t\t} else if (document.defaultView && document.defaultView.getComputedStyle) {\n\t\t\treturn document.defaultView.getComputedStyle(el, \"\")[cssprop];\n\t\t}\n\t}", "function n(t){return getComputedStyle(t)}", "function n(t){return getComputedStyle(t)}", "function n(t){return getComputedStyle(t)}", "function n(t){return getComputedStyle(t)}", "function n(t){return getComputedStyle(t)}", "function n(t){return getComputedStyle(t)}", "function _getStyle(el, property) {\n if (window.getComputedStyle) {\n return document.defaultView.getComputedStyle(el, null)[property];\n }\n if (el.currentStyle) {\n return el.currentStyle[property];\n }\n }" ]
[ "0.74161464", "0.7402455", "0.7323505", "0.7323505", "0.7323505", "0.7178649", "0.71709555", "0.71709555", "0.7052388", "0.6960331", "0.66900355", "0.6477672", "0.6383238", "0.6381317", "0.6374921", "0.63383347", "0.6274924", "0.6226914", "0.61520463", "0.61465746", "0.61160547", "0.6116008", "0.6115612", "0.60974735", "0.60682994", "0.60579705", "0.5946043", "0.5946043", "0.5928838", "0.5926657", "0.5926657", "0.59183997", "0.5900328", "0.58584344", "0.5851671", "0.58494854", "0.58491427", "0.58121485", "0.5800633", "0.5791025", "0.57875115", "0.57469076", "0.57451546", "0.57141834", "0.57141834", "0.5703884", "0.56821626", "0.5676576", "0.5675687", "0.5667601", "0.56548584", "0.56469756", "0.5639846", "0.563394", "0.5632218", "0.56184417", "0.56184417", "0.56184417", "0.5611309", "0.5602138", "0.55857855", "0.55809313", "0.55809313", "0.55801964", "0.55790335", "0.5563963", "0.5563963", "0.556354", "0.55613077", "0.55613077", "0.555305", "0.555305", "0.554424", "0.5532849", "0.5530996", "0.55290985", "0.5528312", "0.5528312", "0.5528312", "0.55253845", "0.55235434", "0.55235434", "0.55235434", "0.55235434", "0.55235434", "0.55235434", "0.55235434", "0.55235434", "0.55235434", "0.55235434", "0.55235434", "0.55235434", "0.550647", "0.54903567", "0.54903567", "0.54903567", "0.54903567", "0.54903567", "0.54903567", "0.5473732" ]
0.6328783
16
Detect support of translate3d
function detect3dSupport() { var el = document.createElement('p'), has3d, transforms = { 'webkitTransform': '-webkit-transform', 'msTransform': '-ms-transform', 'transform': 'transform' }; // Add it to the body to get the computed style document.body.insertBefore(el, null); for (var t in transforms) { if (el.style[t] !== undefined) { el.style[t] = 'translate3d(1px,1px,1px)'; has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]); } } document.body.removeChild(el); return (has3d !== undefined && has3d.length > 0); //&& has3d !== "none" }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function support3d() {\n \t\t\tvar el = document.createElement('p'),\n \t\t\t\thas3d,\n \t\t\t\ttransforms = {\n \t\t\t\t\t'webkitTransform':'-webkit-transform',\n \t\t\t\t\t'OTransform':'-o-transform',\n \t\t\t\t\t'msTransform':'-ms-transform',\n \t\t\t\t\t'MozTransform':'-moz-transform',\n \t\t\t\t\t'transform':'transform'\n \t\t\t\t};\n\n \t\t\t// Add it to the body to get the computed style.\n \t\t\tdocument.body.insertBefore(el, null);\n\n \t\t\tfor (var t in transforms) {\n \t\t\t\tif (el.style[t] !== undefined) {\n \t\t\t\t\tel.style[t] = \"translate3d(1px,1px,1px)\";\n \t\t\t\t\thas3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n \t\t\t\t}\n \t\t\t}\n\n \t\t\tdocument.body.removeChild(el);\n\n \t\t\treturn (has3d !== undefined && has3d.length > 0 && has3d !== \"none\");\n \t\t}", "function detect3dSupport() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform': '-webkit-transform',\n 'msTransform': '-ms-transform',\n 'transform': 'transform'\n };\n // Add it to the body to get the computed style\n document.body.insertBefore(el, null);\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n document.body.removeChild(el);\n return (has3d !== undefined && has3d.length > 0 && has3d !== \"none\");\n }", "function support3d() {\r\n var el = document.createElement('p'),\r\n has3d,\r\n transforms = {\r\n 'webkitTransform':'-webkit-transform',\r\n 'OTransform':'-o-transform',\r\n 'msTransform':'-ms-transform',\r\n 'MozTransform':'-moz-transform',\r\n 'transform':'transform'\r\n };\r\n\r\n // Add it to the body to get the computed style.\r\n document.body.insertBefore(el, null);\r\n\r\n for (var t in transforms) {\r\n if (el.style[t] !== undefined) {\r\n el.style[t] = 'translate3d(1px,1px,1px)';\r\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\r\n }\r\n }\r\n\r\n document.body.removeChild(el);\r\n\r\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\r\n }", "function support3d() {\r\n var el = document.createElement('p'),\r\n has3d,\r\n transforms = {\r\n 'webkitTransform':'-webkit-transform',\r\n 'OTransform':'-o-transform',\r\n 'msTransform':'-ms-transform',\r\n 'MozTransform':'-moz-transform',\r\n 'transform':'transform'\r\n };\r\n\r\n // Add it to the body to get the computed style.\r\n document.body.insertBefore(el, null);\r\n\r\n for (var t in transforms) {\r\n if (el.style[t] !== undefined) {\r\n el.style[t] = 'translate3d(1px,1px,1px)';\r\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\r\n }\r\n }\r\n\r\n document.body.removeChild(el);\r\n\r\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\r\n }", "function support3d() {\r\n var el = document.createElement('p'),\r\n has3d,\r\n transforms = {\r\n 'webkitTransform':'-webkit-transform',\r\n 'OTransform':'-o-transform',\r\n 'msTransform':'-ms-transform',\r\n 'MozTransform':'-moz-transform',\r\n 'transform':'transform'\r\n };\r\n\r\n // Add it to the body to get the computed style.\r\n document.body.insertBefore(el, null);\r\n\r\n for (var t in transforms) {\r\n if (el.style[t] !== undefined) {\r\n el.style[t] = 'translate3d(1px,1px,1px)';\r\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\r\n }\r\n }\r\n\r\n document.body.removeChild(el);\r\n\r\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\r\n }", "function support3d() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform':'-webkit-transform',\n 'OTransform':'-o-transform',\n 'msTransform':'-ms-transform',\n 'MozTransform':'-moz-transform',\n 'transform':'transform'\n };\n\n // Add it to the body to get the computed style.\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\n }", "function support3d() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform':'-webkit-transform',\n 'OTransform':'-o-transform',\n 'msTransform':'-ms-transform',\n 'MozTransform':'-moz-transform',\n 'transform':'transform'\n };\n\n // Add it to the body to get the computed style.\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\n }", "function support3d() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform':'-webkit-transform',\n 'OTransform':'-o-transform',\n 'msTransform':'-ms-transform',\n 'MozTransform':'-moz-transform',\n 'transform':'transform'\n };\n\n // Add it to the body to get the computed style.\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\n }", "function support3d() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform':'-webkit-transform',\n 'OTransform':'-o-transform',\n 'msTransform':'-ms-transform',\n 'MozTransform':'-moz-transform',\n 'transform':'transform'\n };\n\n // Add it to the body to get the computed style.\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\n }", "function support3d() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform':'-webkit-transform',\n 'OTransform':'-o-transform',\n 'msTransform':'-ms-transform',\n 'MozTransform':'-moz-transform',\n 'transform':'transform'\n };\n\n // Add it to the body to get the computed style.\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\n }", "function support3d() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform': '-webkit-transform',\n 'OTransform': '-o-transform',\n 'msTransform': '-ms-transform',\n 'MozTransform': '-moz-transform',\n 'transform': 'transform'\n };\n\n // Add it to the body to get the computed style.\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\n }", "function checkTransform3dSupport() {\n\t div.style[support.transform] = '';\n\t div.style[support.transform] = 'rotateY(90deg)';\n\t return div.style[support.transform] !== '';\n\t }", "function checkTransform3dSupport() {\n div.style[support.transform] = '';\n div.style[support.transform] = 'rotateY(90deg)';\n return div.style[support.transform] !== '';\n }", "function checkTransform3dSupport() {\n div.style[support.transform] = '';\n div.style[support.transform] = 'rotateY(90deg)';\n return div.style[support.transform] !== '';\n }", "function checkTransform3dSupport() {\n div.style[support.transform] = '';\n div.style[support.transform] = 'rotateY(90deg)';\n return div.style[support.transform] !== '';\n }", "function checkTransform3dSupport() {\n div.style[support.transform] = '';\n div.style[support.transform] = 'rotateY(90deg)';\n return div.style[support.transform] !== '';\n }", "function support3d() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform': '-webkit-transform',\n 'OTransform': '-o-transform',\n 'msTransform': '-ms-transform',\n 'MozTransform': '-moz-transform',\n 'transform': 'transform'\n }; //preventing the style p:empty{display: none;} from returning the wrong result\n\n el.style.display = 'block'; // Add it to the body to get the computed style.\n\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n return has3d !== undefined && has3d.length > 0 && has3d !== 'none';\n }", "function support3d() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform':'-webkit-transform',\n 'OTransform':'-o-transform',\n 'msTransform':'-ms-transform',\n 'MozTransform':'-moz-transform',\n 'transform':'transform'\n };\n\n //preventing the style p:empty{display: none;} from returning the wrong result\n el.style.display = 'block';\n\n // Add it to the body to get the computed style.\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\n }", "function support3d() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform':'-webkit-transform',\n 'OTransform':'-o-transform',\n 'msTransform':'-ms-transform',\n 'MozTransform':'-moz-transform',\n 'transform':'transform'\n };\n\n //preventing the style p:empty{display: none;} from returning the wrong result\n el.style.display = 'block';\n\n // Add it to the body to get the computed style.\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\n }", "function support3d() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'webkitTransform':'-webkit-transform',\n 'OTransform':'-o-transform',\n 'msTransform':'-ms-transform',\n 'MozTransform':'-moz-transform',\n 'transform':'transform'\n };\n\n //preventing the style p:empty{display: none;} from returning the wrong result\n el.style.display = 'block'\n\n // Add it to the body to get the computed style.\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\n }", "function support3d() {\r\n var el = document.createElement('p'),\r\n has3d,\r\n transforms = {\r\n 'webkitTransform':'-webkit-transform',\r\n 'OTransform':'-o-transform',\r\n 'msTransform':'-ms-transform',\r\n 'MozTransform':'-moz-transform',\r\n 'transform':'transform'\r\n };\r\n\r\n //preventing the style p:empty{display: none;} from returning the wrong result\r\n el.style.display = 'block';\r\n\r\n // Add it to the body to get the computed style.\r\n document.body.insertBefore(el, null);\r\n\r\n for (var t in transforms) {\r\n if (el.style[t] !== undefined) {\r\n el.style[t] = 'translate3d(1px,1px,1px)';\r\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\r\n }\r\n }\r\n\r\n document.body.removeChild(el);\r\n\r\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\r\n }", "function support3d() {\r\n var el = document.createElement('p'),\r\n has3d,\r\n transforms = {\r\n 'webkitTransform':'-webkit-transform',\r\n 'OTransform':'-o-transform',\r\n 'msTransform':'-ms-transform',\r\n 'MozTransform':'-moz-transform',\r\n 'transform':'transform'\r\n };\r\n\r\n //preventing the style p:empty{display: none;} from returning the wrong result\r\n el.style.display = 'block'\r\n\r\n // Add it to the body to get the computed style.\r\n document.body.insertBefore(el, null);\r\n\r\n for (var t in transforms) {\r\n if (el.style[t] !== undefined) {\r\n el.style[t] = 'translate3d(1px,1px,1px)';\r\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\r\n }\r\n }\r\n\r\n document.body.removeChild(el);\r\n\r\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\r\n }", "function has3DTransforms() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'WebkitTransform':'-webkit-transform',\n 'MozTransform':'-moz-transform',\n };\n\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = \"translate3d(1px,1px,1px)\";\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n return (has3d !== undefined && has3d.length > 0 && has3d !== \"none\");\n }", "function has3DTransforms() {\n var el = document.createElement('p'),\n has3d,\n transforms = {\n 'WebkitTransform':'-webkit-transform',\n 'MozTransform':'-moz-transform',\n };\n\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = \"translate3d(1px,1px,1px)\";\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n return (has3d !== undefined && has3d.length > 0 && has3d !== \"none\");\n }", "function _checkCSS3D() {\n var el = document.createElement('p');\n var has3d;\n var transforms = {\n webkitTransform: '-webkit-transform',\n OTransform: '-o-transform',\n msTransform: '-ms-transform',\n MozTransform: '-moz-transform',\n transform: 'transform'\n };\n\n // Add it to the body to get the computed style.\n document.body.insertBefore(el, null);\n\n for (var t in transforms) {\n if (el.style[t] !== undefined) {\n el.style[t] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\n }\n }\n\n document.body.removeChild(el);\n device.css3D = has3d !== undefined && has3d.length > 0 && has3d !== 'none';\n }", "function transform3dTest() {\n var mqProp = \"transform-3d\",\n vendors = [ \"Webkit\", \"Moz\", \"O\" ],\n // Because the `translate3d` test below throws false positives in Android:\n ret = media(\"(-\" + vendors.join(\"-\" + mqProp + \"),(-\") + \"-\" + mqProp + \"),(\" + mqProp + \")\");\n\n if (ret) {\n return !!ret;\n }\n\n var el = $window.document.createElement(\"div\"),\n transforms = {\n // We’re omitting Opera for the time being; MS uses unprefixed.\n 'MozTransform': '-moz-transform',\n 'transform': 'transform'\n };\n\n fakeBody.append(el);\n\n for (var t in transforms) {\n if (el.style[ t ] !== undefined) {\n el.style[ t ] = 'translate3d( 100px, 1px, 1px )';\n ret = window.getComputedStyle(el).getPropertyValue(transforms[ t ]);\n }\n }\n return ( !!ret && ret !== \"none\" );\n }", "function transform3dTest() {\n\tvar prop = \"transform-3d\";\n\treturn validStyle( 'perspective', '10px', 'moz' ) || $.mobile.media( \"(-\" + vendors.join( \"-\" + prop + \"),(-\" ) + \"-\" + prop + \"),(\" + prop + \")\" );\n}", "function can3DTransformPositionFixed() {\n\t\tvar blacklist = \"(Android 1\\.5)|(Android 1\\.6)|(Android 2\\.1)|(Android 2\\.2)|(Android 2\\.3)\"; // Exclude Android browser 2.3 and earlier\n\t\tvar blacklistRE = new RegExp(blacklist);\n\t\treturn !blacklistRE.test(navigator.userAgent);\n\t}", "function getTranslate3d(){\n if (options.direction !== 'vertical') {\n return 'translate3d(100%, 0px, 0px)';\n }\n\n return 'translate3d(0px, 100%, 0px)';\n }", "function supportsCSS3D() {\n var props = [\n 'perspectiveProperty', 'WebkitPerspective', 'MozPerspective'\n ], testDom = document.createElement('a');\n\n for (var i = 0; i < props.length; i++) {\n if (props[i] in testDom.style) {\n return true;\n }\n }\n\n return false;\n }", "function supportsCSS3D() {\r\n var props = [\r\n 'perspectiveProperty', 'WebkitPerspective', 'MozPerspective'\r\n ], testDom = document.createElement('a');\r\n\r\n for(var i=0; i<props.length; i++){\r\n if(props[i] in testDom.style){\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }", "function getTransforms(translate3d){\r\n return {\r\n '-webkit-transform': translate3d,\r\n '-moz-transform': translate3d,\r\n '-ms-transform':translate3d,\r\n 'transform': translate3d\r\n };\r\n }", "function getTransforms(translate3d){\r\n return {\r\n '-webkit-transform': translate3d,\r\n '-moz-transform': translate3d,\r\n '-ms-transform':translate3d,\r\n 'transform': translate3d\r\n };\r\n }", "function getTransforms(translate3d){\r\n return {\r\n '-webkit-transform': translate3d,\r\n '-moz-transform': translate3d,\r\n '-ms-transform':translate3d,\r\n 'transform': translate3d\r\n };\r\n }", "function getTransforms(translate3d){\r\n return {\r\n '-webkit-transform': translate3d,\r\n '-moz-transform': translate3d,\r\n '-ms-transform':translate3d,\r\n 'transform': translate3d\r\n };\r\n }", "function getTransforms(translate3d){\r\n return {\r\n '-webkit-transform': translate3d,\r\n '-moz-transform': translate3d,\r\n '-ms-transform':translate3d,\r\n 'transform': translate3d\r\n };\r\n }", "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "function getTransX(elem) {\n var style = elem.style.transform || elem.style['-webkit-transform'];\n if (!style) return false;\n return Number(style.match(/translate3d\\((-?\\d+)px,/)[1]);\n}", "function detectPrefixes() {\n var transform = void 0;\n var transition = void 0;\n var transitionEnd = void 0;\n var hasTranslate3d = void 0;\n\n (function () {\n var el = document.createElement('_');\n var style = el.style;\n\n var prop = void 0;\n\n if (style[prop = 'webkitTransition'] === '') {\n transitionEnd = 'webkitTransitionEnd';\n transition = prop;\n }\n\n if (style[prop = 'transition'] === '') {\n transitionEnd = 'transitionend';\n transition = prop;\n }\n\n if (style[prop = 'webkitTransform'] === '') {\n transform = prop;\n }\n\n if (style[prop = 'msTransform'] === '') {\n transform = prop;\n }\n\n if (style[prop = 'transform'] === '') {\n transform = prop;\n }\n\n document.body.insertBefore(el, null);\n style[transform] = 'translate3d(0, 0, 0)';\n hasTranslate3d = !!global.getComputedStyle(el).getPropertyValue(transform);\n document.body.removeChild(el);\n })();\n\n return {\n transform: transform,\n transition: transition,\n transitionEnd: transitionEnd,\n hasTranslate3d: hasTranslate3d\n };\n}", "function testTransformsSupport() {\n var div = create('div');\n return typeof div.style.perspective !== 'undefined' || typeof div.style.webkitPerspective !== 'undefined';\n }", "function getTransforms(translate3d) {\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform': translate3d,\n 'transform': translate3d\n };\n }", "function getTransforms(translate3d) {\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform': translate3d,\n 'transform': translate3d\n };\n }", "function translate(x, y, use3d) {\n\n return (has3d && use3d) ? ' translate3d(' + x + 'px,' + y + 'px, 0px) '\n : ' translate(' + x + 'px, ' + y + 'px) ';\n\n }", "function gTranslate(x,y,z) {\n modelMatrix = mult(translate(x,y,z), modelMatrix) ;\n}", "function getBwFeatures() {\n var result = '';\n var element = document.body || document.documentElement,\n elementStyle = element.style,\n isCSSTransitions = typeof elementStyle.transition !== 'undefined' || typeof elementStyle.WebkitTransition !== 'undefined' || typeof elementStyle.MozTransition !== 'undefined' || typeof elementStyle.OTransition !== 'undefined';\n if(isCSSTransitions === true) {\n var div = document.createElement('div');\n // Check if 3D transforms are supported\n if(typeof div.style.WebkitPerspective !== 'undefined' || typeof div.style.perspective !== 'undefined') {\n result = 'translate3d';\n }\n // Additional checks for Webkit\n if(result === 'css3D' && typeof div.styleWebkitPerspective !== 'undefined') {\n var style = document.createElement('style');\n style.textContent = '@media (transform-3d),(-webkit-transform-3d){#test-for-3D{left:9px;position:absolute;height:5px;margin:0;padding:0;border:0;}}';\n document.getElementsByTagName('head')[0].appendChild(style);\n div.id = 'test-for-3D';\n document.body.appendChild(div);\n if(!(div.offsetLeft === 9 && div.offsetHeight === 5)) {\n result = null;\n }\n style.parentNode.removeChild(style);\n div.parentNode.removeChild(div);\n }\n // If CSS 3D transforms are not supported, check if 2D transforms are supported\n if(!result && (typeof div.style['-webkit-transform'] !== 'undefined' || typeof div.style.transform !== 'undefined')) {\n result = 'translate';\n }\n } else {\n result = 'translate';\n }\n return result;\n}", "function checkCssSupported() {\n // First, check if the 'perspective' CSS property or a vendor-prefixed\n // variant is available.\n var perspectiveProperty = prefixProperty('perspective');\n var el = document.createElement('div');\n var supported = typeof el.style[perspectiveProperty] !== 'undefined';\n\n // Certain versions of Chrome disable 3D transforms even though the CSS\n // property exists. In those cases, we use the following media query,\n // which only succeeds if the feature is indeed enabled.\n if (supported && perspectiveProperty === 'WebkitPerspective') {\n var id = '__marzipano_test_css3d_support__';\n var st = document.createElement('style');\n st.textContent = '@media(-webkit-transform-3d){#' + id + '{height: 3px;})';\n document.getElementsByTagName('head')[0].appendChild(st);\n el.id = id;\n document.body.appendChild(el);\n // The offsetHeight seems to be different than 3 at some zoom levels on\n // Chrome (and maybe other browsers). Test for > 0 instead.\n supported = el.offsetHeight > 0;\n st.parentNode.removeChild(st);\n el.parentNode.removeChild(el);\n }\n\n return supported;\n}", "@autobind\n updateTranslates(event) {\n for (var i = 0, i3 = 0, l = this.particleCount; i < l; i ++, i3 += 3 ) {\n this.translateArray[ i3 + 0 ] = this.targetArray[ i3 + 0 ];\n this.translateArray[ i3 + 1 ] = this.targetArray[ i3 + 1 ];\n this.translateArray[ i3 + 2 ] = this.targetArray[ i3 + 2 ];\n }\n this.geometry.getAttribute( 'translate' ).needsUpdate = true;\n this.material.uniforms[ 'mode' ].value = 0.0;\n }", "tryTransformInPlace(transform) {\n transform.multiplyPoint3dArrayInPlace(this._points);\n return true;\n }", "initTranslateDrag() {\n const me = this;\n me.mode = me.mode || 'translateXY';\n\n if (!me.isElementDraggable && me.targetSelector) {\n me.isElementDraggable = element => DomHelper.up(element, me.targetSelector);\n }\n }", "function isGL3D () {\n var gd = this.gd;\n return (gd._fullLayout && gd._fullLayout._hasGL3D) === true;\n}", "function gTranslate(x, y, z) {\n modelMatrix = mult(modelMatrix, translate([x, y, z]));\n}", "function gTranslate(x, y, z) {\n modelMatrix = mult(modelMatrix, translate([x, y, z]));\n}", "decompose(_translate, _rotate, _scale, _skew, _perspective) {\n // Normalize the matrix.\n if (this.$matrix.m44 == 0)\n return false;\n\n // Gather the params\n let translate = (_translate == undefined || !(\"length\" in _translate)) ? new J3DIVector3 : _translate;\n let rotate = (_rotate == undefined || !(\"length\" in _rotate)) ? new J3DIVector3 : _rotate;\n let scale = (_scale == undefined || !(\"length\" in _scale)) ? new J3DIVector3 : _scale;\n let skew = (_skew == undefined || !(\"length\" in _skew)) ? new J3DIVector3 : _skew;\n let perspective = (_perspective == undefined || !(\"length\" in _perspective)) ? new Array(4) : _perspective;\n\n let matrix = new J3DIMatrix4(this);\n\n matrix.divide(matrix.$matrix.m44);\n\n // perspectiveMatrix is used to solve for perspective, but it also provides\n // an easy way to test for singularity of the upper 3x3 component.\n let perspectiveMatrix = new J3DIMatrix4(matrix);\n\n perspectiveMatrix.$matrix.m14 = 0;\n perspectiveMatrix.$matrix.m24 = 0;\n perspectiveMatrix.$matrix.m34 = 0;\n perspectiveMatrix.$matrix.m44 = 1;\n\n if (perspectiveMatrix._determinant4x4() == 0)\n return false;\n\n // First, isolate perspective.\n if (matrix.$matrix.m14 != 0 || matrix.$matrix.m24 != 0 || matrix.$matrix.m34 != 0) {\n // rightHandSide is the right hand side of the equation.\n let rightHandSide = [matrix.$matrix.m14, matrix.$matrix.m24, matrix.$matrix.m34, matrix.$matrix.m44];\n\n // Solve the equation by inverting perspectiveMatrix and multiplying\n // rightHandSide by the inverse.\n let inversePerspectiveMatrix = new J3DIMatrix4(perspectiveMatrix);\n inversePerspectiveMatrix.invert();\n let transposedInversePerspectiveMatrix = new J3DIMatrix4(inversePerspectiveMatrix);\n transposedInversePerspectiveMatrix.transpose();\n transposedInversePerspectiveMatrix.multVecMatrix(perspective, rightHandSide);\n\n // Clear the perspective partition\n matrix.$matrix.m14 = matrix.$matrix.m24 = matrix.$matrix.m34 = 0\n matrix.$matrix.m44 = 1;\n } else {\n // No perspective.\n perspective[0] = perspective[1] = perspective[2] = 0;\n perspective[3] = 1;\n }\n\n // Next take care of translation\n translate[0] = matrix.$matrix.m41\n matrix.$matrix.m41 = 0\n translate[1] = matrix.$matrix.m42\n matrix.$matrix.m42 = 0\n translate[2] = matrix.$matrix.m43\n matrix.$matrix.m43 = 0\n\n // Now get scale and shear. 'row' is a 3 element array of 3 component vectors\n let row0 = new J3DIVector3(matrix.$matrix.m11, matrix.$matrix.m12, matrix.$matrix.m13);\n let row1 = new J3DIVector3(matrix.$matrix.m21, matrix.$matrix.m22, matrix.$matrix.m23);\n let row2 = new J3DIVector3(matrix.$matrix.m31, matrix.$matrix.m32, matrix.$matrix.m33);\n\n // Compute X scale factor and normalize first row.\n scale[0] = row0.vectorLength();\n row0.divide(scale[0]);\n\n // Compute XY shear factor and make 2nd row orthogonal to 1st.\n skew[0] = row0.dot(row1);\n row1.combine(row0, 1.0, -skew[0]);\n\n // Now, compute Y scale and normalize 2nd row.\n scale[1] = row1.vectorLength();\n row1.divide(scale[1]);\n skew[0] /= scale[1];\n\n // Compute XZ and YZ shears, orthogonalize 3rd row\n skew[1] = row1.dot(row2);\n row2.combine(row0, 1.0, -skew[1]);\n skew[2] = row1.dot(row2);\n row2.combine(row1, 1.0, -skew[2]);\n\n // Next, get Z scale and normalize 3rd row.\n scale[2] = row2.vectorLength();\n row2.divide(scale[2]);\n skew[1] /= scale[2];\n skew[2] /= scale[2];\n\n // At this point, the matrix (in rows) is orthonormal.\n // Check for a coordinate system flip. If the determinant\n // is -1, then negate the matrix and the scaling factors.\n let pdum3 = new J3DIVector3(row1);\n pdum3.cross(row2);\n if (row0.dot(pdum3) < 0) {\n for (i = 0; i < 3; i++) {\n scale[i] *= -1;\n row[0][i] *= -1;\n row[1][i] *= -1;\n row[2][i] *= -1;\n }\n }\n\n // Now, get the rotations out\n rotate[1] = Math.asin(-row0[2]);\n if (Math.cos(rotate[1]) != 0) {\n rotate[0] = Math.atan2(row1[2], row2[2]);\n rotate[2] = Math.atan2(row0[1], row0[0]);\n } else {\n rotate[0] = Math.atan2(-row2[0], row1[1]);\n rotate[2] = 0;\n }\n\n // Convert rotations to degrees\n let rad2deg = 180 / Math.PI;\n rotate[0] *= rad2deg;\n rotate[1] *= rad2deg;\n rotate[2] *= rad2deg;\n\n return true;\n }", "_setTranslation() {\n // avoid unnecessary calculations if we don't have a users set relative position\n let worldPosition = tempWorldPos1.set(0, 0, 0);\n if(!this.relativeTranslation.equals(worldPosition)) {\n worldPosition = this._documentToWorldSpace(this.relativeTranslation);\n }\n\n this._translation.set(\n this._boundingRect.world.left + worldPosition.x,\n this._boundingRect.world.top + worldPosition.y,\n //this._translation.z,\n this.relativeTranslation.z / this.camera.CSSPerspective\n );\n\n // we should update the plane mvMatrix\n this._updateMVMatrix = true;\n }", "toggle3D() {\n this.load().then((ol3d) => {\n ol3d.setEnabled(!ol3d.getEnabled());\n });\n }", "function setTranslate(xPos, yPos, el) {\n el.style.transform = \"translate3d(\" + xPos + \"px, \" + yPos + \"px, 0)\";\n}", "function translateUp() {\n console.log('translate up triggered');\n var m = new THREE.Matrix4();\n m.set( 1, 0, 0, 0,\n 0, 1, 0, 3.5,\n 0, 0, 1, 0,\n 0, 0, 0, 1 );\n geometry.applyMatrix(m);\n // render\n render();\n}", "function fixTransforms(props, el) {\n // clone props at this state\n var propsCopy = {};\n for (var k in props) {\n propsCopy[k] = props[k];\n }\n\n var propVal;\n for (var p in props) {\n propVal = props[p];\n\n // if not a transform: translate, just move on\n if (p != 'transform' || !isTranslate(propVal)) {\n continue;\n }\n\n var x = null;\n var y = null;\n var xy = null;\n var xyz = null;\n\n propVal = propVal.substr(0, propVal.indexOf(')') + 1);\n\n if (startsWith(propVal, 'translateX(')) {\n x = propVal.match(/translateX\\((.*)\\)/)[1].trim();\n } else if (startsWith(propVal, 'translateY(')) {\n y = propVal.match(/translateY\\((.*)\\)/)[1].trim();\n } else if (startsWith(propVal, 'translate(')) {\n xy = propVal.match(/translate\\((.*)\\)/)[1].replace(' ', '').split(',');\n x = xy[0];\n y = xy[1];\n } else { // translate3d( --> X,Y,Z\n xyz = propVal.match(/translate3d\\((.*)\\)/)[1].replace(' ', '').split(',');\n x = xyz[0];\n y = xyz[1];\n }\n\n if (x) {\n var xVal = parseInt(x);\n var xUnits = x.replace(xVal.toString(), '');\n\n if (props.left && props.right && props.left != 'auto' && props.right != 'auto') {\n continue;\n }\n\n if (props.left && props.left != 'auto') {\n var left = props.left.trim();\n var leftVal = parseInt(left);\n var leftUnits = left.replace(leftVal.toString(), '');\n\n if (leftVal == 0|| isNaN(leftVal) || xUnits != leftUnits) {\n continue;\n }\n\n if (xUnits == 'px') {\n propsCopy.left = leftVal + xVal + 'px';\n } else if (xUnits == '%') {\n propsCopy.left = computeNewPctPos(el, 'left', leftVal, xVal);\n }\n } else if (props.right && props.right != 'auto') {\n var right = props.right.trim();\n var rightVal = parseInt(right);\n var rightUnits = right.replace(rightVal.toString(), '');\n\n if (rightVal == 0|| isNaN(rightVal) || xUnits != rightUnits) {\n continue;\n }\n\n xVal = -1 * xVal; // swap around signs\n\n if (xUnits == 'px') {\n propsCopy.right = rightVal + xVal + 'px';\n } else if (xUnits == '%') {\n propsCopy.right = computeNewPctPos(el, 'right', rightVal, xVal);\n }\n } else {\n propsCopy.left = x;\n }\n }\n\n if (y) {\n var yVal = parseInt(y);\n var yUnits = y.replace(yVal.toString(), '');\n\n if (props.top && props.bottom && props.top != 'auto' && props.bottom != 'auto') {\n continue;\n }\n\n if (props.top) {\n var top = props.top.trim();\n var topVal = parseInt(top);\n var topUnits = top.replace(topVal.toString(), '');\n\n if (topVal == 0|| isNaN(topVal) || yUnits != topUnits) {\n continue;\n }\n\n if (yUnits == 'px') {\n propsCopy.top = topVal + yVal + 'px';\n } else if (yUnits == '%') {\n propsCopy.top = computeNewPctPos(el, 'top', topVal, yVal);\n }\n } else if (props.bottom) {\n var bottom = props.bottom.trim();\n var bottomVal = parseInt(bottom);\n var bottomUnits = bottom.replace(bottomVal.toString(), '');\n\n if (bottomVal == 0|| isNaN(bottomVal) || yUnits != bottomUnits) {\n continue;\n }\n\n yVal = -1 * yVal; // swap around signs\n\n if (yUnits == 'px') {\n propsCopy.bottom = bottomVal + yVal + 'px';\n } else if (yUnits == '%') {\n propsCopy.bottom = computeNewPctPos(el, 'bottom', bottomVal, yVal);\n }\n } else {\n propsCopy.top = y;\n }\n }\n\n if (['relative', 'absolute', 'fixed'].indexOf(props['position']) == -1) {\n propsCopy.position = 'relative';\n }\n\n if (x || y) {\n continue;\n }\n }\n\n return propsCopy;\n}", "init_tran(x, y, z) {\n this.ctm = mult(this.ctm, translate(x, y, z));\n\n\n }", "function setTransform() {\n items.style.transform = 'translate3d(' + (-pos * 480) + 'px,0,0)';\n}", "function translate( x, y, z )\n{\n if(arguments.length!=2 && arguments.length != 3) {\n throw \"translate(): not a mat3 or mat4\";\n }\n if(arguments.length == 2) {\n result = mat3();\n result[0][2] = x;\n result[1][2] = y;\n\n return result;\n }\n result = mat4();\n\n result[0][3] = x;\n result[1][3] = y;\n result[2][3] = z;\n\n return result;\n\n}", "OLDtranslateMat4c(x, y, z, m) {\n\n const m12 = m[12];\n m[0] += m12 * x;\n m[4] += m12 * y;\n m[8] += m12 * z;\n\n const m13 = m[13];\n m[1] += m13 * x;\n m[5] += m13 * y;\n m[9] += m13 * z;\n\n const m14 = m[14];\n m[2] += m14 * x;\n m[6] += m14 * y;\n m[10] += m14 * z;\n\n const m15 = m[15];\n m[3] += m15 * x;\n m[7] += m15 * y;\n m[11] += m15 * z;\n\n return m;\n }", "function setTransforms() {\n itemsStyle.style.transform = 'translate3d(' + (posI * 550) + 'px,0,0)';\n}", "function translate(dX, dY, dZ){\r\n if (buttonE && currPick!=null){\r\n\r\n vert = currPick.vert;\r\n var updatedVert = [];\r\n var T = new Matrix4();\r\n T = T.setTranslate(dX, dY, dZ);\r\n \r\n for (var i=0; i<vert.length; i+=3){\r\n var newVert = new Vector3([vert[i], vert[i+1], vert[i+2]]);\r\n newVert = T.multiplyVector3(newVert);\r\n updatedVert.push(newVert.elements[0], newVert.elements[1], newVert.elements[2]);\r\n }\r\n \r\n currPick.vert = updatedVert;\r\n currPick.center = updateCenter(currPick.vert)\r\n \r\n console.log(\"translated\");\r\n if(disx===dX && disy===dY && disz===dZ){drawObjects();}\r\n }\r\n}", "turnOn3D(){\n if(this.currentDimension === Enum.DimensionType.THREE_D)\n return null;\n \n this.controls.enableRotate = true;\n\n this.currentDimension = Enum.DimensionType.THREE_D;\n }", "function getTranslateX(element) {\n\t var style, transform, r, match, k;\n\t if (!element) {\n\t return 0;\n\t }\n\t if (cssTransitionsSupported) {\n\t style = element.style || element;\n\t transform = style.webkitTransform;\n\t if (typeof transform === \"string\") {\n\t r = new RegExp(\"translate(3d|X|)\\\\(-*(\\\\d+)\");\n\t match = r.exec(transform);\n\t if (match) {\n\t k = parseFloat(match[1]);\n\t if (isFinite(k)) {\n\t return k;\n\t }\n\t }\n\t }\n\t }\n\t else {\n\t var k = parseInt($(element).css(\"left\"));\n\t if (isFinite(k)) {\n\t return k;\n\t }\n\t }\n\t return 0;\n\t}", "function translateDown() {\n console.log('translate down triggered');\n var m = new THREE.Matrix4();\n m.set( 1, 0, 0, 0,\n 0, 1, 0, -3.5,\n 0, 0, 1, 0,\n 0, 0, 0, 1 );\n geometry.applyMatrix(m);\n // render\n render();\n}", "function onManipulatorXYZChangedHandler(sender, args) {\r\n\r\n var xyzDelta = manipulatorData.getTrait(\"ManipulatorTraitXYZ\").value;\r\n var dx = xyzDelta[0];\r\n var dy = xyzDelta[1];\r\n var dz = xyzDelta[2];\r\n\r\n coreTranslate(dx, dy, dz);\r\n}", "static getTransform ({ x = null, y = null, zoom = null }) {\n const transforms = []\n if (x !== null || y !== null) {\n transforms.push(`translate3d(${x || 0}px,${y || 0}px,0)`)\n }\n if (zoom !== null) {\n transforms.push(`scale3d(${zoom},${zoom},1)`)\n }\n return { transform: transforms.length === 0 ? 'none' : transforms.join(' ') }\n }", "function getTranslate(element) {\n var transform = element.css('-webkit-transform') || element.css('-ms-transform') || element.css('-moz-transform') || \n element.css('-o-transform') || element.css('transform');\n var matrix = transform.substr(7, transform.length - 8).split(', ');\n\n return { x: parseFloat(matrix[4]) || 0, y: parseFloat(matrix[5]) || 0 };\n }", "apply(){\n if(!this.animationDone){\n this.scene.translate( this.translateVec[0], this.translateVec[1], this.translateVec[2]);\n if(!(this.vectors[this.pointIndex].vec[0]==0 && this.vectors[this.pointIndex].vec[2]==0))\n { \n this.scene.rotate(this.angle,0,1,0);\n }\n }\n }", "#updateTranslate() {\n\n const size = this.#getSize();\n\n var t = this.#difftranslate;\n t.x /= size.x;\n t.y /= size.x;\n\n var c = this.translatepower;\n this.camera.position.x -= t.x * c;\n this.camera.position.y += t.y * c;\n\n this.#difftranslate.x = 0;\n this.#difftranslate.y = 0;\n }", "function with3DAcceleration(element, action, args) {\n\t var property = \"-webkit-transform\",\n enabler = \"translate3d(0,0,0)\",\n\t origValue = element.css(property);\n\n\t var isNone = !(origValue && origValue.match(/^\\s*none\\s*$/i));\n\t element.css(property, isNone ? enabler : origValue + \" \" + enabler);\n\t try {\n\t return action.apply(this, args);\n\t } finally {\n\t element.css(property, origValue);\n\t }\n\t}", "function onTouchMove(event3D) {\n var event = event3D.domEvent;\n if (state === STATE.ROTATE) {\n\n rotateEnd.set(event.touches[0].pageX - window.scrollX, event.touches[0].pageY - window.scrollY);\n rotateDelta.subVectors(rotateEnd, rotateStart);\n\n that.rotateLeft(2 * Math.PI * rotateDelta.x / pixelsPerRound * that.userRotateSpeed);\n that.rotateUp(2 * Math.PI * rotateDelta.y / pixelsPerRound * that.userRotateSpeed);\n\n rotateStart.copy(rotateEnd);\n this.showAxes();\n } else {\n touchMoveVector[0].set(touchStartPosition[0].x - event.touches[0].pageX,\n touchStartPosition[0].y - event.touches[0].pageY);\n touchMoveVector[1].set(touchStartPosition[1].x - event.touches[1].pageX,\n touchStartPosition[1].y - event.touches[1].pageY);\n if (touchMoveVector[0].lengthSq() > touchMoveThreshold &&\n touchMoveVector[1].lengthSq() > touchMoveThreshold) {\n touchStartPosition[0].set(event.touches[0].pageX,\n event.touches[0].pageY);\n touchStartPosition[1].set(event.touches[1].pageX,\n event.touches[1].pageY);\n if (touchMoveVector[0].dot(touchMoveVector[1]) > 0 &&\n state !== STATE.ZOOM) {\n state = STATE.MOVE;\n } else if (touchMoveVector[0].dot(touchMoveVector[1]) < 0 &&\n state !== STATE.MOVE) {\n state = STATE.ZOOM;\n }\n if (state === STATE.ZOOM) {\n var tmpVector = new THREE$1.Vector2();\n tmpVector.subVectors(touchStartPosition[0],\n touchStartPosition[1]);\n if (touchMoveVector[0].dot(tmpVector) < 0 &&\n touchMoveVector[1].dot(tmpVector) > 0) {\n that.zoomOut();\n } else if (touchMoveVector[0].dot(tmpVector) > 0 &&\n touchMoveVector[1].dot(tmpVector) < 0) {\n that.zoomIn();\n }\n }\n }\n if (state === STATE.MOVE) {\n var intersection = intersectViewPlane(event3D.mouseRay,\n that.center,\n moveStartNormal);\n if (!intersection) {\n return;\n }\n var delta = new THREE$1.Vector3().subVectors(moveStartIntersection.clone(),\n intersection.clone());\n that.center.addVectors(moveStartCenter.clone(), delta.clone());\n that.camera.position.addVectors(moveStartPosition.clone(), delta.clone());\n that.update();\n that.camera.updateMatrixWorld();\n }\n\n this.showAxes();\n\n event.preventDefault();\n }\n }", "translate(x, y, z = 0) {\n const m = this.getCurrentMatrix();\n this.setCurrentMatrix(m4.translate(m, [x, y, z]));\n }", "function updatePerspectiveOriginInit() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($('.posts-container[data-load-animation=\"perspective\"]').length > 0) {\r\n\t\t\t\t\t\trequestAnimationFrame(updatePerspectiveOrigin);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function parallaxElements() {\n const targets = document.querySelectorAll('.parallax-landing');\n\n for(let index = 0; index < targets.length; index++) {\n\n let targetOffsetMiddle = targets[index].offsetTop + Math.floor(targets[index].clientHeight/2);\n let windowOffsetMiddle = window.pageYOffset + Math.floor(window.innerHeight/2);\n\n if(windowOffsetMiddle >= targetOffsetMiddle) {\n\n let pos = (windowOffsetMiddle - targetOffsetMiddle) * targets[index].dataset.rate;\n\n if(targets[index].dataset.direction === 'vertical') {\n targets[index].style.transform = 'translate3d(0px, ' + pos + 'px, 0px)';\n } else {\n targets[index].style.transform = 'translate3d(' + pos + 'px, 0px, 0px)';\n }\n\n } else {\n targets[index].style.transform = 'translate3d(0px, 0px, 0px)';\n }\n\n }\n}", "function detectTransformProperty() {\n var transformProperty = 'transform',\n safariPropertyHack = 'webkitTransform';\n if (typeof document.body.style[transformProperty] !== 'undefined') {\n\n ['webkit', 'moz', 'o', 'ms'].every(function (prefix) {\n var e = '-' + prefix + '-transform';\n if (typeof document.body.style[e] !== 'undefined') {\n transformProperty = e;\n return false;\n }\n return true;\n });\n } else if (typeof document.body.style[safariPropertyHack] !== 'undefined') {\n transformProperty = '-webkit-transform';\n } else {\n transformProperty = undefined;\n }\n return transformProperty;\n }", "onTranslation() {\n // get our slider translation and take our previous translation into account\n var planeTranslation = {\n x: this.direction === 0 ? this.translation - this.previousTranslation.x : 0,\n y: this.direction === 1 ? this.translation - this.previousTranslation.y : 0,\n };\n\n // keep our WebGL planes position in sync with their HTML elements\n for(var i = 0; i < this.planes.length; i++) {\n // in the previous CodePen we were using updatePosition the method which handles positioning automatically\n // however this method internally calls getBoundingClientRect() which causes a reflow and therefore impacts performance\n // so we will position our planes manually with setRelativePosition instead, which does not trigger a layout repaint call\n this.planes[i].setRelativePosition(planeTranslation.x, planeTranslation.y);\n }\n\n // shader pass displacement texture offset\n if(this.shaderPass) {\n // we will offset our displacement effect on main axis so it follows the drag\n var offset = ((this.direction - 1) * 2 + 1) * this.translation / this.boundaries.referentSize;\n\n this.shaderPass.uniforms.offset.value[this.direction] = offset;\n }\n }", "function transformContainer(translate3d, animated){\n \t\t\tif(animated){\n \t\t\t\taddAnimation(container);\n \t\t\t}else{\n \t\t\t\tremoveAnimation(container);\n \t\t\t}\n\n \t\t\tcontainer.css(getTransforms(translate3d));\n\n \t\t\t//syncronously removing the class after the animation has been applied.\n \t\t\tsetTimeout(function(){\n \t\t\t\tcontainer.removeClass('fp-notransition');\n \t\t\t},10)\n \t\t}", "function detectTransformProperty() {\n var transformProperty = 'transform',\n safariPropertyHack = 'webkitTransform';\n if (typeof document.body.style[transformProperty] !== 'undefined') {\n\n ['webkit', 'moz', 'o', 'ms'].every(function (prefix) {\n var e = '-' + prefix + '-transform';\n if (typeof document.body.style[e] !== 'undefined') {\n transformProperty = e;\n return false;\n }\n return true;\n });\n } else if (typeof document.body.style[safariPropertyHack] !== 'undefined') {\n transformProperty = '-webkit-transform';\n } else {\n transformProperty = undefined;\n }\n return transformProperty;\n }", "get targetTranslateX() {\n return +this.getAttribute('target-translate-x') || 0;\n }", "static make3DTranslationMatrix(vector){\n if(vector.length == null || vector.length != 3){\n return null;\n }\n let M = Matrix.makeIdentity(4,4);\n M.matrix[0][3] = vector[0];\n M.matrix[1][3] = vector[1];\n M.matrix[2][3] = vector[2];\n return M;\n}", "function translate(i, j)\n{\n var v = new THREE.Vector3();\n\n v.y = 0;\n v.x = (i * squaresize) - (MAXPOS / 2);\n v.z = (j * squaresize) - (MAXPOS / 2);\n\n return v;\n}", "parseTranslate(matrix, transformation, transformationID) {\r\n var args = this.parseCoordinates3D(transformation, transformationID); //parse translate arguments\r\n if (!Array.isArray(args)) {\r\n this.onXMLError(\"Error while parsing coords (\" + args + \") in: \" + transformationID);\r\n return matrix;\r\n }\r\n\r\n matrix = mat4.translate(matrix, matrix, args);\r\n return matrix;\r\n }", "function set_translation(elem, x, y)\n{\n elem.style.OTransform =\n elem.style.MozTransform =\n \"translate({0}px, {1}px)\".fmt(x, y);\n elem.style.WebkitTransform = \"translate3d({0}px, {1}px, 0)\".fmt(x, y);\n}", "function hitDetect3D(PVector p1, PVector s1, PVector p2, PVector s2) {\n s1.x /= 2;\n s1.y /= 2;\n s1.z /= 2;\n s2.x /= 2;\n s2.y /= 2; \n s2.z /= 2; \n if ( p1.x + s1.x >= p2.x - s2.x && \n p1.x - s1.x <= p2.x + s2.x && \n p1.y + s1.y >= p2.y - s2.y && \n p1.y - s1.y <= p2.y + s2.y &&\n p1.z + s1.z >= p2.z - s2.z && \n p1.z - s1.z <= p2.z + s2.z\n ) {\n return true;\n } else {\n return false;\n }\n}", "static isVisible(element) {\n const cssMatrixAsArray = element.style.transform\n .replace('matrix3d(', '')\n .replace(')', '')\n .split(', ');\n\n return cssMatrixAsArray.every((cur) => cur === '0' || cur === '1');\n }", "function checkHasPositionalTracking () {\n\t var vrDisplay = controls.getVRDisplay();\n\t if (isMobile() || isGearVR()) { return false; }\n\t return vrDisplay && vrDisplay.capabilities.hasPosition;\n\t}", "function recalcTransforms() {\n var fiftyPercent = Math.round(window.innerWidth / 2) + 'px';\n pointingRight = 'translateZ(-'+fiftyPercent+') rotateY(+90deg) translateZ(+'+fiftyPercent+')';\n pointingLeft = 'translateZ(-'+fiftyPercent+') rotateY(-90deg) translateZ(+'+fiftyPercent+')';\n pointingFront = 'translateZ(-'+fiftyPercent+') rotateY(0deg) translateZ(+'+fiftyPercent+')';\n}", "function getTransformProperty(element) {\n\t var properties = [\n\t 'transform',\n\t 'WebkitTransform',\n\t 'msTransform',\n\t 'MozTransform',\n\t 'OTransform'\n\t ];\n\t var p;\n\t while (p = properties.shift()) {\n\t if (typeof element.style[p] != 'undefined') {\n\t return p;\n\t }\n\t }\n\t return false;\n\t}", "get hasTranslationDoF() {}", "function toO3D(n) {\n return n !== true ? n : false;\n}", "function toO3D(n) {\n return n !== true ? n : false;\n}" ]
[ "0.79246575", "0.791739", "0.7851457", "0.7851457", "0.7851457", "0.78462875", "0.78462875", "0.78462875", "0.78462875", "0.78462875", "0.782492", "0.7668006", "0.76585275", "0.76585275", "0.76101035", "0.76101035", "0.75682825", "0.7524417", "0.7524417", "0.7522251", "0.7499815", "0.749408", "0.7389803", "0.7388125", "0.73750234", "0.71067834", "0.6983021", "0.6711228", "0.66915905", "0.6478887", "0.6426769", "0.63950634", "0.63950634", "0.63950634", "0.63950634", "0.63950634", "0.63657594", "0.63657594", "0.63657594", "0.63657594", "0.63657594", "0.63657594", "0.63657594", "0.63611674", "0.635685", "0.6322833", "0.6220827", "0.62099314", "0.6088772", "0.6056477", "0.5904873", "0.58052576", "0.57646424", "0.57638127", "0.5738938", "0.56759083", "0.5622337", "0.5622337", "0.5557864", "0.554229", "0.55364704", "0.55114836", "0.550604", "0.548847", "0.54311097", "0.54276377", "0.5421032", "0.5371258", "0.5353287", "0.5328512", "0.5300681", "0.527526", "0.5262412", "0.52593184", "0.524255", "0.5236175", "0.5232035", "0.51868075", "0.5184532", "0.51776516", "0.5131031", "0.5129364", "0.51260906", "0.5123842", "0.51196104", "0.5108144", "0.5103849", "0.50987077", "0.5086887", "0.5086241", "0.5073933", "0.5055894", "0.5043181", "0.50384516", "0.50380844", "0.50155425", "0.5006428", "0.5004982", "0.50030977", "0.50030977" ]
0.796588
0
port of webkit cubic bezier handling by
function cubicBezierAtTime(t,p1x,p1y,p2x,p2y,duration) { var ax = 0,bx = 0,cx = 0,ay = 0,by = 0,cy = 0; function sampleCurveX(t) {return ((ax * t + bx) * t + cx) * t;} function sampleCurveY(t) {return ((ay * t + by) * t + cy) * t;} function sampleCurveDerivativeX(t) {return (3.0 * ax * t + 2.0 * bx) * t + cx;} function solveEpsilon(duration) {return 1.0 / (200.0 * duration);} function solve(x,epsilon) {return sampleCurveY(solveCurveX(x,epsilon));} function fabs(n) {if (n >= 0) {return n;}else {return 0 - n;}} function solveCurveX(x,epsilon) { var t0,t1,t2,x2,d2,i; for (t2 = x, i = 0; i < 8; i++) {x2 = sampleCurveX(t2) - x; if (fabs(x2) < epsilon) {return t2;} d2 = sampleCurveDerivativeX(t2); if (fabs(d2) < 1e-6) {break;} t2 = t2 - x2 / d2;} t0 = 0.0; t1 = 1.0; t2 = x; if (t2 < t0) {return t0;} if (t2 > t1) {return t1;} while (t0 < t1) {x2 = sampleCurveX(t2); if (fabs(x2 - x) < epsilon) {return t2;} if (x > x2) {t0 = t2;}else {t1 = t2;} t2 = (t1 - t0) * 0.5 + t0;} return t2; // Failure. } cx = 3.0 * p1x; bx = 3.0 * (p2x - p1x) - cx; ax = 1.0 - cx - bx; cy = 3.0 * p1y; by = 3.0 * (p2y - p1y) - cy; ay = 1.0 - cy - by; return solve(t, solveEpsilon(duration)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bezier(u, p0, p1, p2, p3) {\n\n return Math.pow(u, 3) * (p3 + 3 * (p1 - p2) - p0)\n + 3 * Math.pow(u, 2) * (p0 - 2 * p1 + p2)\n + 3 * u * (p1 - p0) + p0;\n}", "function bezier(u, p0, p1, p2, p3) {\n\n return Math.pow(u, 3) * (p3 + 3 * (p1 - p2) - p0)\n + 3 * Math.pow(u, 2) * (p0 - 2 * p1 + p2)\n + 3 * u * (p1 - p0) + p0;\n}", "function cubicBezier(bezier) {\r\n var mX1 = bezier[0];\r\n var mY1 = bezier[1];\r\n var mX2 = bezier[2];\r\n var mY2 = bezier[3];\r\n\r\n this.get = function(aX) {\r\n if (mX1 == mY1 && mX2 == mY2) return aX; // linear\r\n return CalcBezier(GetTForX(aX), mY1, mY2);\r\n }\r\n\r\n function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\r\n function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\r\n function C(aA1) { return 3.0 * aA1; }\r\n\r\n // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\r\n function CalcBezier(aT, aA1, aA2) {\r\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\r\n }\r\n\r\n // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\r\n function GetSlope(aT, aA1, aA2) {\r\n return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\r\n }\r\n\r\n function GetTForX(aX) {\r\n // Newton raphson iteration\r\n var aGuessT = aX;\r\n for (var i = 0; i < 4; ++i) {\r\n var currentSlope = GetSlope(aGuessT, mX1, mX2);\r\n if (currentSlope == 0.0) return aGuessT;\r\n var currentX = CalcBezier(aGuessT, mX1, mX2) - aX;\r\n aGuessT -= currentX / currentSlope;\r\n }\r\n return aGuessT;\r\n }\r\n}", "function CubicPoly() {\n\n\t \t}", "function cubicBezier(x1, y1, x2, y2) {\n function xForT(t) {\n var omt = 1-t;\n return 3 * omt * omt * t * x1 + 3 * omt * t * t * x2 + t * t * t;\n }\n\n function yForT(t) {\n var omt = 1-t;\n return 3 * omt * omt * t * y1 + 3 * omt * t * t * y2 + t * t * t;\n }\n\n function tForX(x) {\n // Binary subdivision.\n var mint = 0, maxt = 1;\n for (var i = 0; i < 30; ++i) {\n var guesst = (mint + maxt) / 2;\n var guessx = xForT(guesst);\n if (x < guessx) {\n maxt = guesst;\n } else {\n mint = guesst;\n }\n }\n return (mint + maxt) / 2;\n }\n\n return function bezierClosure(x) {\n if (x == 0) {\n return 0;\n }\n if (x == 1) {\n return 1;\n }\n return yForT(tForX(x));\n }\n}", "function CubicPoly() {\r\n\r\n\t\t}", "function CubicPoly() {\r\n\r\n\t}", "function CubicPoly() {\n\n\t}", "function CubicPoly() {\n\n\t}", "function CubicPoly(){}", "function CubicPoly() {}", "function CubicPoly() {}", "function CubicPoly() {}", "function CubicPoly() {}", "function CubicPoly() {}", "function _bezierXder(t) { return Cx + t * (2*Bx + 3*Ax * t); }", "function bezier_x_der(t) { return Cx + t * (2*Bx + 3*Ax * t); }", "function bezier(k, n, u) {\n return Math.pow(u, k) * Math.pow((1 - u), (n - k)) * combinations[n.toString()][k]\n}", "function punti_cerchio_bezier(r){\n var c = [[0,1,0],[1.6,1,0],[1.6,-1.5,0],[0,-1.5,0],[-1.6,-1.5,0],[-1.6,1,0],[0,1,0]];\n for(var i=0;i<c.length;i++)\n for(var k=0;k<c[i].length;k++)\n c[i][k] = c[i][k]*r;\n return c;\n}", "function bezier_curve(p0, p1, p2, p3, scale) {\n // var i2 = { x: p1.x + scale*(p1.x-p0.x), y: p1.y + scale*(p1.y-p0.y) };\n // var i3 = { x: p2.x + scale*(p2.x-p3.x), y: p2.y + scale*(p2.y-p3.y) };\n\n // var d = 'M'+p1.x+','+p1.y+' '+'C'+i2.x+','+i2.y+\" \"+i3.x+','+i3.y+\" \"+p2.x+\",\"+p2.y;\n\n let d = 'M ';\n\n // Chase's algorithm via StackOverflow\n let a1 = p2.x-p0.x;\n let a2 = (2*p0.x-5*p1.x+4*p2.x-p3.x);\n let a3 = (3*p1.x-p0.x-3*p2.x+p3.x);\n let b1 = (p2.y-p0.y);\n let b2 = (2*p0.y-5*p1.y+4*p2.y-p3.y);\n let b3 = (3*p1.y-p0.y-3*p2.y+p3.y);\n let g = 16;\n let one_over_g = 1/g;\n for (let i = 0; i < g; i++){\n let t = i * one_over_g;\n let tt = t*t;\n let ttt = tt * t;\n\n let x = 0.5 * (2*p1.x+ a1*t + a2*tt + a3*ttt);\n let y = 0.5 * (2*p1.y+ b1*t + b2*tt + b3*ttt);\n d += x+' '+y+' ';\n }\n d += p2.x+' '+p2.y+' ';\n\n return d;\n }", "easeInCubic(t) {\n return t * t * t;\n }", "function bezier() {\n\n ctx = this;\n ctx.lineWidth = this.curve_thickness;\n ctx.strokeStyle = this.bezier_color;\n /**check for correct number of arguments*/\n if (arguments.length % 2 != 0 || arguments.length < 4) {\n throw \"Incorrect number of points \" + arguments.length;\n }\n\n //transform initial arguments into an {Array} of [x,y] coordinates\n var initialPoints = [];\n for (var i = 0; i < arguments.length; i = i + 2) {\n initialPoints.push([arguments[i], arguments[i + 1]]);\n }\n\n function distance(a, b) {\n return Math.sqrt(Math.pow(a[0] - b[0], 2) + Math.pow(a[1] - b[1], 2));\n }\n\n /**Computes the drawing/support points for the Bezier curve*/\n function computeSupportPoints(points) {\n\n /**Computes factorial*/\n function fact(k) {\n if (k == 0 || k == 1) {\n return 1;\n } else {\n return k * fact(k - 1);\n }\n }\n\n /**Computes Bernstain\n *@param {Integer} i - the i-th index\n *@param {Integer} n - the total number of points\n *@param {Number} t - the value of parameter t , between 0 and 1\n **/\n function B(i, n, t) {\n //if(n < i) throw \"Wrong\";\n return fact(n) / (fact(i) * fact(n - i)) * Math.pow(t, i) * Math.pow(1 - t, n - i);\n }\n\n\n /**Computes a point's coordinates for a value of t\n *@param {Number} t - a value between o and 1\n *@param {Array} points - an {Array} of [x,y] coodinates. The initial points\n **/\n function P(t, points) {\n var r = [0, 0];\n var n = points.length - 1;\n for (var i = 0; i <= n; i++) {\n r[0] += points[i][0] * B(i, n, t);\n r[1] += points[i][1] * B(i, n, t);\n }\n return r;\n }\n\n\n /**Compute the incremental step*/\n var tLength = 0;\n for (var i = 0; i < points.length - 1; i++) {\n tLength += distance(points[i], points[i + 1]);\n }\n var step = 1 / tLength;\n\n //compute the support points\n var temp = [];\n for (var t = 0; t <= 1; t = t + step) {\n var p = P(t, points);\n temp.push(p);\n }\n return temp;\n }\n\n /**Generic paint curve method*/\n function paintCurve(points) {\n ctx.save();\n\n ctx.beginPath();\n ctx.moveTo(points[0][0], points[0][1]);\n for (var i = 1; i < points.length; i++) {\n ctx.lineTo(points[i][0], points[i][1]);\n }\n ctx.stroke();\n ctx.restore();\n }\n\n var supportPoints = computeSupportPoints(initialPoints);\n paintCurve(supportPoints);\n}", "function cubicEaseInOut (p) {\n if(p < 0.5) {\n return 4 * p * p * p;\n } else {\n var f = ((2 * p) - 2);\n return 0.5 * f * f * f + 1;\n }\n}", "function bezier(p1, p2, p3, p4, t) {\n\n var a = 1 - t,\n b = a * a * a,\n c = t * t * t;\n\n return point2D(Math.round(b * p1.x + 3 * t * a * a * p2.x + 3 * t * t * a * p3.x + c * p4.x),\n Math.round(b * p1.y + 3 * t * a * a * p2.y + 3 * t * t * a * p3.y + c * p4.y));\n\n }", "function easeInCubic(t, b, c, d) {\n\t return c * (t /= d) * t * t + b;\n\t}", "function easeInCubic (t, b, c, d)\n {\n return c*(t/=d)*t*t + b;\n }", "function cubicBezierAtTime(t,p1x,p1y,p2x,p2y,duration) {\n var ax = 0,bx = 0,cx = 0,ay = 0,by = 0,cy = 0;\n function sampleCurveX(t) {return ((ax * t + bx) * t + cx) * t;}\n function sampleCurveY(t) {return ((ay * t + by) * t + cy) * t;}\n function sampleCurveDerivativeX(t) {return (3.0 * ax * t + 2.0 * bx) * t + cx;}\n function solveEpsilon(duration) {return 1.0 / (200.0 * duration);}\n function solve(x,epsilon) {return sampleCurveY(solveCurveX(x,epsilon));}\n function fabs(n) {if (n >= 0) {return n;}else {return 0 - n;}}\n function solveCurveX(x,epsilon) {\n var t0,t1,t2,x2,d2,i;\n for (t2 = x, i = 0; i < 8; i++) {x2 = sampleCurveX(t2) - x; if (fabs(x2) < epsilon) {return t2;} d2 = sampleCurveDerivativeX(t2); if (fabs(d2) < 1e-6) {break;} t2 = t2 - x2 / d2;}\n t0 = 0.0; t1 = 1.0; t2 = x; if (t2 < t0) {return t0;} if (t2 > t1) {return t1;}\n while (t0 < t1) {x2 = sampleCurveX(t2); if (fabs(x2 - x) < epsilon) {return t2;} if (x > x2) {t0 = t2;}else {t1 = t2;} t2 = (t1 - t0) * 0.5 + t0;}\n return t2; // Failure.\n }\n cx = 3.0 * p1x; bx = 3.0 * (p2x - p1x) - cx; ax = 1.0 - cx - bx; cy = 3.0 * p1y; by = 3.0 * (p2y - p1y) - cy; ay = 1.0 - cy - by;\n return solve(t, solveEpsilon(duration));\n }", "function easeInCubic(t) {\n return t * t * t;\n }", "function easeInCubic(t) {\n return t * t * t;\n }", "function easeInOutCubic(t, b, c, d) {\n\t if ((t /= d / 2) < 1) return c / 2 * t * t * t + b;\n\t return c / 2 * ((t -= 2) * t * t + 2) + b;\n\t}", "function bezier(pts,size) {\n var start = pts[0];\n var cpre = start;\n var segs=[];\n for (var p = 0; p < pts.length; p+=2) {\n var end = pts[p];\n var c2 = p==0? invertPt(pts[1],pts[0]) : pts[p-1];\n var c1 = invertPt(cpre,start);\n segs.push([start, c1, c2, end]);\n start = end;\n cpre = c2;\n }\n segs.push([start,invertPt(cpre,start),start,start]);\n\n var tstep = segs.length / size;\n var tsize = size / segs.length;\n var acc = [];\n for (var i = 0; i < segs.length; i++) {\n var s = segs[i];\n for (var t = 0; t <= 1; t += tstep) {\n acc.push(cubicPt(s[0],s[1],s[2],s[3],t));\n }\n }\n return acc;\n}", "easeInOutCubic(t) {\n return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;\n }", "function easeInOutCubic(t, b, c, d) {\n\tif ((t/=d/2) < 1) return c/2*t*t + b;\n\treturn -c/2 * ((--t)*(t-2) - 1) + b;\n}", "function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }", "function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }", "function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }", "function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }", "function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }", "function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }", "function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }", "function Bezier(idx, p0, p1, p2, p3){\n var cX = 3 * (p1.x - p0.x);\n var bX = 3 * (p2.x - p1.x) - cX;\n var aX = p3.x - p0.x - cX - bX;\n\n var cY = 3 * (p1.y - p0.y);\n var bY = 3 * (p2.y - p1.y) - cY;\n var aY = p3.y - p0.y - cY - bY;\n //x(t) = axt3 + bxt2 + cxt + x0\n this.x = (aX * Math.pow(idx, 3)) + (bX * Math.pow(idx, 2)) + (cX * idx) + p0.x;\n this.y = (aY * Math.pow(idx, 3)) + (bY * Math.pow(idx, 2)) + (cY * idx) + p0.y;\n \n}", "function calcBezier(aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }", "function bezFunction() {\n var math = Math;\n function pointOnLine2D(x1, y1, x2, y2, x3, y3) {\n var det1 = x1 * y2 + y1 * x3 + x2 * y3 - x3 * y2 - y3 * x1 - x2 * y1;\n return det1 > -0.001 && det1 < 0.001;\n }\n function pointOnLine3D(x1, y1, z1, x2, y2, z2, x3, y3, z3) {\n if (z1 === 0 && z2 === 0 && z3 === 0) return pointOnLine2D(x1, y1, x2, y2, x3, y3);\n var dist1 = math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2) + math.pow(z2 - z1, 2));\n var dist2 = math.sqrt(math.pow(x3 - x1, 2) + math.pow(y3 - y1, 2) + math.pow(z3 - z1, 2));\n var dist3 = math.sqrt(math.pow(x3 - x2, 2) + math.pow(y3 - y2, 2) + math.pow(z3 - z2, 2));\n var diffDist;\n if (dist1 > dist2) {\n if (dist1 > dist3) diffDist = dist1 - dist2 - dist3;\n else diffDist = dist3 - dist2 - dist1;\n } else if (dist3 > dist2) diffDist = dist3 - dist2 - dist1;\n else diffDist = dist2 - dist1 - dist3;\n return diffDist > -0.0001 && diffDist < 0.0001;\n }\n var getBezierLength = function() {\n return function(pt1, pt2, pt3, pt4) {\n var curveSegments = defaultCurveSegments;\n var k;\n var i;\n var len;\n var ptCoord;\n var perc;\n var addedLength = 0;\n var ptDistance;\n var point = [];\n var lastPoint = [];\n var lengthData = bezierLengthPool.newElement();\n len = pt3.length;\n for(k = 0; k < curveSegments; k += 1){\n perc = k / (curveSegments - 1);\n ptDistance = 0;\n for(i = 0; i < len; i += 1){\n ptCoord = bmPow(1 - perc, 3) * pt1[i] + 3 * bmPow(1 - perc, 2) * perc * pt3[i] + 3 * (1 - perc) * bmPow(perc, 2) * pt4[i] + bmPow(perc, 3) * pt2[i];\n point[i] = ptCoord;\n if (lastPoint[i] !== null) ptDistance += bmPow(point[i] - lastPoint[i], 2);\n lastPoint[i] = point[i];\n }\n if (ptDistance) {\n ptDistance = bmSqrt(ptDistance);\n addedLength += ptDistance;\n }\n lengthData.percents[k] = perc;\n lengthData.lengths[k] = addedLength;\n }\n lengthData.addedLength = addedLength;\n return lengthData;\n };\n }();\n function getSegmentsLength(shapeData) {\n var segmentsLength = segmentsLengthPool.newElement();\n var closed = shapeData.c;\n var pathV = shapeData.v;\n var pathO = shapeData.o;\n var pathI = shapeData.i;\n var i;\n var len = shapeData._length;\n var lengths = segmentsLength.lengths;\n var totalLength = 0;\n for(i = 0; i < len - 1; i += 1){\n lengths[i] = getBezierLength(pathV[i], pathV[i + 1], pathO[i], pathI[i + 1]);\n totalLength += lengths[i].addedLength;\n }\n if (closed && len) {\n lengths[i] = getBezierLength(pathV[i], pathV[0], pathO[i], pathI[0]);\n totalLength += lengths[i].addedLength;\n }\n segmentsLength.totalLength = totalLength;\n return segmentsLength;\n }\n function BezierData(length) {\n this.segmentLength = 0;\n this.points = new Array(length);\n }\n function PointData(partial, point) {\n this.partialLength = partial;\n this.point = point;\n }\n var buildBezierData = function() {\n var storedData = {\n };\n return function(pt1, pt2, pt3, pt4) {\n var bezierName = (pt1[0] + '_' + pt1[1] + '_' + pt2[0] + '_' + pt2[1] + '_' + pt3[0] + '_' + pt3[1] + '_' + pt4[0] + '_' + pt4[1]).replace(/\\./g, 'p');\n if (!storedData[bezierName]) {\n var curveSegments = defaultCurveSegments;\n var k;\n var i;\n var len;\n var ptCoord;\n var perc;\n var addedLength = 0;\n var ptDistance;\n var point;\n var lastPoint = null;\n if (pt1.length === 2 && (pt1[0] !== pt2[0] || pt1[1] !== pt2[1]) && pointOnLine2D(pt1[0], pt1[1], pt2[0], pt2[1], pt1[0] + pt3[0], pt1[1] + pt3[1]) && pointOnLine2D(pt1[0], pt1[1], pt2[0], pt2[1], pt2[0] + pt4[0], pt2[1] + pt4[1])) curveSegments = 2;\n var bezierData = new BezierData(curveSegments);\n len = pt3.length;\n for(k = 0; k < curveSegments; k += 1){\n point = createSizedArray(len);\n perc = k / (curveSegments - 1);\n ptDistance = 0;\n for(i = 0; i < len; i += 1){\n ptCoord = bmPow(1 - perc, 3) * pt1[i] + 3 * bmPow(1 - perc, 2) * perc * (pt1[i] + pt3[i]) + 3 * (1 - perc) * bmPow(perc, 2) * (pt2[i] + pt4[i]) + bmPow(perc, 3) * pt2[i];\n point[i] = ptCoord;\n if (lastPoint !== null) ptDistance += bmPow(point[i] - lastPoint[i], 2);\n }\n ptDistance = bmSqrt(ptDistance);\n addedLength += ptDistance;\n bezierData.points[k] = new PointData(ptDistance, point);\n lastPoint = point;\n }\n bezierData.segmentLength = addedLength;\n storedData[bezierName] = bezierData;\n }\n return storedData[bezierName];\n };\n }();\n function getDistancePerc(perc, bezierData) {\n var percents = bezierData.percents;\n var lengths = bezierData.lengths;\n var len = percents.length;\n var initPos = bmFloor((len - 1) * perc);\n var lengthPos = perc * bezierData.addedLength;\n var lPerc = 0;\n if (initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]) return percents[initPos];\n var dir = lengths[initPos] > lengthPos ? -1 : 1;\n var flag = true;\n while(flag){\n if (lengths[initPos] <= lengthPos && lengths[initPos + 1] > lengthPos) {\n lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos + 1] - lengths[initPos]);\n flag = false;\n } else initPos += dir;\n if (initPos < 0 || initPos >= len - 1) {\n // FIX for TypedArrays that don't store floating point values with enough accuracy\n if (initPos === len - 1) return percents[initPos];\n flag = false;\n }\n }\n return percents[initPos] + (percents[initPos + 1] - percents[initPos]) * lPerc;\n }\n function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {\n var t1 = getDistancePerc(percent, bezierData);\n var u1 = 1 - t1;\n var ptX = math.round((u1 * u1 * u1 * pt1[0] + (t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1) * pt3[0] + (t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1) * pt4[0] + t1 * t1 * t1 * pt2[0]) * 1000) / 1000;\n var ptY = math.round((u1 * u1 * u1 * pt1[1] + (t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1) * pt3[1] + (t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1) * pt4[1] + t1 * t1 * t1 * pt2[1]) * 1000) / 1000;\n return [\n ptX,\n ptY\n ];\n }\n var bezierSegmentPoints = createTypedArray('float32', 8);\n function getNewSegment(pt1, pt2, pt3, pt4, startPerc, endPerc, bezierData) {\n if (startPerc < 0) startPerc = 0;\n else if (startPerc > 1) startPerc = 1;\n var t0 = getDistancePerc(startPerc, bezierData);\n endPerc = endPerc > 1 ? 1 : endPerc;\n var t1 = getDistancePerc(endPerc, bezierData);\n var i;\n var len = pt1.length;\n var u0 = 1 - t0;\n var u1 = 1 - t1;\n var u0u0u0 = u0 * u0 * u0;\n var t0u0u0_3 = t0 * u0 * u0 * 3; // eslint-disable-line camelcase\n var t0t0u0_3 = t0 * t0 * u0 * 3; // eslint-disable-line camelcase\n var t0t0t0 = t0 * t0 * t0;\n //\n var u0u0u1 = u0 * u0 * u1;\n var t0u0u1_3 = t0 * u0 * u1 + u0 * t0 * u1 + u0 * u0 * t1; // eslint-disable-line camelcase\n var t0t0u1_3 = t0 * t0 * u1 + u0 * t0 * t1 + t0 * u0 * t1; // eslint-disable-line camelcase\n var t0t0t1 = t0 * t0 * t1;\n //\n var u0u1u1 = u0 * u1 * u1;\n var t0u1u1_3 = t0 * u1 * u1 + u0 * t1 * u1 + u0 * u1 * t1; // eslint-disable-line camelcase\n var t0t1u1_3 = t0 * t1 * u1 + u0 * t1 * t1 + t0 * u1 * t1; // eslint-disable-line camelcase\n var t0t1t1 = t0 * t1 * t1;\n //\n var u1u1u1 = u1 * u1 * u1;\n var t1u1u1_3 = t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1; // eslint-disable-line camelcase\n var t1t1u1_3 = t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1; // eslint-disable-line camelcase\n var t1t1t1 = t1 * t1 * t1;\n for(i = 0; i < len; i += 1){\n bezierSegmentPoints[i * 4] = math.round((u0u0u0 * pt1[i] + t0u0u0_3 * pt3[i] + t0t0u0_3 * pt4[i] + t0t0t0 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase\n bezierSegmentPoints[i * 4 + 1] = math.round((u0u0u1 * pt1[i] + t0u0u1_3 * pt3[i] + t0t0u1_3 * pt4[i] + t0t0t1 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase\n bezierSegmentPoints[i * 4 + 2] = math.round((u0u1u1 * pt1[i] + t0u1u1_3 * pt3[i] + t0t1u1_3 * pt4[i] + t0t1t1 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase\n bezierSegmentPoints[i * 4 + 3] = math.round((u1u1u1 * pt1[i] + t1u1u1_3 * pt3[i] + t1t1u1_3 * pt4[i] + t1t1t1 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase\n }\n return bezierSegmentPoints;\n }\n return {\n getSegmentsLength: getSegmentsLength,\n getNewSegment: getNewSegment,\n getPointInSegment: getPointInSegment,\n buildBezierData: buildBezierData,\n pointOnLine2D: pointOnLine2D,\n pointOnLine3D: pointOnLine3D\n };\n }", "easeOutCubic(t) {\n return --t * t * t + 1;\n }", "function cubicBezierAtTime(t,p1x,p1y,p2x,p2y,duration) {\r\n var ax=0,bx=0,cx=0,ay=0,by=0,cy=0;\r\n // `ax t^3 + bx t^2 + cx t' expanded using Horner's rule.\r\n function sampleCurveX(t) {return ((ax*t+bx)*t+cx)*t;}\r\n function sampleCurveY(t) {return ((ay*t+by)*t+cy)*t;}\r\n function sampleCurveDerivativeX(t) {return (3.0*ax*t+2.0*bx)*t+cx;}\r\n // The epsilon value to pass given that the animation is going to run over |dur| seconds. The longer the\r\n // animation, the more precision is needed in the timing function result to avoid ugly discontinuities.\r\n function solveEpsilon(duration) {return 1.0/(200.0*duration);}\r\n function solve(x,epsilon) {return sampleCurveY(solveCurveX(x,epsilon));}\r\n // Given an x value, find a parametric value it came from.\r\n function solveCurveX(x,epsilon) {var t0,t1,t2,x2,d2,i;\r\n function fabs(n) {if(n>=0) {return n;}else {return 0-n;}}\r\n // First try a few iterations of Newton's method -- normally very fast.\r\n for(t2=x, i=0; i<8; i++) {x2=sampleCurveX(t2)-x; if(fabs(x2)<epsilon) {return t2;} d2=sampleCurveDerivativeX(t2); if(fabs(d2)<1e-6) {break;} t2=t2-x2/d2;}\r\n // Fall back to the bisection method for reliability.\r\n t0=0.0; t1=1.0; t2=x; if(t2<t0) {return t0;} if(t2>t1) {return t1;}\r\n while(t0<t1) {x2=sampleCurveX(t2); if(fabs(x2-x)<epsilon) {return t2;} if(x>x2) {t0=t2;}else {t1=t2;} t2=(t1-t0)*0.5+t0;}\r\n return t2; // Failure.\r\n }\r\n // Calculate the polynomial coefficients, implicit first and last control points are (0,0) and (1,1).\r\n cx=3.0*p1x; bx=3.0*(p2x-p1x)-cx; ax=1.0-cx-bx; cy=3.0*p1y; by=3.0*(p2y-p1y)-cy; ay=1.0-cy-by;\r\n // Convert from input time to parametric value in curve, then from that to output time.\r\n return solve(t, solveEpsilon(duration));\r\n }", "function easeInOutCubic(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return c / 2 * t * t * t + b;\n }\n return c / 2 * ((t -= 2) * t * t + 2) + b;\n }", "function easeInOutCubic(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return c / 2 * t * t * t + b;\n }\n return c / 2 * ((t -= 2) * t * t + 2) + b;\n }", "function easeInOutCubic(t, b, c, d) {\n t /= d / 2;\n if (t < 1) {\n return c / 2 * t * t * t + b;\n }\n return c / 2 * ((t -= 2) * t * t + 2) + b;\n }", "function Bezier(startPt, endPt, startCtrlPt, endCtrlPt) {\n\tvar b;\n\tb.startPoint=startPt;\n\tb.endPoint=endPt;\n\tb.startControlPoint = startCtrlPt;\n\tb.endControlPoint = endCtrlPt;\n\tb.getCartesianAt = new function(t) {\n\t\tif (t > 1 || t < 0) { /* TODO error handler */}\n\t\tvar x = Math.pow((1 - t),3) * b.startPoint.x +\n\t\t3*t*Math.pow((1-t),2) * b.startControlPoint.x +\n\t\t3*Math.pow(t,2)*(1-t) * b.endControlPoint.x +\n\t\tpow(t,3) * b.endPoint.x;\n\t\t\n\t\tvar y = Math.pow((1 - t),3) * b.startPoint.y +\n\t\t3*t*Math.pow((1-t),2) * b.startControlPoint.y +\n\t\t3*Math.pow(t,2)*(1-t) * b.endControlPoint.y +\n\t\tMath.pow(t,3) * b.endPoint.y;\n\t\t\n\t\treturn [x,y];\n\t}\n\treturn b;\n}", "function easeOutCubic (t, b, c, d)\n {\n return c*((t=t/d-1)*t*t + 1) + b;\n }", "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n}", "function Bezier(p1,p2,p3,p4) {\n\t// defining the bezier functions in the polynomial form\n\tvar Cx = 3 * p1;\n\tvar Bx = 3 * (p3 - p1) - Cx;\n\tvar Ax = 1 - Cx - Bx;\n\n\tvar Cy = 3 * p2;\n\tvar By = 3 * (p4 - p2) - Cy;\n\tvar Ay = 1 - Cy - By;\n\n\tfunction bezier_x(t) { return t * (Cx + t * (Bx + t * Ax)); }\n\tfunction bezier_y(t) { return t * (Cy + t * (By + t * Ay)); }\n\n\t// using Newton's method to aproximate the parametric value of x for t\n\tfunction bezier_x_der(t) { return Cx + t * (2*Bx + 3*Ax * t); }\n\n\tfunction find_x_for(t) {\n\t\tvar x=t, i=0, z;\n\t\twhile (i < 5) { // making 3 iterations max\n\t\t\tz = bezier_x(x) - t;\n\t\t\tif (Math.abs(z) < 1e-3) break; // if already got close enough\n\t\t\tx = x - z/bezier_x_der(x);\n\t\t\ti++;\n\t\t}\n\t\treturn x;\n\t};\n\n\treturn function(t) {\n\t\treturn bezier_y(find_x_for(t));\n\t}\n}", "function easeOutCubic(t, b, c, d) {\n\t return c * ((t = t / d - 1) * t * t + 1) + b;\n\t}", "function easeInOutCubic(t) {\n return t < .5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;\n }", "function easeInOutCubic(t) {\n return t < .5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;\n }", "function bezier_x_der(t) { // bezier_x derivative\n return Cx + t * (2*Bx + t * 3*Ax) + 1e-3;\n }", "function makeBezier(qttAval) {\n\t//qttAval = 0 não existe curva\n\tif(qttAval == 0) return;\n\t//Salva os pontos intermediarios\n\tvar midPoints = new Array();\n\tvar points = getPoints();\n\tmidPoints[0] = new coord(parseInt(points[0].getAttribute('cx')), parseInt(points[0].getAttribute('cy')));\n\tfor(var i = 1 ; i <= qttAval ; i++){\n\t\tmidPoints[midPoints.length] = deCasteljau(points.length-1 , 0, i/qttAval);\n\t}\n\n\t//Cria as linhas da curva a partir dos pontos intermediarios\n\tfor(var i = 1 ; i < midPoints.length ; i++){\n\t\tlet color;\n\t\tvar bezierClass = \"b\" + selCurve;\n\t\tif(curveCB.checked) color = \"#fcba03\";\n\t\telse color = \"#00000000\";\n\t\tvar l = document.createElementNS(web, \"line\");\n\t\tl.setAttribute('x1', parseInt(midPoints[i-1].x));\n\t\tl.setAttribute('y1', parseInt(midPoints[i-1].y));\n\t\tl.setAttribute('x2', parseInt(midPoints[i].x));\n\t\tl.setAttribute('y2', parseInt(midPoints[i].y));\n\t\tl.setAttribute('style', 'stroke : ' + color + '; stroke-width : 2');\n\t\tl.setAttribute(\"class\", bezierClass);\n\t\tmainCanvas.appendChild(l);\n\t}\n}", "function drawBezierCurve(controlPoints, colour)\r\n{ \r\n var drawingPoint;\r\n for(var t = 0; t <= 1;t += 0.001)\r\n {\r\n drawingPoint = computeCurrentCurvePoint(controlPoints, t);\r\n drawBezierPoint(drawingPoint, colour);\r\n }\r\n}", "function easeInOutCubic(t, b, c, d) {\n t /= d/2;\n if (t < 1) {\n return c / 2 * t * t * t + b;\n }\n return c / 2 * ((t -= 2) * t * t + 2) + b;\n }", "function easeInOutCubic(t, b, c, d) {\n t /= d/2;\n if (t < 1) {\n return c / 2 * t * t * t + b;\n }\n return c / 2 * ((t -= 2) * t * t + 2) + b;\n }", "function easeInOutCubic (t, b, c, d)\n {\n if ((t/=d/2) < 1)\n {\n return c/2*t*t*t + b;\n }\n else\n {\n return c/2*((t-=2)*t*t + 2) + b;\n }\n }", "function easeOutCubic(pos) {\n return Math.pow(pos - 1, 3) + 1;\n}", "function Bezier1(t, startX, startY, c1X, c1Y, c2X, c2Y)\n{\n this.x = ((1 - t) * (1 - t) * startX) + (2 * (1 - t) * t * c1X) + (t * t * c2X)\n this.y = ((1 - t) * (1 - t) * startY) + (2 * (1 - t) * t * c1Y) + (t * t * c2Y)\n}", "static calcBezier(aT, aA1, aA2) {\n return ((this.A(aA1, aA2) * aT + this.B(aA1, aA2)) * aT + this.C(aA1)) * aT;\n }", "decompose() {\r\n let p = this.degree;\r\n let U = this.knots;\r\n let m = U.length - 1;\r\n let P = this.cpoints;\r\n let dim = this.dimension;\r\n let alphas = new common_1.NDArray({ shape: [p] });\r\n let a = p;\r\n let b = p + 1;\r\n let total_bezier = m - 2 * p;\r\n let Q = new common_1.NDArray({ shape: [total_bezier, p + 1, dim] });\r\n let nb = 0; // Counter for Bezier segments\r\n for (let i = 0; i < p + 1; i++) {\r\n for (let z = 0; z < dim; z++) {\r\n Q.set(nb, i, z, P.get(i, z));\r\n }\r\n }\r\n let i;\r\n while (b < m) {\r\n i = b;\r\n while (b < m && U.get(b + 1) === U.get(b)) {\r\n b += 1;\r\n }\r\n let mult = b - i + 1;\r\n if (mult < p) {\r\n let numerator = U.get(b) - U.get(a);\r\n // Compute and store alphas\r\n for (let j = p; j > mult; j--) {\r\n alphas.set(j - mult - 1, numerator / (U.get(a + j) - U.get(a)));\r\n }\r\n let r = p - mult; // Insert knot r times\r\n for (let j = 1; j < r + 1; j++) {\r\n let save = r - j;\r\n let s = mult + j; // This many new points\r\n for (let k = p; k > s - 1; k--) {\r\n let alpha = alphas.get(k - s);\r\n for (let z = 0; z < dim; z++) {\r\n Q.set(nb, k, z, alpha * Q.get(nb, k, z) +\r\n (1.0 - alpha) * Q.get(nb, k - 1, z));\r\n }\r\n }\r\n if (b < m) {\r\n for (let z = 0; z < dim; z++) {\r\n Q.set(nb + 1, save, z, Q.get(nb, p, z));\r\n }\r\n }\r\n }\r\n }\r\n nb += 1;\r\n if (b < m) {\r\n for (let i = p - mult; i < p + 1; i++) {\r\n for (let z = 0; z < dim; z++) {\r\n Q.set(nb, i, z, P.get(b - p + i, z));\r\n }\r\n }\r\n a = b;\r\n b += 1;\r\n }\r\n }\r\n let bezlist = [];\r\n for (let i = 0; i < Q.length; i++) {\r\n bezlist.push(new BezierCurve(p, Q.get(i).reshape([p + 1, dim])));\r\n }\r\n return bezlist;\r\n }", "function cubicBezierAtTime(t,p1x,p1y,p2x,p2y,duration) {\n var ax = 0,bx = 0,cx = 0,ay = 0,by = 0,cy = 0;\n function sampleCurveX(t) {\n return ((ax * t + bx) * t + cx) * t;\n }\n function sampleCurveY(t) {\n return ((ay * t + by) * t + cy) * t;\n }\n function sampleCurveDerivativeX(t) {\n return (3.0 * ax * t + 2.0 * bx) * t + cx;\n }\n function solveEpsilon(duration) {\n return 1.0 / (200.0 * duration);\n }\n function solve(x,epsilon) {\n return sampleCurveY(solveCurveX(x, epsilon));\n }\n function fabs(n) {\n if (n >= 0) {\n return n;\n } else {\n return 0 - n;\n }\n }\n function solveCurveX(x, epsilon) {\n var t0,t1,t2,x2,d2,i;\n for (t2 = x, i = 0; i < 8; i++) {\n x2 = sampleCurveX(t2) - x;\n if (fabs(x2) < epsilon) {\n return t2;\n }\n d2 = sampleCurveDerivativeX(t2);\n if (fabs(d2) < 1e-6) {\n break;\n }\n t2 = t2 - x2 / d2;\n }\n t0 = 0.0;\n t1 = 1.0;\n t2 = x;\n if (t2 < t0) {\n return t0;\n }\n if (t2 > t1) {\n return t1;\n }\n while (t0 < t1) {\n x2 = sampleCurveX(t2);\n if (fabs(x2 - x) < epsilon) {\n return t2;\n }\n if (x > x2) {\n t0 = t2;\n }else {\n t1 = t2;\n }\n t2 = (t1 - t0) * 0.5 + t0;\n }\n return t2; // Failure.\n }\n cx = 3.0 * p1x;\n bx = 3.0 * (p2x - p1x) - cx;\n ax = 1.0 - cx - bx;\n cy = 3.0 * p1y;\n by = 3.0 * (p2y - p1y) - cy;\n ay = 1.0 - cy - by;\n return solve(t, solveEpsilon(duration));\n }", "function cubicBezierAtTime(t,p1x,p1y,p2x,p2y,duration) {\n var ax = 0,bx = 0,cx = 0,ay = 0,by = 0,cy = 0;\n function sampleCurveX(t) {\n return ((ax * t + bx) * t + cx) * t;\n }\n function sampleCurveY(t) {\n return ((ay * t + by) * t + cy) * t;\n }\n function sampleCurveDerivativeX(t) {\n return (3.0 * ax * t + 2.0 * bx) * t + cx;\n }\n function solveEpsilon(duration) {\n return 1.0 / (200.0 * duration);\n }\n function solve(x,epsilon) {\n return sampleCurveY(solveCurveX(x, epsilon));\n }\n function fabs(n) {\n if (n >= 0) {\n return n;\n } else {\n return 0 - n;\n }\n }\n function solveCurveX(x, epsilon) {\n var t0,t1,t2,x2,d2,i;\n for (t2 = x, i = 0; i < 8; i++) {\n x2 = sampleCurveX(t2) - x;\n if (fabs(x2) < epsilon) {\n return t2;\n }\n d2 = sampleCurveDerivativeX(t2);\n if (fabs(d2) < 1e-6) {\n break;\n }\n t2 = t2 - x2 / d2;\n }\n t0 = 0.0;\n t1 = 1.0;\n t2 = x;\n if (t2 < t0) {\n return t0;\n }\n if (t2 > t1) {\n return t1;\n }\n while (t0 < t1) {\n x2 = sampleCurveX(t2);\n if (fabs(x2 - x) < epsilon) {\n return t2;\n }\n if (x > x2) {\n t0 = t2;\n }else {\n t1 = t2;\n }\n t2 = (t1 - t0) * 0.5 + t0;\n }\n return t2; // Failure.\n }\n cx = 3.0 * p1x;\n bx = 3.0 * (p2x - p1x) - cx;\n ax = 1.0 - cx - bx;\n cy = 3.0 * p1y;\n by = 3.0 * (p2y - p1y) - cy;\n ay = 1.0 - cy - by;\n return solve(t, solveEpsilon(duration));\n }", "function cubicBezierAtTime(t,p1x,p1y,p2x,p2y,duration) {\n var ax = 0,bx = 0,cx = 0,ay = 0,by = 0,cy = 0;\n function sampleCurveX(t) {\n return ((ax * t + bx) * t + cx) * t;\n }\n function sampleCurveY(t) {\n return ((ay * t + by) * t + cy) * t;\n }\n function sampleCurveDerivativeX(t) {\n return (3.0 * ax * t + 2.0 * bx) * t + cx;\n }\n function solveEpsilon(duration) {\n return 1.0 / (200.0 * duration);\n }\n function solve(x,epsilon) {\n return sampleCurveY(solveCurveX(x, epsilon));\n }\n function fabs(n) {\n if (n >= 0) {\n return n;\n } else {\n return 0 - n;\n }\n }\n function solveCurveX(x, epsilon) {\n var t0,t1,t2,x2,d2,i;\n for (t2 = x, i = 0; i < 8; i++) {\n x2 = sampleCurveX(t2) - x;\n if (fabs(x2) < epsilon) {\n return t2;\n }\n d2 = sampleCurveDerivativeX(t2);\n if (fabs(d2) < 1e-6) {\n break;\n }\n t2 = t2 - x2 / d2;\n }\n t0 = 0.0;\n t1 = 1.0;\n t2 = x;\n if (t2 < t0) {\n return t0;\n }\n if (t2 > t1) {\n return t1;\n }\n while (t0 < t1) {\n x2 = sampleCurveX(t2);\n if (fabs(x2 - x) < epsilon) {\n return t2;\n }\n if (x > x2) {\n t0 = t2;\n }else {\n t1 = t2;\n }\n t2 = (t1 - t0) * 0.5 + t0;\n }\n return t2; // Failure.\n }\n cx = 3.0 * p1x;\n bx = 3.0 * (p2x - p1x) - cx;\n ax = 1.0 - cx - bx;\n cy = 3.0 * p1y;\n by = 3.0 * (p2y - p1y) - cy;\n ay = 1.0 - cy - by;\n return solve(t, solveEpsilon(duration));\n }", "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "function cubic_example() {\n let bg = color(0, 0, 25)\n background(bg)\n noFill()\n\n // constrain our mouse to the canvas\n mouseX = constrain(mouseX, 0, width)\n mouseY = constrain(mouseY, 0, height)\n\n // main time control for our bezier curve\n // let t = map(mouseX, a.x, c.x, 0, 1)\n // let t = map(mouseX, 0, width, 0, 1)\n let t = abs(sin(frameCount * 0.01))\n\n // calculate all lerp points for 1st, 2nd, and 3rd order lines\n ab = p5.Vector.lerp(a.v, b.v, t)\n bc = p5.Vector.lerp(b.v, c.v, t)\n cd = p5.Vector.lerp(c.v, d.v, t)\n ab_bc = p5.Vector.lerp(ab, bc, t)\n bc_cd = p5.Vector.lerp(bc, cd, t)\n draw_vertex = p5.Vector.lerp(ab_bc, bc_cd, t)\n\n // 3rd order red lines\n stroke(0, 100, 80) // red\n line(ab_bc.x, ab_bc.y, bc_cd.x, bc_cd.y)\n\n // 2nd order blue lines should be under the 1st order gray lines\n // blue lines between {ab, bc}, {bc, cd}\n stroke(200, 100, 80) // blue\n line(ab.x, ab.y, bc.x, bc.y)\n line(bc.x, bc.y, cd.x, cd.y)\n\n // gray lines between {a, b}, {b, c}, {c, d}\n stroke(0, 0, 60) // gray\n line(a.v.x, a.v.y, b.v.x, b.v.y)\n line(b.v.x, b.v.y, c.v.x, c.v.y)\n line(c.v.x, c.v.y, d.v.x, d.v.y)\n\n strokeWeight(2) // vertex strokeWeight\n // a blue circle for each vertex d, e\n fill(bg)\n\n // finally, draw all the vertex circles\n\n // blue vertices 2nd order lerp points\n stroke(200, 100, 80)\n circle(ab.x, ab.y, 10)\n circle(bc.x, bc.y, 10)\n circle(cd.x, cd.y, 10)\n\n // red vertices\n stroke(0, 100, 80) // red\n circle(ab_bc.x, ab_bc.y, 10)\n circle(bc_cd.x, bc_cd.y, 10)\n\n // draw a path for our curve\n strokeWeight(3)\n stroke(0, 0, 100) // white\n // s is the time value inside this loop, going from 0 up to t itself\n for (let s=0; s<=t; s+=0.001) {\n // f is our main drawing point for the quadratic bezier curve\n // here, the v returned is equal to f\n let v = cubic(a.v, b.v, c.v, d.v, s)\n point(v.x, v.y)\n }\n\n fill(bg)\n draggableVertices.forEach(dv => dv.show(mouseX, mouseY))\n\n // these are the highest z-index values\n stroke(0, 0, 100) // white\n circle(draw_vertex.x, draw_vertex.y, 12)\n\n // these are the highest z-index values\n stroke(0, 0, 100) // white\n // circle(draw_vertex.x, draw_vertex.y, 12)\n\n}", "function Bezier(/* p0, p1, c0, c1 */) {\n\tvar o = this;\n\tvar points = normalizeArguments(\"pppp\", arguments);\n\tvar p0 = points[0];\n\tvar p1 = points[1];\n\tvar c0 = points[2];\n\tvar c1 = points[3];\n\n\to.x0 = p0.x, o.y0 = p0.y, o.x1 = p1.x, o.y1 = p1.y, o.cx0 = c0.x, o.cy0 = c0.y, o.cx1 = c1.x, o.cy1 = c1.y;\n}", "function wingPositionFunction(t)\n{\n var height = .25;\n\n var p0 = new THREE.Vector3(0,0,0);\n var p1 = new THREE.Vector3(0,0,1);\n\n var p2 = new THREE.Vector3(0,0,1);\n var p3 = new THREE.Vector3(1,0,1);\n\n var curve = new THREE.CubicBezierCurve3(p0, p1, p2, p3);\n\n return curve.getPoint(t);\n}", "function drawCurve(x1,y1,x4,y4,xc,yc,prevx,prevy,prevz,plcnt)\n{ \n\t//Compute Bezier Curve\n\tvar ax = x1 - xc;\n\tvar ay = y1 - yc;\n\tvar bx = x4 - xc;\n\tvar by = y4 - yc;\n\tvar q1 = Math.pow(ax,2) + Math.pow(ay,2);\n\tvar q2 = q1 + (ax * bx) + (ay * by);\n\tvar k2 = (4.0 / 3.0) * (parseFloat(Math.sqrt(2 * q1 * q2) - q2) / parseFloat((ax * by) - (ay * bx)));\n\tvar x2 = xc + ax - (k2 * ay);\n\tvar y2 = yc + ay + (k2 * ax);\n\tvar x3 = xc + bx + (k2 * by);\n\tvar y3 = yc + by - (k2 * bx);\n\t\n\t//Intialize the curve for xy plane\n\tif ( plcnt === 0) {\n\tvar curve = new THREE.CubicBezierCurve3(\n\t\t\n\t\t//Initialize the vectors\n\t\tnew THREE.Vector2( ax, ay , prevz),\n\t\tnew THREE.Vector2( x2, y2 , prevz),\n\t\tnew THREE.Vector2( x3, y3 , prevz),\n\t\tnew THREE.Vector2( bx, by , prevz)\n\t\t\n\t);}\n\t\n\t//Intialize the curve for xz plane\n\tif ( plcnt === 1) {\n\tvar curve = new THREE.CubicBezierCurve3(\n\t\t\n\t\t//Initialize the vectors\n\t\tnew THREE.Vector2( ax, prevy ,ay),\n\t\tnew THREE.Vector2( x2, prevy ,y2),\n\t\tnew THREE.Vector2( x3, prevy ,y3),\n\t\tnew THREE.Vector2( bx, prevy ,by)\n\t\t\n\t);}\n\n\t//Intialize the curve for yz plane\n\tif ( plcnt === 2) {\n\tvar curve = new THREE.CubicBezierCurve3(\n\t\t\n\t\t//Initialize the vectors\n\t\tnew THREE.Vector2( prevx, ax, ay),\n\t\tnew THREE.Vector2( prevx, x2, y2),\n\t\tnew THREE.Vector2( prevx, x3, y3),\n\t\tnew THREE.Vector2( prevx, bx, by)\n\t\t\n\t);}\n\n\t//Set the points\n\tvar points = curve.getPoints( 50 );\n\tvar geometry = new THREE.BufferGeometry().setFromPoints( points );\n\t\n\t//Set the material to draw\n\tvar material = new THREE.LineBasicMaterial( { color : 0xff0000 } );\n\n\t// Create the final object to add to the scene\n\tvar curveObject = new THREE.Line( geometry, material );\n\n\t//Add the initialized curve to the scene\n\tscene.add( curveObject );\n\t//renderer.render( scene, camera );\n}", "function easeOutQuad(t, b, c, d) {\n return -c*(t/=d)*(t-2) + b;\n}", "function cubicOut(t) {\n\t\tvar f = t - 1.0;\n\t\treturn f * f * f + 1.0;\n\t}", "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "function generateBezierCurve() {\n //create the position matrix, from the current position of the control points\n var controlP1 = mat4(positions[0],positions[2],positions[4],positions[6],\n positions[1],positions[3],positions[5],positions[7],\n 1,1,1,1,\n 1,1,1,1);\n\n var controlP2 = mat4(positions[6],positions[8],positions[10],positions[12],\n positions[7],positions[9],positions[11],positions[13],\n 1,1,1,1,\n 1,1,1,1);\n\n //use the math from class to generate the martix of points\n ans = mult(controlP1,bezierM);\n ans2 = mult(controlP2,bezierM);\n //push the line segments for the number of subdivisions\n for(t = 0; t <= 1; t+=(1/subdivisions))\n {\n //use the parametric equations to generate the correct point\n xt = ans[0][0]*Math.pow(t,3) + ans[0][1]*Math.pow(t,2) + ans[0][2]*t + ans[0][3];\n //Push x-coordinate for 2D drawing\n bezierPos.push(xt);\n yt = ans[1][0]*Math.pow(t,3) + ans[1][1]*Math.pow(t,2) + ans[1][2]*t + ans[1][3];\n //Push y-coordinate for 2D drawing\n bezierPos.push(yt);\n\n //Handle the 2nd bezier curve\n xt2 = ans2[0][0]*Math.pow(t,3) + ans2[0][1]*Math.pow(t,2) + ans2[0][2]*t + ans2[0][3];\n bezierPos2.push(xt2);\n yt2 = ans2[1][0]*Math.pow(t,3) + ans2[1][1]*Math.pow(t,2) + ans2[1][2]*t + ans2[1][3];\n bezierPos2.push(yt2);\n }\n //hard code in the last point to draw, otherwise the end point won't be connected.\n bezierPos.push(positions[6]);\n bezierPos.push(positions[7]);\n bezierPos2.push(positions[12]);\n bezierPos2.push(positions[13]); \n}", "function linearTween(t, b, c, d) {\n return c * t / d + b;\n}", "function draw_bezier(ctx, p0, p3) {\n\tvar px, py, x, y, t, v;\n\tvar p1 = p3.cp[0],\n\t\tp2 = p3.cp[1];\n\n\tctx.save();\n\tvar w = velocity_to_width((p3.v+p0.v)/2);\n\tctx.beginPath();\n\tctx.lineWidth = w;\n\tctx.moveTo(p0.x, p0.y);\n\tctx.bezierCurveTo(p1.x, p1.y, p2.x, p2.y, p3.x, p3.y);\n\tctx.stroke();\n\tctx.beginPath();\n\tctx.arc(p3.x, p3.y, w/2, 0, Math.PI*2);\n\tctx.fill();\n\tctx.restore();\n\treturn;\n\n\t// ctx.save();\n\t// ctx.lineCap = 'butt';\n\t// ctx.lineJoin = 'round';\n\t// px = p0.x;\n\t// py = p0.y;\n\t// for(t = 0; t <= 1; t += 0.1) {\n\t// \tx = (1-t)*(1-t)*(1-t)*p0.x + 3*(1-t)*(1-t)*t*p1.x + 3*(1-t)*t*t*p2.x + t*t*t*p3.x;\n\t// \ty = (1-t)*(1-t)*(1-t)*p0.y + 3*(1-t)*(1-t)*t*p1.y + 3*(1-t)*t*t*p2.y + t*t*t*p3.y;\n\t// \tv = (1-t)*p0.v + t*p3.v;\n\t// \tctx.beginPath();\n\t// \tctx.lineWidth = velocity_to_width(v, 3);\n\t// \tctx.moveTo(px, py);\n\t// \tctx.lineTo(x, y);\n\t// \tctx.arc(x, y, velocity_to_width(v,3), 0, 2*Math.PI);\n\n\t// \tctx.stroke();\n\t// \tpx = x;\n\t// \tpy = y;\n\t// }\n\t// ctx.stroke();\n\t// ctx.restore();\n}", "function linearTween(t, b, c, d) {\n\t return c * t / d + b;\n\t}", "function calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n }", "function calcBezier (aT, aA1, aA2) {\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n}", "function an_setAnimationCurves(){\n\t\tif (!an_canProceed()) { return false; }\n\t\tif(INTERPOLATOR_MODE < android_interpolator.interpolatorTypesAry.length){\n\t\t\tan_two_keyframe_func();\n\t\t}\n\t\telse{\n\n\t\t\t// var k0 = BEZIER_FUNCTION[INTERPOLAOTR_STRING_ARRAY[INTERPOLATOR_MODE]][0];\n\t\t\t// var k1 = BEZIER_FUNCTION[INTERPOLAOTR_STRING_ARRAY[INTERPOLATOR_MODE]][1];\n\t\t\t// var k2 = BEZIER_FUNCTION[INTERPOLAOTR_STRING_ARRAY[INTERPOLATOR_MODE]][2];\n\t\t\t// var k3 = BEZIER_FUNCTION[INTERPOLAOTR_STRING_ARRAY[INTERPOLATOR_MODE]][3];\n\n\t\t\t// alert(bezier1)\n\n\t\t\t//alert(k0+\",\"+k1+\",\"+k2+\",\"+k3+\"\")\n\t\t\tan_two_keyframe_cubicbeziers(bezier1,bezier2,bezier3,bezier4);\n\n\t\t\t//an_two_keyframe_cubicbeziers(0.42, 0.00, 1.00, 1.00);\n\t\t}\n\t}", "function calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n}", "function calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n}", "function calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n}", "function cubic(k2, k3, k4, s) {\n return -((3.0*(s-1.0)*k3-k4*s)*s-3.0*(s-1.0)**2*k2)*s\n }", "static cubic(t) {\n return t * t * t;\n }", "function BezierCurve(reference, step) {\n this.reference = reference;\n this.step = step;\n\n this.setStep = function(s) {\n this.step = s;\n return this;\n }\n\n this.addReference = function(c) {\n this.reference.push(c);\n return this;\n }\n\n this.getReference = function(i) {\n return this.reference[i];\n }\n\n this.addDotInReference = function(i, dot) {\n this.reference[i].push(dot);\n return this;\n }\n\n this.setReference = function(c) {\n this.reference = c;\n return this;\n }\n\n this.resetReference = function() {\n this.reference = new Array();\n return this;\n }\n\n this.repairCurve = function() {\n if (this.reference.length < 2) return;\n\n for (var i = 1; i < this.reference.length; ++i) {\n this.reference[i][1] = \n this.repairDotJoin(this.reference[i - 1][this.reference[i - 1].length - 2], this.reference[i][0]);\n }\n return this;\n }\n\n this.repairDotJoin = function(f, c) {\n var x = f[0] > c[0] ? (f[0] - (f[0] - c[0]) * 2) : (f[0] + (c[0] - f[0]) * 2)\n var y = f[1] > c[1] ? (f[1] - (f[1] - c[1]) * 2) : (f[1] + (c[1] - f[1]) * 2);\n \n return [x, y];\n }\n\n this.factorial = function(x) {\n if (x < 2) {\n return 1;\n }\n var result = 1;\n for (var i = 2; i < x + 1; ++i) {\n result *= i;\n }\n return result;\n }\n\n this.basis = function(i, n, t) {\n if (t < 0) t = 0;\n if (t > 1) t = 1;\n if (n - i < 0) i = n;\n\n var result = this.factorial(n) / (this.factorial(i) * this.factorial(n-i))\n result *= Math.pow(t, i) * Math.pow((1 - t), (n - i));\n\n return result;\n }\n\n this.referenceFunc = function(num, t) {\n var x = 0;\n var y = 0;\n for (var i = 0; i < this.reference[num].length; ++i) {\n var basis = this.basis(i, this.reference[num].length - 1, t);\n x += this.reference[num][i][0] * basis;\n y += this.reference[num][i][1] * basis;\n }\n return [x, y];\n }\n\n\n this.getCurve = function() {\n var result = new Array();\n this.repairCurve();\n for (var i = 0; i < this.reference.length; ++i) {\n for (var t = 0; t < 1 + this.step ; t += this.step) {\n if (t > 1) {\n t = 1;\n }\n result.push(this.referenceFunc(i, t));\n }\n }\n\n return result;\n }\n }", "function CalcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n }", "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "function CalcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n }", "function CalcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n }", "function calcBezier (aT, aA1, aA2) {\r\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\r\n }", "function calcBezier (aT, aA1, aA2) {\r\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\r\n }", "function calcBezier (aT, aA1, aA2) {\r\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\r\n }", "controlCurve(d0, d1) {\n this.p[1] = d0 / 3 + this.p[0];\n this.p[2] = this.p[3] - d1 / 3;\n }" ]
[ "0.7434528", "0.73906165", "0.7286761", "0.72729313", "0.72659224", "0.72434634", "0.71712834", "0.71361804", "0.71361804", "0.7048622", "0.70382494", "0.70382494", "0.70382494", "0.70382494", "0.70382494", "0.69458205", "0.69004536", "0.678628", "0.6750835", "0.6660342", "0.6653235", "0.65967643", "0.65499264", "0.6535177", "0.6527418", "0.6491634", "0.64716387", "0.6466399", "0.6466399", "0.645913", "0.644453", "0.6430207", "0.64197516", "0.6400252", "0.6400252", "0.6400252", "0.6400252", "0.6400252", "0.6400252", "0.6400252", "0.63955474", "0.6382203", "0.63645643", "0.6339426", "0.63265055", "0.63183856", "0.63183856", "0.63183856", "0.6315581", "0.6311965", "0.63070905", "0.6301539", "0.62896127", "0.6284156", "0.6284156", "0.6274737", "0.62713295", "0.62646455", "0.6256799", "0.6256799", "0.6256104", "0.62519777", "0.6244134", "0.6226106", "0.6207157", "0.6198908", "0.6198908", "0.6198908", "0.6192728", "0.6192728", "0.61726505", "0.6169138", "0.6167945", "0.61674833", "0.6151382", "0.6148847", "0.6142535", "0.6142535", "0.61419487", "0.61259466", "0.6125231", "0.6113496", "0.6111176", "0.60925424", "0.6075846", "0.6063525", "0.6063525", "0.6063525", "0.60634786", "0.6062901", "0.60534996", "0.6045539", "0.60440266", "0.60440266", "0.60416496", "0.60416496", "0.60371375", "0.60371375", "0.60371375", "0.6029586" ]
0.6876951
17